10.11 Writing to an output database

You can write your own data to an output database, and you can use Abaqus/CAE to view the data. Writing to an output database is very similar to reading from an output database. When you open an existing database, the Odb object contains all the objects found in the output database, such as instances, steps, and field output data. In contrast, when you are writing to a new output database, these objects do not exist. As a result you must use a constructor to create the objects. For example, you use the Part constructor to create a Part object, the Instance constructor to create an OdbInstance object, and the Step constructor to create an OdbStep object.

After you create an object, you use methods of the objects to enter or modify the data associated with the object. For example, if you are creating an output database, you first create an Odb object. You then use the Part constructor to create a part. After creating the part, you use the addNodes and addElements methods of the Part object to add nodes and elements, respectively. Similarly, you use the addData method of the FieldOutput object to add field output data to the output database. After creating an output database, you should use the save method on the Odb object to save the output database.

The example program in Creating an output database, Section 10.15.2, also illustrates how you can write to an output database.

The following topics are covered:


10.11.1 Creating a new output database

You use the Odb constructor to create a new, empty Odb object.For a full description of the Odb command, see Odb object, Section 61.1 of the Abaqus Scripting Reference Manual. Abaqus creates the RootAssembly object when you create or open an output database.

You use the save method to save the output database.For a full description of the save command, see save, Section 61.1.4 of the Abaqus Scripting Reference Manual.


10.11.2 Writing model data

To define the geometry of your model, you first create the parts that are used by the model and then you add nodes and elements to the parts. You then define the assembly by creating instances of the parts. If the output database already contains results data, you should not change the geometry of the model. This is to ensure that the results remain synchronized with the model.

Part

If the part was created by Abaqus/CAE, the description of the native Abaqus/CAE geometry is stored in the model database, but it is not stored in the output database. A part is stored in an output database as a collection of nodes, elements, surfaces, and sets. You use the Part constructor to add a part to the Odb object. You can specify the type of the part; however, only DEFORMABLE_BODY is currently supported. For example,For a full description of the Part constructor, see OdbPart object, Section 61.21 of the Abaqus Scripting Reference Manual. The new Part object is empty and does not contain geometry. After you create the Part object, you then add nodes and elements.

You use the addNodes method to add nodes by defining node labels and coordinates. You can also define an optional node set. For example, For a full description of the addNodes command, see addNodes, Section 61.21.3 of the Abaqus Scripting Reference Manual.

Similarly, you use the addElements method to add elements to the part using a sequence of element labels, element connectivity, and element type. You can also define an optional element set and an optional section category. For example, For a full description of the addElements command, see addElements, Section 61.21.2 of the Abaqus Scripting Reference Manual.

The RootAssembly object

The root assembly is created when you create the output database. You access the RootAssembly object using the same syntax as that used for reading from an output database.You can create both instances and regions on the RootAssembly object.

Part instances

You use the Instance constructor to create part instances of the parts you have already defined using the Part constructor. For example, You can also supply an optional local coordinate system that specifies the rotation and translation of the part instance. You can add nodes and elements only to a part; you cannot add elements and nodes to a part instance. As a result, you should create the nodes and elements that define the geometry of a part before you instance the part. For a full description of the Instance command, see OdbInstance object, Section 61.17 of the Abaqus Scripting Reference Manual.

Regions

Region commands are used to create sets from element labels, node labels, and element faces. You can create a set on a part, part instance, or the root assembly. Node and element labels are unique within an instance but not within the assembly. As a result, a set on the root assembly requires the names of the part instances associated with the nodes and elements. You can also use region commands to create surfaces.

For example,

Materials

You use the Material object to list material properties. Material objects are members of the Odb object.

Sections

You use the Section object to create sections and profiles. Section objects are members of the Odb object.

Section assignments

You use the SectionAssignment object to assign sections and their associated material properties to regions of the model. SectionAssignment objects are members of the Odb object. For a full description of the assignSection method, see assignSection, Section 61.17.7 of the Abaqus Scripting Reference Manual.


10.11.3 Writing results data

To write results data to the output database, you first create the Step objects that correspond to each step of the analysis. If you are writing field output data, you also create the Frame objects that will contain the field data. History output data are associated with Step objects.

Steps

You use the Step constructor to create a results step for time, frequency, or modal domain results. For example,The Step constructor has an optional previousStepName argument that specifies the step after which this step must be inserted in the steps repository. For a full description of the Step command, see Step, Section 61.26.1 of the Abaqus Scripting Reference Manual.

Frames

You use the Frame constructor to create a frame for field output. For example, For a full description of the Frame command, see Frame, Section 61.16.3 of the Abaqus Scripting Reference Manual.


10.11.4 Writing field output data

A FieldOutput object contains a “cloud of data values” (e.g., stress tensors at each integration point for all elements). Each data value has a location, type, and value. You add field output data to a Frame object by first creating a FieldOutput object using the FieldOutput constructor and then adding data to the FieldOutput object using the addData method. For example, For a full description of the FieldOutput constructor, see FieldOutput, Section 61.7.1 of the Abaqus Scripting Reference Manual.

The type argument to the FieldOutput constructor describes the type of the data—tensor, vector, or scalar. The properties of the different tensor types are:

Full tensor

A tensor that has six components and three principal values. Full three-dimensional rotation of the tensor is possible.

Three-dimensional surface tensor

A tensor that has only three in-plane components and two principal values. Full three-dimensional rotation of the tensor components is possible.

Three-dimensional planar tensor

A tensor that has three in-plane components, one out-of-plane component, and three principal values. Full three-dimensional rotation of the tensor components is possible.

Two-dimensional surface tensor

A tensor that has only three in-plane components and two principal values. Only in-plane rotation of the tensor components is possible.

Two-dimensional planar tensor

A tensor that has three in-plane components, one out-of-plane component, and three principal values. Only in-plane rotation of the tensor components is possible.

The valid components and invariants for the different data types are given in Table 10–1.

Table 10–1 Valid components and invariants for Abaqus data types.

Data typeComponentsInvariants
SCALAR  
VECTOR1, 2, 3MAGNITUDE
TENSOR_3D_FULL 11, 22, 33, 12, 13, 23MISES, TRESCA, PRESS, INV3, MAX_PRINCIPAL, MID_PRINCIPAL, MIN_PRINCIPAL
TENSOR_3D_SURFACE11, 22, 12MAX_PRINCIPAL, MIN_PRINCIPAL, MAX_INPLANE_PRINCIPAL, MIN_INPLANE_PRINCIPAL
TENSOR_3D_PLANAR11, 22, 33, 12MISES, TRESCA, PRESS, INV3, MAX_PRINCIPAL, MID_PRINCIPAL, MIN_PRINCIPAL, MAX_INPLANE_PRINCIPAL, MIN_INPLANE_PRINCIPAL, OUTOFPLANE_PRINCIPAL
TENSOR_2D_SURFACE11, 22, 12MAX_PRINCIPAL, MIN_PRINCIPAL, MAX_INPLANE_PRINCIPAL, MIN_INPLANE_PRINCIPAL
TENSOR_2D_PLANAR11, 22, 33, 12MISES, TRESCA, PRESS, INV3, MAX_PRINCIPAL, MID_PRINCIPAL, MIN_PRINCIPAL, MAX_INPLANE_PRINCIPAL, MIN_INPLANE_PRINCIPAL, OUTOFPLANE_PRINCIPAL

For example, the following statements add element data to the FieldOutput object:For a full description of the addData command, see addData, Section 61.7.6 of the Abaqus Scripting Reference Manual.

As a convenience, localCoordSystem can be a single transform or a list of transforms. If localCoordSystem is a single transform, it applies to all values. If localCoordSystem is a list of transforms, the number of items in the list must match the number of data values.


10.11.5 Default display properties

The previous examples show how you can use commands to set the default field variable and deformed field variable. Abaqus/CAE uses the default field variable setting to determine the variable to display in a contour plot; for example, stress. Similarly, the default deformed field variable determines the variable that distinguishes a deformed plot from an undeformed plot. Typically, you will use displacement for the default deformed field variable; you cannot specify an invariant or a component. The default variable settings apply for each frame in the step. For example, the following statements use the deformation 'U' as the default setting for both field variable and deformed field variable settings during a particular step:

You can set a different default field variable and deformed field variable for different steps.


10.11.6 Writing history output data

History output is output defined for a single point or for values calculated for a portion of the model as a whole, such as energy. Depending on the type of output expected, the historyRegions repository contains data from one of the following:

Note:  History data from an analysis cannot contain multiple points.

The output from all history requests that relate to a specified point is collected in one HistoryRegion object. You use the HistoryPoint constructor to create the point. For example,For a full description of the HistoryPoint command, see HistoryPoint, Section 61.10.1 of the Abaqus Scripting Reference Manual.

You then use the HistoryRegion constructor to create a HistoryRegion object:For a full description of the HistoryRegion command, see HistoryRegion, Section 61.11.1 of the Abaqus Scripting Reference Manual.

You use the HistoryOutput constructor to add variables to the HistoryRegion object.

Each HistoryOutput object contains a sequence of (frameValue, value) sequences. The HistoryOutput object has a method (addData) for adding data. Each data item is a sequence of (frameValue, value). In a time domain analysis (domain=TIME) the sequence is (stepTime, value). In a frequency domain analysis (domain=FREQUENCY) the sequence is (frequency, value). In a modal domain analysis (domain=MODAL) the sequence is (mode, value).

You add the data values as time and data tuples. The number of data items must correspond to the number of time items. For example,