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?
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]