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.
from odbAccess import *
# retrieve request from user
odbName = input('Enter odb name')
stepName = input('Enter step name')
loadCaseNames = eval(input( \
'Enter new load case as: \
[\'loadCase1Name\', ..., \'loadCaseNName\']'))
if type(loadCaseNames) == tuple:
loadCaseNames = list(loadCaseNames)
lcName = input('Enter new load case name')
scaling = eval(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()
|