All Packages Class Hierarchy This Package Previous Next Index
Class AT.Ac.univie.imp.loeffler.pde.threeD.fd.Grid
java.lang.Object
|
+----AT.Ac.univie.imp.loeffler.pde.threeD.fd.Grid
- public abstract class Grid
- extends Object
- implements ConstGrid
A cubic grid in 3D whose elements are alterable doubles.
Each element of the grid is a double value and is uniquely identified by three non-negative integer indices.
The grid knows about the concept of a boundary, but the actual handling of the boundary elements is
deferred to subclasses.
The allowed indices rande from 0 to (size - 1) in each dimension, where 0 and (size - 1) themselves
characterise the boundary of the grid. Dependent on the boundary strategy of the subclass, accessing the
boundary elements may or may not be allowed.
- Author:
- Gerald Loeffler (Gerald.Loeffler@univie.ac.at)
-
g
-
-
s
-
-
Grid(int, double)
- construct from size and initial value for all elements.
-
add(ConstGrid)
- implements method from ConstGrid.
-
add(int, int, int, double)
- add to the element at the specified position, which must be in the interior of the grid.
-
clone()
- implements method from ConstGrid.
-
get(int, int, int)
- implements method from ConstGrid.
-
getBoundary(int, int, int)
- get an element from the boundary of the grid.
-
isBoundary(int, int, int)
- implements method from ConstGrid.
-
isInterior(int, int, int)
- implements method from ConstGrid.
-
newInstance(int, double)
- create a new grid with exactly the same handling of the boundary (i.e.
-
set(int, int, int, double)
- set the element at the specified position, which must be in the interior of the grid.
-
size()
- implements method from ConstGrid.
s
protected int s
g
protected double g[][][]
Grid
protected Grid(int size,
double value)
- construct from size and initial value for all elements.
The constructor allocates memory for the interior and the boundary of the grid, riscing that the
space for the boundary is wasted if a subclass decides to handle boundary elements differently.
- Parameters:
- size - the size of the grid ( > 0)
- value - the initial value to which all grid element will be set
get
public final double get(int x,
int y,
int z)
- implements method from ConstGrid.
- See Also:
- get
set
public final void set(int x,
int y,
int z,
double v)
- set the element at the specified position, which must be in the interior of the grid.
- Parameters:
- x - the x index of the element (1 <= x < (size() - 1))
- y - the y index of the element (1 <= y < (size() - 1))
- z - the z index of the element (1 <= z < (size() - 1))
- v - the value to which the element is to be set
add
public final void add(int x,
int y,
int z,
double v)
- add to the element at the specified position, which must be in the interior of the grid.
- Parameters:
- x - the x index of the element (1 <= x < (size() - 1))
- y - the y index of the element (1 <= y < (size() - 1))
- z - the z index of the element (1 <= z < (size() - 1))
- v - the value which is to be added to the element
size
public final int size()
- implements method from ConstGrid.
- See Also:
- size
isInterior
public final boolean isInterior(int x,
int y,
int z)
- implements method from ConstGrid.
- See Also:
- isInterior
isBoundary
public final boolean isBoundary(int x,
int y,
int z)
- implements method from ConstGrid.
- Parameters:
- x - the x index of the element
- y - the y index of the element
- z - the z index of the element
- Returns:
- true if the element is at the boundary of the grid, false otherwise
- See Also:
- isBoundary
clone
public synchronized Object clone()
- implements method from ConstGrid.
- Overrides:
- clone in class Object
- See Also:
- clone
add
public final synchronized Grid add(ConstGrid grid)
- implements method from ConstGrid.
- See Also:
- add
getBoundary
protected abstract double getBoundary(int x,
int y,
int z)
- get an element from the boundary of the grid.
- Parameters:
- x - the x index of the boundary element
- y - the y index of the boundary element
- z - the z index of the boundary element
- Returns:
- the element (a double value) at the specified position
- Throws: IndexOutOfBoundsException
- if read access to the boundary is not allowed
All Packages Class Hierarchy This Package Previous Next Index