Package gov.nih.mipav.model.structures
Class Voro.pre_container_base
java.lang.Object
gov.nih.mipav.model.structures.Voro.pre_container_base
- Direct Known Subclasses:
Voro.pre_container,Voro.pre_container_poly
- Enclosing class:
Voro
\brief A class for storing an arbitrary number of particles, prior to setting
up a container geometry.
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptiondoubleThe minimum x coordinate of the container.doubleThe minimum y coordinate of the container.doubleThe minimum z coordinate of the container.doubleThe maximum x coordinate of the container.doubleThe maximum y coordinate of the container.doubleThe maximum z coordinate of the container.protected intA pointer to the next available slot on the current particle ID chunk.protected intA pointer to the next available slot on the current floating point chunk.protected intA pointer to the end of the current integer chunk.protected intA pointer to the last allocated integer ID chunk.protected intA pointer to the last allocated chunk of floating point information.protected intThe size of the chunk index.protected intA pointer to the end of the integer ID chunk index, used to determine when the chunk index is full.protected int[][]A pointer to the chunk index to store the integer particle IDs.protected double[][]A pointer to the chunk index to store the floating point information associated with particles.protected intThe number of doubles associated with a single particle (three for the standard container, four when radius information is stored).booleanA boolean value that determines if the x coordinate in periodic or not.booleanA boolean value that determines if the y coordinate in periodic or not.booleanA boolean value that determines if the z coordinate in periodic or not. -
Constructor Summary
ConstructorsConstructorDescriptionpre_container_base(double ax_, double bx_, double ay_, double by_, double az_, double bz_, boolean xperiodic_, boolean yperiodic_, boolean zperiodic_, int ps_) The class constructor sets up the geometry of container, initializing the minimum and maximum coordinates in each direction. -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()The destructor frees the dynamically allocated memory.protected voidExtends the index of chunks.voidguess_optimal(int[] nx, int[] ny, int[] nz) Makes a guess at the optimal grid of blocks to use, computing in a way that \param[out] (nx,ny,nz) the number of blocks to use.protected voidAllocates a new chunk of memory for storing particles.intCalculates and returns the total number of particles stored within the class.
-
Field Details
-
ax
public double axThe minimum x coordinate of the container. -
bx
public double bxThe maximum x coordinate of the container. -
ay
public double ayThe minimum y coordinate of the container. -
by
public double byThe maximum y coordinate of the container. -
az
public double azThe minimum z coordinate of the container. -
bz
public double bzThe maximum z coordinate of the container. -
xperiodic
public boolean xperiodicA boolean value that determines if the x coordinate in periodic or not. -
yperiodic
public boolean yperiodicA boolean value that determines if the y coordinate in periodic or not. -
zperiodic
public boolean zperiodicA boolean value that determines if the z coordinate in periodic or not. -
ps
protected int psThe number of doubles associated with a single particle (three for the standard container, four when radius information is stored). -
index_sz
protected int index_szThe size of the chunk index. -
pre_id
protected int[][] pre_idA pointer to the chunk index to store the integer particle IDs. -
end_id_outer_index
protected int end_id_outer_indexA pointer to the last allocated integer ID chunk. -
l_id
protected int l_idA pointer to the end of the integer ID chunk index, used to determine when the chunk index is full. -
ch_id
protected int ch_idA pointer to the next available slot on the current particle ID chunk. -
e_id
protected int e_idA pointer to the end of the current integer chunk. -
pre_p
protected double[][] pre_pA pointer to the chunk index to store the floating point information associated with particles. -
end_p_outer_index
protected int end_p_outer_indexA pointer to the last allocated chunk of floating point information. -
ch_p
protected int ch_pA pointer to the next available slot on the current floating point chunk.
-
-
Constructor Details
-
pre_container_base
public pre_container_base(double ax_, double bx_, double ay_, double by_, double az_, double bz_, boolean xperiodic_, boolean yperiodic_, boolean 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. \param[in] (ax_,bx_) the minimum and maximum x coordinates. \param[in] (ay_,by_) the minimum and maximum y coordinates. \param[in] (az_,bz_) the minimum and maximum z coordinates. \param[in] (xperiodic_,yperiodic_,zperiodic_ ) flags setting whether the container is periodic in each coordinate direction. \param[in] ps_ the number of floating point entries to store for each particle.
-
-
Method Details
-
guess_optimal
public void guess_optimal(int[] nx, int[] ny, int[] nz) Makes a guess at the optimal grid of blocks to use, computing in a way that \param[out] (nx,ny,nz) the number of blocks to use. -
delete
public void delete()The destructor frees the dynamically allocated memory. -
total_particles
public int total_particles()Calculates and returns the total number of particles stored within the class. \return The number of particles. -
new_chunk
protected void new_chunk()Allocates a new chunk of memory for storing particles. -
extend_chunk_index
protected void extend_chunk_index()Extends the index of chunks.
-