Use the following command to retrieve the example script: abaqus fetch job=stressRange The fetch command also retrieves an input file that you can use to generate an output database that can be read by the example script.
from odbAccess import *
# retrieve request from user
odbName = input('Enter odb name')
stepName = input('Enter step name')
# retrieve steps from the odb
odb=openOdb(odbName)
step = odb.steps[stepName]
sFields = []
for loadCase in step.loadCases.values():
stressField = step.getFrame(loadCase=loadCase).\
fieldOutputs['S']
sFields.append(stressField.getScalarField(
componentLabel='S11'))
# compute stress range
maxStress, maxLoc = maxEnvelope(sFields)
minStress, minLoc = minEnvelope(sFields)
stressRange = maxStress - minStress
# save to same step
newFrame = step.Frame(incrementNumber=0, frameValue=0.0,
description='Stress Range')
newFrame.FieldOutput(field=stressRange, name='S11 Range')
odb.save()
odb.close()
|