Voro++
|
Extension of the container_periodic_base class for computing regular Voronoi tessellations. More...
#include <container_prd.hh>
Public Member Functions | |
container_periodic (double bx_, double bxy_, double by_, double bxz_, double byz_, double bz_, int nx_, int ny_, int nz_, int init_mem_) | |
void | clear () |
void | put (int n, double x, double y, double z) |
void | put (int n, double x, double y, double z, int &ai, int &aj, int &ak) |
void | put (particle_order &vo, int n, double x, double y, double z) |
void | import (FILE *fp=stdin) |
void | import (particle_order &vo, FILE *fp=stdin) |
void | import (const char *filename) |
void | import (particle_order &vo, const char *filename) |
void | compute_all_cells () |
double | sum_cell_volumes () |
template<class c_loop > | |
void | draw_particles (c_loop &vl, FILE *fp) |
void | draw_particles (FILE *fp=stdout) |
void | draw_particles (const char *filename) |
template<class c_loop > | |
void | draw_particles_pov (c_loop &vl, FILE *fp) |
void | draw_particles_pov (FILE *fp=stdout) |
void | draw_particles_pov (const char *filename) |
template<class c_loop > | |
void | draw_cells_gnuplot (c_loop &vl, FILE *fp) |
void | draw_cells_gnuplot (FILE *fp=stdout) |
void | draw_cells_gnuplot (const char *filename) |
template<class c_loop > | |
void | draw_cells_pov (c_loop &vl, FILE *fp) |
void | draw_cells_pov (FILE *fp=stdout) |
void | draw_cells_pov (const char *filename) |
template<class c_loop > | |
void | print_custom (c_loop &vl, const char *format, FILE *fp) |
void | print_custom (const char *format, FILE *fp=stdout) |
void | print_custom (const char *format, const char *filename) |
bool | find_voronoi_cell (double x, double y, double z, double &rx, double &ry, double &rz, int &pid) |
template<class v_cell , class c_loop > | |
bool | compute_cell (v_cell &c, c_loop &vl) |
template<class v_cell > | |
bool | compute_cell (v_cell &c, int ijk, int q) |
Friends | |
class | voro_compute< container_periodic > |
This class is an extension of the container_periodic_base that has routines specifically for computing the regular Voronoi tessellation with no dependence on particle radii.
Definition at line 215 of file container_prd.hh.
voro::container_periodic::container_periodic | ( | double | bx_, |
double | bxy_, | ||
double | by_, | ||
double | bxz_, | ||
double | byz_, | ||
double | bz_, | ||
int | nx_, | ||
int | ny_, | ||
int | nz_, | ||
int | init_mem_ | ||
) |
The class constructor sets up the geometry of container.
[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. |
Definition at line 70 of file container_prd.cc.
void voro::container_periodic::clear | ( | ) |
Clears a container of particles.
Definition at line 446 of file container_prd.cc.
void voro::container_periodic::compute_all_cells | ( | ) |
Computes all of the Voronoi cells in the container, but does nothing with the output. It is useful for measuring the pure computation time of the Voronoi algorithm, without any additional calculations such as volume evaluation or cell output.
Definition at line 497 of file container_prd.cc.
bool voro::container_periodic::compute_cell | ( | v_cell & | c, |
c_loop & | vl | ||
) | [inline] |
Computes the Voronoi cell for a particle currently being referenced by a loop class.
[out] | c | a Voronoi cell class in which to store the computed cell. |
[in] | vl | the loop class to use. |
Definition at line 391 of file container_prd.hh.
bool voro::container_periodic::compute_cell | ( | v_cell & | c, |
int | ijk, | ||
int | q | ||
) | [inline] |
Computes the Voronoi cell for given particle.
[out] | c | a Voronoi cell class in which to store the computed cell. |
[in] | ijk | the block that the particle is within. |
[in] | q | the index of the particle within the block. |
Definition at line 403 of file container_prd.hh.
void voro::container_periodic::draw_cells_gnuplot | ( | c_loop & | vl, |
FILE * | fp | ||
) | [inline] |
Computes Voronoi cells and saves the output in gnuplot format.
[in] | vl | the loop class to use. |
[in] | fp | a file handle to write to. |
Definition at line 307 of file container_prd.hh.
void voro::container_periodic::draw_cells_gnuplot | ( | FILE * | fp = stdout | ) | [inline] |
Computes all Voronoi cells and saves the output in gnuplot format.
[in] | fp | a file handle to write to. |
Definition at line 317 of file container_prd.hh.
void voro::container_periodic::draw_cells_gnuplot | ( | const char * | filename | ) | [inline] |
Compute all Voronoi cells and saves the output in gnuplot format.
[in] | filename | the name of the file to write to. |
Definition at line 324 of file container_prd.hh.
void voro::container_periodic::draw_cells_pov | ( | c_loop & | vl, |
FILE * | fp | ||
) | [inline] |
Computes Voronoi cells and saves the output in POV-Ray format.
[in] | vl | the loop class to use. |
[in] | fp | a file handle to write to. |
Definition at line 334 of file container_prd.hh.
void voro::container_periodic::draw_cells_pov | ( | FILE * | fp = stdout | ) | [inline] |
Computes all Voronoi cells and saves the output in POV-Ray format.
[in] | fp | a file handle to write to. |
Definition at line 345 of file container_prd.hh.
void voro::container_periodic::draw_cells_pov | ( | const char * | filename | ) | [inline] |
Computes all Voronoi cells and saves the output in POV-Ray format.
[in] | filename | the name of the file to write to. |
Definition at line 352 of file container_prd.hh.
void voro::container_periodic::draw_particles | ( | c_loop & | vl, |
FILE * | fp | ||
) | [inline] |
Dumps particle IDs and positions to a file.
[in] | vl | the loop class to use. |
[in] | fp | a file handle to write to. |
Definition at line 257 of file container_prd.hh.
void voro::container_periodic::draw_particles | ( | FILE * | fp = stdout | ) | [inline] |
Dumps all of the particle IDs and positions to a file.
[in] | fp | a file handle to write to. |
Definition at line 266 of file container_prd.hh.
void voro::container_periodic::draw_particles | ( | const char * | filename | ) | [inline] |
Dumps all of the particle IDs and positions to a file.
[in] | filename | the name of the file to write to. |
Definition at line 272 of file container_prd.hh.
void voro::container_periodic::draw_particles_pov | ( | c_loop & | vl, |
FILE * | fp | ||
) | [inline] |
Dumps particle positions in POV-Ray format.
[in] | vl | the loop class to use. |
[in] | fp | a file handle to write to. |
Definition at line 281 of file container_prd.hh.
void voro::container_periodic::draw_particles_pov | ( | FILE * | fp = stdout | ) | [inline] |
Dumps all particle positions in POV-Ray format.
[in] | fp | a file handle to write to. |
Definition at line 291 of file container_prd.hh.
void voro::container_periodic::draw_particles_pov | ( | const char * | filename | ) | [inline] |
Dumps all particle positions in POV-Ray format.
[in] | filename | the name of the file to write to. |
Definition at line 297 of file container_prd.hh.
bool voro::container_periodic::find_voronoi_cell | ( | double | x, |
double | y, | ||
double | z, | ||
double & | rx, | ||
double & | ry, | ||
double & | rz, | ||
int & | pid | ||
) |
Takes a vector and finds the particle whose Voronoi cell contains that vector. This is equivalent to finding the particle which is nearest to the vector.
[in] | (x,y,z) | the vector to test. |
[out] | (rx,ry,rz) | the position of the particle whose Voronoi cell contains the vector. This may point to a particle in a periodic image of the primary domain. |
[out] | pid | the ID of the particle. |
Definition at line 295 of file container_prd.cc.
void voro::container_periodic::import | ( | FILE * | fp = stdin | ) |
Import a list of particles from an open file stream into the container. Entries of four numbers (Particle ID, x position, y position, z position) are searched for. If the file cannot be successfully read, then the routine causes a fatal error.
[in] | fp | the file handle to read from. |
Definition at line 392 of file container_prd.cc.
void voro::container_periodic::import | ( | particle_order & | vo, |
FILE * | fp = stdin |
||
) |
Import a list of particles from an open file stream, also storing the order of that the particles are read. Entries of four numbers (Particle ID, x position, y position, z position) are searched for. If the file cannot be successfully read, then the routine causes a fatal error.
[in,out] | vo | a reference to an ordering class to use. |
[in] | fp | the file handle to read from. |
Definition at line 405 of file container_prd.cc.
void voro::container_periodic::import | ( | const char * | filename | ) | [inline] |
Imports a list of particles from an open file stream into the container. Entries of four numbers (Particle ID, x position, y position, z position) are searched for. If the file cannot be successfully read, then the routine causes a fatal error.
[in] | filename | the name of the file to open and read from. |
Definition at line 232 of file container_prd.hh.
void voro::container_periodic::import | ( | particle_order & | vo, |
const char * | filename | ||
) | [inline] |
Imports a list of particles from an open file stream into the container. Entries of four numbers (Particle ID, x position, y position, z position) are searched for. In addition, the order in which particles are read is saved into an ordering class. If the file cannot be successfully read, then the routine causes a fatal error.
[in,out] | vo | the ordering class to use. |
[in] | filename | the name of the file to open and read from. |
Definition at line 246 of file container_prd.hh.
void voro::container_periodic::print_custom | ( | c_loop & | vl, |
const char * | format, | ||
FILE * | fp | ||
) | [inline] |
Computes the Voronoi cells and saves customized information about them.
[in] | vl | the loop class to use. |
[in] | format | the custom output string to use. |
[in] | fp | a file handle to write to. |
Definition at line 363 of file container_prd.hh.
void voro::container_periodic::print_custom | ( | const char * | format, |
FILE * | fp = stdout |
||
) |
Computes all the Voronoi cells and saves customized information about them.
[in] | format | the custom output string to use. |
[in] | fp | a file handle to write to. |
Definition at line 460 of file container_prd.cc.
void voro::container_periodic::print_custom | ( | const char * | format, |
const char * | filename | ||
) |
Computes all the Voronoi cells and saves customized information about them.
[in] | format | the custom output string to use. |
[in] | filename | the name of the file to write to. |
Definition at line 477 of file container_prd.cc.
void voro::container_periodic::put | ( | int | n, |
double | x, | ||
double | y, | ||
double | z | ||
) |
Put a particle into the correct region of the container.
[in] | n | the numerical ID of the inserted particle. |
[in] | (x,y,z) | the position vector of the inserted particle. |
Definition at line 91 of file container_prd.cc.
void voro::container_periodic::put | ( | int | n, |
double | x, | ||
double | y, | ||
double | z, | ||
int & | ai, | ||
int & | aj, | ||
int & | ak | ||
) |
Put a particle into the correct region of the container.
[in] | n | the numerical ID of the inserted particle. |
[in] | (x,y,z) | the position vector of the inserted particle. |
[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 118 of file container_prd.cc.
void voro::container_periodic::put | ( | particle_order & | vo, |
int | n, | ||
double | x, | ||
double | y, | ||
double | z | ||
) |
Put a particle into the correct region of the container, also recording into which region it was stored.
[in] | vo | the ordering class in which to record the region. |
[in] | n | the numerical ID of the inserted particle. |
[in] | (x,y,z) | the position vector of the inserted particle. |
Definition at line 147 of file container_prd.cc.
double voro::container_periodic::sum_cell_volumes | ( | ) |
Calculates all of the Voronoi cells and sums their volumes. In most cases without walls, the sum of the Voronoi cell volumes should equal the volume of the container to numerical precision.
Definition at line 518 of file container_prd.cc.