10.15 Example programs that access data from an output database

The following examples illustrate how you use the output database commands to access data from an output database:


10.15.1 Finding the maximum value of von Mises stress

This example illustrates how you can iterate through an output database and search for the maximum value of von Mises stress. The program opens the output database specified by the first argument on the command line and iterates through the following:

In addition, you can supply an optional assembly element set argument from the command line, in which case the program searches only the element set for the maximum value of von Mises stress.

The following illustrates how you can run the example program from the system prompt. The program will search the element set ALL ELEMENTS in the viewer tutorial output database for the maximum value of von Mises stress:

abaqus odbMaxMises.py -odb viewer_tutorial.odb 
    -elset “ ALL ELEMENTS”

Note:  If a command line argument is a String that contains spaces, some systems will interpret the String correctly only if it is enclosed in double quotation marks. For example, “ ALL ELEMENTS”.

You can also run the example with only the -help parameter for a summary of the usage.

Use the following commands to retrieve the example program and the viewer tutorial output database:

abaqus fetch job=odbMaxMises.C
abaqus fetch job=viewer_tutorial


10.15.2 Creating an output database

The following example illustrates how you can use the Abaqus C++ API commands to do the following:

  1. Create a new output database.

  2. Add model data.

  3. Add field data.

  4. Add history data.

  5. Read history data.

  6. Save the output database.

Use the following command to retrieve the example program:
abaqus fetch job=odbWrite

 


10.15.3 Reading data from an output database

This example illustrates how you can print the content of an output database. The example opens the output database specified on the command line and calls functions that print the following:

Use the following command to retrieve the example program:

abaqus fetch job=odbDump


10.15.4 Decreasing the amount of data in an output database by retaining data at specific frames

This example illustrates how you can decrease the size of an output database. In most cases a large output database results from excessive field output being generated over a large number of frames. The Abaqus C++ API does not support the deletion of data from an output database; however, you can use this example program to copy data from select frames into a second output database created by a datacheck analysis that has identical model data. The original analysis and the datacheck analysis must be run using the same number of processors because the internal organization of data may differ based on the number of processors. The program uses addData to copy data at specified frames from the large output database into the new output database. The addData method works only when the model data in the two output databases are identical. For more information, see addData, Section 61.7.6 of the Abaqus Scripting Reference Manual.

When you run the program, the following command line parameters are required:

-smallOdb odbName

The name of the output database created with a datacheck analysis of the original problem. For more information, see Abaqus/Standard, Abaqus/Explicit, and Abaqus/CFD execution, Section 3.2.2 of the Abaqus Analysis User's Manual.

-largeOdb odbName

The name of the large output database generated by the original problem. The program copies selected frames from this output database.

The following parameters are optional:

-history

Copy all history output from all available steps in the large output database. By default, history output is not copied.

Warning:  Copying large amounts of history data can result in the program creating a very large output database.

-debug

Print a detailed report of all the operations performed during the running of the program. By default, no debug information is generated.

Warning:  If you are extracting data from a large output database, the debug option can generate large amounts of information.

You can also run the example with only the -help parameter for a summary of the usage.

The following is an example of how you can use this program in conjunction with the output database generated by the problem described in Free ring under initial velocity: comparison of rate-independent and rate-dependent plasticity, Section 1.3.4 of the Abaqus Benchmarks Manual. Use the following commands to retrieve the example program and the benchmark input file:

abaqus fetch job=odbFilter.C
abaqus fetch job=ringshell.inp

  1. Run an analysis using the benchmark input file:

    abaqus job=ringshell
    This creates an output database called ringshell.odb that contains 100 frames of data.

  2. Run a datacheck analysis to obtain a new output database called ringshell_datacheck.odb that contains the same model data as ringshell.odb:

    abaqus job=ringshell_datacheck -input ringshell datacheck

  3. Create the executable program:

    abaqus make job=odbFilter.C

The program displays the number of frames available in each step. For each step you must specify the number of increments between frames, which is the frequency at which the data will be copied to the new output database. Data for the first and last increment in each step are always copied. For example, if a step has 100 frames, and you enter a frame interval of 37, the program will copy data for frames 0, 37, 74, and 100.

The following statement will run the executable program and read data from the small output database containing only model data and the large output database created by the benchmark example:

abaqus odbFilter -smallOdb ringshell_datacheck -largeOdb ringshell 
The program prompts you for the increment between frames:
Results from ODB : ringshell.odb will be filtered & written 
to ODB: ringshell_datacheck
By default only the first & last increment of a step will 
be saved
For each step enter the increment between frames
for example : 3 => frames 0,3,6,..,lastframe will be saved
STEP Step-1 has 101 Frames
Enter Increment between frames
Enter 37 to define the increment between frames. The program then reads the data and displays the frames being processed:
Processing frame # : 0
Processing frame # : 37
Processing frame # : 74
Processing frame # : 100
Filtering successfully completed


10.15.5 Stress range for multiple load cases

This example illustrates how you can use the envelope operations to compute the stress range over a number of load cases. The example program does the following:

Use the following command to retrieve the example program:

abaqus fetch job=stressRange
The fetch command also retrieves an input file that you can use to generate an output database that can be read by the example program.


10.15.6 A C++ version of FELBOW

This example illustrates the use of a C++ program to read selected element integration point records from an output database and to postprocess the elbow element results. The program creates X–Y data that can be plotted with the X–Y plotting capability in Abaqus/CAE. The program performs the same function as the FORTRAN program described in Creation of a data file to facilitate the postprocessing of elbow element results: FELBOW, Section 14.1.6 of the Abaqus Example Problems Manual.

The program reads integration point data for elbow elements from an output database to visualize one of the following:

  1. Variation of an output variable around the circumference of a given elbow element, or

  2. Ovalization of a given elbow element.

The program creates either an ASCII file containing X–Y data or a new output database file that can be viewed using Abaqus/CAE.

To use option 2, you must ensure that the integration point coordinates (COORD) are written to the output database. For option 1 the X-data are data for the distance around the circumference of the elbow element, measured along the middle surface, and the Y-data are data for the output variable. For option 2 the X–Y data are the current coordinates of the middle-surface integration points around the circumference of the elbow element, projected to a local coordinate system in the plane of the deformed cross-section. The origin of the local system coincides with the center of the cross-section; the plane of the deformed cross-section is defined as the plane that contains the center of the cross-section.

You should specify the name of the output database during program execution. The program prompts for additional information, depending on the option that was chosen; this information includes the following:

Before program execution, compile and link the C++ program using the abaqus make utility:

abaqus make job=felbow.C
After successful compilation, the program's object code is linked automatically with the Abaqus object codes stored in the shared program library and interface library to build the executable program. Refer to Chapter 4, Customizing the Abaqus environment,” of the Abaqus Installation and Licensing Guide to see which compile and link commands are used for a particular computer.

Before executing the program, run an analysis that creates an output database file containing the appropriate output. This analysis includes, for example, output for the elements and the integration point coordinates of the elements. Execute the program using the following command:

abaqus felbow <filename.odb>
The program prompts for other information, such as the desired postprocessing option, part name, etc. The program processes the data and produces a text file or a new output database file that contains the information required to visualize the elbow element results.

Elastic-plastic collapse of a thin-walled elbow under in-plane bending and internal pressure, Section 1.1.2 of the Abaqus Example Problems Manual, contains several figures that can be created with the aid of this program.