UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
voro::container_base Class Reference

Class for representing a particle system in a three-dimensional rectangular box. More...

#include <container.hh>

+ Inheritance diagram for voro::container_base:

Public Member Functions

 container_base (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, int ps_)
 
 container_base (container_base &Other)=delete
 
container_baseoperator= (const container_base &Other)=delete
 
 container_base (container_base &&Other) noexcept
 
container_baseoperator= (container_base &&Other)=delete
 
 ~container_base ()
 
bool point_inside (double x, double y, double z) const
 
void region_count () const
 
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) const
 
void initialize_search (int ci, int cj, int ck, int ijk, int &i, int &j, int &k, int &disp) const
 
void frac_pos (double x, double y, double z, double ci, double cj, double ck, double &fx, double &fy, double &fz) const
 
int region_index (int ci, int cj, int ck, int ei, int ej, int ek, double &qx, double &qy, double &qz, int &disp) const
 
int total_particles () const
 
- Public Member Functions inherited from voro::voro_base
bool contains_neighbor (const char *format) const
 
 voro_base (int nx_, int ny_, int nz_, double boxx_, double boxy_, double boxz_)
 
 voro_base (const voro_base &Other)=delete
 
voro_baseoperator= (const voro_base &Other)=delete
 
 voro_base (voro_base &&Other) noexcept
 
voro_baseoperator= (voro_base &&Other)=delete
 
 ~voro_base ()
 
- Public Member Functions inherited from voro::wall_list
 wall_list ()
 
 wall_list (const wall_list &Other)=delete
 
wall_listoperator= (const wall_list &Other)=delete
 
 wall_list (wall_list &&Other) noexcept
 
wall_listoperator= (wall_list &&Other)
 
 ~wall_list ()
 
void add_wall (wall *w)
 
void add_wall (wall &w)
 
void add_wall (wall_list &wl)
 
bool point_inside_walls (double x, double y, double z) const
 
template<class c_class >
bool apply_walls (c_class &c, double x, double y, double z) const
 
void deallocate ()
 

Public Attributes

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
 
int ** id
 
double ** p
 
int * co
 
int * mem
 
const int ps
 
- Public Attributes 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
 
doublemrad
 
- Public Attributes inherited from voro::wall_list
wall ** walls
 
wall ** wep
 

Protected Member Functions

void add_particle_memory (int i)
 
bool put_locate_block (int &ijk, double &x, double &y, double &z)
 
bool put_remap (int &ijk, double &x, double &y, double &z) const
 
bool remap (int &ai, int &aj, int &ak, int &ci, int &cj, int &ck, double &x, double &y, double &z, int &ijk) const
 
- Protected Member Functions inherited from voro::voro_base
int step_int (double a) const
 
int step_mod (int a, int b) const
 
int step_div (int a, int b) const
 
- Protected Member Functions inherited from voro::wall_list
void increase_wall_memory ()
 

Additional Inherited Members

- Static Public Attributes inherited from voro::voro_base
static const unsigned int wl [wl_seq_length *wl_hgridcu]
 
- Protected Attributes inherited from voro::wall_list
wall ** wel
 
int current_wall_size
 

Detailed Description

Class for representing a particle system in a three-dimensional rectangular box.

This class represents a system of particles in a three-dimensional rectangular box. Any combination of non-periodic and periodic coordinates can be used in the three coordinate directions. The class is not intended for direct use, but instead forms the base of the container and container_poly classes that add specialized routines for computing the regular and radical Voronoi tessellations respectively. It contains routines that are commonly between these two classes, such as those for drawing the domain, and placing particles within the internal data structure.

The class is derived from the wall_list class, which encapsulates routines for associating walls with the container, and the voro_base class, which encapsulates routines about the underlying computational grid.

Constructor & Destructor Documentation

◆ container_base() [1/3]

voro::container_base::container_base ( 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,
int  ps_ 
)

The class constructor sets up the geometry of container, initializing the minimum and maximum coordinates in each direction, and setting whether each direction is periodic or not. It divides the container into a rectangular grid of blocks, and allocates memory for each of these for storing particle positions and IDs.

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.
[in]ps_the number of floating point entries to store for each particle.

◆ container_base() [2/3]

voro::container_base::container_base ( container_base Other)
delete

◆ container_base() [3/3]

voro::container_base::container_base ( container_base &&  Other)
inlinenoexcept

◆ ~container_base()

voro::container_base::~container_base ( )

The container destructor frees the dynamically allocated memory.

Member Function Documentation

◆ add_particle_memory()

void voro::container_base::add_particle_memory ( int  i)
protected

Increase memory for a particular region.

Parameters
[in]ithe index of the region to reallocate.

◆ frac_pos()

void voro::container_base::frac_pos ( double  x,
double  y,
double  z,
double  ci,
double  cj,
double  ck,
double fx,
double fy,
double fz 
) const
inline

Returns the position of a particle currently being computed relative to the computational block that it is within. It is used to select the optimal worklist entry to use.

Parameters
[in](x,y,z)the position of the particle.
[in](ci,cj,ck)the block that the particle is within.
[out](fx,fy,fz)the position relative to the block.

◆ initialize_search()

void voro::container_base::initialize_search ( int  ci,
int  cj,
int  ck,
int  ijk,
int &  i,
int &  j,
int &  k,
int &  disp 
) const
inline

Initializes parameters for a find_voronoi_cell call within the voro_compute template.

Parameters
[in](ci,cj,ck)the coordinates of the test block in the container coordinate system.
[in]ijkthe index of the test block
[out](i,j,k)the coordinates of the test block relative to the voro_compute coordinate system.
[out]dispa block displacement used internally by the find_voronoi_cell routine.

◆ initialize_voronoicell()

template<class v_cell >
bool voro::container_base::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 
) const
inline

Initializes the Voronoi cell prior to a compute_cell operation for a specific particle being carried out by a voro_compute class. The cell is initialized to fill the entire container. For non-periodic coordinates, this is set by the position of the walls. For periodic coordinates, the space is equally divided in either direction from the particle's initial position. Plane cuts made by any walls that have been added are then applied to the cell.

Parameters
[in,out]ca reference to a voronoicell object.
[in]ijkthe block that the particle is within.
[in]qthe index of the particle within its block.
[in](ci,cj,ck)the coordinates of the block in the container coordinate system.
[out](i,j,k)the coordinates of the test block relative to the voro_compute coordinate system.
[out](x,y,z)the position of the particle.
[out]dispa block displacement used internally by the compute_cell routine.
Returns
False if the plane cuts applied by walls completely removed the cell, true otherwise.

◆ operator=() [1/2]

container_base & voro::container_base::operator= ( const container_base Other)
delete

◆ operator=() [2/2]

container_base & voro::container_base::operator= ( container_base &&  Other)
delete

◆ point_inside()

bool voro::container_base::point_inside ( double  x,
double  y,
double  z 
) const

This function tests to see if a given vector lies within the container bounds and any walls.

Parameters
[in](x,y,z)the position vector to be tested.
Returns
True if the point is inside the container, false if the point is outside.

◆ put_locate_block()

bool voro::container_base::put_locate_block ( int &  ijk,
double x,
double y,
double z 
)
protected

This routine takes a particle position vector, tries to remap it into the primary domain. If successful, it computes the region into which it can be stored and checks that there is enough memory within this region to store it.

Parameters
[out]ijkthe region index.
[in,out](x,y,z)the particle position, remapped into the primary domain if necessary.
Returns
True if the particle can be successfully placed into the container, false otherwise.

◆ put_remap()

bool voro::container_base::put_remap ( int &  ijk,
double x,
double y,
double z 
) const
inlineprotected

Takes a particle position vector and computes the region index into which it should be stored. If the container is periodic, then the routine also maps the particle position to ensure it is in the primary domain. If the container is not periodic, the routine bails out.

Parameters
[out]ijkthe region index.
[in,out](x,y,z)the particle position, remapped into the primary domain if necessary.
Returns
True if the particle can be successfully placed into the container, false otherwise.

◆ region_count()

void voro::container_base::region_count ( ) const

Outputs the a list of all the container regions along with the number of particles stored within each.

◆ region_index()

int voro::container_base::region_index ( int  ci,
int  cj,
int  ck,
int  ei,
int  ej,
int  ek,
double qx,
double qy,
double qz,
int &  disp 
) const
inline

Calculates the index of block in the container structure corresponding to given coordinates.

Parameters
[in](ci,cj,ck)the coordinates of the original block in the current computation, relative to the container coordinate system.
[in](ei,ej,ek)the displacement of the current block from the original block.
[in,out](qx,qy,qz)the periodic displacement that must be added to the particles within the computed block.
[in]dispa block displacement used internally by the find_voronoi_cell and compute_cell routines.
Returns
The block index.

◆ remap()

bool voro::container_base::remap ( int &  ai,
int &  aj,
int &  ak,
int &  ci,
int &  cj,
int &  ck,
double x,
double y,
double z,
int &  ijk 
) const
inlineprotected

Takes a position vector and attempts to remap it into the primary domain.

Parameters
[out](ai,aj,ak)the periodic image displacement that the vector is in, with (0,0,0) corresponding to the primary domain.
[out](ci,cj,ck)the index of the block that the position vector is within, once it has been remapped.
[in,out](x,y,z)the position vector to consider, which is remapped into the primary domain during the routine.
[out]ijkthe block index that the vector is within.
Returns
True if the particle is within the container or can be remapped into it, false if it lies outside of the container bounds.

◆ total_particles()

int voro::container_base::total_particles ( ) const
inline

Sums up the total number of stored particles.

Returns
The number of particles.

Member Data Documentation

◆ ax

const double voro::container_base::ax

The minimum x coordinate of the container.

◆ ay

const double voro::container_base::ay

The minimum y coordinate of the container.

◆ az

const double voro::container_base::az

The minimum z coordinate of the container.

◆ bx

const double voro::container_base::bx

The maximum x coordinate of the container.

◆ by

const double voro::container_base::by

The maximum y coordinate of the container.

◆ bz

const double voro::container_base::bz

The maximum z coordinate of the container.

◆ co

int* voro::container_base::co

This array holds the number of particles within each computational box of the container.

◆ id

int** voro::container_base::id

This array holds the numerical IDs of each particle in each computational box.

◆ mem

int* voro::container_base::mem

This array holds the maximum amount of particle memory for each computational box of the container. If the number of particles in a particular box ever approaches this limit, more is allocated using the add_particle_memory() function.

◆ p

double** voro::container_base::p

A two dimensional array holding particle positions. For the derived container_poly class, this also holds particle radii.

◆ ps

const int voro::container_base::ps

The amount of memory in the array structure for each particle. This is set to 3 when the basic class is initialized, so that the array holds (x,y,z) positions. If the container class is initialized as part of the derived class container_poly, then this is set to 4, to also hold the particle radii.

◆ xperiodic

const bool voro::container_base::xperiodic

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

◆ yperiodic

const bool voro::container_base::yperiodic

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

◆ zperiodic

const bool voro::container_base::zperiodic

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


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