Public Member Functions | Data Fields
voro::particle_order Class Reference

A class for storing ordering information when particles are added to a container. More...

#include <c_loops.hh>

Public Member Functions

 particle_order (int init_size=init_ordering_size)
 ~particle_order ()
void add (int ijk, int q)

Data Fields

int * o
int * op
int size

Detailed Description

When particles are added to a container class, they are sorted into an internal computational grid of blocks. The particle_order class provides a mechanism for remembering which block particles were sorted into. The import and put routines in the container class have variants that also take a particle_order class. Each time they are called, they will store the block that the particle was sorted into, plus the position of the particle within the block. The particle_order class can used by the c_loop_order class to specifically loop over the particles that have their information stored within it.

Definition at line 37 of file c_loops.hh.

Constructor & Destructor Documentation

voro::particle_order::particle_order ( int  init_size = init_ordering_size)

The particle_order constructor allocates memory to store the ordering information.

[in]init_sizethe initial amount of memory to allocate.

Definition at line 51 of file c_loops.hh.

voro::particle_order::~particle_order ( )

The particle_order destructor frees the dynamically allocated memory used to store the ordering information.

Definition at line 55 of file c_loops.hh.

Member Function Documentation

void voro::particle_order::add ( int  ijk,
int  q 

Adds a record to the order, corresponding to the memory address of where a particle was placed into the container.

[in]ijkthe block into which the particle was placed.
[in]qthe position within the block where the particle was placed.

Definition at line 63 of file c_loops.hh.

Field Documentation

int* voro::particle_order::o

A pointer to the array holding the ordering.

Definition at line 40 of file c_loops.hh.

int* voro::particle_order::op

A pointer to the next position in the ordering array in which to store an entry.

Definition at line 43 of file c_loops.hh.

int voro::particle_order::size

The current memory allocation for the class, set to the number of entries which can be stored.

Definition at line 46 of file c_loops.hh.

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