### 3.4.8. Volume Routines

Volumes are groups of elements in a CFX results file. Accessing volumes within the current zone (see cfxExportZoneSet) is performed by making calls to the following functions. It should be noted that the volume definitions for a zone are not loaded into the Export API until either `cfxExportVolumeList` (see cfxExportVolumeList) or `cfxExportVolumeGet` (see cfxExportVolumeGet) are called. This reduces memory overheads in the API by not allocating space until required.

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

#### 3.4.8.1. cfxExportVolumeCount

    int cfxExportVolumeCount ()

Query the number of volumes defined in the current zone.

#### 3.4.8.2. cfxExportVolumeSize

    int cfxExportVolumeSize (int volnum, int type)

Query the number of nodes (if type is `cfxVOL_NODES`) or number of elements (if type is `cfxVOL_ELEMS`) defining the volume indexed by `volnum` in the current zone. The return value will be 0 if `volnum` is out of range or type is invalid.

#### 3.4.8.3. cfxExportVolumeName

    char *cfxExportVolumeName (int volnum)

Query the name of the volume in the current zone indexed by `volnum`. Returns `NULL` if the `volnum` is out of range.

Note: The returned pointer points to internal storage, which will be overwritten by the next call to `cfxExportVolumeName`.

#### 3.4.8.4. cfxExportVolumeList

    int *cfxExportVolumeList (int volnum, int type)

Query the nodes (type is `cfxVOL_NODES`) or elements (`cfxVOL_ELEMS`) that define a volume.

This function returns a pointer to an array of node ids or element ids that define the volume identified by `volnum` or `NULL` if the volume number is out of range or the type is not recognized.

#### 3.4.8.5. cfxExportVolumeGet

    int cfxExportVolumeGet (int volnum, int type, int index, int *id)

Query the [index]th element (type is `cfxVOL_ELEM`) or [index]th node (type is `cfxVOL_NODE`) that defines a volume `volnum` in the current zone.

If volnum 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 element in defining the volume and the function will return `index`.

#### 3.4.8.6. cfxExportVolumeFree

    void cfxExportVolumeFree (int volnum)

Deallocate any internal data storage associated with the volume defined by `volnum`.

Release 18.2 - © ANSYS, Inc. All rights reserved.