Voro++
Public Member Functions | Data Fields | Static Public Attributes | Protected Member Functions
voro::voro_base Class Reference

Class containing data structures common across all particle container classes. More...

#include <v_base.hh>

+ Inheritance diagram for voro::voro_base:

Public Member Functions

bool contains_neighbor (const char *format)
 
 voro_base (int nx_, int ny_, int nz_, double boxx_, double boxy_, double boxz_)
 

Data Fields

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
 

Static Public Attributes

static const unsigned int wl [wl_seq_length *wl_hgridcu]
 

Protected Member Functions

int step_int (double a)
 
int step_mod (int a, int b)
 
int step_div (int a, int b)
 

Detailed Description

This class contains constants and data structures that are common across all particle container classes. It contains constants setting the size of the underlying subgrid of blocks that forms the basis of the Voronoi cell computations. It also constructs bound tables that are used in the Voronoi cell computation, and contains a number of routines that are common across all container classes.

Definition at line 25 of file v_base.hh.

Constructor & Destructor Documentation

voro::voro_base::voro_base ( int  nx_,
int  ny_,
int  nz_,
double  boxx_,
double  boxy_,
double  boxz_ 
)

This function is called during container construction. The routine scans all of the worklists in the wl[] array. For a given worklist of blocks labeled $w_1$ to $w_n$, it computes a sequence $r_0$ to $r_n$ so that $r_i$ is the minimum distance to all the blocks $w_{j}$ where $j>i$ and all blocks outside the worklist. The values of $r_n$ is calculated first, as the minimum distance to any block in the shell surrounding the worklist. The $r_i$ are then computed in reverse order by considering the distance to $w_{i+1}$.

Definition at line 23 of file v_base.cc.

Member Function Documentation

bool voro::voro_base::contains_neighbor ( const char *  format)

Checks to see whether "%n" appears in a format sequence to determine whether neighbor information is required or not.

Parameters
[in]formatthe format string to check.
Returns
True if a "%n" is found, false otherwise.

Definition at line 100 of file v_base.cc.

int voro::voro_base::step_div ( int  a,
int  b 
)
inlineprotected

A custom integer division function that returns consistent stepping for negative numbers. For example, (-2,-1,0,1,2) step_div 2 is (-1,-1,0,0,1).

Parameters
[in](a,b)the input integers.
Returns
The value of a div b, consistent for negative numbers.

Definition at line 81 of file v_base.hh.

int voro::voro_base::step_int ( double  a)
inlineprotected

A custom int function that returns consistent stepping for negative numbers, so that (-1.5, -0.5, 0.5, 1.5) maps to (-2,-1,0,1).

Parameters
[in]athe number to consider.
Returns
The value of the custom int operation.

Definition at line 67 of file v_base.hh.

int voro::voro_base::step_mod ( int  a,
int  b 
)
inlineprotected

A custom modulo function that returns consistent stepping for negative numbers. For example, (-2,-1,0,1,2) step_mod 2 is (0,1,0,1,0).

Parameters
[in](a,b)the input integers.
Returns
The value of a modulo b, consistent for negative numbers.

Definition at line 74 of file v_base.hh.

Field Documentation

const double voro::voro_base::boxx

The size of a computational block in the x direction.

Definition at line 41 of file v_base.hh.

const double voro::voro_base::boxy

The size of a computational block in the y direction.

Definition at line 43 of file v_base.hh.

const double voro::voro_base::boxz

The size of a computational block in the z direction.

Definition at line 45 of file v_base.hh.

double* voro::voro_base::mrad

An array to hold the minimum distances associated with the worklists. This array is initialized during container construction, by the initialize_radii() routine.

Definition at line 55 of file v_base.hh.

const int voro::voro_base::nx

The number of blocks in the x direction.

Definition at line 28 of file v_base.hh.

const int voro::voro_base::nxy

A constant, set to the value of nx multiplied by ny, which is used in the routines that step through blocks in sequence.

Definition at line 36 of file v_base.hh.

const int voro::voro_base::nxyz

A constant, set to the value of nx*ny*nz, which is used in the routines that step through blocks in sequence.

Definition at line 39 of file v_base.hh.

const int voro::voro_base::ny

The number of blocks in the y direction.

Definition at line 30 of file v_base.hh.

const int voro::voro_base::nz

The number of blocks in the z direction.

Definition at line 32 of file v_base.hh.

const unsigned int voro_base::wl
static

The pre-computed block worklists.

Definition at line 57 of file v_base.hh.

const double voro::voro_base::xsp

The inverse box length in the x direction.

Definition at line 47 of file v_base.hh.

const double voro::voro_base::ysp

The inverse box length in the y direction.

Definition at line 49 of file v_base.hh.

const double voro::voro_base::zsp

The inverse box length in the z direction.

Definition at line 51 of file v_base.hh.


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