Package gov.nih.mipav.model.structures
Class Voro.container_periodic_base
java.lang.Object
gov.nih.mipav.model.structures.Voro.voro_base_unitcell
gov.nih.mipav.model.structures.Voro.container_periodic_base
- Direct Known Subclasses:
Voro.container_periodic_poly_radius_poly,Voro.container_periodic_radius_mono
- Enclosing class:
Voro
\brief Class for representing a particle system in a 3D periodic
non-orthogonal periodic domain.
This class represents a particle system in a three-dimensional
non-orthogonal periodic domain. The domain is defined by three periodicity
vectors (bx,0,0), (bxy,by,0), and (bxz,byz,bz) that represent a
parallelepiped. Internally, the class stores particles in the box 0invalid input: '<'xinvalid input: '<'bx,
0invalid input: '<'yinvalid input: '<'by, 0invalid input: '<'zinvalid input: '<'bz, and constructs periodic images of particles that displaced
by the three periodicity vectors when they are necessary for the
computation. The internal memory structure for this class is significantly
different from the container_base class in order to handle the dynamic
construction of these periodic images.
The class is derived from the unitcell class, which encapsulates information
about the domain geometry, and the voro_base class, which encapsulates
information about the underlying computational grid.
-
Field Summary
FieldsModifier and TypeFieldDescriptionint[]This array holds the number of particles within each computational box of the container.intThe lower y index (inclusive) of the primary domain within the block structure.intThe lower z index (inclusive) of the primary domain within the block structure.int[][]This array holds the numerical IDs of each particle in each computational box.byte[]An array holding information about periodic image construction at a given location.intThe initial amount of memory to allocate for particles for each block.doubleint[]This array holds the maximum amount of particle memory for each computational box of the container.intThe total number of blocks.intThe total size of the block structure (including images) in the y direction.intThe total size of the block structure (including images) in the z direction.double[][]A two dimensional array holding particle positions.intThe amount of memory in the array structure for each particle.intThe upper y index (exclusive) of the primary domain within the block structure.intThe upper z index (exclusive) of the primary domain within the block structure. -
Constructor Summary
ConstructorsConstructorDescriptioncontainer_periodic_base(double bx_, double bxy_, double by_, double bxz_, double byz_, double bz_, int nx_, int ny_, int nz_, int init_mem_, int ps_) The class constructor sets up the geometry of container, initializing the minimum and maximum coordinates in each direction, and setting whether each direction is periodic or not. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidadd_particle_memory(int i) Increase memory for a particular region.voidChecks that the particles within each block lie within that block's bounds.voidThis routine creates all periodic images of the particles.voidcreate_periodic_image(int di, int dj, int dk) Creates particles within an image block by copying them from the primary domain and shifting them.voidcreate_side_image(int di, int dj, int dk) Creates particles within an image block that is aligned with the primary domain in the z axis.voidcreate_vertical_image(int di, int dj, int dk) Creates particles within an image block that is not aligned with the primary domain in the z axis.voiddelete()The container destructor frees the dynamically allocated memory.voidfrac_pos(double x, double y, double z, double ci, double cj, double ck, double[] fx, double[] fy, double[] fz) Returns the position of a particle currently being computed relative to the computational block that it is within.voidinitialize_search(int ci, int cj, int ck, int ijk, int[] i, int[] j, int[] k, int[] disp) Initializes parameters for a find_voronoi_cell call within the voro_compute template.booleaninitialize_voronoicell(Voro.voronoicell_neighbor c, int ijk, int q, int ci, int cj, int ck, int[] i, int[] j, int[] k, double[] x, double[] y, double[] z, int[] disp) booleaninitialize_voronoicell(Voro.voronoicell c, int ijk, int q, int ci, int cj, int ck, int[] i, int[] j, int[] k, double[] x, double[] y, double[] z, int[] disp) Initializes the Voronoi cell prior to a compute_cell operation for a specific particle being carried out by a voro_compute class.voidPrints all particles in the container, including those that have been constructed in image blocks.voidput_image(int reg, int fijk, int l, double dx, double dy, double dz) Copies a particle position from the primary domain into an image block.protected voidput_locate_block(int[] ijk, double[] x, double[] y, double[] z) Takes a particle position vector and computes the region index into which it should be stored.protected voidput_locate_block(int[] ijk, double[] x, double[] y, double[] z, int[] ai, int[] aj, int[] ak) Takes a particle position vector and computes the region index into which it should be stored.voidOutputs the a list of all the container regions along with the number of particles stored within each.intregion_index(int ci, int cj, int ck, int ei, int ej, int ek, double[] qx, double[] qy, double[] qz, int[] disp) Calculates the index of block in the container structure corresponding to given coordinates.protected voidremap(int[] ai, int[] aj, int[] ak, int[] ci, int[] cj, int[] ck, double[] x, double[] y, double[] z, int[] ijk) Takes a position vector and remaps it into the primary domain.Methods inherited from class gov.nih.mipav.model.structures.Voro.voro_base_unitcell
compute_minimum, contains_neighbor, contains_neighbor, draw_domain_gnuplot, draw_domain_gnuplot, draw_domain_pov, draw_domain_pov, images, intersects_image, step_div, step_int, step_mod
-
Field Details
-
max_len_sq
public double max_len_sq -
ey
public int eyThe lower y index (inclusive) of the primary domain within the block structure. -
ez
public int ezThe lower z index (inclusive) of the primary domain within the block structure. -
wy
public int wyThe upper y index (exclusive) of the primary domain within the block structure. -
wz
public int wzThe upper z index (exclusive) of the primary domain within the block structure. -
oy
public int oyThe total size of the block structure (including images) in the y direction. -
oz
public int ozThe total size of the block structure (including images) in the z direction. -
oxyz
public int oxyzThe total number of blocks. -
id
public int[][] idThis array holds the numerical IDs of each particle in each computational box. -
p
public double[][] pA two dimensional array holding particle positions. For the derived container_poly class, this also holds particle radii. -
co
public int[] coThis array holds the number of particles within each computational box of the container. -
mem
public int[] memThis array holds the maximum amount of particle memory for each computational box of the container. If the number of particles in a particular box ever approaches this limit, more is allocated using the add_particle_memory() function. -
img
public byte[] imgAn array holding information about periodic image construction at a given location. -
init_mem
public int init_memThe initial amount of memory to allocate for particles for each block. -
ps
public int psThe amount of memory in the array structure for each particle. This is set to 3 when the basic class is initialized, so that the array holds (x,y,z) positions. If the container class is initialized as part of the derived class container_poly, then this is set to 4, to also hold the particle radii.
-
-
Constructor Details
-
container_periodic_base
public container_periodic_base(double bx_, double bxy_, double by_, double bxz_, double byz_, double bz_, int nx_, int ny_, int nz_, int init_mem_, int ps_) The class constructor sets up the geometry of container, initializing the minimum and maximum coordinates in each direction, and setting whether each direction is periodic or not. It divides the container into a rectangular grid of blocks, and allocates memory for each of these for storing particle positions and IDs. \param[in] (bx_) The x coordinate of the first unit vector. \param[in] (bxy_,by_) The x and y coordinates of the second unit vector. \param[in] (bxz_,byz_,bz_) The x, y, and z coordinates of the third unit vector. \param[in] (nx_,ny_,nz_) the number of grid blocks in each of the three coordinate directions. \param[in] init_mem_ the initial memory allocation for each block. \param[in] ps_ the number of floating point entries to store for each particle.
-
-
Method Details
-
delete
public void delete()The container destructor frees the dynamically allocated memory. -
print_all_particles
public void print_all_particles()Prints all particles in the container, including those that have been constructed in image blocks. -
region_count
public void region_count()Outputs the a list of all the container regions along with the number of particles stored within each. -
initialize_voronoicell
public boolean initialize_voronoicell(Voro.voronoicell c, int ijk, int q, int ci, int cj, int ck, int[] i, int[] j, int[] k, double[] x, double[] y, double[] z, int[] disp) Initializes the Voronoi cell prior to a compute_cell operation for a specific particle being carried out by a voro_compute class. The cell is initialized to be the pre-computed unit Voronoi cell based on planes formed by periodic images of the particle. \param[in,out] c a reference to a voronoicell object. \param[in] ijk the block that the particle is within. \param[in] q the index of the particle within its block. \param[in] (ci,cj,ck) the coordinates of the block in the container coordinate system. \param[out] (i,j,k) the coordinates of the test block relative to the voro_compute coordinate system. \param[out] (x,y,z) the position of the particle. \param[out] disp a block displacement used internally by the compute_cell routine. \return False if the plane cuts applied by walls completely removed the cell, true otherwise. -
initialize_voronoicell
public boolean initialize_voronoicell(Voro.voronoicell_neighbor c, int ijk, int q, int ci, int cj, int ck, int[] i, int[] j, int[] k, double[] x, double[] y, double[] z, int[] disp) -
initialize_search
public void initialize_search(int ci, int cj, int ck, int ijk, int[] i, int[] j, int[] k, int[] disp) Initializes parameters for a find_voronoi_cell call within the voro_compute template. \param[in] (ci,cj,ck) the coordinates of the test block in the container coordinate system. \param[in] ijk the index of the test block \param[out] (i,j,k) the coordinates of the test block relative to the voro_compute coordinate system. \param[out] disp a block displacement used internally by the find_voronoi_cell routine (but not needed in this instance.) -
frac_pos
public void frac_pos(double x, double y, double z, double ci, double cj, double ck, double[] fx, double[] fy, double[] fz) Returns the position of a particle currently being computed relative to the computational block that it is within. It is used to select the optimal worklist entry to use. \param[in] (x,y,z) the position of the particle. \param[in] (ci,cj,ck) the block that the particle is within. \param[out] (fx,fy,fz) the position relative to the block. -
region_index
public int region_index(int ci, int cj, int ck, int ei, int ej, int ek, double[] qx, double[] qy, double[] qz, int[] disp) Calculates the index of block in the container structure corresponding to given coordinates. \param[in] (ci,cj,ck) the coordinates of the original block in the current computation, relative to the container coordinate system. \param[in] (ei,ej,ek) the displacement of the current block from the original block. \param[in,out] (qx,qy,qz) the periodic displacement that must be added to the particles within the computed block. \param[in] disp a block displacement used internally by the find_voronoi_cell and compute_cell routines (but not needed in this instance.) \return The block index. -
create_all_images
public void create_all_images()This routine creates all periodic images of the particles. It is meant for diagnostic purposes only, since usually periodic images are dynamically created in when they are referenced. -
check_compartmentalized
public void check_compartmentalized()Checks that the particles within each block lie within that block's bounds. This is useful for diagnosing problems with periodic image computation. -
add_particle_memory
protected void add_particle_memory(int i) Increase memory for a particular region. \param[in] i the index of the region to reallocate. -
put_locate_block
protected void put_locate_block(int[] ijk, double[] x, double[] y, double[] z) Takes a particle position vector and computes the region index into which it should be stored. If the container is periodic, then the routine also maps the particle position to ensure it is in the primary domain. If the container is not periodic, the routine bails out. \param[out] ijk the region index. \param[in,out] (x,y,z) the particle position, remapped into the primary domain if necessary. \return True if the particle can be successfully placed into the container, false otherwise. -
put_locate_block
protected void put_locate_block(int[] ijk, double[] x, double[] y, double[] z, int[] ai, int[] aj, int[] ak) Takes a particle position vector and computes the region index into which it should be stored. If the container is periodic, then the routine also maps the particle position to ensure it is in the primary domain. If the container is not periodic, the routine bails out. \param[out] ijk the region index. \param[in,out] (x,y,z) the particle position, remapped into the primary domain if necessary. \param[out] (ai,aj,ak) the periodic image displacement that the particle is in, with (0,0,0) corresponding to the primary domain. \return True if the particle can be successfully placed into the container, false otherwise. -
create_periodic_image
public void create_periodic_image(int di, int dj, int dk) Creates particles within an image block by copying them from the primary domain and shifting them. If the given block is aligned with the primary domain in the z-direction, the routine calls the simpler create_side_image routine where the image block may comprise of particles from up to two primary blocks. Otherwise is calls the more complex create_vertical_image where the image block may comprise of particles from up to four primary blocks. \param[in] (di,dj,dk) the coordinates of the image block to create. -
create_side_image
public void create_side_image(int di, int dj, int dk) Creates particles within an image block that is aligned with the primary domain in the z axis. In this case, the image block may be comprised of particles from two primary blocks. The routine considers these two primary blocks, and adds the needed particles to the image. The remaining particles from the primary blocks are also filled into the neighboring images. \param[in] (di,dj,dk) the index of the block to consider. The z index must satisfy ezinvalid input: '<'=dkinvalid input: '<'wz. -
create_vertical_image
public void create_vertical_image(int di, int dj, int dk) Creates particles within an image block that is not aligned with the primary domain in the z axis. In this case, the image block may be comprised of particles from four primary blocks. The routine considers these four primary blocks, and adds the needed particles to the image. The remaining particles from the primary blocks are also filled into the neighboring images. \param[in] (di,dj,dk) the index of the block to consider. The z index must satisfy dk=wz. -
put_image
public void put_image(int reg, int fijk, int l, double dx, double dy, double dz) Copies a particle position from the primary domain into an image block. \param[in] reg the block index within the primary domain that the particle is within. \param[in] fijk the index of the image block. \param[in] l the index of the particle entry within the primary block. \param[in] (dx,dy,dz) the displacement vector to add to the particle. -
remap
protected void remap(int[] ai, int[] aj, int[] ak, int[] ci, int[] cj, int[] ck, double[] x, double[] y, double[] z, int[] ijk) Takes a position vector and remaps it into the primary domain. \param[out] (ai,aj,ak) the periodic image displacement that the vector is in, with (0,0,0) corresponding to the primary domain. \param[out] (ci,cj,ck) the index of the block that the position vector is within, once it has been remapped. \param[in,out] (x,y,z) the position vector to consider, which is remapped into the primary domain during the routine. \param[out] ijk the block index that the vector is within.
-