Package org.openscience.cdk.tools
Class GridGenerator
- java.lang.Object
-
- org.openscience.cdk.tools.GridGenerator
-
-
Constructor Summary
Constructors Constructor Description GridGenerator()
GridGenerator(double[] minMax, double initialValue, boolean cubicGridFlag)
GridGenerator(double min, double max)
GridGenerator(double min, double max, double initialValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
generateGrid()
Main method creates a grid between given boundaries (dimensions).javax.vecmath.Point3d
getCoordinatesFromGridPoint(int gridPoint)
Method calculates coordinates from a given grid array position.javax.vecmath.Point3d
getCoordinatesFromGridPoint(javax.vecmath.Point3d gridPoint)
Method calculates coordinates from a given grid point.int[]
getDim()
double
getExtendGrid()
double[][][]
getGrid()
double[]
getGridArray()
javax.vecmath.Point3d
getGridPointFrom3dCoordinates(javax.vecmath.Point3d coord)
Method calculates the nearest grid point from given coordinates.double
getLatticeConstant()
double
getMaxx()
double
getMaxy()
double
getMaxz()
double
getMinx()
double
getMiny()
double
getMinz()
double[]
gridToGridArray(double[][][] grid)
Method transforms the grid to an array.void
initializeGrid(double value)
Method initialise the given grid points with a value.double[][][]
initializeGrid(double[][][] grid, double value)
Method initialise the given grid points with a value.void
setDim(int[] dim)
void
setDimension(double[] minMax, boolean cubicGridFlag)
Method sets the maximal 3d dimensions to given min and max values.void
setDimension(double min, double max)
Method sets the maximal 3d dimensions to given min and max values.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.void
setExtendGrid(double extendGrid)
void
setGrid(double[][][] grid)
void
setLatticeConstant(double latticeConstant)
String
toString()
void
writeGridInPmeshFormat(String outPutFileName)
Method transforms the grid into pmesh format.void
writeGridInPmeshFormat(String outPutFileName, double cutOff)
Method transforms the grid into pmesh format.
-
-
-
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.
-
-