2.3. Retrieving Data from the Results File

There are two methods for retrieving data from the results file:

2.3.1. Results File Reader

The Mechanical APDL solver results are typically stored in a binary file using the format described in Description of the Results File. This file can have an .rst, .rth, or .rmg extension, depending on the analysis type.

The results file format can be visualized as a tree of records.

Figure 2.1: Results File Structure

Results File Structure

Color code: blue - general records; purple - geometry; red - results sets; yellow - element results

The Results File Reader is a C++ object API that facilitates access to these records.

You can relate the above tree structure to the records described in Results File Format. The below table shows typical examples.

Table 2.1: Finding Records in the Results File Description

Record LabelMeaningSample Content from .rst File
GEOGeometry data
c   GEO      i       1       80     Geometry data header(was 20 in 32 bit vers)

c                                        0,  maxety,   maxrl,    nnod,    nelm,
c                                   maxcsy,  ptrETY,  ptrREL,  ptrLOC,  ptrCSY,  (10)
...
DSIData set index for solution sets
c   DSI      i       1    2*resmax  Data sets index table. This record contains
c                                   the record pointers for the beginning of
c                                   each data set. The first resmax records are
c                                   the first 32 bits of the index, the second
c                                   resmax records are the second 32 bits. 
...
NODNodal equivalence table
c   NOD      i       1     nnod     Nodal equivalence table. This table equates
c                                   the number used for storage to the actual
c                                   node number
c                                    (Back(i),i=1,nnod)
ELMElement equivalence table
c   ELM      i       1     nelm     Element equivalence table. The program
c                                   stores all element data in the numerical
c                                   order that the SOLUTION processor solves the
c                                   elements.  This table equates the order
c                                   number used to the actual element number

2.3.1.1. Compile and Link with the Result File Reader Code

To compile your code based on the Results File Reader, you must add the path that contains the main C_RstFile.h include file and its dependencies, as shown below.

Windows:

C:\Program Files\ANSYS Inc\v242\ansys\customize\include 

Linux:

/ansys_inc/v242/ansys/customize/include/

On Windows, you must add the -DWINNT preprocessor definition at compile time. On Linux, you must add -DLINUX.

To link your application, add the following libraries to your link process.

Windows:

C:\Program Files\ANSYS Inc\v242\ansys\custom\lib\winx64\CadoeKernel.lib
C:\Program Files\ANSYS Inc\v242\ansys\custom\lib\winx64\CadoeReaders.lib

Linux:

/ansys_inc/v242/ansys/lib/linx64/libCadoeKernel.so
/ansys_inc/v242/ansys/lib/linx64/libCadoeReaders.so

Note that these libraries have dependencies to the Intel MKL library.

2.3.1.2. Open an Existing Results File

The first step is to add this line at the beginning of your C++ code:

#include "C_RstFile.h"

Suppose that you have a results file named file.rst in your current directory. Use this line to open an existing file:

C_RstFile     RstFile( "file.rst");   // File is opened. Ready to be parsed.

The file will automatically close when the object is deleted.

2.3.1.3. Basic Concepts

2.3.1.3.1. Vector Format Description

The Results File Reader offers the ability to get the values of a record of the results file via the CVEC<T> object, where T is the type of scalars of the record of interest (typically int, double, float or complex<double>).

You can create and allocate a CVEC object by typing:

CVEC<double> V(10); // Create and allocate a vector of 10 double values

The C_RstFile object allocates the vector using the correct size.

The size of a vector is accessible by calling the member function:

int size = V.Dim();

To access the values of the vector, get the pointer to the beginning of the vector:

double *values = V.Adr();

Or you can directly access the ith value:

int           i = 0;      // The first value
double    val = V[i]; 
2.3.1.3.2. Get a Record in the Results File

Based on the tree representation shown in Figure 2.1: Results File Structure, you can get any record from an opened results file just by specifying its location in the tree.

  1. First, the global header of the results file can be accessed using a special call:

    C_Record      *RstHeader = RstFile.GetGlobalHeader();        // The main global RST File Header (“RST” in the tree)

    The results file header contains global information about what can be found in the current file (mesh, results, and so on).

    To get the array of values from a C_Record object, use this call:

    CVEC<int>     VecHead;                        // VecHead is defined as an Vector of Integers.
    RstFile.GetRecord( *RstHeader, VecHead);      // Fills the VecHead vector
    VecHead.Print();                              // Print to screen the values of the vector

    You can then access the values of this vector. Please refer to the C_RstFile::E_RstHeader C++ enum for a list of usable constants.

    int nnod = VecHead[C_RstFile::E_NNOD];        // To Get the number of Nodes
    int nelm = VecHead[C_RstFile::E_NELM];        // To Get the number of Elements
  2. Next, from this global header you can get the C_Record object by giving the complete path to the record of interest. Here we access the nodal solution (NSL) of the first solution set:

    C_Record *Block = RstHeader->find( "RST::DSI::SET1::NSL");
  3. Then, depending on the type of values the record contains, you can get the values:

    CVEC<double> V;
    RstFile.GetRecord( *Block, V);  
    for( int ii=0; ii<V.Dim(); ii++)          // Print the values of the vector
      cout << ii << ":  " << V[ii] << endl;
2.3.1.3.3. Repeatedly Reading Records of the Results File

Some sets of records are repeated in the file. To optimize the reading of such records, you can use the dedicated functions C_RstFile::GetFirstRec and C_RstFile::GetNextRec. They can be used for:

  • The element descriptions:

    RST::GEO::EID

  • The element type:

    RST::GEO::ETY

  • The element section data:

    RST::GEO::SEC

  • The coordinate system description:

    RST::GEO::CSY

See Extract the Elements for examples of how to use these functions.

2.3.1.4. Extract Nodes and Elements

From the VecHead global header vector, you can get global information for the nodes.

  • Maximum node number of the model:

    C_RstFile::E_MAXN

  • Actual number of nodes used in the solution phase:

    C_RstFile::E_NNOD

  • Number of DOFs per node:

    C_RstFile::E_NUMDOF

2.3.1.4.1. Extract the Nodes

Node locations are stored in the record “LOC”, under the geometry section of the tree:

c   LOC     dp     nnod      7      (64 bit version)
c                                   Node,X,Y,Z,THXY,THYZ,THZX for each node
c                                   Nodes are in node number order

To get the entire vector of node numbers and coordinates, you can use this direct call:

// ===== Node,X,Y,Z,THXY,THYZ,THZX for each node. Nodes are in node number order
CVEC<>    GeoNod;		  // Type is not specified, double is the default

Block = RstHeader->find( "RST::GEO::LOC");     // Get a handle to the LOC block in the tree
RstFile.GetRecord( *Block, GeoNod, ALL_REC);   // Fills the GeoNod vector; ALL_REC means ask for all nodes

cout << "\n   Global Nodes Vector, Dim =  : " << GeoNod.Dim();

// ===== The same data, but for a single node : 
int           NumNod(1);
CVEC<>        GeoNod_i;

RstFile.GetRecord( *Block, GeoNod_i, NumNod);

cout << "\n   Single Nodes Vector, Dim =  : " << GeoNod_i.Dim() << endl;
2.3.1.4.2. Extract the Elements

From the Global header vector, you can get global information for the elements.

  • Maximum element number of the model:

    C_RstFile::E_MAXE

  • Actual number of elements used in the solution phase:

    C_RstFile::E_NELM

Element Description Record

Element descriptions are stored in the record “EID”, in the geometry section of the tree:

c   EID      i       1     nelm     Element descriptions index table. This
c                                   record contains the record pointers for each
c                                   element description. (LONGINT (2*nelm) for
c                                   64 bit version, relative to ptrEIDL).
c                                   The order of the elements is the same as
c                                   the order in the element equivalence table.

c   ---      i     nelm  10+nodelm  Element descriptions. Each of these records
c                                   is pointed to by a record pointer given in
c                                   the record labeled EID. The length of these
c                                   records varies for each element (actual
c                                   length is returned from routine BINRD8).
c                                   nodelm shown here is the number of nodes for
c                                   this element. Its value is defined in the
c                                   element type description record. 

You can, for instance, get repeatedly all the element descriptions by calling the functions C_RstFile::GetFirstRec and C_RstFile::GetNextRec:

CVEC<int> ElemDesc;
int iel = RstFile.GetFirstRec( "RST::GEO::EID", ElemDesc, 0, true);
while (iel != -1)
  {
    iel = RstFile.GetNextRec( ElemDes);      
  }  

Element Type Record

Element type descriptions are stored in the record "ETY":

c   ETY      i       1     maxety   The element types index table. This record
c                                   contains record pointers for each element
c                                   type description. (Relative to ptrETYPL
c                                   for 64 bit version)

In the same way as shown above for element descriptions, you can loop over the element types, calling the same set of functions.

CVEC<int> ElemType;
int iel = RstFile.GetFirstRec( "RST::GEO::ETY", ElemType, 0, true);
while (iel != -1)
  {
    iel = RstFile.GetNextRec( ElemType);
  }  

2.3.1.5. Extract a Solution Vector

To get a given nodal or element solution in a given solution set, you can call the C_RstFile::GetSolution function.

CVEC<T> *V = RstFile.GetSolution(int iset, string IdSol, CVEC<T> *Sol, int NumEntity);

where:

iset is the solution set number.
IdSol is the solution record ID (for example, "NSL", "RF", "ENS", and so on).
Sol is the vector where the values are to be stored. If it is not allocated, the function allocates it and returns.
NumEntity is the node or element number. Default = All_REC, meaning all entities in the same vector are requested.

You can access the vector properties using this:

int Size = SolNod.Dim();  // To get the size of the output vector
double val = SolNod[ii];  // To access the values of the vector

2.3.1.6. Example: Extract a Nodal Solution Vector

This example demonstrates reading the nodal solution corresponding to the first solution set.

int              iSet = 1;                // ===== Solution set number
string           IdSol = "NSL";           // ===== Solution Id we want to get
CVEC<double>     Displacement;            // ===== The vector to fill with the solution
int              NumEntity = ALL_REC;     // ===== The Entity (node/elem) number; ALL_REC means all entitites

RstFile.GetSolution( iset, IdSol, &Displacement, NumEntity);

cout << "Size of the nodal solution vector : " << Displacement.Dim() << endl;

Displacement.Print( stdout);

2.3.1.7. Example: Extract an Element Solution Vector

This example demonstrates reading the element nodal stresses corresponding to the first solution set and the first element.

int              iSet = 1;           // ===== Solution set number
string           IdSol = "ENS";      // ===== Solution Id we want to get
CVEC<double>     EnsVector;          // ===== The vector to fill with the solution
int              NumEntity = 1;      // ===== The element number

RstFile.GetSolution(iset, IdSol, &EnsVector, NumEntity);

cout << "Size of the element solution vector : " << EnsVector.Dim() << endl;

EnsVector.Print( stdout);

Given an elementary result, we can also loop over all elements where this result is stored using the C_RstFile::GetFirstLocalSolution and C_RstFile::GetNextLocalSolution functions.

int              iSet = 1;           // ===== Solution set number
string           IdSol = "ENS";      // ===== Solution Id we want to get
CVEC<double>     EnsVector;          // ===== The vector to fill with the solution
int              NumEntity = 1;      // ===== The first element number

NumEntity = RstFile.
GetFirstLocalSolution( iSet, IdSol, EnsVector, NumEntity);


While ( NumEntity > 0)
{
      // EnsVector contains nodal stresses of the element #NumEntity

      NumEntity 
      = RstFile.
      GetNextLocalSolution( EnsVector, NextEntity);
      }

2.3.1.8. Example: Using the Results File Reader in a Standalone Program

/**
* @file   TestRstReader.cpp
*
* @brief  This source file shows the way we can open an RST File,
*	 and extract data using the C++ C_RstFile Object.
*
*/

#include <stdio.h>
#include "C_RstFile.h"

void
main(int argc, char *argv[])
{
	char		*FileName = argv[1];

	// ================================================================================
	// ===== Open the RST File :

	cout << "\n	Open the RST File		: " << FileName << endl;

	C_RstFile	RstFile(FileName);				// ===== OPEN THE RST FILE

	C_Record	*RstHeader = RstFile.GetGlobalHeader();		//       Handle on the Global header

	cout << "\n	Ansys Rev. : " << RstFile.AnsRev() << endl;

	// ===== Get global numbers for this model

	int	maxn = RstFile.RstHeader(C_RstFile::E_MAXN);	// Maximum node number
	int	nnod = RstFile.RstHeader(C_RstFile::E_NNOD);	// Number of nodes

	int	maxe = RstFile.RstHeader(C_RstFile::E_MAXE);	// Maximum element number
	int	nelm = RstFile.RstHeader(C_RstFile::E_NELM);	// Number of elements

	cout << "\n	Number of Nodes		: " << nnod;
	cout << "\n	Max Node Number		: " << maxn << endl;
	cout << "\n	Number of Elements		: " << nelm;
	cout << "\n	Max Elt Number		: " << maxe << endl;

	// ================================================================================
	// ===== Extract Nodes Data

	// Node,X,Y,Z,THXY,THYZ,THZX for each node. Nodes are in node number order

	C_Record	*Block = NULL;

	Block = RstHeader->find("RST::GEO::LOC");		// Get the pointer to the LOC Record

	CVEC<>	GeoNod;
	RstFile.GetRecord(*Block, GeoNod, ALL_REC);	// Fills the GeoNod Array

	cout << "\n	Global Nodes Vector, Size =	: " << GeoNod.Dim();

	// The same data, but for a single node:

	int		NumNod(1);
	CVEC<>	GeoNod_i;
	RstFile.GetRecord(*Block, GeoNod_i, NumNod);	// We only read the data for the 1st node

	cout << "\n	Single Nodes Vector, Size =	: " << GeoNod_i.Dim() << endl;

	// ================================================================================
	// ===== Extract Elements Data

	// ===== Mapping	Elt Index <-> Elt Number

	Block = RstHeader->find("RST::ELM");		// Get the pointer to the ELM Record

	CVEC<int>	Elm;
	RstFile.GetRecord(*Block, Elm);		// Fills the Elm Array

	cout << "\n	Element Equivalence Table Size	: " << Elm.Dim() << endl;


	// ===== Get the Geometry Header

	Block = RstHeader->find("RST::GEO");		// Get the pointer to the GEO Record

	CVEC<int>	GeoHeader;
	RstFile.GetRecord(*Block, GeoHeader);		// Fills the GeoHeader Array

	// This GeoHeader contains information such as the maximum element type reference number in the model:

	int	maxety = GeoHeader[C_RstFile::E_GMAXETY];

	// For each element type, we can get the Type description

	cout << "\n	Extract All Element Types Descriptions .... " << endl;

	CVEC<int>	ElemEty;
	int ityp = RstFile.GetFirstRec("RST::GEO::ETY", ElemEty, 0, true);
	while (ityp != -1)
	{
		cout << "	Got Description for Element Type	: " << ElemEty[1] << endl;
		ityp = RstFile.GetNextRec(ElemEty);
	}

	// For each element, we extract the description associated to 

	cout << "\n	Extract All Element Descriptions .... \n";

	CVEC<int>	ElemDes;
	int iel = RstFile.GetFirstRec("RST::GEO::EID", ElemDes, 0, true);
	while (iel != -1)
	{
		int	imat = ElemDes[0],
			itype = ElemDes[1];

		cout << "Element " << iel << ": Material = " << imat << " , Element Type Number = " << itype << endl;

		iel = RstFile.GetNextRec(ElemDes);
	}

	cout << "\n		            Element " << nelm << "   OK" << endl;

	// ================================================================================
	// ===== We get the number of solution sets

	int		NbSet = RstFile.RstHeader(C_RstFile::E_NSETS);

	cout << "\n	Number of Result Sets	: " << NbSet << endl;

	// Get the Nodal Solution of the 1st solution set

	int 		iset(1);		// 1st solution set
	string	IdSol = "NSL";	// “NSL” means Nodal Solution
	CVEC<>	SolNod;		// This vector will contain the Nodal Solution

	RstFile.GetSolution(iset, IdSol, &SolNod);

	cout << "Nodal Solution vector : size = " << SolNod.Dim() << endl;


	// Get the Nodal Stresses for the 1st Element, for the 1st solution set

	IdSol = "ENS";

	int		NumElem = 1;
	int		Size(0);
	CVEC<>	EnsElem;

	try {

		RstFile.GetSolution(iset, IdSol, &EnsElem, NumElem);
	}
	catch (C_CadoeException e) {
		if (e.getExceptionCode() == E_ResultNotAvailable)
		{
			cerr << "This result " << IdSol << " is not available\n";
		}
	}

	Size = EnsElem.Dim();

	cout << "\n	Size of the ENS vector for the 1st Element = " << Size << endl;


	// Loop to get all the Element Nodal Stresses, for the 1st Solution Set

	NumElem = RstFile.GetFirstLocalSolution( iset, IdSol, EnsElem, 1); // 1 means we start at the 1st Element
	if (NumElem == -3) cerr << "No Elementary results stored in this Result File\n";
	if (NumElem == -2) cerr << "this result is not stored for this Element " << NumElem << "in this Solution Set\n";

	while(NumElem > 0)
	{
		cout << "For Element #" << NumElem << " Norm of the Nodal Stress Vector is : " << EnsElem.Nrm() << endl;

		NumElem = RstFile.GetNextLocalSolution( EnsElem);
	}

	return;
}

2.3.2. Results File Access Routines

The method of accessing the results file described in this section is presented as an alternative to the Results File Reader.

You can use the low-level routines described in Accessing Mechanical APDL Binary Files to retrieve data from the results file. Or you can use the routines described below that retrieve data specific to the format of the results file.

These files reside in the subdirectory \Program Files\ANSYS Inc\V242\ANSYS\customize\user (on Windows systems) or /ansys_inc/v242/ansys/customize/misc (on Linux systems). See Access Routines for Results Files for information on compiling and linking these routines.

2.3.2.1. Overview of the Routines

For each data record in the results file, routines exist that:

  • Read the record index and allocate space for the data. These are named ResRdrecordBegin, where record is a descriptive name of the record, for example, ResRdNodeBegin

  • Read the data itself. These are named ResRdrecord, for example, ResRdNode

  • Deallocate space for the data. These are named ResRdrecordEnd, for example, ResRdNodeEnd

Below is a complete listing of all the routines with the indentation indicating the required nested calling sequence:

function ResRdBegin (Nunit,Lunit,Fname,ncFname,Title,JobName,Units,NumDOF,DOF,UserCode,MaxNode,NumNode,MaxElem,NumElem,MaxResultSet,NumResultSet)
  subroutine ResRdGeomBegin (MaxType,MaxReal,MaxCsys,nXYZ)
    subroutine ResRdTypeBegin (NumType,TypeLen)
      function ResRdType (itype,ielc,TypeNo)
    subroutine ResRdTypeEnd
    subroutine ResRdRealBegin (NumReal,NumPerReal,RealLen)
      function ResRdReal (iReal,Rcon,RealNo)
    subroutine ResRdRealEnd
    subroutine ResRdCsysBegin (NumCsys,CsysLen)
      function ResRdCsys (iCsys,CsysNo)
    subroutine ResRdCsysEnd
    subroutine ResRdNodeBegin
      function ResRdNode (iNode,xyzang)
    subroutine ResRdNodeEnd
    subroutine ResRdElemBegin
      function ResRdElem (iElem,nodes,ElemData)
    subroutine ResRdElemEnd
  subroutine ResRdGeomEnd
  subroutine ResRdSectMatBegin (MaxSect,MaxMat)
    subroutine ResRdSectBegin (NumSect,NumPerSect,SectLen)
      function ResRdSect (iSect,SecData,SectNo)
    subroutine ResRdSectEnd
    subroutine ResRdMatBegin (NumMat,NumPerMat)
      function ResRdMat (iMat,iprop,MatData)
    subroutine ResRdMatEnd
  subroutine ResRdSectMatEnd
  function ResRdSolBegin (key,lstep,substep,ncumit,kcmplx,time,Title,DofLab)
    subroutine ResRdDispBegin
      function ResRdDisp (node,Disp)
    subroutine ResRdDispEnd
    subroutine ResRdRforBegin (nRForce)
      function ResRdRfor (node,idof,value)
    subroutine ResRdRforEnd
    subroutine ResRdBCBegin (BCHeader)
      subroutine ResRdFixBegin (BCHeader,nFixed)
        function ResRdFix (node,idof,value)
      subroutine ResRdFixEnd
      subroutine ResRdForcBegin (BCHeader,nForces)
        function ResRdForc (node,idof,value)
      subroutine ResRdForcEnd
    subroutine ResRdBCEnd
    subroutine ResRdEresBegin
      function ResRdEstrBegin  (iElem)
        function ResRdEstr (iStr,Str)
      subroutine ResRdEstrEnd
    subroutine ResRdEresEnd
  subroutine ResRdSolEnd
subroutine ResRdEnd

These routines are contained in the file ResRd.F. See the demonstration routine ResRdDemo.F on the distribution medium for an example of the usage of these routines.

The memory allocation scheme is described in Memory Management Routines in Part II: Guide to User-Programmable Features.

The following sections describe the data-reading routines. See the file ResRd.F and its corresponding include deck ResRd.inc for listings of the corresponding Begin/End routines.

2.3.2.2. ResRdBegin (Opening the File and Retrieving Global Information)

*deck,ResRdBegin
      function ResRdBegin (Nunit, Lunit, Fname, ncFname, Title, JobName,
     x                     Units, NumDOF, DOF, UserCode,
     x                     MaxNode, NumNode, MaxElem, NumElem,
     x                     MaxResultSet,NumResultSet)
c primary function:    Open result file and return global information

c object/library: ResRd

c  input arguments:
c     Nunit    (int,sc,in)       - Fortran Unit number for file (ANSYS uses 12)
c     Lunit    (int,sc,in)       - Current print output unit (usually 6 <STDOUT>)
c     Fname    (ch*(ncFname),sc,in) - The name (with extension) for the file
c     ncFname  (int,sc,in)       - Number of characters in Fname

c  output arguments:
c     Title    (ch*80,ar(2),out) - Title and First subtitle
c     JobName  (ch*32,sc,out)    - Jobname from file
c     Units    (int,sc,out)      - unit system
c                                   = 0 - user defined units
c                                   = 1 - SI
c                                   = 2 - CSG
c                                   = 3 - U.S. Customary, using feet
c                                   = 4 - U.S. Customary, using inches
c                                   = 5 - MKS
c                                   = 6 - MPA
c                                   = 7 - uMKS
c     NumDOF   (int,sc,out)      - Number of DOF per node
c     DOF      (int,ar(*),out)   - The DOFs per node
c     UserCode (int,sc,out)      - Code for this application
c     MaxNode  (int,sc,out)      - Maximum node number used
c     NumNode  (int,sc,out)      - Number of nodes attached to elements
c     MaxElem  (int,sc,out)      - Maximum element number used
c     NumElem  (int,sc,out)      - Number of elements used
c     MaxResultSet (int,sc,out)  - Maximum number of result sets (usually 1000)
c     NumResultSet (int,sc,out)  - Number of result sets on file
c     ResRdBegin (int,sc,out)    - 0, successful  other, error in file open


2.3.2.3. ResRdGeomBegin (Retrieving Global Geometry Information)

*deck,ResRdGeomBegin
      subroutine ResRdGeomBegin (MaxType, MaxReal, MaxCsys, nXYZ)
c primary function:    Read Geometry Header Record

c object/library: ResRd

c  input arguments:  none

c  output arguments:
c     MaxType  (int,sc,out)       - Maximum element type
c     MaxReal  (int,sc,out)       - Maximum real constant set number
c     MaxCsys  (int,sc,out)       - Maximum coordinate system number
c     nXYZ     (int,sc,out)       - number of nodes with coordinates


2.3.2.4. ResRdType (Retrieving Element Types)

*deck,ResRdType
      function ResRdType (itype,ielc,TypeNo)
c primary function:    Read an element type record

c object/library: ResRd

c  input arguments:
c     itype    (int,sc,in)         - Element type number

c  output arguments:  none
c     ielc     (int,ar(IELCSZ),out)- Element characteristics
c     TypeNo    (int,sc,out)       - External Element Type number
c     ResRdType (int,sc,out        - number of words read



2.3.2.5. ResRdReal (Retrieving Real Constants)

*deck,ResRdReal
      function ResRdReal (iReal,Rcon,RealNo)
c primary function:    Read real constant record

c object/library: ResRd

c  input arguments:
c     iReal    (int,sc,in)             - Real set number

c  output arguments:  none
c     Rcon      (dp,ar(ResRdReal),out) - Real Constants
c     RealNo    (int,sc,out)           - External Real Constant number
c     ResRdReal (int,sc,out)           - Number of real constants in set


2.3.2.6. ResRdCsys (Retrieving Coordinate Systems)

*deck,ResRdCsys
      function ResRdCsys (iCsys,Csys,CsysNo)
c primary function:    Read a coordinate system record

c object/library: ResRd

c  input arguments:
c     iCsys     (int,sc,in)           - Coordinate system number

c  output arguments:
c     Csys      (dp,ar(ResRdCsys),out)- Coordinate system description
c     CsysNo    (int,sc,out)          - External Coordinate system number
c     ResRdCsys (int,sc,out)          - Number of values


2.3.2.7. ResRdNode (Retrieving Nodal Coordinates)

*deck,ResRdNode
      function ResRdNode (iNode,xyzang)
c primary function:    Get a node

c object/library: ResRd

c  input arguments:
c     iNode     (int,sc,in)     - node sequence number
c                                  (1 to nXYZnode)

c  output arguments:
c     xyzang    (dp,ar(6),out)  - x,y,z,thxy,thyz,thzx for node
c     ResRdNode (int,sc,out)    - Node number


2.3.2.8. ResRdElem (Retrieving Elements)

*deck,ResRdElem
      function ResRdElem (iElem, nodes, ElemData)
c primary function:    Read an element

c object/library: ResRd

c  input arguments:
c     iElem    (int,sc,in)       - The element number

c  output arguments:
c     ResRdElem(int,sc,out)      - Number of nodes
c     nodes    (int,ar(n),out)   - Element nodes
c     ElemData (int,ar(10),out)  - Element information
c                                    mat    - material reference number
c                                    type   - element type number
c                                    real   - real constant reference number
c                                    secnum - section number
c                                    esys   - element coordinate system
c                                    death  - death flag
c                                             = 0 - alive
c                                             = 1 - dead
c                                    solidm - solid model reference
c                                    shape  - coded shape key
c                                    elnum  - element number
c                                    pexcl  - P-Method exclude key


2.3.2.9. ResRdSectMatBegin (Retrieving Global Section and Material Information)

*deck,ResRdSectMatBegin
      subroutine ResRdSectMatBegin (MaxSect, MaxMat)
c primary function:    Read maximum section and material number
c                      from the Geometry Header Record

c object/library: ResRd

c  input arguments:  none

c  output arguments:
c     MaxSect  (int,sc,out)       - Maximum section number
c     MaxMat   (int,sc,out)       - Maximum material number


2.3.2.10. ResRdSect (Retrieving Section Data)

*deck,ResRdSect
      function ResRdSect (iSect,SecData,SectNo)
c primary function:    Read section record

c object/library: ResRd

c  input arguments:
c     iSect    (int,sc,in)             - Section set number

c  output arguments:
c     SecData   (dp,ar(ResRdSect),out) - Section data
c     SectNo    (int,sc,out)           - Exteral Section number
c     ResRdSect (int,sc,out)           - Number of section data in set


2.3.2.11. ResRdMat (Retrieving Material Data)

*deck,ResRdMat
      function ResRdMat (iMat,iprop,MatData)
c primary function:    Read material record

c object/library: ResRd

c  input arguments:
c     iMat     (int,sc,in)             - Material set number
c     iprop    (int,sc,in)             - Property reference number
c                                        See mpinqr for details

c  output arguments:
c     MatData   (dp,ar(ResRdMat),out)  - Material data for type iprop
c     ResRdMat  (int,sc,out)           - Number of material data in set


See Function mpinqr (Getting Information About a Material Property) for details on the property reference number (iprop).

2.3.2.12. ResRdSolBegin (Retrieving Result Set Location)

*deck,ResRdSolBegin
      function ResRdSolBegin (key,lstep,substep,ncumit,kcmplx,time,
     x                        Title,DofLab)
c primary function:    Read the solution header records

c object/library: ResRd

c  input arguments:
c     key      (int,sc,in)       - 0, find by set number
c                                  1, find by lstep/substep
c                                  2, find by ncumit
c                                  3, find by time
c     lstep    (int,sc,in/out)   - Load step number
c                                   if key=0, this is the set number
c     substep  (int,sc,in/out)   - Substep of this load step
c     ncumit   (int,sc,in/out)   - Cumulative iteration number
c     kcmplx   (int,sc,in)       - 0, Real solution   1, Imaginary solution
c     time     (dp,sc,in/out)    - Current solution time

c  output arguments:
c     Title    (ch*80,ar(5),out)  - Title and 4 subtitles
c     DofLab   (ch*4,ar(nDOF),out)- Labels for DOFs
c     ResRdSolBegin (int,sc,out)  - 0, requested solution set found
c                                   1, not found


2.3.2.13. ResRdDisp (Retrieving Nodal Solution)

*deck,ResRdDisp
      function ResRdDisp (node,Disp)
c primary function:    Retrieve a nodal displacement

c object/library: ResRd

c  input arguments:
c     node     (int,sc,in)       - Node number

c  output arguments:
c     Disp     (dp,ar(nDOF),out) - Displacements
c     ResRdDisp(int,sc,out)      - Number of displacements


2.3.2.14. ResRdRfor (Retrieving Reaction Solution)

*deck,ResRdRfor
      function ResRdRfor (node,idof,value)
c primary function:    Retrieve a reaction force

c object/library: ResRd

c  input arguments:
c     node     (int,sc,in)       - External node number
c     idof     (int,sc,in)       - Internal dof number

c  output arguments:
c     value     (dp,sc,in)       - Value of reaction force
c     ResRdRfor (int,sc,out)     - Number of returned values (0 or 1)


2.3.2.15. ResRdFix (Retrieving Applied Nodal Constraints)

*deck,ResRdFix
      function ResRdFix (node,idof,value)
c primary function:    Retrieve a constraint value

c object/library: ResRd

c  input arguments:
c     node     (int,sc,in)       - External node number
c     idof     (int,sc,in)       - Internal dof number

c  output arguments:
c     value    (dp,ar(4),in)     - Real,Imag, RealOld,ImagOld
c     ResRdFix (int,sc,out)      - Number of returned values (0 or 4)


2.3.2.16. ResRdForc (Retrieving Applied Nodal Loads Solution)

*deck,ResRdForc
      function ResRdForc (node,idof,value)
c primary function:    Retrieve an applied force value

c object/library: ResRd

c  input arguments:
c     node      (int,sc,in)       - External node number
c     idof      (int,sc,in)       - Internal dof number

c  output arguments:
c     value     (dp,ar(4),in)     - Real,Imag, RealOld,ImagOld
c     ResRdForc (int,sc,out)      - Number of returned values (0 or 4)


2.3.2.17. ResRdEstr (Retrieving Element Solutions)

*deck,ResRdEstr
      function ResRdEstr (iStr,Str)
c primary function:   Get an element's results

c object/library: ResRd


c  input arguments:
c     iStr    (int,sc,in)       - element record number (1-NUMELEDATASETS)

c  output arguments:
c     ResRdEstr (int,sc,out)       - Number of element values
c     Str       (dp,ar(nStr),out)  - element values