============================= 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 script in :ref:`creating-an-output-database` also illustrates how you can write to an output database. Creating a new output database ------------------------------ You use the Odb constructor to create a new, empty Odb object. .. code-block:: cpp odb_Odb& odb = Odb("myData","derived data", "test problem", "testWrite.odb"); For a full description of the Odb command, see :py:class:`~abaqus.Odb.Odb.Odb` object. Abaqus creates the RootAssembly object when you create or open an output database. You use the `save` method to `save` the output database. .. code-block:: cpp odb.save(); For a full description of the save command, see :py:meth:`~abaqus.Odb.OdbBase.OdbBase.save`. 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,` .. code-block:: cpp odb_Part& part1 = odb.Part("part-1", odb_Enum::THREE_D, odb_Enum::DEFORMABLE_BODY); For a full description of the Part constructor, see :py:class:`~abaqus.Odb.OdbPart.OdbPart`. The new Part object is empty and does not contain geometry. After you create the Part object, you 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, .. code-block:: cpp odb_SequenceInt nodeLabels; nodeLabels.append(1); nodeLabels.append(2); nodeLabels.append(3); nodeLabels.append(5); nodeLabels.append(7); nodeLabels.append(11); double c[6][3] = { {2.0, 1.0, 0.0}, {1.0, 1.0, 0.0}, {1.0, 0.0, 0.0}, {2.0, 0.0, 0.0}, {1.0, 0.0, 1.0}, {2.0, 0.0, 1.0} }; odb_SequenceSequenceFloat nodeCoor; for (int n=0; n