MJoeS
Structural
- Dec 4, 2015
- 2
Hello all!
After going through all possible forums, I haven't been able to solve the problem of accessing nodal output variables using python to post-process my results. My model is just a simple beam model (Eltype=B31), that is subjected to bending. In this case I want to extract the nodal strain values at the top of the beam. Getting the values at the integration points proves no trouble. However generating a subset of nodal outputs doesn't seem to work. Instead of getting 1 output value per element as when using Int. Points as fieldOutput, I get two values per element. These values are however equal to each other and equal to the result at the integration point... I have requested 'element output, position=NODAL' in my input file. Can anyone help me with finding my mistake? Thank you very much in advance!
Here is my code:
# Open the output database.
psOdb = odbAccess.openOdb(path='bend-El-Output.odb')
# Select Node Set
elset=psOdb.rootAssembly.instances['PART-3-1'].elementSets['ELSET'] # Just a collection of all elements in the beam
nset=psOdb.rootAssembly.instances['PART-3-1'].nodeSets['NSET']
sCat = psOdb.SectionCategory(name='SC',description='n/a')
sP = sCat.SectionPoint(number=2,description='n/a')
A=psOdb.steps['Bending'].frames[10].fieldOutputs['LE'].getSubset(position=ELEMENT_NODAL, region=elset) #position=INTEGRATION_POINT works fine
A.getSubset(sectionPoint = elset.elements[0].sectionCategory.sectionPoints[4])
print A.values[2].data[0] # Probe a value of LE11
Cheers, Morten
After going through all possible forums, I haven't been able to solve the problem of accessing nodal output variables using python to post-process my results. My model is just a simple beam model (Eltype=B31), that is subjected to bending. In this case I want to extract the nodal strain values at the top of the beam. Getting the values at the integration points proves no trouble. However generating a subset of nodal outputs doesn't seem to work. Instead of getting 1 output value per element as when using Int. Points as fieldOutput, I get two values per element. These values are however equal to each other and equal to the result at the integration point... I have requested 'element output, position=NODAL' in my input file. Can anyone help me with finding my mistake? Thank you very much in advance!
Here is my code:
# Open the output database.
psOdb = odbAccess.openOdb(path='bend-El-Output.odb')
# Select Node Set
elset=psOdb.rootAssembly.instances['PART-3-1'].elementSets['ELSET'] # Just a collection of all elements in the beam
nset=psOdb.rootAssembly.instances['PART-3-1'].nodeSets['NSET']
sCat = psOdb.SectionCategory(name='SC',description='n/a')
sP = sCat.SectionPoint(number=2,description='n/a')
A=psOdb.steps['Bending'].frames[10].fieldOutputs['LE'].getSubset(position=ELEMENT_NODAL, region=elset) #position=INTEGRATION_POINT works fine
A.getSubset(sectionPoint = elset.elements[0].sectionCategory.sectionPoints[4])
print A.values[2].data[0] # Probe a value of LE11
Cheers, Morten