Voro++
|
Template for carrying out Voronoi cell computations.
#include <v_compute.hh>
Public Member Functions | |
voro_compute (c_class &con_, int hx_, int hy_, int hz_) | |
~voro_compute () | |
template<class v_cell > | |
bool | compute_cell (v_cell &c, int ijk, int s, int ci, int cj, int ck) |
void | find_voronoi_cell (double x, double y, double z, int ci, int cj, int ck, int ijk, particle_record &w, double &mrs) |
Data Fields | |
c_class & | con |
const double | boxx |
const double | boxy |
const double | boxz |
const double | xsp |
const double | ysp |
const double | zsp |
const int | hx |
const int | hy |
const int | hz |
const int | hxy |
const int | hxyz |
const int | ps |
int ** | id |
double ** | p |
int * | co |
Definition at line 39 of file v_compute.hh.
template voro::voro_compute< c_class >::voro_compute | ( | c_class & | con_, |
int | hx_, | ||
int | hy_, | ||
int | hz_ | ||
) |
The class constructor initializes constants from the container class, and sets up the mask and queue used for Voronoi computations.
[in] | con_ | a reference to the container class to use. |
[in] | (hx_,hy_,hz_) | the size of the mask to use. |
Definition at line 23 of file v_compute.cc.
|
inline |
The class destructor frees the dynamically allocated memory for the mask and queue.
Definition at line 90 of file v_compute.hh.
template bool voro::voro_compute< c_class >::compute_cell | ( | v_cell & | c, |
int | ijk, | ||
int | s, | ||
int | ci, | ||
int | cj, | ||
int | ck | ||
) |
This routine computes a Voronoi cell for a single particle in the container. It can be called by the user, but is also forms the core part of several of the main functions, such as store_cell_volumes(), print_all(), and the drawing routines. The algorithm constructs the cell by testing over the neighbors of the particle, working outwards until it reaches those particles which could not possibly intersect the cell. For maximum efficiency, this algorithm is divided into three parts. In the first section, the algorithm tests over the blocks which are in the immediate vicinity of the particle, by making use of one of the precomputed worklists. The code then continues to test blocks on the worklist, but also begins to construct a list of neighboring blocks outside the worklist which may need to be test. In the third section, the routine starts testing these neighboring blocks, evaluating whether or not a particle in them could possibly intersect the cell. For blocks that intersect the cell, it tests the particles in that block, and then adds the block neighbors to the list of potential places to consider.
[in,out] | c | a reference to a voronoicell object. |
[in] | ijk | the index of the block that the test particle is in. |
[in] | s | the index of the particle within the test block. |
[in] | (ci,cj,ck) | the coordinates of the block that the test particle is in relative to the container data structure. |
Definition at line 291 of file v_compute.cc.
template void voro::voro_compute< c_class >::find_voronoi_cell | ( | double | x, |
double | y, | ||
double | z, | ||
int | ci, | ||
int | cj, | ||
int | ck, | ||
int | ijk, | ||
particle_record & | w, | ||
double & | mrs | ||
) |
Finds the Voronoi cell that given vector is within. For containers that are not radially dependent, this corresponds to findig the particle that is closest to the vector; for the radical tessellation containers, this corresponds to a finding the minimum weighted distance.
[in] | (x,y,z) | the vector to consider. |
[in] | (ci,cj,ck) | the coordinates of the block that the test particle is in relative to the container data structure. |
[in] | ijk | the index of the block that the test particle is in. |
[out] | w | a reference to a particle record in which to store information about the particle whose Voronoi cell the vector is within. |
[out] | mrs | the minimum computed distance. |
Definition at line 71 of file v_compute.cc.
const double voro::voro_compute< c_class >::boxx |
The size of an internal computational block in the x direction.
Definition at line 45 of file v_compute.hh.
const double voro::voro_compute< c_class >::boxy |
The size of an internal computational block in the y direction.
Definition at line 48 of file v_compute.hh.
const double voro::voro_compute< c_class >::boxz |
The size of an internal computational block in the z direction.
Definition at line 51 of file v_compute.hh.
int* voro::voro_compute< c_class >::co |
An array holding the number of particles within each computational box of the container.
Definition at line 86 of file v_compute.hh.
c_class& voro::voro_compute< c_class >::con |
A reference to the container class on which to carry out
Definition at line 42 of file v_compute.hh.
const int voro::voro_compute< c_class >::hx |
The number of boxes in the x direction for the searching mask.
Definition at line 62 of file v_compute.hh.
const int voro::voro_compute< c_class >::hxy |
A constant, set to the value of hx multiplied by hy, which is used in the routines which step through mask boxes in sequence.
Definition at line 70 of file v_compute.hh.
const int voro::voro_compute< c_class >::hxyz |
A constant, set to the value of hx*hy*hz, which is used in the routines which step through mask boxes in sequence.
Definition at line 73 of file v_compute.hh.
const int voro::voro_compute< c_class >::hy |
The number of boxes in the y direction for the searching mask.
Definition at line 64 of file v_compute.hh.
const int voro::voro_compute< c_class >::hz |
The number of boxes in the z direction for the searching mask.
Definition at line 66 of file v_compute.hh.
int** voro::voro_compute< c_class >::id |
This array holds the numerical IDs of each particle in each computational box.
Definition at line 79 of file v_compute.hh.
double** voro::voro_compute< c_class >::p |
A two dimensional array holding particle positions. For the derived container_poly class, this also holds particle radii.
Definition at line 83 of file v_compute.hh.
const int voro::voro_compute< c_class >::ps |
The number of floating point entries to store for each particle.
Definition at line 76 of file v_compute.hh.
const double voro::voro_compute< c_class >::xsp |
The inverse box length in the x direction, set to nx/(bx-ax).
Definition at line 54 of file v_compute.hh.
const double voro::voro_compute< c_class >::ysp |
The inverse box length in the y direction, set to ny/(by-ay).
Definition at line 57 of file v_compute.hh.
const double voro::voro_compute< c_class >::zsp |
The inverse box length in the z direction, set to nz/(bz-az).
Definition at line 60 of file v_compute.hh.