Package gov.nih.mipav.model.structures
Class Voro.voro_base_wall_list
java.lang.Object
gov.nih.mipav.model.structures.Voro.voro_base_wall_list
- Direct Known Subclasses:
Voro.container_base
- Enclosing class:
Voro
\brief A class for storing a list of pointers to walls.
This class stores a list of pointers to wall classes. It contains several
simple routines that make use of the wall classes (such as telling whether a
given position is inside all of the walls or not). It can be used by itself,
but also forms part of container_base, for associating walls with this
class.
-
Field Summary
FieldsModifier and TypeFieldDescriptiondoubleThe size of a computational block in the x direction.doubleThe size of a computational block in the y direction.doubleThe size of a computational block in the z direction.protected intThe current amount of memory allocated for walls.double[]An array to hold the minimum distances associated with the worklists.intThe number of blocks in the x direction.intA finalant, set to the value of nx multiplied by ny, which is used in the routines that step through blocks in sequence.intA finalant, set to the value of nx*ny*nz, which is used in the routines that step through blocks in sequence.intThe number of blocks in the y direction.intThe number of blocks in the z direction.An array holding pointers to wall objects.protected intA pointer to the limit of the walls array, used to determine when array is full.(package private) intA pointer to the next free position to add a wall pointer.doubleThe inverse box length in the x direction.doubleThe inverse box length in the y direction.doubleThe inverse box length in the z direction. -
Constructor Summary
ConstructorsConstructorDescriptionThe wall_list constructor sets up an array of pointers to wall classes.voro_base_wall_list(int nx_, int ny_, int nz_, double boxx_, double boxy_, double boxz_) This function is called during container finalruction. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds all of the walls on another wall_list to this class.voidAdds a wall to the list.booleanapply_walls(Voro.voronoicell_neighbor c, double x, double y, double z) booleanapply_walls(Voro.voronoicell c, double x, double y, double z) Cuts a Voronoi cell by all of the walls currently on the list.(package private) voidcompute_minimum(double[] minr, double xlo, double xhi, double ylo, double yhi, double zlo, double zhi, int ti, int tj, int tk) Computes the minimum distance from a subregion to a given block.(package private) booleancontains_neighbor(byte[] format) Checks to see whether "%n" appears in a format sequence to determine whether neighbor information is required or not.(package private) booleancontains_neighbor(char[] format) voidDeallocates all of the wall classes pointed to by the wall_list.voiddelete()The wall_list destructor frees the array of pointers to the wall classes.protected voidIncreases the memory allocation for the walls array.booleanpoint_inside_walls(double x, double y, double z) Determines whether a given position is inside all of the walls on the list.protected intstep_div(int a, int b) A custom Double division function that returns consistent stepping for negative numbers.protected intstep_int(double a) A custom int function that returns consistent stepping for negative numbers, so that (-1.5, -0.5, 0.5, 1.5) maps to (-2,-1,0,1).protected intstep_mod(int a, int b) A custom modulo function that returns consistent stepping for negative numbers.
-
Field Details
-
nx
public int nxThe number of blocks in the x direction. -
ny
public int nyThe number of blocks in the y direction. -
nz
public int nzThe number of blocks in the z direction. -
nxy
public int nxyA finalant, set to the value of nx multiplied by ny, which is used in the routines that step through blocks in sequence. -
nxyz
public int nxyzA finalant, set to the value of nx*ny*nz, which is used in the routines that step through blocks in sequence. -
boxx
public double boxxThe size of a computational block in the x direction. -
boxy
public double boxyThe size of a computational block in the y direction. -
boxz
public double boxzThe size of a computational block in the z direction. -
xsp
public double xspThe inverse box length in the x direction. -
ysp
public double yspThe inverse box length in the y direction. -
zsp
public double zspThe inverse box length in the z direction. -
mrad
public double[] mradAn array to hold the minimum distances associated with the worklists. This array is initialized during container finalruction, by the initialize_radii() routine. -
walls
An array holding pointers to wall objects. -
wep_index
int wep_indexA pointer to the next free position to add a wall pointer. -
wel_index
protected int wel_indexA pointer to the limit of the walls array, used to determine when array is full. -
current_wall_size
protected int current_wall_sizeThe current amount of memory allocated for walls.
-
-
Constructor Details
-
voro_base_wall_list
public voro_base_wall_list(int nx_, int ny_, int nz_, double boxx_, double boxy_, double boxz_) This function is called during container finalruction. The routine scans all of the worklists in the wl[] array. For a given worklist of blocks labeled \f$w_1\f$ to \f$w_n\f$, it computes a sequence \f$r_0\f$ to \f$r_n\f$ so that $r_i$ is the minimum distance to all the blocks \f$w_{j}\f$ where \f$j>i\f$ and all blocks outside the worklist. The values of \f$r_n\f$ is calculated first, as the minimum distance to any block in the shell surrounding the worklist. The \f$r_i\f$ are then computed in reverse order by considering the distance to \f$w_{i+1}\f$. -
voro_base_wall_list
public voro_base_wall_list()The wall_list constructor sets up an array of pointers to wall classes.
-
-
Method Details
-
step_int
protected int step_int(double a) A custom int function that returns consistent stepping for negative numbers, so that (-1.5, -0.5, 0.5, 1.5) maps to (-2,-1,0,1). \param[in] a the number to consider. \return The value of the custom int operation. -
step_mod
protected int step_mod(int a, int b) A custom modulo function that returns consistent stepping for negative numbers. For example, (-2,-1,0,1,2) step_mod 2 is (0,1,0,1,0). \param[in] (a,b) the input Doubles. \return The value of a modulo b, consistent for negative numbers. -
step_div
protected int step_div(int a, int b) A custom Double division function that returns consistent stepping for negative numbers. For example, (-2,-1,0,1,2) step_div 2 is (-1,-1,0,0,1). \param[in] (a,b) the input Doubles. \return The value of a div b, consistent for negative numbers. -
compute_minimum
void compute_minimum(double[] minr, double xlo, double xhi, double ylo, double yhi, double zlo, double zhi, int ti, int tj, int tk) Computes the minimum distance from a subregion to a given block. If this distance is smaller than the value of minr, then it passes \param[in,out] minr a pointer to the current minimum distance. If the distance computed in this function is smaller, then this distance is set to the new one. \param[out] (xlo,ylo,zlo) the lower coordinates of the subregion being considered. \param[out] (xhi,yhi,zhi) the upper coordinates of the subregion being considered. \param[in] (ti,tj,tk) the coordinates of the block. -
contains_neighbor
boolean contains_neighbor(byte[] format) Checks to see whether "%n" appears in a format sequence to determine whether neighbor information is required or not. \param[in] format the format string to check. \return True if a "%n" is found, false otherwise. -
contains_neighbor
boolean contains_neighbor(char[] format) -
delete
public void delete()The wall_list destructor frees the array of pointers to the wall classes. -
add_wall
Adds a wall to the list. \param[in] w the wall to add. -
add_wall
Adds all of the walls on another wall_list to this class. \param[in] wl a reference to the wall class. -
point_inside_walls
public boolean point_inside_walls(double x, double y, double z) Determines whether a given position is inside all of the walls on the list. \param[in] (x,y,z) the position to test. \return True if it is inside, false if it is outside. -
apply_walls
Cuts a Voronoi cell by all of the walls currently on the list. \param[in] c a reference to the Voronoi cell class. \param[in] (x,y,z) the position of the cell. \return True if the cell still exists, false if the cell is deleted. -
apply_walls
-
deallocate
public void deallocate()Deallocates all of the wall classes pointed to by the wall_list. -
increase_wall_memory
protected void increase_wall_memory()Increases the memory allocation for the walls array.
-