Class Voro.pre_container_base

  • Direct Known Subclasses:
    Voro.pre_container, Voro.pre_container_poly
    Enclosing class:
    Voro

    class Voro.pre_container_base
    extends java.lang.Object
    \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

      Fields 
      Modifier and Type Field Description
      double ax
      The minimum x coordinate of the container.
      double ay
      The minimum y coordinate of the container.
      double az
      The minimum z coordinate of the container.
      double bx
      The maximum x coordinate of the container.
      double by
      The maximum y coordinate of the container.
      double bz
      The maximum z coordinate of the container.
      protected int ch_id
      A pointer to the next available slot on the current particle ID chunk.
      protected int ch_p
      A pointer to the next available slot on the current floating point chunk.
      protected int e_id
      A pointer to the end of the current integer chunk.
      protected int end_id_outer_index
      A pointer to the last allocated integer ID chunk.
      protected int end_p_outer_index
      A pointer to the last allocated chunk of floating point information.
      protected int index_sz
      The size of the chunk index.
      protected int l_id
      A pointer to the end of the integer ID chunk index, used to determine when the chunk index is full.
      protected int[][] pre_id
      A pointer to the chunk index to store the integer particle IDs.
      protected double[][] pre_p
      A pointer to the chunk index to store the floating point information associated with particles.
      protected int ps
      The number of doubles associated with a single particle (three for the standard container, four when radius information is stored).
      boolean xperiodic
      A boolean value that determines if the x coordinate in periodic or not.
      boolean yperiodic
      A boolean value that determines if the y coordinate in periodic or not.
      boolean zperiodic
      A boolean value that determines if the z coordinate in periodic or not.
    • Constructor Summary

      Constructors 
      Constructor Description
      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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void delete()
      The destructor frees the dynamically allocated memory.
      protected void extend_chunk_index()
      Extends the index of chunks.
      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.
      protected void new_chunk()
      Allocates a new chunk of memory for storing particles.
      int total_particles()
      Calculates and returns the total number of particles stored within the class.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ax

        public double ax
        The minimum x coordinate of the container.
      • bx

        public double bx
        The maximum x coordinate of the container.
      • ay

        public double ay
        The minimum y coordinate of the container.
      • by

        public double by
        The maximum y coordinate of the container.
      • az

        public double az
        The minimum z coordinate of the container.
      • bz

        public double bz
        The maximum z coordinate of the container.
      • xperiodic

        public boolean xperiodic
        A boolean value that determines if the x coordinate in periodic or not.
      • yperiodic

        public boolean yperiodic
        A boolean value that determines if the y coordinate in periodic or not.
      • zperiodic

        public boolean zperiodic
        A boolean value that determines if the z coordinate in periodic or not.
      • ps

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

        protected int index_sz
        The size of the chunk index.
      • pre_id

        protected int[][] pre_id
        A pointer to the chunk index to store the integer particle IDs.
      • end_id_outer_index

        protected int end_id_outer_index
        A pointer to the last allocated integer ID chunk.
      • l_id

        protected int l_id
        A pointer to the end of the integer ID chunk index, used to determine when the chunk index is full.
      • ch_id

        protected int ch_id
        A pointer to the next available slot on the current particle ID chunk.
      • e_id

        protected int e_id
        A pointer to the end of the current integer chunk.
      • pre_p

        protected double[][] pre_p
        A pointer to the chunk index to store the floating point information associated with particles.
      • end_p_outer_index

        protected int end_p_outer_index
        A pointer to the last allocated chunk of floating point information.
      • ch_p

        protected int ch_p
        A pointer to the next available slot on the current floating point chunk.
    • Constructor Detail

      • 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 Detail

      • 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.