Eleo
Mechanical
- Mar 2, 2015
- 26
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)