cclcjp228
Aerospace
- May 30, 2016
- 5
hi everyone,
i was writing a python script to extract nodal customised shear stress from odb file over each frame. i first tried to extract shear stress from each frame as a practice.
i successfully obtained all the nodes in the part of interests, i.e. the total number is correct.
however, i did not get any values as it generates "0" value.
i really dont know where my problem is. how can i deal with that problems?
here is my code:
ForceFile = open('Results.dat','w')
odbPath = "C:/Temp/123.odb"
odb = session.openOdb(name=odbPath,readOnly=FALSE)
allSteps = session.odbData[odbPath].steps.keys()
for i in range(len(allSteps)):
step = odb.steps[allSteps]
allFrames = session.odbData[odbPath].steps[allSteps].frames.keys()
for j in range(len(allFrames)):
frame = step.frames[j] #get the current frame in step
myInstance = odb.rootAssembly.instances["BOTTOM-1"] #get the instance of interest
numNodes = len(myInstance.nodes) #get the number of nodes
ReactionForce = frame.fieldOutputs['S']
for el in range(0,numNodes):
ReactionForceInterest = ReactionForce.getSubset(region=myInstance.nodes[el]).values # get the node inside the instance
ForceFile.write( + " ") ####! PLOBLEMS need help; i have tried to use ReactionForceInterest.data[3]...
ForceFile.write("\n")
ForceFile.close()
odb.close()
thanks in advance.
i was writing a python script to extract nodal customised shear stress from odb file over each frame. i first tried to extract shear stress from each frame as a practice.
i successfully obtained all the nodes in the part of interests, i.e. the total number is correct.
however, i did not get any values as it generates "0" value.
i really dont know where my problem is. how can i deal with that problems?
here is my code:
ForceFile = open('Results.dat','w')
odbPath = "C:/Temp/123.odb"
odb = session.openOdb(name=odbPath,readOnly=FALSE)
allSteps = session.odbData[odbPath].steps.keys()
for i in range(len(allSteps)):
step = odb.steps[allSteps]
allFrames = session.odbData[odbPath].steps[allSteps].frames.keys()
for j in range(len(allFrames)):
frame = step.frames[j] #get the current frame in step
myInstance = odb.rootAssembly.instances["BOTTOM-1"] #get the instance of interest
numNodes = len(myInstance.nodes) #get the number of nodes
ReactionForce = frame.fieldOutputs['S']
for el in range(0,numNodes):
ReactionForceInterest = ReactionForce.getSubset(region=myInstance.nodes[el]).values # get the node inside the instance
ForceFile.write( + " ") ####! PLOBLEMS need help; i have tried to use ReactionForceInterest.data[3]...
ForceFile.write("\n")
ForceFile.close()
odb.close()
thanks in advance.