deyentl
Materials
- Jul 12, 2011
- 39
Hi guys,
I just noticed a problem with COORD and I want to get your opinion. I've written a small script to get stresses and coordinates out of a certain elementset. I'm doing exactly the same for both, but it only works for the stress. For COORD I always get an empty fieldoutput. I've posted my script below, with additional comments.
Why is this happening? Is there a workaround?
import odbAccess
instanceName = 'FEM_YSW-1'
mySetName = 'FIBRE3'
OdbName = 'Small.odb'
StepName = 'Step-1'
#Create the odb, step and frame
myOdb = session.openOdb(OdbName)
myStep = myOdb.steps[StepName]
myFrame = myStep.frames[-1]
#Create an odbSet object for the element set of a certain fibre
mySet = myOdb.rootAssembly.instances[instanceName].elementSets[mySetName]
#Create fieldoutputs for stress and coords of the entire odb
stress_full = myStep.frames[-1].fieldOutputs['S']
coords_full = myStep.frames[-1].fieldOutputs['COORD']
#Create fieldoutputs for stress and coords of a certain element set
stress = myStep.frames[-1].fieldOutputs['S'].getSubset(region = mySet)
coords = myStep.frames[-1].fieldOutputs['COORD'].getSubset(region = mySet)
#Check length of the fieldoutput. It works perfectly for the entire odb.
len(stress_full.values)
len(coords_full.values)
#However, for the coords of the subset, it only works for stress and not for coords. For coords it returns 0.
len(stress.values)
len(coords.values)
I just noticed a problem with COORD and I want to get your opinion. I've written a small script to get stresses and coordinates out of a certain elementset. I'm doing exactly the same for both, but it only works for the stress. For COORD I always get an empty fieldoutput. I've posted my script below, with additional comments.
Why is this happening? Is there a workaround?
import odbAccess
instanceName = 'FEM_YSW-1'
mySetName = 'FIBRE3'
OdbName = 'Small.odb'
StepName = 'Step-1'
#Create the odb, step and frame
myOdb = session.openOdb(OdbName)
myStep = myOdb.steps[StepName]
myFrame = myStep.frames[-1]
#Create an odbSet object for the element set of a certain fibre
mySet = myOdb.rootAssembly.instances[instanceName].elementSets[mySetName]
#Create fieldoutputs for stress and coords of the entire odb
stress_full = myStep.frames[-1].fieldOutputs['S']
coords_full = myStep.frames[-1].fieldOutputs['COORD']
#Create fieldoutputs for stress and coords of a certain element set
stress = myStep.frames[-1].fieldOutputs['S'].getSubset(region = mySet)
coords = myStep.frames[-1].fieldOutputs['COORD'].getSubset(region = mySet)
#Check length of the fieldoutput. It works perfectly for the entire odb.
len(stress_full.values)
len(coords_full.values)
#However, for the coords of the subset, it only works for stress and not for coords. For coords it returns 0.
len(stress.values)
len(coords.values)