SDA (SDA flex)  7.2
Simulation of Diffusional Association
Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
DTGrid3D< T, K > Class Template Reference

#include <DTGrid3D.hpp>

Collaboration diagram for DTGrid3D< T, K >:

Public Member Functions

 DTGrid3D (char *, T, T)
 DTGrid3D constructor. More...
 
 ~DTGrid3D ()
 DTGrid3D destructor. More...
 
accessxyz (int, int, int)
 Random access function. More...
 
bool excl_accessxyz (int, int, int)
 
access_fast (int, int, int)
 Random access function. More...
 
T * getCell (T *, int, int, int)
 Random access to grid cells. More...
 
T * getCell2 (T *, int, int, int)
 Random access to grid cells. (2nd version) More...
 
int type_of_grid (void)
 

Public Attributes

struct {
   char *   Title
 
   int   grdflag
 
   int   one
 
   int   idummy1
 
   int   idummy2
 
   int   idummy3
 
   int   idummy4
 
   int   idummy5
 
   float   scale
 
   float   spacing
 
   float   dummy1
 
   float   dummy2
 
   float   dummy3
 
   float   dummy4
 
   float   dummy5
 
   float   dummy6
 
   float   dummy7
 
   struct dimensions {
      int   i
 
      int   j
 
      int   k
 
   }   dim
 
   struct origin {
      float   x
 
      float   y
 
      float   z
 
   }   o
 
uhbd
 UHBD header information. More...
 

Protected Member Functions

void getCellz (T *, int, int, int, typename ArrayPrs< K >::PairArray *)
 A random access function suited for excluded volume grids, based on the function. More...
 
void getCellyz (T *, int, int, int, typename ArrayPrs< K >::PairArray *)
 Random access function for grid cells (y direction, DTGrid2D). More...
 
access_fast_z (int, typename ArrayPrs< K >::PairArray *)
 Random access function for DTGrid3D. More...
 
access_fast_yz (int, int, typename ArrayPrs< K >::PairArray *)
 Random access function for DTGrid2D. More...
 

Private Member Functions

void set_value_list_3D (T *, int)
 DTGrid3D 'value' array setup. More...
 
void set_zcoord_list (K *, int)
 zCoord array setup More...
 
void set_ptr_list_3D (K *, int)
 acc (3D) array setup More...
 
void set_gamma_values (T, T)
 Set the default gamma value. More...
 
void set_projection2D (K *, K *, K *, K *, K *, K *, int, int, int, int, int, int)
 proj2D setup More...
 
void set_uhbd_parameters (float, float, float, float, float, int, int, int)
 Reset pointers that temporarily store addresses for random access. More...
 
void Reset_pointers_3D (void)
 
void test_format_dtgrid (char *)
 Determine the DT-Grid file format. More...
 
void size_ds (unsigned int)
 Estimate the grid file size. More...
 
void format_ascii (char *)
 Open and Read the ascii grid file. More...
 
void format_binary (char *)
 Open and Read the binary grid file. More...
 

Private Attributes

ArrayReg< T > * Value_List_3D
 
ArrayPrs< K > * Zcoord_List
 
ArrayPtr< T, K > * Ptr_List_3D
 
DTGrid2D< T, K > * proj2D
 
int Length_of_Value_List_3D
 
int Length_of_Zcoord_List
 
int Length_of_Ptr_List_3D
 
gamma_i
 
gamma_o
 
int iform
 grid file format: binary = 0; ascii = 1 More...
 
int grid_type
 grid type: exclusion grid = 0; normal grid = 1 More...
 
scfct
 
float scale
 scaling factor More...
 
float spacing
 
struct {
   int   i
 
   int   j
 
   int   k
 
dimensions
 grid dimensions in x, y and z directions given by i, j and k, respectively More...
 
struct {
   float   x
 
   float   y
 
   float   z
 
origin
 hold the coordinates (in x, y and z) of the grid origin. More...
 

Constructor & Destructor Documentation

◆ DTGrid3D()

template<typename T , typename K >
DTGrid3D< T, K >::DTGrid3D ( char *  file_name,
scfct_i,
gamma 
)

DTGrid3D constructor.

Parameters
file_nameinput dt-grid file.
scfct_iscaling factor.
gammauser defined default value for grid points not stored in dt-grid.

◆ ~DTGrid3D()

template<typename T , typename K >
DTGrid3D< T, K >::~DTGrid3D

DTGrid3D destructor.

Member Function Documentation

◆ access_fast()

template<typename T , typename K >
T DTGrid3D< T, K >::access_fast ( int  a,
int  b,
int  c 
)

Random access function.

Faster (not significantly, though) implementation of random data access In SDA random cell access function is used. This function returns the data for a single grid point.

Parameters
aindex x of the data value to be returned
bindex y of the data value to be returned
cindex z of the data value to be returned
Attention
Check for parallel safety! The function is not used in current SDA implementation, though.

◆ access_fast_yz()

template<typename T , typename K >
T DTGrid3D< T, K >::access_fast_yz ( int  b,
int  c,
typename ArrayPrs< K >::PairArray *  coord2 
)
protected

Random access function for DTGrid2D.

Check for the indices in 2D dt-grid. If the index b is found, call the random access function for the last index (c) in DTGrid3D.

Parameters
bindex y of the data value to be returned
cindex z of the data value to be returned
coord2pointer to the index pair stored in yCoord array that list the indices to the first connected component in the 2D tubular grid.

◆ access_fast_z()

template<typename T , typename K >
T DTGrid3D< T, K >::access_fast_z ( int  c,
typename ArrayPrs< K >::PairArray *  coord3 
)
protected

Random access function for DTGrid3D.

Check for the indices in 3D dt-grid. If the index c is found, return the value stored the 'value' array.

Parameters
cindex z of the data value to be returned
coord3pointer to the index pair stored in zCoord array that list the indices to the first connected component in the 3D tubular grid.

◆ accessxyz()

template<typename T , typename K >
T DTGrid3D< T, K >::accessxyz ( int  a,
int  b,
int  c 
)

Random access function.

A different implementation of random data access function

See also
access_fast In SDA random cell access function is used. This function returns the data for a single grid point.
Parameters
aindex x of the data value to be returned
bindex y of the data value to be returned
cindex z of the data value to be returned
Attention
Check for parallel safety! The function is not used in current SDA implementation, though.
Here is the caller graph for this function:

◆ excl_accessxyz()

template<typename T , typename K >
bool DTGrid3D< T, K >::excl_accessxyz ( int  ,
int  ,
int   
)

◆ format_ascii()

template<typename T , typename K >
void DTGrid3D< T, K >::format_ascii ( char *  file_ascii)
private

Open and Read the ascii grid file.

Note
very similar to
See also
format_binary function. Can these two functions be merged? Detailed description of the variables used in this function is available in the
format_binary function
Parameters
file_asciiname of the grid file.

◆ format_binary()

template<typename T , typename K >
void DTGrid3D< T, K >::format_binary ( char *  file_binary)
private

Open and Read the binary grid file.

The header of a DT-Grid file is same as that of a UHBD file. Therefore the parameter definitions are identical.

Note
This function and the rest of the file related functions, as well as parameters can be put together in a class.
See also
format_ascii and
size_ds
Parameters
file_binaryname of the grid file.

◆ getCell()

template<typename T , typename K >
T * DTGrid3D< T, K >::getCell ( T *  Cell,
int  a,
int  b,
int  c 
)

Random access to grid cells.

This function returns a cubic grid cell that contains the data stored in the grid point whose indices are input by the user, as well as the other 7 neighbor points that make up the 8 point grid cell. The given set of index: x, y and z defines the origin of the grid cell that is to be accessed. The other grid points are: {(x,y,z),(x,y,z+1),(x,y+1,z),(x,y+1,z+1),(x+1,y,z),(x+1,y+1,z),(x+1,y,z+1),(x+1,y+1,z+1)}

Parameters
Cellarray to copy the values stored inside the grid cell that accessed randomly.
aindex x of the origin of the data cell inside the complete grid to be returned.
bindex y of the origin of the data cell inside the complete grid to be returned.
cindex z of the origin of the data cell inside the complete grid to be returned.

◆ getCell2()

template<typename T , typename K >
T * DTGrid3D< T, K >::getCell2 ( T *  Cell,
int  a,
int  b,
int  c 
)

Random access to grid cells. (2nd version)

This function assumes that there is only one connected component in DTGrid1D level. Structures, potential fields are usually one connected piece in 3D. So care should be taken when this function is used

Parameters
Cellarray to copy the values stored inside the grid cell that accessed randomly.
aindex x of the origin of the data cell inside the complete grid to be returned.
bindex y of the origin of the data cell inside the complete grid to be returned.
cindex z of the origin of the data cell inside the complete grid to be returned.
Here is the caller graph for this function:

◆ getCellyz()

template<typename T , typename K >
void DTGrid3D< T, K >::getCellyz ( T *  Cell,
int  x,
int  b,
int  c,
typename ArrayPrs< K >::PairArray *  coord2 
)
protected

Random access function for grid cells (y direction, DTGrid2D).

Call to this function returns the last function call (

See also
getCellz) in order to fill the corresponding points in the cubic cell input.
Parameters
Cellarray to copy the values stored inside the grid cell that accessed randomly.
xindex of the grid cell point in x direction (0 or 1 for a 3dimensional cubic cell)
bindex y of the origin of the data cell inside the complete grid to be returned.
cindex z of the origin of the data cell inside the complete grid to be returned
coord2pointer to the index pair stored in yCoord array that list the indices to the first connected component in the 2D tubular grid.

Only b is inside the connected component

Only b+1 is inside the connected component

◆ getCellz()

template<typename T , typename K >
void DTGrid3D< T, K >::getCellz ( T *  Cell,
int  x,
int  y,
int  c,
typename ArrayPrs< K >::PairArray *  coord3 
)
protected

A random access function suited for excluded volume grids, based on the function.

See also
accessxyz.

This function is almost identical to 'accessxyz' except that it returns false instead of a user defined gamma_o value. Also, a pointer that holds an address into the value array is not required and therefore is not incremented. ('Value' array consists only of one member for excluded volume type of grid!)

Parameters
aindex x of the data value to be returned
bindex y of the data value to be returned
cindex z of the data value to be returned Random access to grid cells in z direction.

Call to this function fills the corresponding points in the cubic cell input by looking up the values from the actual grid.

Parameters
Cellarray to copy the values stored inside the grid cell that accessed randomly.
xindex of the grid cell point in x direction (0 or 1 for a 3dimensional cubic cell)
yindex of the grid cell point in y direction (0 or 1 for a 3dimensional cubic cell)
cindex z of the origin of the data cell inside the complete grid to be returned
coord3pointer to the index pair stored in zCoord array that list the indices to the first connected component in the 3D tubular grid.

◆ Reset_pointers_3D()

template<typename T , typename K >
void DTGrid3D< T, K >::Reset_pointers_3D ( void  )
private

◆ set_gamma_values()

template<typename T , typename K >
void DTGrid3D< T, K >::set_gamma_values ( g_i,
g_o 
)
private

Set the default gamma value.

Gamma is returned when a point to be accessed is determined to be outside the tubular grid.

Attention
Although two separate parameters are listed here, there is no distinction between the "outside" and "inside" regions of the grid at the current implementation. This to be improved in the future
Parameters
g_ivalue inside the closed region
g_ovalue outside the closed grid region

◆ set_projection2D()

template<typename T , typename K >
void DTGrid3D< T, K >::set_projection2D ( K *  values1,
K *  values2,
K *  values3,
K *  values4,
K *  values5,
K *  values6,
int  length1,
int  length2,
int  length3,
int  length4,
int  length5,
int  length6 
)
private

proj2D setup

Create an instance of a DTGrid2D class and set up this proj2D object that contain yCoord, acc (2D) and the 'value' (2D) arrays.

Parameters
values1pointer to the 'value' array of the DTGrid2D.
values2pointer to the yCoord array of the DTGrid2D.
values3pointer to the acc array of the DTGrid2D.
values4pointer (to be passed to DTGrid1D) to the 'value' array of the DTGrid1D.
values5pointer (to be passed to DTGrid1D) to the xCoord array of the DTGrid1D.
values6pointer (to be passed to DTGrid1D) to the acc array of the DTGrid1D.
length1the length of the 'value' (2D) array.
length2the length of the yCoord array.
length3the length of the acc (2D) array.
length4the length of the 'value' (1D) array.
length5the length of the xcoord array.
length6the length of the acc (1D) array.
Here is the call graph for this function:

◆ set_ptr_list_3D()

template<typename T , typename K >
void DTGrid3D< T, K >::set_ptr_list_3D ( K *  values,
int  length 
)
private

acc (3D) array setup

Read and store the list of pointers to the first member of each of the connected components in an N-dimensional dt-grid.

Parameters
valuesa pointer to the array that stores the acc array indices.
lengththe length of the acc array.
Here is the call graph for this function:

◆ set_uhbd_parameters()

template<typename T , typename K >
void DTGrid3D< T, K >::set_uhbd_parameters ( float  sc,
float  sp,
float  ox,
float  oy,
float  oz,
int  dimi,
int  dimj,
int  dimk 
)
private

Reset pointers that temporarily store addresses for random access.

The function is not required when the pointers are not used as global variables. Read and set the grid parameters.

These parameters are inherited from the UHBD file format and kept in DTGrid files.

Parameters
scthe scaling factor.
spthe uniform spacing value of the grid.
oxcoordinate x of the origin.
oycoordinate y of the origin.
ozcoordinate z of the origin.
dimidimension of the grid in x direction.
dimjdimension of the grid in y direction.
dimkdimension of the grid in z direction.

◆ set_value_list_3D()

template<typename T , typename K >
void DTGrid3D< T, K >::set_value_list_3D ( T *  values,
int  length 
)
private

DTGrid3D 'value' array setup.

Read the 3D 'value' array and store.

Parameters
valuespointer to the array that stores the 'value' array.
lengththe length of the 'value' array.
Here is the call graph for this function:

◆ set_zcoord_list()

template<typename T , typename K >
void DTGrid3D< T, K >::set_zcoord_list ( K *  values,
int  length 
)
private

zCoord array setup

Read and store the zCoord array that stores in minimum and maximum coordinates of the connected components in z direction.

Parameters
valuesa pointer that holds the zCoord array.
lengththe length of the zCoord array.
Here is the call graph for this function:

◆ size_ds()

template<typename T , typename K >
void DTGrid3D< T, K >::size_ds ( unsigned int  val)
private

Estimate the grid file size.

Parameters
valsize of file in bytes

◆ test_format_dtgrid()

template<typename T , typename K >
void DTGrid3D< T, K >::test_format_dtgrid ( char *  Input)
private

Determine the DT-Grid file format.

This function opens and reads the dt-grid file in order to determine whether it is binary or ASCII.

Parameters
Inputname of input dt-grid file.

If binary, the first value stored is an integer, 160.

◆ type_of_grid()

template<typename T , typename K >
int DTGrid3D< T, K >::type_of_grid ( void  )
inline

Member Data Documentation

◆ 

struct { ... } ::dimensions DTGrid3D< T, K >::dim

◆ 

struct { ... } DTGrid3D< T, K >::dimensions

grid dimensions in x, y and z directions given by i, j and k, respectively

WARNING!!! definining the variables below in here instead of in functions is not parallel-safe! Private members for use inside accessxyz! Do not use outside this function!

◆ dummy1

template<typename T , typename K >
float DTGrid3D< T, K >::dummy1

◆ dummy2

template<typename T , typename K >
float DTGrid3D< T, K >::dummy2

◆ dummy3

template<typename T , typename K >
float DTGrid3D< T, K >::dummy3

◆ dummy4

template<typename T , typename K >
float DTGrid3D< T, K >::dummy4

◆ dummy5

template<typename T , typename K >
float DTGrid3D< T, K >::dummy5

◆ dummy6

template<typename T , typename K >
float DTGrid3D< T, K >::dummy6

◆ dummy7

template<typename T , typename K >
float DTGrid3D< T, K >::dummy7

◆ gamma_i

template<typename T , typename K >
T DTGrid3D< T, K >::gamma_i
private

◆ gamma_o

template<typename T , typename K >
T DTGrid3D< T, K >::gamma_o
private

◆ grdflag

template<typename T , typename K >
int DTGrid3D< T, K >::grdflag

◆ grid_type

template<typename T , typename K >
int DTGrid3D< T, K >::grid_type
private

grid type: exclusion grid = 0; normal grid = 1

◆ i

template<typename T , typename K >
int DTGrid3D< T, K >::i

◆ idummy1

template<typename T , typename K >
int DTGrid3D< T, K >::idummy1

◆ idummy2

template<typename T , typename K >
int DTGrid3D< T, K >::idummy2

◆ idummy3

template<typename T , typename K >
int DTGrid3D< T, K >::idummy3

◆ idummy4

template<typename T , typename K >
int DTGrid3D< T, K >::idummy4

◆ idummy5

template<typename T , typename K >
int DTGrid3D< T, K >::idummy5

◆ iform

template<typename T , typename K >
int DTGrid3D< T, K >::iform
private

grid file format: binary = 0; ascii = 1

◆ j

template<typename T , typename K >
int DTGrid3D< T, K >::j

◆ k

template<typename T , typename K >
int DTGrid3D< T, K >::k

◆ Length_of_Ptr_List_3D

template<typename T , typename K >
int DTGrid3D< T, K >::Length_of_Ptr_List_3D
private

◆ Length_of_Value_List_3D

template<typename T , typename K >
int DTGrid3D< T, K >::Length_of_Value_List_3D
private

◆ Length_of_Zcoord_List

template<typename T , typename K >
int DTGrid3D< T, K >::Length_of_Zcoord_List
private

◆ 

struct { ... } ::origin DTGrid3D< T, K >::o

◆ one

template<typename T , typename K >
int DTGrid3D< T, K >::one

◆ 

struct { ... } DTGrid3D< T, K >::origin

hold the coordinates (in x, y and z) of the grid origin.

◆ proj2D

template<typename T , typename K >
DTGrid2D<T,K>* DTGrid3D< T, K >::proj2D
private

◆ Ptr_List_3D

template<typename T , typename K >
ArrayPtr<T,K>* DTGrid3D< T, K >::Ptr_List_3D
private

◆ scale

template<typename T , typename K >
float DTGrid3D< T, K >::scale
private

scaling factor

◆ scfct

template<typename T , typename K >
T DTGrid3D< T, K >::scfct
private

◆ spacing

template<typename T , typename K >
float DTGrid3D< T, K >::spacing
private

◆ Title

template<typename T , typename K >
char* DTGrid3D< T, K >::Title

◆ 

struct { ... } DTGrid3D< T, K >::uhbd

UHBD header information.

◆ Value_List_3D

template<typename T , typename K >
ArrayReg<T>* DTGrid3D< T, K >::Value_List_3D
private

◆ x

template<typename T , typename K >
float DTGrid3D< T, K >::x

◆ y

template<typename T , typename K >
float DTGrid3D< T, K >::y

◆ z

template<typename T , typename K >
float DTGrid3D< T, K >::z

◆ Zcoord_List

template<typename T , typename K >
ArrayPrs<K>* DTGrid3D< T, K >::Zcoord_List
private

The documentation for this class was generated from the following file:
Imprint/Privacy