eng23bio
Structural
- Oct 11, 2011
- 24
Hi there,
I have an odb from which I'd like to extract some data, namely a reaction force and some displacements. Here is a working part of the code (except for the Time1). The analysis is non-linear due to the material properties so I have to make various increments (around 60). I want to write to an output file Time.dat the different times (the increments, or the cum ulative increments) and to another file Results.dat the forces. If I remove the line ""Time1=lastStep.frameValue"" it works nicely, I get the forces in the different frames of the step, but I do not want to get the frames, I want to get the time step associated to the frame.I have looked at the scripting user manual but I do not seem to find what I need.
Any help would be appreciated,
Sincerely
*************************************
import odbAccess
ForceFile = open('Results.dat','w')
TimeFile=open('Time.dat','w')
myOdb = odbAccess.openOdb(path='Job1.odb')
lastStep=myOdb.steps['Step-1']
for x in range(len(lastStep.frames)):
lastFrame = lastStep.frames[x]
Time1=lastStep.frameValue%%%Here must be the thing...
ReactionForce = lastFrame.fieldOutputs['RF']
TimeFile.write(Time1)
for v in ReactionForce.values:
if v.nodeLabel == 1:
ForceFile.write('%10.8E\t' % (v.data[1]))
myOdb.close()
ForceFile.close()
TimeFile.close()
**************************
I have an odb from which I'd like to extract some data, namely a reaction force and some displacements. Here is a working part of the code (except for the Time1). The analysis is non-linear due to the material properties so I have to make various increments (around 60). I want to write to an output file Time.dat the different times (the increments, or the cum ulative increments) and to another file Results.dat the forces. If I remove the line ""Time1=lastStep.frameValue"" it works nicely, I get the forces in the different frames of the step, but I do not want to get the frames, I want to get the time step associated to the frame.I have looked at the scripting user manual but I do not seem to find what I need.
Any help would be appreciated,
Sincerely
*************************************
import odbAccess
ForceFile = open('Results.dat','w')
TimeFile=open('Time.dat','w')
myOdb = odbAccess.openOdb(path='Job1.odb')
lastStep=myOdb.steps['Step-1']
for x in range(len(lastStep.frames)):
lastFrame = lastStep.frames[x]
Time1=lastStep.frameValue%%%Here must be the thing...
ReactionForce = lastFrame.fieldOutputs['RF']
TimeFile.write(Time1)
for v in ReactionForce.values:
if v.nodeLabel == 1:
ForceFile.write('%10.8E\t' % (v.data[1]))
myOdb.close()
ForceFile.close()
TimeFile.close()
**************************