3.4.6. Region Routines

Regions are groups of faces in an Ansys CFX results file. Accessing regions within the current zone (see cfxExportZoneSet) is performed by making calls to the following functions. It should be noted that the region information is not loaded into the Export API until either cfxExportRegionList (see cfxExportRegionList) or cfxExportRegionGet (see cfxExportRegionGet) are called. This reduces memory overheads in the API by not allocating space until required.

When access to region in the current zone is no longer required a call to cfxExportRegionFree (see cfxExportRegionFree) should be made to deallocate any internal storage.

3.4.6.1. cfxExportRegionCount

int cfxExportRegionCount ()

Query the number of regions defined in the current zone.

3.4.6.2. cfxExportRegionSize

int cfxExportRegionSize (int regnum, int type)

Query the number of faces (if type is cfxREG_FACES) or nodes (if type is cfxREG_NODES) defined in the region identified by regnum in the current zone.

The function returns the number of faces or nodes in the current zone or 0 if either regnum is out of range or type is invalid.

3.4.6.3. cfxExportRegionName

char *cfxExportRegionName (int regnum)

Query the name of the region in the current zone identifies by regnum.

The function returns the name of the region or NULL if the region number supplied is out of range. The pointer returned points to static storage, which will be overwritten by the next call to cfxExportRegionName.

3.4.6.4. cfxExportRegionList

int *cfxExportRegionList (int regnum, int type)

Query the nodes (type is cfxREG_NODES) or faces (cfxREG_FACES) that define a region. This function returns a pointer to an array of node ids or face ids that define the region identified by regnum or NULL if the region number is out of range or the type is not recognized. If type is specified as cfxREG_FACES, the returned ids will represent faces. The element number and local element face number may be extracted from each face id returned by using the macros cfxELEMNUM and cfxFACENUM. The node numbers for the face may be obtained by calling cfxExportFaceNodes. For details, see cfxExportFaceNodes.

3.4.6.5. cfxExportRegionGet

int cfxExportRegionGet (int regnum, int type, int index, int *id)

Query the index’th element (type is cfxREG_ELEM) or index’th node (type is cfxREG_NODE) that defines a region regnum in the current zone.

If regnum is out of range or type is not recognized or index is out of range, 0 is returned.

Otherwise id will contain the id of the appropriate node or face defining the region and the function will return index.

If type is specified as cfxREG_FACES, the returned id will represent the identity of a face. The element number and local element face number may be extracted from the id by using the macros cfxELEMNUM and cfxFACENUM.

3.4.6.6. cfxExportRegionFree

void cfxExportRegionFree (int regnum)

Deallocate any internal data storage associated with the region defined by regnum.