Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

ABAQUS scripting region argument yields inconsistent nodeSet

Status
Not open for further replies.

RBureau

Materials
Feb 18, 2021
17
Hi all,

I have a simulation of a tensile test featuring 10010 nodes, and in that simulation I have a node set of 130 nodes named "XSYM", for which I would like to extract nodal forces using python scripting. I run the following code, which is pretty standard, but the call to getSubset creates nodes out of nowhere.

[tt]from odbAccess import *

odb = openOdb("Job-1.odb")
frames = odb.steps["Step-1"].frames
myNodeSet = odb.rootAssembly.instances["TENSILE"].nodeSets["SYMX"]
print(len(myNodeSet.nodes))

fieldOutput = frames[-1].fieldOutputs["RF"]
print(len(fieldOutput.values))

fieldOutput = frames[-1].fieldOutputs["RF"].getSubset(region=myNodeSet)
print(len(fieldOutput.values))[/tt]

Now, I would expect the three calls to print to give me:
130 -> the number of nodes in myNodeSet
10010 -> the total number of nodes
130 -> once again the number of nodes in myNodeSet

Instead, I get the following results:
130 -> this is ok
10010 -> this is ok
1040 -> this is not ok

When I check the node labels (node number), the first 130 are correct, and all the others have labels ranging in millions, meaning that they are nodes I did not define myself.

Does anyone know why?

Thanks in advance

 
Replies continue below

Recommended for you

Search "Using regions to read a subset of field output data". I am not that much into scripting but I guess you need to create odbset object.
 
Thanks NRP99. The statement: [tt]myNodeSet = odb.rootAssembly.instances["TENSILE"].nodeSets["SYMX"][/tt] already creates an OdbSet, containing the 130 nodes of my set. I still do not know why, when I later use getSubset(region=myNodeSet), I end up with more than 130 nodal values. Worse even, these values are different each time I run my script!
 
This should not happen then. Are these garbage values? Might be using fieldOutput multiple times causing this, I guess. Could you get the meaningful result when you use the commands from the help manual section I posted earlier?

Code:
from odbAccess import *

odb = openOdb('Job-1.odb')
frames = odb.steps['Step-1'].frames
myNodeSet = odb.rootAssembly.instances['TENSILE'].nodeSets['SYMX']
myReaction = frames[-1].fieldOutputs['RF']
rmyNoddeSet = myReaction.getSubset(region=myNodeSet)
rmyNoddeSetValues = rmyNoddeSet.values
for v in rmyNoddeSetValues:
    print v.nodeLabel, v.data
 
In essence, that's already what I do. I just count the number of entries in rmyNoddeSetValues instead of printing them. I just ran your code, and I get 1040 printouts, with inconsistent node numbers. Below are the first and last 5 printouts:

22 [-13.433395 -0.46440947 -0.02727298]
23 [-13.192169 0.14006762 0. ]
363 [-26.512383 -0.02929281 0. ]
364 [-26.712109 -0.5370853 0. ]
365 [-26.828821 -0.83190155 0. ]
...
343931218 [0.0000000e+00 5.9478080e-01 2.1404363e-31]
343931218 [0.0000000e+00 5.9478080e-01 2.1404363e-31]
343932014 [8.6683124e-01 2.7966554e-38 2.1415680e-31]
343932014 [8.6683124e-01 2.7966554e-38 2.1415680e-31]
343932014 [8.6683124e-01 2.7966554e-38 2.1415680e-31]
 
Since I am not an expert in scripting, could it possible that the extracted values are unaveraged at nodes and the reaction values from other elements are also reported at the nodes?

You can print the reaction values in *.dat file by using below command in inp file. Place below keywords in step definition.

*node print, nset=myNodeSet_name, totals=yes, global=yes
RF,
 
I wondered the same thing, since I use 8-nodes elements, and I have exactly 8*130 = 1040 values. However, the node labels make no sense at all. They do not correspond to nodes I defined, they repeat, and they feature extremely low force values.

In any case, I have a workaround and I can still extract the reaction force at the nodes of interest, but it is more expensive than the getSubset method. As I want to use that in an optimization script, I was wondering if I could make the getSubset method work.

Thanks for your suggestions!
 
I ran a sample case of solid cantilever beam with traction load (vertically downwards load) to check the script I uploaded in earlier post. Strangely that works for me and gives exact no of nodal reaction forces for no of nodes present in the selected set. Checked with the interior nodes which are connected to more elements to see whether un-averaging values are printed or not. But no there is no inconsistent values higher than no of nodes in set. But the no of nodes in selected set is printed as only 1 which I need to investigate now.[hairpull]

Code:
from odbAccess import *

odb = openOdb('Beam_with_traction.odb')
frames = odb.steps['Step-1'].frames
myNodeSet = odb.rootAssembly.nodeSets['SET-2']
print(len(myNodeSet.nodes))
myReaction = frames[-1].fieldOutputs['RF']
rmyNoddeSet = myReaction.getSubset(region=myNodeSet)
rmyNoddeSetValues = rmyNoddeSet.values
for v in rmyNoddeSetValues:
    print v.nodeLabel, v.data
 
Alright, thanks for checking. I have a symmetric boundary condition on the node set of interest. Maybe that's the culprit.

In my case, print(len(myNodeSet.nodes)) gives the good number of nodes, but getSubset(region=myNodeset) returns whatever.

Surprisingly enough, my workaround involves using getSubset(region=node) for each node in myNodeSet.nodes, and that works fine.

Python:
from odbAccess import *

odb = openOdb('Job-1.odb')
frames = odb.steps['Step-1'].frames
myNodeSet = odb.rootAssembly.instances['TENSILE'].nodeSets['SYMX']
myReaction = frames[-1].fieldOutputs['RF']

for node in myNodeSet.nodes:
    values = myReaction.getSubset(region=node).values
    print values[0].nodeLabel


Somehow for me, the [tt]region[/tt] argument does not like when it is given an OdbSet object, but does not mind being given a OdbMeshNode object.
 
The symmetry boundary condition seems to be indeed the culprit. Damn! I just tried on a set that has no symmetry on it, and it works fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor