Interface MiCell
-
- All Known Subinterfaces:
MeXLineCell
,MeXSurfaceCell
,MiLineCell
,MiSurfaceCell
,MiVolumeCell
public interface MiCell
Defines a cell of a mesh.A cell is a basic volume, surface or edge element that connects adjacent nodes of a mesh. The MiCell interface is necessary to define the topology of unstructured 1D, 2D or 3D meshes.
MiCell
is the base interface that defines topological characteristics of a cell (characteristics not depending on the cell dimension):- the number of nodes: see
getNumNodes()
- the node index: see
getNodeIndex(int)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description double[]
getCenter(MiGeometryI geometry)
Gets the center of this cell.long
getNodeIndex(int node)
Gets the index (in the mesh) of a node.int
getNumNodes()
Gets the number of nodes.double
getRelativeSize(MiGeometryI meshGeometry)
Gets the relative size of the cell.boolean
isPointInsideCell(MiGeometryI meshGeometry, double[] point, double[] weights)
Checks if a point is inside or outside this cell.
-
-
-
Method Detail
-
getNumNodes
int getNumNodes()
Gets the number of nodes.- Returns:
- nodes number of this cell
-
getNodeIndex
long getNodeIndex(int node)
Gets the index (in the mesh) of a node.- Parameters:
node
- node number (where:0 <= node < getNumNodes
)- Returns:
- node index in the mesh
-
isPointInsideCell
boolean isPointInsideCell(MiGeometryI meshGeometry, double[] point, double[] weights)
Checks if a point is inside or outside this cell.If the point is inside this cell, the specified array is filled with weight values of the point. A weight value (aka shape function) must be given for each node of the cell, see chapter "Properties of shape functions" in the User's Guide for more details.
This method is not used by all extraction classes but it is needed for streamline extraction for example.
Note: For extraction purpose only, it is not necessary to allocate the weight array since extraction classes are optimized such as weight arrays passed to this method are already allocated and large enough to retrieve all the computed weights. Thus the following assignment is then sufficient:
weight[i] = wi for each i with 0 <= i < getNumNodes
- Parameters:
meshGeometry
- the geometry of the mesh. It is used to retrieve the node coordinates of this cellpoint
- coordinates {x,y,z} of point to be checkedweights
- the array into which the weight values are to be stored, it must contain at least as many elements as the number of nodes in this cell.- Returns:
true
if the point is inside this cell
-
getCenter
double[] getCenter(MiGeometryI geometry)
Gets the center of this cell.This method is not used by all extraction classes.
- Parameters:
geometry
- the geometry of the mesh. It is used to retrieve the node coordinates- Returns:
- the center coordinates {x,y,z} of this cell
-
getRelativeSize
double getRelativeSize(MiGeometryI meshGeometry)
Gets the relative size of the cell.This method is used only by the
MoMeshCellShape
to display node names if using the relative offset feature and the streamline extraction to adapt the step integration to the size of the cell.getRelativeSize
should return a value depending on the size of the cell. For instance,getRelativeSize
can return the length of the longest edge of this cell, or the length of its diagonal.If
getRelativeSize
returns a constant value for any cell, the stream line extraction uses a constant number of step integration anywhere in the mesh. Returning a constant implies that all the cells are supposed to have the same size.getRelativeSize
) must not return 0.- Parameters:
meshGeometry
- the geometry of the mesh. It is used to retrieve the node coordinates of this cell.- Returns:
- the relative size of the cell.
-
-