Voro++: voro::container_periodic_poly Class Reference

Voro++

- Main Page
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions | Friends
voro::container_periodic_poly Class Reference

Extension of the container_periodic_base class for computing radical Voronoi tessellations. More...

`#include <container_prd.hh>`

Inheritance diagram for voro::container_periodic_poly:

## Public Member Functions
| container_periodic_poly (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, double r)
void | put (int n, double x, double y, double z, double r, int &ai, int &aj, int &ak)
void | put (particle_order &vo, int n, double x, double y, double z, double r)
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)
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)
template<class v_cell >
bool | compute_ghost_cell (v_cell &c, double x, double y, double z, double r)
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)
Public Member Functions inherited from 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)
| ~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_)
Public Member Functions inherited from voro::radius_poly
| radius_poly ()

## Friends
class | voro_compute< container_periodic_poly >

## Additional Inherited Members
Data Fields inherited from voro::container_periodic_base
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
Data Fields inherited from voro::radius_poly
double ** | ppr
double | max_radius
Static Public Attributes inherited from voro::voro_base
static const unsigned int | wl [wl_seq_length *wl_hgridcu]
Protected Member Functions inherited from voro::container_periodic_base
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)
Protected Member Functions inherited from voro::radius_poly
void | r_init (int ijk, int s)
void | r_prime (double rv)
bool | r_ctest (double crs, double mrs)
double | r_cutoff (double lrs)
double | r_max_add (double rs)
double | r_current_sub (double rs, int ijk, int q)
double | r_scale (double rs, int ijk, int q)
bool | r_scale_check (double &rs, double mrs, int ijk, int q)
Protected Attributes inherited from voro::unitcell
double | max_uv_y
double | max_uv_z

## Detailed Description

This class is an extension of container_periodic_base that has routines specifically for computing the radical Voronoi tessellation that depends on the particle radii.

Definition at line 433 of file container_prd.hh.

## Constructor & Destructor Documentation

voro::container_periodic_poly::container_periodic_poly | ( | 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.

Parameters

  [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 85 of file container_prd.cc.

## Member Function Documentation

void voro::container_periodic_poly::clear | ( |  | ) |

Clears a container of particles, also clearing resetting the maximum radius to zero.

Definition at line 454 of file container_prd.cc.

void voro::container_periodic_poly::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 510 of file container_prd.cc.

template<class v_cell , class c_loop >

bool voro::container_periodic_poly::compute_cell | ( | v_cell & | c,
|  | c_loop & | vl
| ) |  |
| inline

Computes the Voronoi cell for a particle currently being referenced by a loop class.

Parameters

  [out] | c | a Voronoi cell class in which to store the computed cell.
  [in] | vl | the loop class to use.

Returns
  True if the cell was computed. If the cell cannot be computed because it was removed entirely for some reason, then the routine returns false.

Definition at line 608 of file container_prd.hh.

template<class v_cell >

bool voro::container_periodic_poly::compute_cell | ( | v_cell & | c,
|  | int | ijk,
|  | int | q
| ) |  |
| inline

Computes the Voronoi cell for given particle.

Parameters

  [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.

Returns
  True if the cell was computed. If the cell cannot be computed because it was removed entirely for some reason, then the routine returns false.

Definition at line 620 of file container_prd.hh.

template<class v_cell >

bool voro::container_periodic_poly::compute_ghost_cell | ( | v_cell & | c,
|  | double | x,
|  | double | y,
|  | double | z,
|  | double | r
| ) |  |
| inline

Computes the Voronoi cell for a ghost particle at a given location.

Parameters

  [out] | c | a Voronoi cell class in which to store the computed cell.
  [in] | (x,y,z) | the location of the ghost particle.
  [in] | r | the radius of the ghost particle.

Returns
  True if the cell was computed. If the cell cannot be computed, if it is removed entirely by a wall or boundary condition, then the routine returns false.

Definition at line 634 of file container_prd.hh.

template<class c_loop >

void voro::container_periodic_poly::draw_cells_gnuplot | ( | c_loop & | vl,
|  | FILE * | fp
| ) |  |
| inline

Computes Voronoi cells and saves the output in gnuplot format.

Parameters

  [in] | vl | the loop class to use.
  [in] | fp | a file handle to write to.

Definition at line 527 of file container_prd.hh.

void voro::container_periodic_poly::draw_cells_gnuplot | ( | FILE * | fp = `stdout` | ) |
| inline

Compute all Voronoi cells and saves the output in gnuplot format.

Parameters

  [in] | fp | a file handle to write to.

Definition at line 537 of file container_prd.hh.

void voro::container_periodic_poly::draw_cells_gnuplot | ( | const char * | filename | ) |
| inline

Compute all Voronoi cells and saves the output in gnuplot format.

Parameters

  [in] | filename | the name of the file to write to.

Definition at line 544 of file container_prd.hh.

template<class c_loop >

void voro::container_periodic_poly::draw_cells_pov | ( | c_loop & | vl,
|  | FILE * | fp
| ) |  |
| inline

Computes Voronoi cells and saves the output in POV-Ray format.

Parameters

  [in] | vl | the loop class to use.
  [in] | fp | a file handle to write to.

Definition at line 554 of file container_prd.hh.

void voro::container_periodic_poly::draw_cells_pov | ( | FILE * | fp = `stdout` | ) |
| inline

Computes all Voronoi cells and saves the output in POV-Ray format.

Parameters

  [in] | fp | a file handle to write to.

Definition at line 565 of file container_prd.hh.

void voro::container_periodic_poly::draw_cells_pov | ( | const char * | filename | ) |
| inline

Computes all Voronoi cells and saves the output in POV-Ray format.

Parameters

  [in] | filename | the name of the file to write to.

Definition at line 572 of file container_prd.hh.

template<class c_loop >

void voro::container_periodic_poly::draw_particles | ( | c_loop & | vl,
|  | FILE * | fp
| ) |  |
| inline

Dumps particle IDs, positions and radii to a file.

Parameters

  [in] | vl | the loop class to use.
  [in] | fp | a file handle to write to.

Definition at line 475 of file container_prd.hh.

void voro::container_periodic_poly::draw_particles | ( | FILE * | fp = `stdout` | ) |
| inline

Dumps all of the particle IDs, positions and radii to a file.

Parameters

  [in] | fp | a file handle to write to.

Definition at line 485 of file container_prd.hh.

void voro::container_periodic_poly::draw_particles | ( | const char * | filename | ) |
| inline

Dumps all of the particle IDs, positions and radii to a file.

Parameters

  [in] | filename | the name of the file to write to.

Definition at line 492 of file container_prd.hh.

template<class c_loop >

void voro::container_periodic_poly::draw_particles_pov | ( | c_loop & | vl,
|  | FILE * | fp
| ) |  |
| inline

Dumps particle positions in POV-Ray format.

Parameters

  [in] | vl | the loop class to use.
  [in] | fp | a file handle to write to.

Definition at line 501 of file container_prd.hh.

void voro::container_periodic_poly::draw_particles_pov | ( | FILE * | fp = `stdout` | ) |
| inline

Dumps all the particle positions in POV-Ray format.

Parameters

  [in] | fp | a file handle to write to.

Definition at line 511 of file container_prd.hh.

void voro::container_periodic_poly::draw_particles_pov | ( | const char * | filename | ) |
| inline

Dumps all the particle positions in POV-Ray format.

Parameters

  [in] | filename | the name of the file to write to.

Definition at line 517 of file container_prd.hh.

bool voro::container_periodic_poly::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. Additional wall classes are not considered by this routine.

Parameters

  [in] | (x,y,z) | the vector to test.
  [out] | (rx,ry,rz) | the position of the particle whose Voronoi cell contains the vector. If the container is periodic, this may point to a particle in a periodic image of the primary domain.
  [out] | pid | the ID of the particle.

Returns
  True if a particle was found. If the container has no particles, then the search will not find a Voronoi cell and false is returned.

Definition at line 331 of file container_prd.cc.

void voro::container_periodic_poly::import | ( | FILE * | fp = `stdin` | ) |

Import a list of particles from an open file stream into the container. Entries of five numbers (Particle ID, x position, y position, z position, radius) are searched for. If the file cannot be successfully read, then the routine causes a fatal error.

Parameters

  [in] | fp | the file handle to read from.

Definition at line 419 of file container_prd.cc.

void voro::container_periodic_poly::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, radius) are searched for. If the file cannot be successfully read, then the routine causes a fatal error.

Parameters

  [in,out] | vo | a reference to an ordering class to use.
  [in] | fp | the file handle to read from.

Definition at line 432 of file container_prd.cc.

void voro::container_periodic_poly::import | ( | const char * | filename | ) |
| inline

Imports a list of particles from an open file stream into the container_poly class. Entries of five numbers (Particle ID, x position, y position, z position, radius) are searched for. If the file cannot be successfully read, then the routine causes a fatal error.

Parameters

  [in] | filename | the name of the file to open and read from.

Definition at line 450 of file container_prd.hh.

void voro::container_periodic_poly::import | ( | particle_order & | vo,
|  | const char * | filename
| ) |  |
| inline

Imports a list of particles from an open file stream into the container_poly class. Entries of five numbers (Particle ID, x position, y position, z position, radius) 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.

Parameters

  [in,out] | vo | the ordering class to use.
  [in] | filename | the name of the file to open and read from.

Definition at line 464 of file container_prd.hh.

template<class c_loop >

void voro::container_periodic_poly::print_custom | ( | c_loop & | vl,
|  | const char * | format,
|  | FILE * | fp
| ) |  |
| inline

Computes the Voronoi cells and saves customized information about them.

Parameters

  [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 583 of file container_prd.hh.

void voro::container_periodic_poly::print_custom | ( | const char * | format,
|  | FILE * | fp = `stdout`
| ) |  |

Computes all the Voronoi cells and saves customized information about them.

Parameters

  [in] | format | the custom output string to use.
  [in] | fp | a file handle to write to.

Definition at line 471 of file container_prd.cc.

void voro::container_periodic_poly::print_custom | ( | const char * | format,
|  | const char * | filename
| ) |  |

Computes all the Voronoi cells and saves customized information about them

Parameters

  [in] | format | the custom output string to use.
  [in] | filename | the name of the file to write to.

Definition at line 489 of file container_prd.cc.

void voro::container_periodic_poly::put | ( | int | n,
|  | double | x,
|  | double | y,
|  | double | z,
|  | double | r
| ) |  |

Put a particle into the correct region of the container.

Parameters

  [in] | n | the numerical ID of the inserted particle.
  [in] | (x,y,z) | the position vector of the inserted particle.
  [in] | r | the radius of the particle.

Definition at line 105 of file container_prd.cc.

void voro::container_periodic_poly::put | ( | int | n,
|  | double | x,
|  | double | y,
|  | double | z,
|  | double | r,
|  | int & | ai,
|  | int & | aj,
|  | int & | ak
| ) |  |

Put a particle into the correct region of the container.

Parameters

  [in] | n | the numerical ID of the inserted particle.
  [in] | (x,y,z) | the position vector of the inserted particle.
  [in] | r | the radius of the 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 135 of file container_prd.cc.

void voro::container_periodic_poly::put | ( | particle_order & | vo,
|  | int | n,
|  | double | x,
|  | double | y,
|  | double | z,
|  | double | r
| ) |  |

Put a particle into the correct region of the container, also recording into which region it was stored.

Parameters

  [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.
  [in] | r | the radius of the particle.

Definition at line 164 of file container_prd.cc.

double voro::container_periodic_poly::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.

Returns
  The sum of all of the computed Voronoi volumes.

Definition at line 532 of file container_prd.cc.

The documentation for this class was generated from the following files:

- container_prd.hh
- container_prd.cc