INMOST
A toolkit for distributed mathematical modeling
INMOST::Cell Class Reference

An interface for elements of type CELL. More...

#include <inmost_mesh.h>

Inheritance diagram for INMOST::Cell:
Collaboration diagram for INMOST::Cell:

Public Member Functions

 Cell ()
 Basic constructor. More...
 
 Cell (Mesh *m, HandleType h)
 Basic constructor with fixed handle. More...
 
 Cell (Mesh *m, HandleType *h)
 Basic constructor with an assignable handle. More...
 
 Cell (const Cell &other)
 Copy constructor. More...
 
Celloperator= (Cell const &other)
 Assignment operator. More...
 
Celloperator-> ()
 Operator of dereference to pointer. More...
 
const Celloperator-> () const
 Operator of dereference to constant pointer. More...
 
Cellself ()
 Get self-reference. More...
 
const Cellself () const
 Get constant self-reference. More...
 
ElementArray< NodegetNodes () const
 Get all the nodes of the current cell. More...
 
ElementArray< EdgegetEdges () const
 Get all the edges of the current cell. More...
 
ElementArray< FacegetFaces () const
 Get all the faces of the current cell. More...
 
ElementArray< NodegetNodes (MarkerType mask, bool invert_mask=false) const
 Get the subset of the nodes of the current cell that are (not) marked by provided marker. More...
 
ElementArray< EdgegetEdges (MarkerType mask, bool invert_mask=false) const
 Get the subset of the edges of the current cell that are (not) marked by provided marker. More...
 
ElementArray< FacegetFaces (MarkerType mask, bool invert_mask=false) const
 Get the subset of the faces of the current cell that are (not) marked by provided marker. More...
 
bool CheckEdgeOrder () const
 Check that sequence of edges form a closed loop and each edge have a node that matches one of the nodes at the next edge. More...
 
bool FixEdgeOrder () const
 Repair the sequence of edges so that each edge have node that matches one of the nodes at the next edge. More...
 
Cell Neighbour (Face face) const
 Get a cell that share a face with the current cell. More...
 
ElementArray< CellNeighbouringCells () const
 Get all cells that share the face with the current cell. More...
 
bool Inside (const real *point) const
 Determine, if point lies inside element. More...
 
bool InsidePrint (const real *point, std::ostream &sout=std::cout) const
 
real Volume () const
 Return volume of the cell. More...
 
bool Closure () const
 Test that faces of the cell form the closed set. More...
 
void SwapBackCell () const
 For each adjacent cell make me a front cell and fix normal orientation accordingly.
 
bool CheckConvexity () const
 
- Public Member Functions inherited from INMOST::Element
 Element (Mesh *m, HandleType h)
 
 Element (Mesh *m, HandleType *h)
 
 Element (const Element &other)
 
Elementoperator= (Element const &other)
 
Elementoperator-> ()
 
const Elementoperator-> () const
 
Elementself ()
 
const Elementself () const
 
virtual enumerator nbAdjElements (ElementType etype) const
 Retrieve number of adjacent elements. More...
 
virtual ElementArray< ElementgetAdjElements (ElementType etype) const
 Retrieve unordered array of adjacent elements. More...
 
virtual enumerator nbAdjElements (ElementType etype, MarkerType mask, bool invert_mask=false) const
 Retrieve number of adjacent elements with marker. More...
 
virtual ElementArray< ElementgetAdjElements (ElementType etype, MarkerType mask, bool invert_mask=false) const
 Retrieve unordered array of adjacent elements with marker. More...
 
ElementArray< ElementBridgeAdjacencies (ElementType Bridge, ElementType Dest, MarkerType bridge_mask=0, bool bridge_invert=false, MarkerType target_mask=0, bool target_invert=false) const
 
ElementArray< NodeBridgeAdjacencies2Node (ElementType Bridge, MarkerType bridge_mask=0, bool bridge_invert=false, MarkerType target_mask=0, bool target_invert=false) const
 
ElementArray< EdgeBridgeAdjacencies2Edge (ElementType Bridge, MarkerType bridge_mask=0, bool bridge_invert=false, MarkerType target_mask=0, bool target_invert=false) const
 
ElementArray< FaceBridgeAdjacencies2Face (ElementType Bridge, MarkerType bridge_mask=0, bool bridge_invert=false, MarkerType target_mask=0, bool target_invert=false) const
 
ElementArray< CellBridgeAdjacencies2Cell (ElementType Bridge, MarkerType bridge_mask=0, bool bridge_invert=false, MarkerType target_mask=0, bool target_invert=false) const
 
virtual ElementArray< CellgetCells () const
 Return all the cells of the element. More...
 
virtual ElementArray< CellgetCells (MarkerType mask, bool invert_mask=false) const
 
GeometricType GetGeometricType () const
 
unsigned int GetElementDimension () const
 
Status GetStatus () const
 
void SetStatus (Status status) const
 
Storage::integerGlobalID () const
 
bool CheckElementConnectivity () const
 
void PrintElementConnectivity () const
 
void CastRay (const real *pos, const real *dir, std::map< HandleType, real > &hits) const
 
void ComputeGeometricType () const
 
void Centroid (real *cnt) const
 
void Barycenter (real *cnt) const
 
Storage::real Mean (const MeanFunc &f, real time) const
 
Storage::real Mean (real(*func)(real *x, real t), real time) const
 
bool Boundary () const
 Determine that the element is on the boundary. More...
 
bool Planarity () const
 
bool Hide () const
 If the function returns true then element was hidden, works only inside BeginModification and EndModification, on EndModification all Hidden elements are deleted. More...
 
bool Show () const
 If the function returns true then element was recovered from hidden state, works only inside BeginModification and EndModification. More...
 
bool Delete ()
 Remove element from mesh. More...
 
bool Hidden () const
 
bool New () const
 
void Disconnect (bool delete_upper_adjacent) const
 
void Disconnect (const HandleType *adjacent, INMOST_DATA_ENUM_TYPE num) const
 Disconnect element. More...
 
void Connect (const HandleType *adjacent, INMOST_DATA_ENUM_TYPE num) const
 Connects lower adjacencies to current element. More...
 
void SendTo (std::set< Storage::integer > &procs) const
 Update geometric data for element, calls RecomputeGeometricData from Mesh. More...
 
void SendTo (std::vector< Storage::integer > &procs) const
 
void SendTo (Storage::integer_array procs) const
 
- Public Member Functions inherited from INMOST::Storage
 Storage (const Storage &other)
 
 Storage (Mesh *mesh, HandleType handle)
 
 Storage (Mesh *mesh, HandleType *handle)
 This constructor allows for remote handle modification.
 
Storageoperator= (Storage const &other)
 If there is a link to handle provided (automatically by ElementArray and reference_array), then remote handle value will be modified.
 
__INLINE bool operator< (const Storage &other) const
 
__INLINE bool operator> (const Storage &other) const
 
__INLINE bool operator<= (const Storage &other) const
 
__INLINE bool operator>= (const Storage &other) const
 
__INLINE bool operator== (const Storage &other) const
 
__INLINE bool operator!= (const Storage &other) const
 
__INLINE Storageoperator-> ()
 
__INLINE const Storageoperator-> () const
 
__INLINE Storageself ()
 
__INLINE const Storageself () const
 
__INLINE realReal (const Tag &tag) const
 Retrieve real value associated with Tag. More...
 
__INLINE integerInteger (const Tag &tag) const
 Retrieve integer value associated with Tag. More...
 
__INLINE bulkBulk (const Tag &tag) const
 Retrieve one byte of abstract data associated with Tag. More...
 
__INLINE referenceReference (const Tag &tag) const
 Retrieve Element reference associated with Tag. More...
 
__INLINE remote_referenceRemoteReference (const Tag &tag) const
 Retrieve remote Element reference associated with Tag. More...
 
__INLINE real_array RealArray (const Tag &tag) const
 Retrieve array of real values associated with Tag. More...
 
__INLINE integer_array IntegerArray (const Tag &tag) const
 Retrieve array of integer values associated with Tag. More...
 
__INLINE bulk_array BulkArray (const Tag &tag) const
 Retrieve abstract data associated with Tag as a series of bytes. More...
 
__INLINE reference_array ReferenceArray (const Tag &tag) const
 Retrieve array of Element references associated with Tag. More...
 
__INLINE remote_reference_array RemoteReferenceArray (const Tag &tag) const
 Retrieve array of Element references associated with Tag. More...
 
__INLINE real_array RealArrayDF (const Tag &tag) const
 
__INLINE integer_array IntegerArrayDF (const Tag &tag) const
 
__INLINE bulk_array BulkArrayDF (const Tag &tag) const
 
__INLINE reference_array ReferenceArrayDF (const Tag &tag) const
 
__INLINE remote_reference_array RemoteReferenceArrayDF (const Tag &tag) const
 
__INLINE realRealDF (const Tag &tag) const
 
__INLINE integerIntegerDF (const Tag &tag) const
 
__INLINE bulkBulkDF (const Tag &tag) const
 
__INLINE referenceReferenceDF (const Tag &tag) const
 
__INLINE remote_referenceRemoteReferenceDF (const Tag &tag) const
 
__INLINE real_array RealArrayDV (const Tag &tag) const
 
__INLINE integer_array IntegerArrayDV (const Tag &tag) const
 
__INLINE bulk_array BulkArrayDV (const Tag &tag) const
 
__INLINE reference_array ReferenceArrayDV (const Tag &tag) const
 
__INLINE remote_reference_array RemoteReferenceArrayDV (const Tag &tag) const
 
__INLINE realRealDV (const Tag &tag) const
 
__INLINE integerIntegerDV (const Tag &tag) const
 
__INLINE bulkBulkDV (const Tag &tag) const
 
__INLINE referenceReferenceDV (const Tag &tag) const
 
__INLINE remote_referenceRemoteReferenceDV (const Tag &tag) const
 
__INLINE varVariable (const Tag &tag) const
 Retrieve variable reference associated with Tag.
 
__INLINE varVariableDF (const Tag &tag) const
 
__INLINE varVariableDV (const Tag &tag) const
 
__INLINE var_array VariableArray (const Tag &tag) const
 Retrieve array of variables associated with Tag.
 
__INLINE var_array VariableArrayDF (const Tag &tag) const
 
__INLINE var_array VariableArrayDV (const Tag &tag) const
 
__INLINE INMOST_DATA_ENUM_TYPE GetDataSize (const Tag &tag) const
 Return the data length associated with Tag. More...
 
__INLINE INMOST_DATA_ENUM_TYPE GetDataCapacity (const Tag &tag) const
 Return the size of the structure required to represent the data on current element. More...
 
__INLINE void SetDataSize (const Tag &tag, INMOST_DATA_ENUM_TYPE new_size) const
 Set the length of data associated with Tag. More...
 
__INLINE void GetData (const Tag &tag, INMOST_DATA_ENUM_TYPE shift, INMOST_DATA_ENUM_TYPE size, void *data) const
 Extract part of the data associated with Tag. More...
 
__INLINE void SetData (const Tag &tag, INMOST_DATA_ENUM_TYPE shift, INMOST_DATA_ENUM_TYPE size, const void *data) const
 
__INLINE void DelData (const Tag &tag) const
 
__INLINE bool DelSparseData (const Tag &tag) const
 Deallocates space allocated for sparse data, frees variable array if necessary.
 
__INLINE void DelDenseData (const Tag &tag) const
 Frees variable array or fills field with zeroes.
 
__INLINE bool HaveData (const Tag &tag) const
 Check if any data is associated with Tag.
 
__INLINE ElementType GetElementType () const
 
__INLINE integer GetElementNum () const
 
__INLINE void SetMarker (MarkerType n) const
 
__INLINE bool GetMarker (MarkerType n) const
 
__INLINE void RemMarker (MarkerType n) const
 
__INLINE void SetPrivateMarker (MarkerType n) const
 
__INLINE bool GetPrivateMarker (MarkerType n) const
 
__INLINE void RemPrivateMarker (MarkerType n) const
 
__INLINE void ClearMarkerSpace () const
 
__INLINE void GetMarkerSpace (bulk copy[MarkerFields]) const
 
__INLINE void SetMarkerSpace (bulk source[MarkerFields]) const
 
__INLINE integer LocalID () const
 
__INLINE integer DataLocalID () const
 This number is guaranteed to be between 0 and Mesh::NumberOf(type of element) after Mesh::ReorderEmpty.
 
__INLINE bool isValid () const
 
__INLINE MeshGetMeshLink () const
 
__INLINE HandleType GetHandle () const
 
__INLINE Element getAsElement () const
 
__INLINE Node getAsNode () const
 
__INLINE Edge getAsEdge () const
 
__INLINE Face getAsFace () const
 
__INLINE Cell getAsCell () const
 
__INLINE ElementSet getAsSet () const
 

Static Public Member Functions

static Cell UniteCells (const ElementArray< Cell > &cells, MarkerType del_protect)
 Unite a set of given cells into one cell. More...
 
static bool TestUniteCells (const ElementArray< Cell > &cells, MarkerType del_protect)
 Test that no marked element will be deleted during union of given cells. More...
 
static ElementArray< CellSplitCell (Cell cell, const ElementArray< Face > &faces, MarkerType del_protect)
 Separate a cell according to the set of provided faces. More...
 
static bool TestSplitCell (Cell cell, const ElementArray< Face > &faces, MarkerType del_protect)
 This functions checks is it possible to split the cell by the given set of faces without deleting marked elements. More...
 
- Static Public Member Functions inherited from INMOST::Element
static const char * GeometricTypeName (GeometricType t)
 
static integer GetGeometricDimension (GeometricType m_type)
 
static const char * StatusName (Status s)
 
static bool CheckConnectivity (Mesh *m)
 

Additional Inherited Members

- Public Types inherited from INMOST::Element
typedef INMOST_DATA_BULK_TYPE GeometricType
 
typedef INMOST_DATA_BULK_TYPE Status
 
typedef inner_reference_array adj_type
 
typedef adj_type::iterator adj_iterator
 
typedef adj_type::const_iterator const_adj_iterator
 
typedef adj_type::reverse_iterator adj_reverse_iterator
 
typedef adj_type::const_reverse_iterator const_adj_reverse_iterator
 
- Public Types inherited from INMOST::Storage
typedef INMOST_DATA_REAL_TYPE real
 Storage type for representing real values.
 
typedef INMOST_DATA_INTEGER_TYPE integer
 Storage type for representing integer values.
 
typedef INMOST_DATA_BULK_TYPE bulk
 Storage type for representing one byte of abstract data.
 
typedef INMOST_DATA_ENUM_TYPE enumerator
 type for representing unsigned integer values.
 
typedef HandleType reference
 Storage type for representing references to Element.
 
typedef RemoteHandleType remote_reference
 Storage type for representing references to Element in another Mesh.
 
typedef shell< realreal_array
 Storage type for representing arrays of real values.
 
typedef shell< integerinteger_array
 Storage type for representing arrays of integer values.
 
typedef shell< bulkbulk_array
 Storage type for representing abstract data as a series of bytes.
 
typedef variable var
 Storage type for representing real value with vector of variations.
 
typedef shell< variablevar_array
 Storage type for representing array of values with vectors of variations.
 
- Static Public Attributes inherited from INMOST::Element
static const GeometricType Unset = 0
 
static const GeometricType Vertex = 1
 
static const GeometricType Line = 2
 
static const GeometricType MultiLine = 3
 
static const GeometricType Tri = 4
 
static const GeometricType Quad = 5
 
static const GeometricType Polygon = 6
 
static const GeometricType MultiPolygon = 7
 
static const GeometricType Tet = 8
 
static const GeometricType Hex = 9
 
static const GeometricType Prism = 10
 
static const GeometricType Pyramid = 11
 
static const GeometricType Polyhedron = 12
 
static const GeometricType Set = 253
 
static const GeometricType MeshPart = 254
 
static const GeometricType MaxType = 255
 
static const Status Owned = 1
 
static const Status Shared = 2
 
static const Status Ghost = 4
 
static const Status Any = 0
 
- Protected Member Functions inherited from INMOST::Element
void SetGeometricType (GeometricType t)
 
- Protected Attributes inherited from INMOST::Storage
HandleType handle
 
HandleType * handle_link
 

Detailed Description

An interface for elements of type CELL.

This interface carry the link to the mesh and the element's handle that represents position of the element's data in the mesh.

Interface provides some operations that can be done uniquely on the object of class Element for which Element::GetElementType retruns CELL.

For the basic set of operations on all of the elements check class Element.

For the basic set of operations on the data of the element check class Storage.

You can obtain object of class Cell from Mesh::iteratorCell, in this case obtained object is always valid. Also you can get it through Mesh::CellByLocalID, check with Element::isValid to see whether you have obtained valid object. You can convert an object of class Element into an object of class Cell by Element::getAsCell. In debug mode it will internally check that the element is of type CELL. You may compose an object of class Cell by using constructor and specifing pointer to the mesh and providing element's handle. You can make a handle with ComposeHandle(CELL,local_id) function.

Definition at line 688 of file inmost_mesh.h.

Constructor & Destructor Documentation

◆ Cell() [1/4]

INMOST::Cell::Cell ( )
inline

Basic constructor.

Constructs invalid cell.

Definition at line 694 of file inmost_mesh.h.

◆ Cell() [2/4]

INMOST::Cell::Cell ( Mesh m,
HandleType  h 
)
inline

Basic constructor with fixed handle.

When constructed this way, only handle within object may change.

Parameters
mPointer to the mesh to which the element belongs.
hUnique handle that describes position of the element within the mesh.

Definition at line 701 of file inmost_mesh.h.

◆ Cell() [3/4]

INMOST::Cell::Cell ( Mesh m,
HandleType *  h 
)
inline

Basic constructor with an assignable handle.

When constructed this way, the provided memory location for handle will be modified on assignment.

The purpose of this function is to be used in various non-constant iterators of containers that allow underlying contents to be changed.

Parameters
mPointer to the mesh to which the element belongs.
hPointer to the handle that describes position of the element within mesh.

Definition at line 712 of file inmost_mesh.h.

◆ Cell() [4/4]

INMOST::Cell::Cell ( const Cell other)
inline

Copy constructor.

New object will inherit the assignment behavior of the initial object.

Parameters
otherObject of type Cell to be duplicated.

Definition at line 718 of file inmost_mesh.h.

Member Function Documentation

◆ CheckEdgeOrder()

bool INMOST::Cell::CheckEdgeOrder ( ) const

Check that sequence of edges form a closed loop and each edge have a node that matches one of the nodes at the next edge.

This function works for cells for which Element::GetElementDimension returns 2.

Returns
True if edges form the correct closed loop.
Todo:
  1. Use in topology check algorithms.

◆ Closure()

bool INMOST::Cell::Closure ( ) const

Test that faces of the cell form the closed set.

This is automatically checked for if you activate NEED_TEST_CLOSURE in Mesh::SetTopologyCheck.

Returns
True if faces of the cell form the closed set, false otherwise.

◆ FixEdgeOrder()

bool INMOST::Cell::FixEdgeOrder ( ) const

Repair the sequence of edges so that each edge have node that matches one of the nodes at the next edge.

This function works for cells for which Element::GetGeometricDimension returns 2.

This function may fail if all the edges does not form a closed loop.

Returns
True if edges were successfully reordered to form a closed loop.
Todo:
  1. Use in topology check algorithms.

◆ getEdges() [1/2]

ElementArray<Edge> INMOST::Cell::getEdges ( ) const
virtual

Get all the edges of the current cell.

This function traverses down the adjacency graph by two levels.

The order of the edges is unspecified.

Returns
Set of edges that compose current cell.
Todo:
One should thoroughly check three scenarios of function execution in shared parallel environment for different types of cells (simple tet/hex cells as well as complex polyhedral cells) and draw a conclusion on the best scenario for each condition. One of the development versions contains all the algorithms, ask for the files.
  1. Use of markers (current variant).
  2. Put all elements into array with duplications, then run std::sort and std::unique.
  3. Put all elements into array, check for duplication by running through array.
Warning
Note that this function uses markers to check for duplication of edges in output array. This allows for faster algorithm, but will lead to penalties in shared parallel execution, since operations on markers are declared atomic. For atomic declaration to work you have to define USE_OMP during CMake configuration or in inmost_common.h. If you attempt to use this function in shared parallel execution without USE_OMP you may expect side effects.

Reimplemented from INMOST::Element.

◆ getEdges() [2/2]

ElementArray<Edge> INMOST::Cell::getEdges ( MarkerType  mask,
bool  invert_mask = false 
) const
virtual

Get the subset of the edges of the current cell that are (not) marked by provided marker.

This function traverses down the adjacency graph by two levels.

The order of the edges is unspecified.

Parameters
maskMarker that should be used to filter elements.
invert_maskIf false then those elements that are marked will be taken, otherwise elements that are not marked will be taken.
Returns
Set of the edges that compose current cell and (not) marked by marker.
Warning
To work correctly in shared parallel environment this function requires USE_OMP to be defined in CMake or in inmost_common.h.

Reimplemented from INMOST::Element.

◆ getFaces() [1/2]

ElementArray<Face> INMOST::Cell::getFaces ( ) const
virtual

Get all the faces of the current cell.

This function traverses down the adjacency graph by one level.

The order of the faces returned by this function is preserved from the moment of the construction of the cell.

Returns
Set of faces that compose current cell.

Reimplemented from INMOST::Element.

◆ getFaces() [2/2]

ElementArray<Face> INMOST::Cell::getFaces ( MarkerType  mask,
bool  invert_mask = false 
) const
virtual

Get the subset of the faces of the current cell that are (not) marked by provided marker.

This function traverses down the adjacency graph by one level.

The order of the faces returned by this function is preserved from the moment of the construction of the cell.

Parameters
maskMarker that should be used to filter elements.
invert_maskIf false then those elements that are marked will be taken, otherwise elements that are not marked will be taken.
Returns
Set of the faces that compose current cell and (not) marked by marker.
Warning
To work correctly in shared parallel environment this function requires USE_OMP to be defined in CMake or in inmost_common.h.

Reimplemented from INMOST::Element.

◆ getNodes() [1/2]

ElementArray<Node> INMOST::Cell::getNodes ( ) const
virtual

Get all the nodes of the current cell.

This function traverses up the adjacency graph by one level.

The order of nodes will be preserved from the moment of the construction of the cell. When suggest_nodes array is not supplied into the Mesh::CreateCell functions, then for known types the order of nodes follows VTK convention. For polyhedral cells the order is unspecified. When suggest_nodes_order was provided into Mesh::CreateCell then the order follows provided order.

Returns
Set of nodes that compose current cell.

Reimplemented from INMOST::Element.

◆ getNodes() [2/2]

ElementArray<Node> INMOST::Cell::getNodes ( MarkerType  mask,
bool  invert_mask = false 
) const
virtual

Get the subset of the nodes of the current cell that are (not) marked by provided marker.

This function traverses up the adjacency graph by one level.

The order of nodes will be preserved from the moment of the construction of the cell. When suggest_nodes array is not supplied into the Mesh::CreateCell functions, then for known types the order of nodes follows VTK convention. For polyhedral cells the order is unspecified. When suggest_nodes_order was provided into Mesh::CreateCell then the order follows provided order.

Parameters
maskMarker that should be used to filter elements.
invert_maskIf false then those elements that are marked will be taken, otherwise elements that are not marked will be taken.
Returns
Set of the nodes that compose current cell and (not) marked by marker.
Warning
To work correctly in shared parallel environment this function requires USE_OMP to be defined in CMake or in inmost_common.h.

Reimplemented from INMOST::Element.

◆ Inside()

bool INMOST::Cell::Inside ( const real point) const

Determine, if point lies inside element.

Now it works only for 3-dimensional elements, at future it will be extended to support polygons and segments.

Parameters
pointcoordinates of the point, it is assumed that number of the coordinates is the same as the number of dimensions in the mesh.
Returns
returns true if points inside element, false otherwise
See also
Mesh::GetDimensions
Todo:
  1. Should be checked or extended for 2d cells. (done, testing)

◆ Neighbour()

Cell INMOST::Cell::Neighbour ( Face  face) const

Get a cell that share a face with the current cell.

Don't forget to check that the returned cell is valid. It would return invalid cell for boundary face.

Parameters
faceA face of current cell for which neighbouring cell is determined.
Returns
A cell that shares a given face with the current cell.

◆ NeighbouringCells()

ElementArray<Cell> INMOST::Cell::NeighbouringCells ( ) const

Get all cells that share the face with the current cell.

Returns
Set of cells that share a face with the current cell.

◆ operator->() [1/2]

Cell* INMOST::Cell::operator-> ( )
inline

Operator of dereference to pointer.

This is needed for iterators to work properly.

Returns
Pointer to the current object.

Definition at line 733 of file inmost_mesh.h.

◆ operator->() [2/2]

const Cell* INMOST::Cell::operator-> ( ) const
inline

Operator of dereference to constant pointer.

This is needed for const_iterators to work properly.

Returns
Constant pointer to the current object.

Definition at line 739 of file inmost_mesh.h.

◆ operator=()

Cell& INMOST::Cell::operator= ( Cell const &  other)
inline

Assignment operator.

Assigned object will inherit the asignment behavior of the initial object only in case it was constructed without pointer to a handle. Otherwise it will only modify the memory location to which it points.

Parameters
otherObject of type Cell to be duplicated.
Returns
Reference to the current object. Assignment Operator.

Definition at line 727 of file inmost_mesh.h.

◆ self() [1/2]

Cell& INMOST::Cell::self ( )
inline

Get self-reference.

Main purpose is to convert iterators into elements and to pass them as arguments of functions.

Returns
Constant reference to the current object.

Definition at line 745 of file inmost_mesh.h.

◆ self() [2/2]

const Cell& INMOST::Cell::self ( ) const
inline

Get constant self-reference.

Main purpose is to convert iterators into elements and to pass them as arguments of functions.

Returns
Reference to the current object.

Definition at line 751 of file inmost_mesh.h.

◆ SplitCell()

static ElementArray<Cell> INMOST::Cell::SplitCell ( Cell  cell,
const ElementArray< Face > &  faces,
MarkerType  del_protect 
)
static

Separate a cell according to the set of provided faces.

You should first separate all edges with new nodes by Edge::SplitEdge, then faces with new edges by Face::SplitFace and then create faces using new edges from faces of initial cell and optionally edges from inside of the cell. All faces are supposed to be internal with respect to the current cell. Internally this function will resolve geometry of new cells inside of the current cell by running through adjacency graph.

Parameters
cellA cell to be split.
facesA set of faces, internal for current cell, that will be used for construction of new cells.
del_protectMarker that may be used to protect some elements from deletion by algorithm. Zero means no check.
Returns
A set of new cells.
See also
Edge::SplitEdge
Face::SplitFace
Todo:
  1. The algorithm inside is minimizing the size of the adjacency graph for each new cell. The correct behavior is to calculate volume of the cell for each adjacency graph and choose the graph with minimal volume. This requires calculation of volume for non-convex cells. For correct calculation of volume on non-convex cells one should find one face for which normal orientation can be clearly determined and then orient all edges of the cell with respect to the orientation of edges of this face and establish normals for all faces. Once the algorithm is implemented here it should be implemented in geometrical services or vice verse.
  2. Probably the algorithm should minimize the volume and adjacency graph size altogether. Between the cells with smallest volume within some tolerance select those that have smallest adjacency graph.

◆ TestSplitCell()

static bool INMOST::Cell::TestSplitCell ( Cell  cell,
const ElementArray< Face > &  faces,
MarkerType  del_protect 
)
static

This functions checks is it possible to split the cell by the given set of faces without deleting marked elements.

Parameters
cellA cell to be split.
facesSet of faces, internal for current cell, that will be used for new cells.
del_protectMarker that may be used to protect some elements from deletion by algorithm. Zero means no check.
Returns
True if possible, otherwise false.

◆ TestUniteCells()

static bool INMOST::Cell::TestUniteCells ( const ElementArray< Cell > &  cells,
MarkerType  del_protect 
)
static

Test that no marked element will be deleted during union of given cells.

Parameters
cellsA set of cells to be united.
del_protectA marker that protects elements from deletion. Zero means no check.
Returns
True if no element deleted, false otherwise.

◆ UniteCells()

static Cell INMOST::Cell::UniteCells ( const ElementArray< Cell > &  cells,
MarkerType  del_protect 
)
static

Unite a set of given cells into one cell.

This will create a cell whose faces are formed by symmetric difference of faces of given cells. If you specify a nonzero marker then the procedure will fail if any marked element have to be deleted during union.

Parameters
cellsA set of cells to be united.
del_protectA marker that protects elements from deletion. Zero means no check.
Returns
A new cell.

◆ Volume()

real INMOST::Cell::Volume ( ) const

Return volume of the cell.

Note that currently the volume for non-convex cells may be calculated incorrectly.

Todo:
  1. Geometric services should correctly resolve volume for non-convex cells.

The documentation for this class was generated from the following file: