adr_Nplet_2_lnr
maps the N-dim coordinates, Nplet[], to linear address based on the fortran's convention of memory arrangement of N-dimensional array. Here the Nplet(ii) starts at 0. The linear address, adr, is also assumed to start at 0. So the formula of conversion is
Synopsis
void adr_Nplet_2_lnr(
int Ndim,
int bdy_lgths[],
int Nplet[],
int *lnr_adr_ptr
)
adr = Nplet( 0 ) * 1
+ Nplet( 1 ) * bdy_lgths(0)
+ Nplet( 2 ) * bdy_lgths(0) * bdy_lgths(1)
+ Nplet( 3 ) * bdy_lgths(0) * bdy_lgths(1) * bdy_lgths(2)
+ ..................
+ Nplet(N-1) * bdy_lgths(0) * ...... * bdy_lgths(N-2)
Unmodified Input Variables
- Ndim - Dimensionality of the coordinates, i.e. Number of the elements
in the coordinates, Nplet[].
- bdy_lgths - Integer Array, of size Ndim, holds maximum size in each
dimension of Nplet[].
- Nplet - Integer Array, of size Ndim, the N-dim coordinates to be converted.
Modified Output Variables
- lnr_adr_ptr - Pointer to the linear address, adr, to be calculated with
the above formula.
Definition Location
This subroutine is defined in the librgx.a.
Location:../src/librgx/adr_Nplet_2_lnr.c