Voro++
Public Member Functions | Data Fields
voro::voro_compute< c_class > Class Template Reference

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
 

Detailed Description

template<class c_class>
class voro::voro_compute< c_class >

Definition at line 39 of file v_compute.hh.

Constructor & Destructor Documentation

template<class c_class>
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.

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

template<class c_class>
voro::voro_compute< c_class >::~voro_compute ( )
inline

The class destructor frees the dynamically allocated memory for the mask and queue.

Definition at line 90 of file v_compute.hh.

Member Function Documentation

template<class c_class >
template<class v_cell >
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.

Parameters
[in,out]ca reference to a voronoicell object.
[in]ijkthe index of the block that the test particle is in.
[in]sthe 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.
Returns
False if the Voronoi cell was completely removed during the computation and has zero volume, true otherwise.

Definition at line 291 of file v_compute.cc.

template<class c_class >
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.

Parameters
[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]ijkthe index of the block that the test particle is in.
[out]wa reference to a particle record in which to store information about the particle whose Voronoi cell the vector is within.
[out]mrsthe minimum computed distance.

Definition at line 71 of file v_compute.cc.

Field Documentation

template<class c_class>
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.

template<class c_class>
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.

template<class c_class>
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.

template<class c_class>
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.

template<class c_class>
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.

template<class c_class>
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.

template<class c_class>
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.

template<class c_class>
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.

template<class c_class>
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.

template<class c_class>
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.

template<class c_class>
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.

template<class c_class>
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.

template<class c_class>
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.

template<class c_class>
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.

template<class c_class>
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.

template<class c_class>
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.


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