Voro++
Public Member Functions | Friends
voro::container Class Reference

Extension of the container_base class for computing regular Voronoi tessellations. More...

#include <container.hh>

Inheritance diagram for voro::container:

Public Member Functions

 container (double ax_, double bx_, double ay_, double by_, double az_, double bz_, int nx_, int ny_, int nz_, bool xperiodic_, bool yperiodic_, bool zperiodic_, int init_mem)
void clear ()
void put (int n, double x, double y, double z)
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 >

Detailed Description

This class is an extension of the container_base class that has routines specifically for computing the regular Voronoi tessellation with no dependence on particle radii.

Definition at line 280 of file container.hh.


Constructor & Destructor Documentation

voro::container::container ( double  ax_,
double  bx_,
double  ay_,
double  by_,
double  az_,
double  bz_,
int  nx_,
int  ny_,
int  nz_,
bool  xperiodic_,
bool  yperiodic_,
bool  zperiodic_,
int  init_mem 
)

The class constructor sets up the geometry of container.

Parameters:
[in](ax_,bx_)the minimum and maximum x coordinates.
[in](ay_,by_)the minimum and maximum y coordinates.
[in](az_,bz_)the minimum and maximum z coordinates.
[in](nx_,ny_,nz_)the number of grid blocks in each of the three coordinate directions.
[in](xperiodic_,yperiodic_,zperiodic_) flags setting whether the container is periodic in each coordinate direction.
[in]init_memthe initial memory allocation for each block.

Definition at line 64 of file container.cc.


Member Function Documentation

void voro::container::clear ( )

Clears a container of particles.

Definition at line 384 of file container.cc.

void voro::container::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 435 of file container.cc.

template<class v_cell , class c_loop >
bool voro::container::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]ca Voronoi cell class in which to store the computed cell.
[in]vlthe loop class to use.
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 455 of file container.hh.

template<class v_cell >
bool voro::container::compute_cell ( v_cell &  c,
int  ijk,
int  q 
) [inline]

Computes the Voronoi cell for given particle.

Parameters:
[out]ca Voronoi cell class in which to store the computed cell.
[in]ijkthe block that the particle is within.
[in]qthe index of the particle within the block.
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 467 of file container.hh.

template<class c_loop >
void voro::container::draw_cells_gnuplot ( c_loop &  vl,
FILE *  fp 
) [inline]

Computes Voronoi cells and saves the output in gnuplot format.

Parameters:
[in]vlthe loop class to use.
[in]fpa file handle to write to.

Definition at line 371 of file container.hh.

void voro::container::draw_cells_gnuplot ( FILE *  fp = stdout) [inline]

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

Parameters:
[in]fpa file handle to write to.

Definition at line 381 of file container.hh.

void voro::container::draw_cells_gnuplot ( const char *  filename) [inline]

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

Parameters:
[in]filenamethe name of the file to write to.

Definition at line 388 of file container.hh.

template<class c_loop >
void voro::container::draw_cells_pov ( c_loop &  vl,
FILE *  fp 
) [inline]

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

Parameters:
[in]vlthe loop class to use.
[in]fpa file handle to write to.

Definition at line 398 of file container.hh.

void voro::container::draw_cells_pov ( FILE *  fp = stdout) [inline]

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

Parameters:
[in]fpa file handle to write to.

Definition at line 409 of file container.hh.

void voro::container::draw_cells_pov ( const char *  filename) [inline]

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

Parameters:
[in]filenamethe name of the file to write to.

Definition at line 416 of file container.hh.

template<class c_loop >
void voro::container::draw_particles ( c_loop &  vl,
FILE *  fp 
) [inline]

Dumps particle IDs and positions to a file.

Parameters:
[in]vlthe loop class to use.
[in]fpa file handle to write to.

Definition at line 321 of file container.hh.

void voro::container::draw_particles ( FILE *  fp = stdout) [inline]

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

Parameters:
[in]fpa file handle to write to.

Definition at line 330 of file container.hh.

void voro::container::draw_particles ( const char *  filename) [inline]

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

Parameters:
[in]filenamethe name of the file to write to.

Definition at line 336 of file container.hh.

template<class c_loop >
void voro::container::draw_particles_pov ( c_loop &  vl,
FILE *  fp 
) [inline]

Dumps particle positions in POV-Ray format.

Parameters:
[in]vlthe loop class to use.
[in]fpa file handle to write to.

Definition at line 345 of file container.hh.

void voro::container::draw_particles_pov ( FILE *  fp = stdout) [inline]

Dumps all particle positions in POV-Ray format.

Parameters:
[in]fpa file handle to write to.

Definition at line 355 of file container.hh.

void voro::container::draw_particles_pov ( const char *  filename) [inline]

Dumps all particle positions in POV-Ray format.

Parameters:
[in]filenamethe name of the file to write to.

Definition at line 361 of file container.hh.

bool voro::container::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. 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]pidthe 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 234 of file container.cc.

void voro::container::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.

Parameters:
[in]fpthe file handle to read from.

Definition at line 330 of file container.cc.

void voro::container::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.

Parameters:
[in,out]voa reference to an ordering class to use.
[in]fpthe file handle to read from.

Definition at line 343 of file container.cc.

void voro::container::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.

Parameters:
[in]filenamethe name of the file to open and read from.

Definition at line 296 of file container.hh.

void voro::container::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.

Parameters:
[in,out]vothe ordering class to use.
[in]filenamethe name of the file to open and read from.

Definition at line 310 of file container.hh.

template<class c_loop >
void voro::container::print_custom ( c_loop &  vl,
const char *  format,
FILE *  fp 
) [inline]

Computes the Voronoi cells and saves customized information about them.

Parameters:
[in]vlthe loop class to use.
[in]formatthe custom output string to use.
[in]fpa file handle to write to.

Definition at line 427 of file container.hh.

void voro::container::print_custom ( const char *  format,
FILE *  fp = stdout 
)

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

Parameters:
[in]formatthe custom output string to use.
[in]fpa file handle to write to.

Definition at line 398 of file container.cc.

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

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

Parameters:
[in]formatthe custom output string to use.
[in]filenamethe name of the file to write to.

Definition at line 415 of file container.cc.

void voro::container::put ( int  n,
double  x,
double  y,
double  z 
)

Put a particle into the correct region of the container.

Parameters:
[in]nthe numerical ID of the inserted particle.
[in](x,y,z)the position vector of the inserted particle.

Definition at line 87 of file container.cc.

void voro::container::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.

Parameters:
[in]vothe ordering class in which to record the region.
[in]nthe numerical ID of the inserted particle.
[in](x,y,z)the position vector of the inserted particle.

Definition at line 115 of file container.cc.

double voro::container::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 456 of file container.cc.


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