3.4.1. Defined Constants and Structures

The following constants and data structures are defined in the header file cfxExport.h, which should be included in the export program.

3.4.1.1. Element Types

CFX can use 4 types of element, which are identified by the number of nodes: tetrahedrons (4 nodes), pyramids (5 nodes), prisms/wedges (6 nodes), and hexahedrons (8 nodes). The element types are identified in the Export API by the following constants:

#define cfxELEM_TET 4 
#define cfxELEM_PYR 5 
#define cfxELEM_WDG 6 
#define cfxELEM_HEX 8

3.4.1.2. Volume List Types

The Export API contains functions that enable you to query how volumes are defined in the results file. It is possible to request how a volume is defined in terms of nodes or elements. (For details, see Volume Routines.)

The following constants are defined in the header file and should be used as arguments to the Volume routines:

#define cfxVOL_NODES 0
#define cfxVOL_ELEMS 1

3.4.1.3. Region List Types

The Export API contains functions that enable you to query how regions are defined in the results file. It is possible to request how a region is defined in terms of nodes or faces. (For details, see Region Routines.)

The following constants are defined in the header file and should be used as arguments to the Region routines:

#define cfxREG_NODES 0
#define cfxREG_FACES 1

In the case of nodes, the global node number is returned, while in the case of faces, the returned value is a combination of the global element number and local face number of the element. The following macros are available to enable you to extract the element and face number from the combined value:

#define cfxFACENUM(face) ((face) & 7)
#define cfxELEMNUM(face) ((face) >> 3)

3.4.1.4. Count Entries

Two routines exist for initializing the Export API (see cfxExportInit) and requesting the totals of certain quantities in a zone (see cfxExportZoneSet). The array returned from both of these routines requires the following constants to be used by the calling program to reference the correct quantities.

enum cfxCounts { 
cfxCNT_NODE = 0, /* number of nodes */ 
cfxCNT_ELEMENT, /* number of elements */ 
cfxCNT_VOLUME,   /* number of volumes */
cfxCNT_REGION, /* number of regions */ 
cfxCNT_VARIABLE, /* number of variables */
cfxCNT_TET, /* number of tetrahedral elements */ 
cfxCNT_PYR, /* number of pyramid elements */ 
cfxCNT_WDG, /* number of wedge elements */ 
cfxCNT_HEX, /* number of hexahedral elements */
cfxCNT_SIZE /* size of count array */
};

3.4.1.5. Node Data Structure

Nodes are represented in the Export API using the following structure (note the change in data type of x, y and z):

typedef struct cfxNode { 
float x, y, z; 
} cfxNode;

where x, y, and z are the coordinates of the node. A pointer to an array of these structures is returned by cfxExportNodeList. For details, see cfxExportNodeList.

3.4.1.6. Element Data Structure

Elements are represented by the Export API using the following structure:

typedef struct cfxElement {
int type; 
int *nodeid; 
} cfxElement;

where type is the element type and nodeid is an array of node numbers that define the topology of the element. A pointer to an array of these structures is returned by cfxExportElementList. For details, see Element Types and cfxExportElementList.