Class GridGenerator


  • public class GridGenerator
    extends Object
    Generates a grid of points in 3D space within given boundaries.
    Author:
    cho
    Source code:
    main
    Created on:
    2005-09-30
    • Constructor Detail

      • GridGenerator

        public GridGenerator()
      • GridGenerator

        public GridGenerator​(double min,
                             double max)
      • GridGenerator

        public GridGenerator​(double min,
                             double max,
                             double initialValue)
        Parameters:
        initialValue - used as initial value for the grid points
      • GridGenerator

        public GridGenerator​(double[] minMax,
                             double initialValue,
                             boolean cubicGridFlag)
    • Method Detail

      • setDimension

        public void setDimension​(double min,
                                 double max)
        Method sets the maximal 3d dimensions to given min and max values.
      • setDimension

        public void setDimension​(double[] minMax,
                                 boolean cubicGridFlag)
        Method sets the maximal 3d dimensions to given min and max values.
      • setDimension

        public void setDimension​(double minx,
                                 double maxx,
                                 double miny,
                                 double maxy,
                                 double minz,
                                 double maxz)
        Method sets the maximal 3d dimensions to given min and max values.
      • generateGrid

        public void generateGrid()
        Main method creates a grid between given boundaries (dimensions). The grid my be extended over the given boundaries with the variable extendGrid.
      • initializeGrid

        public void initializeGrid​(double value)
        Method initialise the given grid points with a value.
      • initializeGrid

        public double[][][] initializeGrid​(double[][][] grid,
                                           double value)
        Method initialise the given grid points with a value.
      • gridToGridArray

        public double[] gridToGridArray​(double[][][] grid)
        Method transforms the grid to an array.
      • getCoordinatesFromGridPoint

        public javax.vecmath.Point3d getCoordinatesFromGridPoint​(javax.vecmath.Point3d gridPoint)
        Method calculates coordinates from a given grid point.
      • getCoordinatesFromGridPoint

        public javax.vecmath.Point3d getCoordinatesFromGridPoint​(int gridPoint)
        Method calculates coordinates from a given grid array position.
      • getGridPointFrom3dCoordinates

        public javax.vecmath.Point3d getGridPointFrom3dCoordinates​(javax.vecmath.Point3d coord)
                                                            throws Exception
        Method calculates the nearest grid point from given coordinates.
        Throws:
        Exception
      • writeGridInPmeshFormat

        public void writeGridInPmeshFormat​(String outPutFileName)
                                    throws IOException
        Method transforms the grid into pmesh format.
        Throws:
        IOException
      • writeGridInPmeshFormat

        public void writeGridInPmeshFormat​(String outPutFileName,
                                           double cutOff)
                                    throws IOException
        Method transforms the grid into pmesh format. Only grid points with specific value defined with cutoff are considered.
        
         cutoff <0, the values considered must be <=cutoff
         cutoff >0, the values considered must be >=cutoff
         
        Throws:
        IOException
      • getDim

        public int[] getDim()
        Returns:
        Returns the dim.
      • setDim

        public void setDim​(int[] dim)
        Parameters:
        dim - The dim to set.
      • getExtendGrid

        public double getExtendGrid()
        Returns:
        Returns the extendGrid.
      • setExtendGrid

        public void setExtendGrid​(double extendGrid)
        Parameters:
        extendGrid - The extendGrid to set.
      • getGrid

        public double[][][] getGrid()
        Returns:
        Returns the grid.
      • setGrid

        public void setGrid​(double[][][] grid)
        Parameters:
        grid - The grid to set.
      • getLatticeConstant

        public double getLatticeConstant()
        Returns:
        Returns the latticeConstant.
      • setLatticeConstant

        public void setLatticeConstant​(double latticeConstant)
        Parameters:
        latticeConstant - The latticeConstant to set.
      • getGridArray

        public double[] getGridArray()
        Returns:
        Returns the gridArray.
      • getMaxx

        public double getMaxx()
        Returns:
        Returns the maxx.
      • getMaxy

        public double getMaxy()
        Returns:
        Returns the maxy.
      • getMaxz

        public double getMaxz()
        Returns:
        Returns the maxz.
      • getMinx

        public double getMinx()
        Returns:
        Returns the minx.
      • getMiny

        public double getMiny()
        Returns:
        Returns the miny.
      • getMinz

        public double getMinz()
        Returns:
        Returns the minz.