Computations with FieldOutput objects

This example illustrates how you can operate on FieldOutput objects and save the computed field to the output database. The example script does the following:

  • Retrieves two specified fields from the output database.

  • Computes a new field by subtracting the fields that were retrieved.

  • Creates a new Step object in the output database.

  • Creates a new Frame object in the new step.

  • Creates a new FieldOutput object in the new frame.

  • Uses the addData method to add the computed field to the new FieldOutput object.

Use the following command to retrieve the example script:

abaqus fetch job=fieldOperation

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

# FieldOutput operators example problem
#
# Script that does computations with fields and
# saves the results computed to the output database 
#

from odbAccess import *
odb = openOdb(path='fieldOperation.odb')

# Get fields from output database.

field1 = odb.steps['LC1'].frames[1].fieldOutputs['U']
field2 = odb.steps['LC2'].frames[1].fieldOutputs['U']

# Compute difference between fields.

deltaDisp = field2 - field1

# Save new field.

newStep = odb.Step(name='user', 
    description='user defined results', domain= TIME, timePeriod=0)
newFrame = newStep.Frame(incrementNumber=0, frameValue=0.0)
newField = newFrame.FieldOutput(name='U',
    description='delta displacements', type=VECTOR)
newField.addData(field=deltaDisp)

odb.save()