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