### 3.5.1. IJK Solvers

For the IJK based solvers (Lagrange, ALE, Shell, Beam, Euler, Euler-FCT, Multi-Material Euler), variables in the model are accessed by pointers to dynamically allocated arrays. To assist in the retrieving and storing of grid data a number of Autodyn functions are provided. Examples are also given in Subroutine EXEDIT - 2D and Subroutine EXEDIT3 – 3D for Autodyn-2D and 3D respectively.

Grid variable arrays and pointers are defined in module mdgrid for 2D and mdgrid3 for 3D. The listings for Autodyn-2D and Autodyn-3D give all grid variables and their associated pointer names. Autodyn Variable Listings provides a definition of these variables. The grid arrays and pointer names are used to reference all grid variables either:

- by direct reference to arrays

- through use of the supplied Autodyn functions

By way of illustration, if we want to access the x-velocity at a particular (I,J,K) in the currently processed Part in Autodyn-3D, we would include the mdgrid3 module in our subroutine:

    USE mdgrid3

For node (I,J,K) of the current Part, we can obtain the index, IJK, for this node by including the statement:

    IJK = IJKSET3(I,J,K)

Note:

- For a shell Part, set I=1.

- For a beam Part, set I=1 and J=1.

- For an SPH Part, set I=1 and K=1.

- For 2D, use IJK=IJSET(I,J) instead.

Then we can obtain the required velocity, XVEL, either directly through the array reference or by using a function:

    Direct: 	XVEL = UXN(IJK)

    Function:	XVEL = GV3(NUXN,IJK)

Where NUXN is the pointer index for the X-velocity array. GV3 is an Autodyn-3D function which retrieves the specified variable value from the current Part (the equivalent Autodyn-2D function is simply GV). The various Autodyn functions such as IJKSET3 and GV3 are described in detail in Autodyn Utility Functions/Subroutines.

Normally, the direct reference approach is recommended. This works best when there is a current Part (NSUB) (see Timing of Calls to User Subroutines). For references to Parts other than current, use of the functions is recommended.

In the Euler Godunov processor in 3D, the access to the dynamic memory management is slightly different than the other processors. While, the function GV3 can be called as described before, the direct access method uses Fortran90 pointers. Thus, to reference the x velocity for a 3D Euler Godunov cell:

    Direct: 	XVEL = MTSUB(IJK)%V(NNUXN)

The variable NNUXN is contained in the module mdgrid3. Any specific Euler Godunov variable index is defined by NN`name`, where `name` is the Autodyn-3D internal variable name (see Autodyn-3D – Structured (IJK) Solvers).

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