Voro++
|
Class for representing a particle system in a 3D periodic non-orthogonal periodic domain. More...
#include <container_prd.hh>
Public Member Functions | |
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) | |
~container_periodic_base () | |
void | print_all_particles () |
void | region_count () |
template<class v_cell > | |
bool | initialize_voronoicell (v_cell &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) |
void | initialize_search (int ci, int cj, int ck, int ijk, int &i, int &j, int &k, int &disp) |
void | frac_pos (double x, double y, double z, double ci, double cj, double ck, double &fx, double &fy, double &fz) |
int | region_index (int ci, int cj, int ck, int ei, int ej, int ek, double &qx, double &qy, double &qz, int &disp) |
void | create_all_images () |
void | check_compartmentalized () |
Public Member Functions inherited from voro::unitcell | |
unitcell (double bx_, double bxy_, double by_, double bxz_, double byz_, double bz_) | |
void | draw_domain_gnuplot (const char *filename) |
void | draw_domain_gnuplot (FILE *fp=stdout) |
void | draw_domain_pov (const char *filename) |
void | draw_domain_pov (FILE *fp=stdout) |
bool | intersects_image (double dx, double dy, double dz, double &vol) |
void | images (std::vector< int > &vi, std::vector< double > &vd) |
Public Member Functions inherited from voro::voro_base | |
bool | contains_neighbor (const char *format) |
voro_base (int nx_, int ny_, int nz_, double boxx_, double boxy_, double boxz_) | |
Data Fields | |
int | ey |
int | ez |
int | wy |
int | wz |
int | oy |
int | oz |
int | oxyz |
int ** | id |
double ** | p |
int * | co |
int * | mem |
char * | img |
const int | init_mem |
const int | ps |
Data Fields inherited from voro::unitcell | |
const double | bx |
const double | bxy |
const double | by |
const double | bxz |
const double | byz |
const double | bz |
voronoicell | unit_voro |
Data Fields inherited from voro::voro_base | |
const int | nx |
const int | ny |
const int | nz |
const int | nxy |
const int | nxyz |
const double | boxx |
const double | boxy |
const double | boxz |
const double | xsp |
const double | ysp |
const double | zsp |
double * | mrad |
Protected Member Functions | |
void | add_particle_memory (int i) |
void | put_locate_block (int &ijk, double &x, double &y, double &z) |
void | put_locate_block (int &ijk, double &x, double &y, double &z, int &ai, int &aj, int &ak) |
void | create_periodic_image (int di, int dj, int dk) |
void | create_side_image (int di, int dj, int dk) |
void | create_vertical_image (int di, int dj, int dk) |
void | put_image (int reg, int fijk, int l, double dx, double dy, double dz) |
void | remap (int &ai, int &aj, int &ak, int &ci, int &cj, int &ck, double &x, double &y, double &z, int &ijk) |
Protected Member Functions inherited from voro::voro_base | |
int | step_int (double a) |
int | step_mod (int a, int b) |
int | step_div (int a, int b) |
Additional Inherited Members | |
Static Public Attributes inherited from voro::voro_base | |
static const unsigned int | wl [wl_seq_length *wl_hgridcu] |
Protected Attributes inherited from voro::unitcell | |
double | max_uv_y |
double | max_uv_z |
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 0<x<bx, 0<y<by, 0<z<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.
Definition at line 43 of file container_prd.hh.
voro::container_periodic_base::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.
[in] | (bx_) | The x coordinate of the first unit vector. |
[in] | (bxy_,by_) | The x and y coordinates of the second unit vector. |
[in] | (bxz_,byz_,bz_) | The x, y, and z coordinates of the third unit vector. |
[in] | (nx_,ny_,nz_) | the number of grid blocks in each of the three coordinate directions. |
[in] | init_mem_ | the initial memory allocation for each block. |
[in] | ps_ | the number of floating point entries to store for each particle. |
Definition at line 29 of file container_prd.cc.
voro::container_periodic_base::~container_periodic_base | ( | ) |
The container destructor frees the dynamically allocated memory.
Definition at line 52 of file container_prd.cc.
|
protected |
Increase memory for a particular region.
[in] | i | the index of the region to reallocate. |
Definition at line 357 of file container_prd.cc.
void voro::container_periodic_base::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.
Definition at line 550 of file container_prd.cc.
void voro::container_periodic_base::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.
Definition at line 543 of file container_prd.cc.
|
inlineprotected |
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.
[in] | (di,dj,dk) | the coordinates of the image block to create. |
Definition at line 193 of file container_prd.hh.
|
protected |
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.
[in] | (di,dj,dk) | the index of the block to consider. The z index must satisfy ez<=dk<wz. |
Definition at line 575 of file container_prd.cc.
|
protected |
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.
[in] | (di,dj,dk) | the index of the block to consider. The z index must satisfy dk<ez or dk>=wz. |
Definition at line 627 of file container_prd.cc.
|
inline |
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.
[in] | (x,y,z) | the position of the particle. |
[in] | (ci,cj,ck) | the block that the particle is within. |
[out] | (fx,fy,fz) | the position relative to the block. |
Definition at line 152 of file container_prd.hh.
|
inline |
Initializes parameters for a find_voronoi_cell call within the voro_compute template.
[in] | (ci,cj,ck) | the coordinates of the test block in the container coordinate system. |
[in] | ijk | the index of the test block |
[out] | (i,j,k) | the coordinates of the test block relative to the voro_compute coordinate system. |
[out] | disp | a block displacement used internally by the find_voronoi_cell routine (but not needed in this instance.) |
Definition at line 142 of file container_prd.hh.
|
inline |
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.
[in,out] | c | a reference to a voronoicell object. |
[in] | ijk | the block that the particle is within. |
[in] | q | the index of the particle within its block. |
[in] | (ci,cj,ck) | the coordinates of the block in the container coordinate system. |
[out] | (i,j,k) | the coordinates of the test block relative to the voro_compute coordinate system. |
[out] | (x,y,z) | the position of the particle. |
[out] | disp | a block displacement used internally by the compute_cell routine. |
Definition at line 124 of file container_prd.hh.
|
inline |
Prints all particles in the container, including those that have been constructed in image blocks.
Definition at line 99 of file container_prd.hh.
|
protected |
Copies a particle position from the primary domain into an image block.
[in] | reg | the block index within the primary domain that the particle is within. |
[in] | fijk | the index of the image block. |
[in] | l | the index of the particle entry within the primary block. |
[in] | (dx,dy,dz) | the displacement vector to add to the particle. |
Definition at line 758 of file container_prd.cc.
|
protected |
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.
[out] | ijk | the region index. |
[in,out] | (x,y,z) | the particle position, remapped into the primary domain if necessary. |
Definition at line 183 of file container_prd.cc.
|
protected |
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.
[out] | ijk | the region index. |
[in,out] | (x,y,z) | the particle position, remapped into the primary domain if necessary. |
[out] | (ai,aj,ak) | the periodic image displacement that the particle is in, with (0,0,0) corresponding to the primary domain. |
Definition at line 223 of file container_prd.cc.
void voro::container_periodic_base::region_count | ( | ) |
Outputs the a list of all the container regions along with the number of particles stored within each.
Definition at line 441 of file container_prd.cc.
|
inline |
Calculates the index of block in the container structure corresponding to given coordinates.
[in] | (ci,cj,ck) | the coordinates of the original block in the current computation, relative to the container coordinate system. |
[in] | (ei,ej,ek) | the displacement of the current block from the original block. |
[in,out] | (qx,qy,qz) | the periodic displacement that must be added to the particles within the computed block. |
[in] | disp | a block displacement used internally by the find_voronoi_cell and compute_cell routines (but not needed in this instance.) |
Definition at line 171 of file container_prd.hh.
|
inlineprotected |
Takes a position vector and remaps it into the primary domain.
[out] | (ai,aj,ak) | the periodic image displacement that the vector is in, with (0,0,0) corresponding to the primary domain. |
[out] | (ci,cj,ck) | the index of the block that the position vector is within, once it has been remapped. |
[in,out] | (x,y,z) | the position vector to consider, which is remapped into the primary domain during the routine. |
[out] | ijk | the block index that the vector is within. |
Definition at line 260 of file container_prd.cc.
int* voro::container_periodic_base::co |
This array holds the number of particles within each computational box of the container.
Definition at line 74 of file container_prd.hh.
int voro::container_periodic_base::ey |
The lower y index (inclusive) of the primary domain within the block structure.
Definition at line 47 of file container_prd.hh.
int voro::container_periodic_base::ez |
The lower z index (inclusive) of the primary domain within the block structure.
Definition at line 50 of file container_prd.hh.
int** voro::container_periodic_base::id |
This array holds the numerical IDs of each particle in each computational box.
Definition at line 67 of file container_prd.hh.
char* voro::container_periodic_base::img |
An array holding information about periodic image construction at a given location.
Definition at line 83 of file container_prd.hh.
const int voro::container_periodic_base::init_mem |
The initial amount of memory to allocate for particles for each block.
Definition at line 86 of file container_prd.hh.
int* voro::container_periodic_base::mem |
This 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.
Definition at line 80 of file container_prd.hh.
int voro::container_periodic_base::oxyz |
The total number of blocks.
Definition at line 64 of file container_prd.hh.
int voro::container_periodic_base::oy |
The total size of the block structure (including images) in the y direction.
Definition at line 59 of file container_prd.hh.
int voro::container_periodic_base::oz |
The total size of the block structure (including images) in the z direction.
Definition at line 62 of file container_prd.hh.
double** voro::container_periodic_base::p |
A two dimensional array holding particle positions. For the derived container_poly class, this also holds particle radii.
Definition at line 71 of file container_prd.hh.
const int voro::container_periodic_base::ps |
The 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.
Definition at line 93 of file container_prd.hh.
int voro::container_periodic_base::wy |
The upper y index (exclusive) of the primary domain within the block structure.
Definition at line 53 of file container_prd.hh.
int voro::container_periodic_base::wz |
The upper z index (exclusive) of the primary domain within the block structure.
Definition at line 56 of file container_prd.hh.