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

A class for storing an arbitrary number of particles, prior to setting up a container geometry. More...

#include <pre_container.hh>

+ Inheritance diagram for voro::pre_container_base:

Public Member Functions

void guess_optimal (int &nx, int &ny, int &nz)
 
 pre_container_base (double ax_, double bx_, double ay_, double by_, double az_, double bz_, bool xperiodic_, bool yperiodic_, bool zperiodic_, int ps_)
 
 ~pre_container_base ()
 
int total_particles ()
 

Data Fields

const double ax
 
const double bx
 
const double ay
 
const double by
 
const double az
 
const double bz
 
const bool xperiodic
 
const bool yperiodic
 
const bool zperiodic
 

Protected Member Functions

void new_chunk ()
 
void extend_chunk_index ()
 

Protected Attributes

const int ps
 
int index_sz
 
int ** pre_id
 
int ** end_id
 
int ** l_id
 
int * ch_id
 
int * e_id
 
double ** pre_p
 
double ** end_p
 
double * ch_p
 

Detailed Description

The pre_container_base class can dynamically import and store an arbitrary number of particles. Once the particles have been read in, an appropriate container class can be set up with the optimal grid size, and the particles can be transferred.

The pre_container_base class is not intended for direct use, but forms the base of the pre_container and pre_container_poly classes, that add routines depending on whether particle radii need to be tracked or not.

Definition at line 31 of file pre_container.hh.

Constructor & Destructor Documentation

voro::pre_container_base::pre_container_base ( double  ax_,
double  bx_,
double  ay_,
double  by_,
double  az_,
double  bz_,
bool  xperiodic_,
bool  yperiodic_,
bool  zperiodic_,
int  ps_ 
)

The class constructor sets up the geometry of container, initializing the minimum and maximum coordinates in each direction. It allocates an initial chunk into which to store particle information.

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](xperiodic_,yperiodic_,zperiodic_) flags setting whether the container is periodic in each coordinate direction.
[in]ps_the number of floating point entries to store for each particle.

Definition at line 29 of file pre_container.cc.

voro::pre_container_base::~pre_container_base ( )

The destructor frees the dynamically allocated memory.

Definition at line 41 of file pre_container.cc.

Member Function Documentation

void voro::pre_container_base::extend_chunk_index ( )
protected

Extends the index of chunks.

Definition at line 219 of file pre_container.cc.

void voro::pre_container_base::guess_optimal ( int &  nx,
int &  ny,
int &  nz 
)

Makes a guess at the optimal grid of blocks to use, computing in a way that

Parameters
[out](nx,ny,nz)the number of blocks to use.

Definition at line 57 of file pre_container.cc.

void voro::pre_container_base::new_chunk ( )
protected

Allocates a new chunk of memory for storing particles.

Definition at line 210 of file pre_container.cc.

int voro::pre_container_base::total_particles ( )
inline

Calculates and returns the total number of particles stored within the class.

Returns
The number of particles.

Definition at line 60 of file pre_container.hh.

Field Documentation

const double voro::pre_container_base::ax

The minimum x coordinate of the container.

Definition at line 34 of file pre_container.hh.

const double voro::pre_container_base::ay

The minimum y coordinate of the container.

Definition at line 38 of file pre_container.hh.

const double voro::pre_container_base::az

The minimum z coordinate of the container.

Definition at line 42 of file pre_container.hh.

const double voro::pre_container_base::bx

The maximum x coordinate of the container.

Definition at line 36 of file pre_container.hh.

const double voro::pre_container_base::by

The maximum y coordinate of the container.

Definition at line 40 of file pre_container.hh.

const double voro::pre_container_base::bz

The maximum z coordinate of the container.

Definition at line 44 of file pre_container.hh.

int* voro::pre_container_base::ch_id
protected

A pointer to the next available slot on the current particle ID chunk.

Definition at line 82 of file pre_container.hh.

double* voro::pre_container_base::ch_p
protected

A pointer to the next available slot on the current floating point chunk.

Definition at line 93 of file pre_container.hh.

int* voro::pre_container_base::e_id
protected

A pointer to the end of the current integer chunk.

Definition at line 84 of file pre_container.hh.

int** voro::pre_container_base::end_id
protected

A pointer to the last allocated integer ID chunk.

Definition at line 76 of file pre_container.hh.

double** voro::pre_container_base::end_p
protected

A pointer to the last allocated chunk of floating point information.

Definition at line 90 of file pre_container.hh.

int voro::pre_container_base::index_sz
protected

The size of the chunk index.

Definition at line 71 of file pre_container.hh.

int** voro::pre_container_base::l_id
protected

A pointer to the end of the integer ID chunk index, used to determine when the chunk index is full.

Definition at line 79 of file pre_container.hh.

int** voro::pre_container_base::pre_id
protected

A pointer to the chunk index to store the integer particle IDs.

Definition at line 74 of file pre_container.hh.

double** voro::pre_container_base::pre_p
protected

A pointer to the chunk index to store the floating point information associated with particles.

Definition at line 87 of file pre_container.hh.

const int voro::pre_container_base::ps
protected

The number of doubles associated with a single particle (three for the standard container, four when radius information is stored).

Definition at line 67 of file pre_container.hh.

const bool voro::pre_container_base::xperiodic

A boolean value that determines if the x coordinate in periodic or not.

Definition at line 47 of file pre_container.hh.

const bool voro::pre_container_base::yperiodic

A boolean value that determines if the y coordinate in periodic or not.

Definition at line 50 of file pre_container.hh.

const bool voro::pre_container_base::zperiodic

A boolean value that determines if the z coordinate in periodic or not.

Definition at line 53 of file pre_container.hh.


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