5.1.4 Utility routines for accessing the results file

Products: ABAQUS/Standard  ABAQUS/Explicit  

References

Overview

The ABAQUS results (.fil) file can be accessed with the utility routines described in this section. Access is subsequent to an analysis by a user-written postprocessing program or, in ABAQUS/Standard, from within an analysis by user subroutine URDFIL.

The following utility subroutines are available:

  • DBFILE (read from a file)

  • DBFILW (write to a file)

  • DBRNU (set a unit number for a file)

  • INITPF (initialize a file)

  • POSFIL (determine position in a file; available only in ABAQUS/Standard)

These utility subroutines are described below in alphabetical order.

Only the subroutines DBFILE and POSFIL can be called from user subroutine URDFIL.


DBFILE (read from a file)

Interface

CALL DBFILE(LOP,ARRAY,JRCD)

Variable to be provided to the utility routine

LOP

A flag, which you must set before calling DBFILE, indicating the operation. Set LOP=0 to read the next record in the file; set LOP=2 to rewind the file currently being read (for example, if it is necessary to read the file more than once, it must be rewound since it is a sequential file). If LOP=2 is used, the file must first be read to the end, and it should be rewound only when the end-of-file is reached.

Variables returned from the utility routine

ARRAY

The array containing one record from the file, in the format described in Results file output format, Section 5.1.2. When LOP=0, this array will be filled by the data management routines with the contents of the next record in the file as each call to DBFILE is executed. ARRAY must be dimensioned adequately in your routines to contain the largest record in the file. For almost all cases 500 words is sufficient. The exceptions arise if the problem definition includes user elements or user materials that use more than this many state variables or if substructures with a large number of retained degrees of freedom are used (see Using substructures, Section 7.2.1, for more details regarding substructures). When the results file has been written on a system on which ABAQUS runs in double precision, ARRAY must be declared double precision in your routine.

JRCD

Returned as nonzero if an end-of-file marker is read when DBFILE is called with LOP=0.


DBFILW (write to a file)

Interface

CALL DBFILW(LOP,ARRAY,JRCD)

Variables to be provided to the utility routine

ARRAY

The array containing one record to be written to the file, in the format described in Results file output format, Section 5.1.2.

JRCD

Return code (0 – record written successfully, 1 – record not written).

LOP

Not currently used.


DBRNU (set a unit number for a file)

Interface

CALL DBRNU(JUNIT)

Variable to be provided to the utility routine

JUNIT

The FORTRAN unit number of the results file to be read. Valid unit numbers are 8 to read the .fil file, 15–18, or numbers greater than 100.


INITPF (initialize a file)

Interface

CALL INITPF(FNAME,NRU,LRUNIT,LOUTF)

Variables to be provided to the utility routine

FNAME

A character string defining the root file name (that is, the name without an extension) of the files being read or written. FNAME must be declared as CHARACTER*80 and can include the directory specification as well as the root file name. The extension of each individual file is defined by the LRUNIT array below. See the discussion below for file naming conventions.

NRU

An integer giving the number of results files that the postprocessing program will read. Normally only one results file is read, but sometimes it is necessary to read several results files—for example, to merge them into a single file.

LRUNIT

An integer array that must be dimensioned LRUNIT(2,NRU) in the postprocessing program and must contain the following data before INITPF is called:

LRUNIT(1,K1) is the FORTRAN unit number on which the K1th results file will be read. Valid unit numbers are 8 to read the .fil file, 15–18, or numbers greater than 100. All other units are reserved by ABAQUS. See below for naming conventions based on the unit numbers.

LRUNIT(2,K1) is an integer that must be set to 2 if the K1th results file was written as a binary file or set to 1 if the K1th results file was written in ASCII format.

LOUTF

Needs to be defined only if the program that is making the call to INITPF will also write an output file in the ABAQUS results file format (for example, if results files are being merged into a single results file or if a results file is being converted from binary to ASCII format). In that case LOUTF should be set to 2 if the output file is to be written as a binary file or set to 1 if the output file is to be written as an ASCII file. This results file will be written with the file name extension .fin. See Accessing the results file information, Section 5.1.3, for a discussion of writing results files; see below for information on the naming of this file.

File naming conventions

The file extension is derived from the value of LRUNIT(1,K1). If LRUNIT(1,K1) is 8, the file name will be constructed with the extension fil. Any other unit number will result in a file extension of 0nn, where nn is the number assigned to LRUNIT(1,K1). For example, if LRUNIT(1,K1) is 15, the file extension is .015. If an output file has been indicated by a nonzero value of LOUTF, its extension will be .fin.

For example, to read a file xxxx.fil, set LRUNIT(1,K1) to 8 and the character variable FNAME to xxxx using assignment or data statements. If desired, FNAME can include a directory specification, device name, or path. Operating system environment and shell variables will not be translated properly and, therefore, should not be used.

All error messages generated by ABAQUS are written to FORTRAN unit 6. On most machines error messages will be printed by default directly to the screen if the program is run interactively. You can include an open statement for unit 6 in the main program to redirect messages to a file. If you wish to read or write to units other than those units specified in LRUNIT, OPEN statements for those units may have to be included in the program (depending upon the computer being used). Unit numbers of such auxiliary files should be greater than 100 to avoid any conflict with ABAQUS internal files.


POSFIL (determine position in a file)

The POSFIL utility routine is available only in ABAQUS/Standard.

Interface

CALL POSFIL(NSTEP,NINC,ARRAY,JRCD)

Variables to be provided to the utility routine

NSTEP

Desired step. If this variable is set to 0, the first available step will be read.

NINC

Desired increment. If this variable is set to 0, the first available increment of the specified step will be read.

Variables returned from the utility routine

ARRAY

Real array containing the values of record 2000 from the results file for the requested step and increment.

JRCD

Return code (0 – specified increment found, 1 – specified increment not found). If the step and increment requested are not found in the results file, POSFIL will return an error and leave you positioned at the end of the results file.

Positioning with POSFIL

You may find it convenient to call POSFIL with both NSTEP and NINC set to 0 to skip over the information that is written to the results file at the beginning of an analysis (see Results file output format, Section 5.1.2) and, thus, start reading from the first increment written to the file.

POSFIL cannot be used to move backward in the results file: you cannot use POSFIL to find a given increment in the file and then make a second call to POSFIL later to read an increment earlier than the first one found. If this is attempted, POSFIL will return an error indicating that the requested increment was not found.

Examples