Extract data from .odb file for each time increment of Step-1
Extract data from .odb file for each time increment of Step-1
(OP)
I have written below a code in python to extract data (PHILSM values) from the output file (.odb) at Time increment=10.
How to write a recursive loop in the code in order to extract data (PHILSM values) from the odb.file for Time increment 0, 1,2,3,..., 100 ? Thank you.
from odbAccess import *
from abaqusConstants import *
from odbMaterial import *
from odbSection import *
odb = openOdb(path='Job-1.odb')
myAssembly = odb.rootAssembly
for stepName in odb.steps.keys():
print stepName
step1 = odb.steps.values()[0]
print step1.name
Frame = odb.steps['Step-1'].frames[10]
for fieldName in Frame.fieldOutputs.keys():
print fieldName
# Script to print the name, description, and type members
# for each field output value in the last frame,
for f in Frame.fieldOutputs.values():
print f.name, ':', f.description
print 'Type: ', f.type
# Script to extract and print the PHILSM value.
for loc in f.locations:
print 'Position:',loc.position
print
displacement=Frame.fieldOutputs['PHILSM']
fieldValues=displacement.values
for v in fieldValues:
print 'PHILSM= %6.4f' % (v.data)
How to write a recursive loop in the code in order to extract data (PHILSM values) from the odb.file for Time increment 0, 1,2,3,..., 100 ? Thank you.
from odbAccess import *
from abaqusConstants import *
from odbMaterial import *
from odbSection import *
odb = openOdb(path='Job-1.odb')
myAssembly = odb.rootAssembly
for stepName in odb.steps.keys():
print stepName
step1 = odb.steps.values()[0]
print step1.name
Frame = odb.steps['Step-1'].frames[10]
for fieldName in Frame.fieldOutputs.keys():
print fieldName
# Script to print the name, description, and type members
# for each field output value in the last frame,
for f in Frame.fieldOutputs.values():
print f.name, ':', f.description
print 'Type: ', f.type
# Script to extract and print the PHILSM value.
for loc in f.locations:
print 'Position:',loc.position
displacement=Frame.fieldOutputs['PHILSM']
fieldValues=displacement.values
for v in fieldValues:
print 'PHILSM= %6.4f' % (v.data)





RE: Extract data from .odb file for each time increment of Step-1
RE: Extract data from .odb file for each time increment of Step-1
RE: Extract data from .odb file for each time increment of Step-1
for x in outerloop:
for y in innerloop:
do something
RE: Extract data from .odb file for each time increment of Step-1
allFrames = odb.steps['Step-1'].frames.keys()
for j in range(len(allFrames)):
frame=odb.steps['Step-1'].frames[j]
print frame
RE: Extract data from .odb file for each time increment of Step-1
for x in odb.steps['Step-1'].frames:
x would be the current frame in each loop
RE: Extract data from .odb file for each time increment of Step-1
RE: Extract data from .odb file for each time increment of Step-1
for stepName in odb.steps.keys():
print stepName
step1 = odb.steps.values()[0]
print step1.name
#These two lines below work ok and display each frame with their values
for frame in step1.frames:
print frame
for f in step1.frames.fieldOutputs.values():
print f.name, ':', f.description
print 'Type: ', f.type
## Script to extract and print node and PHILSM value.
for loc in f.locations:
print 'Position:',loc.position
print displacement=frame.fieldOutputs['PHILSM']
fieldValues=displacement.values
#for v in fieldValues:
print 'Node = %d PHILSM= %6.4f' % (v.nodeLabel,v.data)
RE: Extract data from .odb file for each time increment of Step-1
for frames in step.frames:
do something
for vals in values:
do something else
RE: Extract data from .odb file for each time increment of Step-1
With some minor modifications it print out U_mag of one node for each frame.
CODE -->
from odbAccess import * odb = openOdb(path='viewer_tutorial.odb') center = odb.rootAssembly.instances['PART-1-1']. nodeSets['PUNCH'] print '\n****************' for x in odb.steps['Step-1'].frames: displacement = x.fieldOutputs['U'] centerDisplacement = displacement.getSubset(region=center) for y in centerDisplacement.values: print x.description print 'Displacement magnitude =', y.magnitude print '\n' odb.close()RE: Extract data from .odb file for each time increment of Step-1
the TimeStep, Node and Philsm values
for frame in odb.steps['Step-1'].frames:
displacement = frame.fieldOutputs['PHILSM']
for y in displacement.values:
#print frame.description
print ' frame.description[1]=%6.4f,Node = %d PHILSM =%6.4f',(y.frame.description,y.nodeLabel, y.data)
print '\n'