The command line arguments provide the following:
Use the following command to retrieve the example script: abaqus fetch job=createLoadComb 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.
import types
from odbAccess import *
# retrieve request from user
odbName = raw_input('Enter odb name')
stepName = raw_input('Enter step name')
loadCaseNames = eval(raw_input( \
'Enter new load case as: \
[\'loadCase1Name\', ..., \'loadCaseNName\']'))
if type(loadCaseNames) == types.TupleType:
loadCaseNames = list(loadCaseNames)
lcName = raw_input('Enter new load case name')
scaling = eval(raw_input( \
'Enter new load case as:(scaleFactor1, .., scaleFactorN)'))
odb = openOdb(odbName)
step = odb.steps[stepName]
# compute new load case
newStress = 0
newDisp = 0
for loadCaseName in loadCaseNames:
frame = step.getFrame(loadCase=step.loadCases[loadCaseName])
scaleFac = scaling[loadCaseNames.index(frame.loadCase.name)]
newStress = newStress + scaleFac*frame.fieldOutputs['S']
newDisp = newDisp + scaleFac*frame.fieldOutputs['U']
# save new load case to odb
lcNew = step.LoadCase(name=lcName)
newFrame = step.Frame(loadCase=lcNew)
newFrame.FieldOutput(field=newStress, name='S')
newFrame.FieldOutput(name='U', field=newDisp)
odb.save()
odb.close()
|