### 3.5.2. Unstructured Solvers/Elements

For the unstructured solvers, variables associated with nodes and elements can be accessed and stored using specific functions developed for the user:

    CALL GET_ELEM_VAR(index_elem,index_layer)
    CALL GET_NODE_VAR(index_node,index_material)

where

`index_elem` is the internal index for a given element.

`index_node` is the internal index for a given node.

`index_layer` is the layer (integration point) number for each element. For single point integrated solid elements index_layer can be selected as either 0 or 1. For shell elements index_layer defines the shell sublayer number.

`index_material` indicates the material that is being referred to on a given node. For all nodes, except NBS tetrahedral nodes, index_material can be selected as either 0 or 1. For NBS tetrahedral nodes index_material defines the material number.

These functions copy data from the underlying data structures to local arrays. These arrays contain the values of all possible variables. Only the variables used by the element/node identified in the above calls will actually be set. To access these local arrays you will need to include

    USE mdvar_all
    RVL(index_var) will contain all real variables for the element/node
    IVL(index_var) will contain all integer variables for the element/node

The values of `index_var` required to access a particular variable can be can be obtained through the Output, Save, Review variables, Review all unstructured variables option in the interface.

For example, to retrieve the internal energy for an element, you could use the statement

    INT_ENERGY = RVL(IVR_INT_ENERGY)

Only variables that are actually used in the analysis can be retrieved using the RVL(...) option. The variables available depend on the element types and materials used in an analysis, and can be reviewed through the Output, Save, Review variables, Review used unstructured variables option in the interface.

The values of the variables in the array RVL and IVL can be updated and stored by first setting the updated value in the RVL or IVL array: for example,

    RVL(IVR_INT_ENERGY)= NEWVAL

Then use the functions

    CALL PUT_ELEM_VAR(index_elem,index_layer)
    CALL PUT_NODE_VAR(index_node,index_material)

This will place all the new data set for variables in the array RVL and IVL back into permanent main storage for this element or node respectively.

Note:

- The values of user variables VAR01 to VAR20 can also be updated and stored by first setting the updated value in the RVL array and then use the function PUT_ELEM_VAR to place the new values back in permanent main storage for the element.

- See Access to Nodal Variables within an Element for an elaborated example on how to retrieve and store element and nodal variables.

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