Calculation of principal stresses and strains and their directions: FPRIN

This example illustrates the use of a Fortran program to read stress and strain records from an Abaqus results file and to calculate principal stress and strain values and their directions.

This page discusses:

ProductsAbaqus/Standard

General description

This program shows how to retrieve integration point and nodal averaged stress and strain components from an Abaqus results file and then compute principal values and directions using the Abaqus utility routine SPRIND. Usage of this utility routine is documented in the input file provided for this problem, and further details about the interface to this subroutine are discussed in Obtaining Stress Invariants, Principal Stress/Strain Values and Directions, and Rotating Tensors in an Abaqus/Standard Analysis. The results file created by the FJOIN program in Joining data from multiple results files and converting file format: FJOIN is used here to verify that the records that have been put together are retrievable. The previously generated results file was named fjoinxxx.fin. To use it as an input file for postprocessing program FPRIN, the file extension must be changed. This program will assume that the results file has the default .fil extension, which corresponds to Fortran unit 8.

Programming details

The user should first review the general discussion on programming concepts and Abaqus Fortran interfaces in About user postprocessing of Abaqus results files and the detailed discussion of postprocessing given in File Output Format.

When running program FPRIN (this program is named fprin.f on the Abaqus release media), the user will be prompted for the file name that initializes FNAME. Other variables, such as LOUTF, NRU, LRUNIT(1,NRU), and LRUNIT(2,NRU), are initialized inside the program. INITPF and DBRNU are then called to complete the neccesary initializations and file connections. Data processing starts with a double DO-loop over all the records to be read, one-by-one, via a call to DBFILE. Each record is identified by its record key, which is stored in the second entry of the record. When records 1922 and 2000 are processed by program FPRIN, the heading and the current step and increment numbers are written out so as to provide a way to recognize the beginning of data in each analysis. Record type 1 is then examined to determine the output location of stress and strain, the number of direct and shear stress and strain components, and either the element number or the node number for which the records are written. The stress and strain records (11 and 21, respectively) will be filtered out for processing by the Abaqus utility routine SPRIND. When a stress or strain record is passed into SPRIND, principal stresses or strains and the corresponding principal directions are calculated and returned in an unsorted order.

Program compilation and linking

Before program execution, the Fortran program has to be compiled and linked. Both operations, as well as the inclusion of the aba_param.inc file, are performed by a single execution of the abaqus make utility:

abaqus make job=fprin

This may have to be repeated until all Fortran errors are corrected. After successful compilation, the program's object code is automatically linked with the Abaqus object codes stored in the shared program library and interface library in order to build the executable program. Refer to to see which compile and link commands are used for a particular computer.

Program execution

Before the program is executed, a results file must have been created. In this example the results file fjoinxxx.fin created by the FJOIN program discussed in Joining data from multiple results files and converting file format: FJOIN is used. This file must be renamed to fjoinxxx.fil since Fortran unit 8 (which is associated with the .fil file extension) is used in the program to read the file. When the program is executed using the command abaqus fprin, the prompt

Enter the name of the input file (w/o .fil):

will appear. Enter fjoinxxx to define FNAME. The program processes the data and produces a file named pvalue.dat, which contains information about principal stresses and strains and their directions.

Results and discussion

The computed principal stress and strain values and their directions are tabulated below.

Analysis File Principal Component Stress × 105 Strain × 10−3 Dir-1 Dir-2 Dir-3
fjoin002.inp 1 10.714 25.0 1.0 0.0 0.0
2 10.714 25.0 0.0 1.0 0.0
3 0.0 0.0 0.0 0.0 1.0
fjoin003.inp 1 −2.8846 −12.5 0.707 −0.707 0.0
2 2.8846 12.5 0.707 0.707 0.0
3 0.0 0.0 0.0 0.0 1.0
fjoin004.inp 1 0.0 −7.5 1.0 0.0 0.0
2 7.5 25.0 0.0 1.0 0.0
3 0.0 0.0 0.0 0.0 1.0

Input files

fprin.f

Postprocessing program.