ru.sscc.spline.mesh
Class UniformMesh
java.lang.Object
|
+--ru.sscc.spline.mesh.SimpleMesh
|
+--ru.sscc.spline.mesh.UniformMesh
- public class UniformMesh
- extends SimpleMesh
The implementation of 1D uniform mesh.
- See Also:
- Serialized Form
Constructor Summary |
UniformMesh(double origin,
double step,
int count)
Constructs an uniform mesh. |
Method Summary |
double |
averageStep()
Returns an average mesh step. |
double |
distance(int i,
int j)
Returns a distance between i-th and j-th nodes of transformed mesh,
e.g. |
double |
extendedMeshDistance(int i,
int j)
Returns a distance between i-th and j-th nodes of the extended mesh. |
void |
findCell(SimpleMeshWorkspace workspace,
double x)
Finds a mesh cell to which a point belongs. |
double |
get(int i)
Returns a value of i-th mesh node in the original coordinate system. |
boolean |
isUniform()
Returns a mesh uniformness tag. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
UniformMesh
public UniformMesh(double origin,
double step,
int count)
- Constructs an uniform mesh. The affine transform of
the original mesh is applied in such a way to convert the first and
the last mesh nodes to 0 and n-1 correspondingly (here n is a nodes
number).
- Parameters:
origin
- a first mesh nodestep
- a distance between nodescount
- a number of mesh nodes
averageStep
public double averageStep()
- Returns an average mesh step.
- Overrides:
- averageStep in class SimpleMesh
findCell
public void findCell(SimpleMeshWorkspace workspace,
double x)
- Finds a mesh cell to which a point belongs. Writes the cell index
and a position within the cell (a distance in new coordinates from
the left cell bound) into workspace's attributes cellIndex
and cellPoint.
- Overrides:
- findCell in class SimpleMesh
- Parameters:
workspace
- a mesh workspacex
- a point (in original coordinates) to search
get
public final double get(int i)
- Returns a value of i-th mesh node in the original coordinate system.
- Overrides:
- get in class SimpleMesh
isUniform
public final boolean isUniform()
- Returns a mesh uniformness tag.
- Overrides:
- isUniform in class SimpleMesh
distance
public final double distance(int i,
int j)
- Returns a distance between i-th and j-th nodes of transformed mesh,
e.g. the value ti-tj.
- Overrides:
- distance in class SimpleMesh
extendedMeshDistance
public final double extendedMeshDistance(int i,
int j)
- Returns a distance between i-th and j-th nodes of the extended mesh.
- Overrides:
- extendedMeshDistance in class SimpleMesh