Computations with HistoryOutput objects

This example illustrates how you can use the historyOutput operators to compute the displacement magnitude from the components. The example script does the following:

  • Retrieves the node of interest using a nodeSet.

  • Uses the node of interest to construct a HistoryPoint object.

  • Uses the HistoryPoint to retrieve the historyRegion.

  • Computes the displacement magnitude history from the displacement component HistoryOutput objects in the historyRegion.

  • Scales the displacement magnitude history using a predefined value.

  • Prints the displacement magnitude history.

Use the following command to retrieve the example script:

abaqus fetch job=compDispMagHist

The fetch command also retrieves an input file that you can use to generate the output database that is read by the example script.

# HistoryOutput operators example problem.
#
# Compute magnitude of node displacement history from
# displacement components and scale relative to given
# allowable displacement.
#

from odbAccess import *

#
# get historyRegion for the node in nodeSet TIP
#

odb = openOdb(path='compDispMagHist.odb')
endSet = odb.rootAssembly.instances['BEAM-1-1'].nodeSets['TIP']
histPoint = HistoryPoint(node=endSet.nodes[0])
tipHistories = odb.steps['Step-2'].getHistoryRegion(
    point=histPoint)

#
# Compute and scale magnitude.
#

maxAllowableDisp = 5.0
sum = 0 
componentLabels = ('U1', 'U2', 'U3')
for name in componentLabels:
   sum = sum + power(tipHistories.historyOutputs[name], 2.0)
sum = sqrt(sum) / maxAllowableDisp

#
# Print magnitude.
#

print 'History:', sum.name
print 'Time       Magnitude'
for dataPair in sum.data:
    print "%5.4f  %5.2f"%(dataPair[0], dataPair[1])