Class Voro.container_periodic_poly_radius_poly

  • Enclosing class:
    Voro

    class Voro.container_periodic_poly_radius_poly
    extends Voro.container_periodic_base
    \brief Extension of the container_periodic_base class for computing radical Voronoi tessellations. This class is an extension of container_periodic_base that has routines specifically for computing the radical Voronoi tessellation that depends on the particle radii.
    • Field Detail

      • ppr

        public double[][] ppr
        A two-dimensional array holding particle positions and radii.
      • max_radius

        public double max_radius
        The current maximum radius of any particle, used to determine when to cut off the radical Voronoi computation.
      • r_rad

        private double r_rad
      • r_mul

        private double r_mul
      • r_val

        private double r_val
    • Constructor Detail

      • container_periodic_poly_radius_poly

        public container_periodic_poly_radius_poly​(double bx_,
                                                   double bxy_,
                                                   double by_,
                                                   double bxz_,
                                                   double byz_,
                                                   double bz_,
                                                   int nx_,
                                                   int ny_,
                                                   int nz_,
                                                   int init_mem_)
        The class constructor sets up the geometry of container. \param[in] (bx_) The x coordinate of the first unit vector. \param[in] (bxy_,by_) The x and y coordinates of the second unit vector. \param[in] (bxz_,byz_,bz_) The x, y, and z coordinates of the third unit vector. \param[in] (nx_,ny_,nz_) the number of grid blocks in each of the three coordinate directions. \param[in] init_mem_ the initial memory allocation for each block.
    • Method Detail

      • clear

        public void clear()
        Clears a container of particles, also clearing resetting the maximum radius to zero.
      • put

        public void put​(int n,
                        double x,
                        double y,
                        double z,
                        double r)
        Put a particle into the correct region of the container. \param[in] n the numerical ID of the inserted particle. \param[in] (x,y,z) the position vector of the inserted particle. \param[in] r the radius of the particle.
      • put

        public void put​(int n,
                        double x,
                        double y,
                        double z,
                        double r,
                        int[] ai,
                        int[] aj,
                        int[] ak)
        Put a particle into the correct region of the container. \param[in] n the numerical ID of the inserted particle. \param[in] (x,y,z) the position vector of the inserted particle. \param[in] r the radius of the particle. \param[out] (ai,aj,ak) the periodic image displacement that the particle is in, with (0,0,0) corresponding to the primary domain.
      • put

        public void put​(Voro.particle_order vo,
                        int n,
                        double x,
                        double y,
                        double z,
                        double r)
        Put a particle into the correct region of the container, also recording into which region it was stored. \param[in] vo the ordering class in which to record the region. \param[in] n the numerical ID of the inserted particle. \param[in] (x,y,z) the position vector of the inserted particle. \param[in] r the radius of the particle.
      • importList

        public void importList​(java.io.File fp)
        Import a list of particles from an open file stream into the container. Entries of five numbers (Particle ID, x position, y position, z position, radius) are searched for. If the file cannot be successfully read, then the routine causes a fatal error. \param[in] fp the file handle to read from.
      • importList

        public void importList​(Voro.particle_order vo,
                               java.io.File fp)
        Import a list of particles from an open file stream, also storing the order of that the particles are read. Entries of four numbers (Particle ID, x position, y position, z position, radius) are searched for. If the file cannot be successfully read, then the routine causes a fatal error. \param[in,out] vo a reference to an ordering class to use. \param[in] fp the file handle to read from.
      • importList

        public void importList​(java.lang.String filename)
        Imports a list of particles from an open file stream into the container_poly class. Entries of five numbers (Particle ID, x position, y position, z position, radius) are searched for. If the file cannot be successfully read, then the routine causes a fatal error. \param[in] filename the name of the file to open and read from.
      • importList

        public void importList​(Voro.particle_order vo,
                               java.lang.String filename)
        Imports a list of particles from an open file stream into the container_poly class. Entries of five numbers (Particle ID, x position, y position, z position, radius) are searched for. In addition, the order in which particles are read is saved into an ordering class. If the file cannot be successfully read, then the routine causes a fatal error. \param[in,out] vo the ordering class to use. \param[in] filename the name of the file to open and read from.
      • compute_all_cells

        public void compute_all_cells()
        Computes all of the Voronoi cells in the container, but does nothing with the output. It is useful for measuring the pure computation time of the Voronoi algorithm, without any additional calculations such as volume evaluation or cell output.
      • sum_cell_volumes

        public double sum_cell_volumes()
        Calculates all of the Voronoi cells and sums their volumes. In most cases without walls, the sum of the Voronoi cell volumes should equal the volume of the container to numerical precision. \return The sum of all of the computed Voronoi volumes.
      • draw_particles

        public void draw_particles​(Voro.c_loop_all_periodic vl,
                                   java.io.RandomAccessFile fp)
        Dumps particle IDs, positions and radii to a file. \param[in] vl the loop class to use. \param[in] fp a file handle to write to.
      • draw_particles

        public void draw_particles​(java.io.RandomAccessFile fp)
        Dumps all of the particle IDs, positions and radii to a file. \param[in] fp a file handle to write to.
      • draw_particles

        public void draw_particles​(java.lang.String filename)
        Dumps all of the particle IDs, positions and radii to a file. \param[in] filename the name of the file to write to.
      • draw_particles_pov

        public void draw_particles_pov​(Voro.c_loop_all_periodic vl,
                                       java.io.RandomAccessFile fp)
        Dumps particle positions in POV-Ray format. \param[in] vl the loop class to use. \param[in] fp a file handle to write to.
      • draw_particles_pov

        public void draw_particles_pov​(java.io.RandomAccessFile fp)
        Dumps all the particle positions in POV-Ray format. \param[in] fp a file handle to write to.
      • draw_particles_pov

        public void draw_particles_pov​(java.lang.String filename)
        Dumps all the particle positions in POV-Ray format. \param[in] filename the name of the file to write to.
      • draw_cells_gnuplot

        public void draw_cells_gnuplot​(Voro.c_loop_all_periodic vl,
                                       java.io.RandomAccessFile fp)
        Computes Voronoi cells and saves the output in gnuplot format. \param[in] vl the loop class to use. \param[in] fp a file handle to write to.
      • draw_cells_gnuplot

        public void draw_cells_gnuplot​(java.io.RandomAccessFile fp)
        Computes all Voronoi cells and saves the output in gnuplot format. \param[in] fp a file handle to write to.
      • draw_cells_gnuplot

        public void draw_cells_gnuplot​(java.lang.String filename)
        Computes all Voronoi cells and saves the output in gnuplot format. \param[in] filename the name of the file to write to.
      • draw_cells_pov

        public void draw_cells_pov​(Voro.c_loop_all_periodic vl,
                                   java.io.RandomAccessFile fp)
        Computes Voronoi cells and saves the output in POV-Ray format. \param[in] vl the loop class to use. \param[in] fp a file handle to write to.
      • draw_cells_pov

        public void draw_cells_pov​(java.io.RandomAccessFile fp)
        Computes all Voronoi cells and saves the output in POV-Ray format. \param[in] fp a file handle to write to.
      • draw_cells_pov

        public void draw_cells_pov​(java.lang.String filename)
        Computes all Voronoi cells and saves the output in POV-Ray format. \param[in] filename the name of the file to write to.
      • print_custom

        public void print_custom​(Voro.c_loop_all_periodic vl,
                                 char[] format,
                                 java.io.RandomAccessFile fp)
        Computes the Voronoi cells and saves customized information about them. \param[in] vl the loop class to use. \param[in] format the custom output string to use. \param[in] fp a file handle to write to.
      • compute_cell

        public boolean compute_cell​(Voro.voronoicell c,
                                    Voro.c_loop_all_periodic vl)
        Computes the Voronoi cell for a particle currently being referenced by a loop class. \param[out] c a Voronoi cell class in which to store the computed cell. \param[in] vl the loop class to use. \return True if the cell was computed. If the cell cannot be computed because it was removed entirely for some reason, then the routine returns false.
      • compute_cell

        public boolean compute_cell​(Voro.voronoicell c,
                                    int ijk,
                                    int q)
        Computes the Voronoi cell for given particle. \param[out] c a Voronoi cell class in which to store the computed cell. \param[in] ijk the block that the particle is within. \param[in] q the index of the particle within the block. \return True if the cell was computed. If the cell cannot be computed because it was removed entirely for some reason, then the routine returns false.
      • compute_ghost_cell

        public boolean compute_ghost_cell​(Voro.voronoicell c,
                                          double x,
                                          double y,
                                          double z,
                                          double r)
        Computes the Voronoi cell for a ghost particle at a given location. \param[out] c a Voronoi cell class in which to store the computed cell. \param[in] (x,y,z) the location of the ghost particle. \param[in] r the radius of the ghost particle. \return True if the cell was computed. If the cell cannot be computed, if it is removed entirely by a wall or boundary condition, then the routine returns false.
      • compute_ghost_cell

        public boolean compute_ghost_cell​(Voro.voronoicell_neighbor c,
                                          double x,
                                          double y,
                                          double z,
                                          double r)
      • print_custom

        public void print_custom​(char[] format,
                                 java.io.RandomAccessFile fp)
        Computes all the Voronoi cells and saves customized information about them. \param[in] format the custom output string to use. \param[in] fp a file handle to write to.
      • print_custom

        public void print_custom​(char[] format,
                                 java.lang.String filename)
        Computes all the Voronoi cells and saves customized information about them \param[in] format the custom output string to use. \param[in] filename the name of the file to write to.
      • find_voronoi_cell

        public boolean find_voronoi_cell​(double x,
                                         double y,
                                         double z,
                                         double[] rx,
                                         double[] ry,
                                         double[] rz,
                                         int[] pid)
        Takes a vector and finds the particle whose Voronoi cell contains that vector. Additional wall classes are not considered by this routine. \param[in] (x,y,z) the vector to test. \param[out] (rx,ry,rz) the position of the particle whose Voronoi cell contains the vector. If the container is periodic, this may point to a particle in a periodic image of the primary domain. \param[out] pid the ID of the particle. \return True if a particle was found. If the container has no particles, then the search will not find a Voronoi cell and false is returned.
      • radius_poly

        public void radius_poly()
        The class constructor sets the maximum particle radius to be zero.
      • r_init

        protected void r_init​(int ijk,
                              int s)
        This is called prior to computing a Voronoi cell for a given particle to initialize any required constants. \param[in] ijk the block that the particle is within. \param[in] s the index of the particle within the block.
      • r_prime

        protected void r_prime​(double rv)
        Sets a required constant to be used when carrying out a plane bounds check.
      • r_ctest

        protected boolean r_ctest​(double crs,
                                  double mrs)
        Carries out a radius bounds check. \param[in] crs the radius squared to be tested. \param[in] mrs the current maximum distance to a Voronoi vertex multiplied by two. \return True if particles at this radius could not possibly cut the cell, false otherwise.
      • r_cutoff

        protected double r_cutoff​(double lrs)
        Scales a plane displacement during a plane bounds check. \param[in] lrs the plane displacement. \return The scaled value.
      • r_max_add

        protected double r_max_add​(double rs)
        Adds the maximum radius squared to a given value. \param[in] rs the value to consider. \return The value with the radius squared added.
      • r_current_sub

        protected double r_current_sub​(double rs,
                                       int ijk,
                                       int q)
        Subtracts the radius squared of a particle from a given value. \param[in] rs the value to consider. \param[in] ijk the block that the particle is within. \param[in] q the index of the particle within the block. \return The value with the radius squared subtracted.
      • r_scale

        protected double r_scale​(double rs,
                                 int ijk,
                                 int q)
        Scales a plane displacement prior to use in the plane cutting algorithm. \param[in] rs the initial plane displacement. \param[in] ijk the block that the particle is within. \param[in] q the index of the particle within the block. \return The scaled plane displacement.
      • r_scale_check

        protected boolean r_scale_check​(double[] rs,
                                        double mrs,
                                        int ijk,
                                        int q)
        Scales a plane displacement prior to use in the plane cutting algorithm, and also checks if it could possibly cut the cell. \param[in,out] rs the plane displacement to be scaled. \param[in] mrs the current maximum distance to a Voronoi vertex multiplied by two. \param[in] ijk the block that the particle is within. \param[in] q the index of the particle within the block. \return True if the cell could possibly cut the cell, false otherwise.