### 3.4.5. Element Routines

Accessing elements within the current zone (see cfxExportZoneSet) is performed by making calls to the following functions. It should be noted that the elements for a zone are not loaded into the Export API until either `cfxExportElementList` (see cfxExportElementList) or `cfxExportElementGet` (see cfxExportElementGet) are called. This reduces memory overheads in the API by not allocating space until required.

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

#### 3.4.5.1. cfxExportElementCount

    int cfxExportElementCount ()

Query the number of elements defined in the current zone.

#### 3.4.5.2. cfxExportElementList

    cfxElement *cfxExportElementList ()

Return a pointer to an array of cfxElement elements (see cfxelem) containing the type and vertices of each element in the current zone. The first element in the zone is the first element of the array, the second the second and so on.

The memory allocated to represent this information should be deallocated using `cfxExportElementFree` (see cfxExportElementFree) when no longer required.

The following diagrams show the order of the nodes and connections that ANSYS CFX uses for exporting elements:

Note: The vertex ordering for the import API is different. For details, see cfxImportElement.

#### 3.4.5.3. cfxExportElementGet

    int cfxExportElementGet (int elemid, int elemtype, int *nodelist)

Query the type and vertices of a specific element in the current zone.

The index (elemid) is specified between 1 and the number of elements returned by `cfxExportElementCount` (see cfxExportElementCount). If the value of elemid is out of range the return value is 0 otherwise it is elemid.

The type of the element is returned in elemtype and the vertices defining the element in nodelist. Note that nodelist must be large enough to hold the element number of vertices in the element (normally an array of 8 integers is used as this allows space enough for all element types to be handled).

#### 3.4.5.4. cfxExportElementFree

    void cfxExportElementFree ()

Deallocates any internal storage allocated by making calls to `cfxExportElementList` (see cfxExportElementList) or `cfxExportElementGet` (see cfxExportElementGet).

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