2

I want to get the U2 displacement of a particular node using a python script :

dy = odb.steps['LoadingStep'].frames[-1].fieldOutputs['U'].values[node_no].data[1]

The problem is that the [value index] doesn't match the node number. Meaning that the output for the 10th node can't be found using values[10].

How can I get the displacement of a particular node?

Roman Zh.
  • 985
  • 2
  • 6
  • 20

1 Answers1

1

It is possible that there is some error in your index value (for example node with a label '10' is accessible by the index '9').

First, try to check in the Abaqus Viewer python interpreter if your are getting the right node with your node_no:

nd = odb.rootAssembly.instaces['MY_INSTANCE'].nodes[node_no]
highlight(nd)

Note that it will be much easier if, during the generation of your model, you define a Set with your node(s) of interest: after you can access them as easy as:

for nd in odb.rootAssembly.nodeSets['MY_NODE_SET']:
   print(nd.label)

When you identified your node you can get a subset of your FieldOutput, so you will not be bothered by the order of elements in the FieldValueArray values:

fieldU = frame.fieldOutputs['U']
ndFieldU = fieldU.getSubset(region=my_node, position=NODAL)
ndU2 = ndFieldU.values[0].data[1]
Roman Zh.
  • 985
  • 2
  • 6
  • 20
  • Thanks for your answer. I have the node numbers for which I need the displacement. but when I write the following line, dy = odb.steps['Pullout'].frames[-1].fieldOutputs['U'].getSubset(region=node_index, position=NODAL).values[0].dataDouble[1] ABAQUS says : TypeError: region; found int, expecting OdbInstance. I have passed the node number as node_index, what shall I send as the argument region? – Soumya Sadhukhan Jan 28 '21 at 14:31
  • Well, the error message is quite self-explanatory: the method `getSubset` takes an object which should *specify the region for which to extract values* (http://abaqus.software.polimi.it/v6.14/books/ker/default.htm?startat=pt01ch34pyo06.html#ker-fieldoutput-getsubset2-pyc). If you look at the documentation you will see that different object types are accepted as the "region" by this method, but the `int` is not one of them. In the present example the type of `my_node` should be `OdbMeshNode` or an `OdbSet` containing your node of interest. – Roman Zh. Jan 29 '21 at 08:41
  • Could you mark the answer as 'accepted' if it resolves the problem? – Roman Zh. Jan 31 '21 at 12:40