import visualization This statement provides access to the commands that replicate the functionality of the Visualization module in Abaqus/CAE (Abaqus/Viewer). myViewport = session.Viewport(name='Superposition example') This statement creates a new viewport named odbPath = 'viewer_tutorial.odb' This statement creates a path to the tutorial output database. myOdb = session.openOdb(path=odbPath) This statement uses the path variable myViewport.setValues(displayedObject=myOdb) This statement displays the default plot of the output database in the viewport. firstStep = myOdb.steps['Step-1'] secondStep = myOdb.steps['Step-2'] These statements assign the first and second steps in the output database to the variables frame1 = firstStep.frames[-1] frame2 = secondStep.frames[-1] These statements assign the last frame of the first and second steps to the variables displacement1 = frame1.fieldOutputs['U'] displacement2 = frame2.fieldOutputs['U'] These statements assign the displacement field output in the last frame of the first and second steps to the variables stress1 = frame1.fieldOutputs['S'] stress2 = frame2.fieldOutputs['S'] Similarly, these statements assign the stress field output in the last frame of the first and second steps to the variables deltaDisplacement = displacement2 - displacement1 This statement subtracts the displacement field output from the last frame of the two steps and puts the resulting field output into a new variable deltaStress = stress2 - stress1 Similarly, this statement subtracts the stress field output and puts the result in the variable myViewport.odbDisplay.setDeformedVariable(deltaDisplacement) This statement uses myViewport.odbDisplay.setPrimaryVariable(field=deltaStress, outputPosition=INTEGRATION_POINT, refinement=(INVARIANT, 'Mises')) This statement uses myViewport.odbDisplay.display.setValues(plotState=(CONTOURS_ON_DEF,)) The final statement sets the plot state to display a contour plot on the deformed model shape. |