INMOST
Mathematical Modelling Toolkit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
INMOST::Mesh Class Reference

#include <inmost_mesh.h>

Inheritance diagram for INMOST::Mesh:
Collaboration diagram for INMOST::Mesh:

Classes

class  base_iterator
 
class  BulkComparator
 
class  BulkDFComparator
 
class  CentroidComparator
 
class  exchange_data
 
class  GlobalIDComparator
 
class  HierarchyComparator
 
class  IntegerComparator
 
class  IntegerDFComparator
 
class  RealComparator
 
class  RealDFComparator
 

Public Types

enum  MeshState { Serial, Parallel }
 
enum  Action { AGhost, AMigrate }
 
enum  Prepare { UnknownSize, UnknownSource }
 
typedef chunk_array< integer,
chunk_bits_empty > 
empty_container
 
typedef chunk_array< integer,
chunk_bits_elems > 
links_container
 
typedef TagManager::sparse_sub_type sparse_type
 
typedef
TagManager::sparse_sub_record 
sparse_rec
 
typedef sparse_type::size_type senum
 
typedef void(* ReduceOperation )(const Tag &tag, const Element &element, const INMOST_DATA_BULK_TYPE *recv_data, INMOST_DATA_ENUM_TYPE recv_size)
 
typedef std::vector< Tagtag_set
 
typedef std::vector< HandleTypeelement_set
 
typedef std::vector
< INMOST_DATA_BULK_TYPE
buffer_type
 
typedef std::map< int,
element_set
proc_elements
 
typedef std::pair< int,
buffer_type
proc_buffer_type
 
typedef std::vector
< proc_buffer_type
exch_buffer_type
 
typedef base_iterator< StorageiteratorStorage
 
typedef base_iterator< ElementiteratorElement
 
typedef base_iterator< ElementSetiteratorSet
 
typedef base_iterator< CelliteratorCell
 
typedef base_iterator< FaceiteratorFace
 
typedef base_iterator< EdgeiteratorEdge
 
typedef base_iterator< NodeiteratorNode
 
typedef tiny_map
< GeometricData, ElementType, 5 > 
GeomParam
 
- Public Types inherited from INMOST::TagManager
typedef tag_array_type::iterator iteratorTag
 
- Public Types inherited from INMOST::Storage
typedef INMOST_DATA_REAL_TYPE real
 Storage type for representing real values. More...
 
typedef INMOST_DATA_INTEGER_TYPE integer
 Storage type for representing integer values. More...
 
typedef INMOST_DATA_BULK_TYPE bulk
 Storage type for representing one byte of abstact data. More...
 
typedef INMOST_DATA_ENUM_TYPE enumerator
 type for representing unsigned integer values. More...
 
typedef HandleType reference
 Storage type for representing references to Element. More...
 
typedef RemoteHandleType remote_reference
 Storage type for representing references to Element in another Mesh. More...
 
typedef shell< realreal_array
 Storage type for representing arrays of real values. More...
 
typedef shell< integerinteger_array
 Storage type for representing arrays of integer values. More...
 
typedef shell< bulkbulk_array
 Storage type for representing abstact data as a series of bytes. More...
 
typedef variable var
 Storage type for representing real value with vector of variations. More...
 
typedef shell< variablevar_array
 Storage type for representing array of values with vectors of variations. More...
 

Public Member Functions

void Clear ()
 
integer HandleDataPos (HandleType h)
 For debug purposes. More...
 
enumerator MemoryUsage (HandleType h)
 
 Mesh ()
 
 Mesh (std::string name)
 
 Mesh (const Mesh &other)
 
Meshoperator= (Mesh const &other)
 
 ~Mesh ()
 
MarkerType CreateMarker ()
 
MarkerType CreatePrivateMarker ()
 
void ReleaseMarker (MarkerType n)
 
void ReleasePrivateMarker (MarkerType n)
 
__INLINE void SetEpsilon (real e)
 
__INLINE real GetEpsilon () const
 
void SetDimensions (integer dim)
 
__INLINE integer GetDimensions () const
 
__INLINE MeshState GetMeshState () const
 
__INLINE const TagGlobalIDTag () const
 
__INLINE const TagCoordsTag () const
 
__INLINE const TagLowConnTag () const
 
__INLINE const TagHighConnTag () const
 
__INLINE const TagMarkersTag () const
 
__INLINE const TagGeomTypeTag () const
 
__INLINE const TagSendtoTag () const
 
__INLINE const TagSharedTag () const
 
__INLINE const TagOwnerTag () const
 
__INLINE const TagLayersTag () const
 
__INLINE const TagBridgeTag () const
 
__INLINE const TagProcessorsTag () const
 
__INLINE const TagSetNameTag () const
 
__INLINE const TagSetComparatorTag () const
 
__INLINE Tag RedistributeTag ()
 
Tag CreateTag (std::string name, DataType dtype, ElementType etype, ElementType sparse, INMOST_DATA_ENUM_TYPE size=ENUMUNDEF)
 
Tag DeleteTag (Tag tag, ElementType mask=NODE|EDGE|FACE|CELL|ESET|MESH)
 
__INLINE iteratorTag BeginTag ()
 
__INLINE enumerator NumberOfTags () const
 
__INLINE iteratorTag EndTag ()
 
Node CreateNode (const real *coords)
 
std::pair< Edge, boolCreateEdge (const ElementArray< Node > &nodes)
 
std::pair< Face, boolCreateFace (const ElementArray< Edge > &edges)
 
std::pair< Face, boolCreateFace (const ElementArray< Node > &nodes)
 
std::pair< Cell, boolCreateCell (const ElementArray< Face > &faces, const ElementArray< Node > &suggest_nodes_order=ElementArray< Node >(NULL))
 
std::pair< Cell, boolCreateCell (const ElementArray< Node > &c_f_nodes, const integer *c_f_numnodes, integer num_c_faces, const ElementArray< Node > &suggest_nodes_order=ElementArray< Node >(NULL))
 
std::pair< Cell, boolCreateCell (const ElementArray< Node > &c_nodes, const integer *c_f_nodeinds, const integer *c_f_numnodes, integer num_c_faces, const ElementArray< Node > &suggest_nodes_order=ElementArray< Node >(NULL))
 
std::pair< ElementSet, boolCreateSet (std::string name)
 
std::pair< ElementSet, boolCreateSetUnique (std::string name)
 Same as Mesh::CreateSet without checking existance of the set. More...
 
ElementSet GetSet (std::string name)
 
ElementArray< ElementSetGetSetsByPrefix (std::string prefix)
 Retrieve all the sets whose names start with given prefix. More...
 
HandleType LastCreated () const
 
bool isValidHandleRange (HandleType h) const
 
bool isValidElement (integer etypenum, integer lid) const
 
bool isValidElement (ElementType etype, integer lid) const
 
bool isValidCell (integer lid) const
 
bool isValidFace (integer lid) const
 
bool isValidEdge (integer lid) const
 
bool isValidNode (integer lid) const
 
bool isValidElementSet (integer lid) const
 
bool isValidElement (HandleType h) const
 
HandleType FindSharedAdjacency (const HandleType *arr, enumerator num) const
 
void ReorderEmpty (ElementType reordertypes)
 
void ReorderApply (Tag index, ElementType mask)
 
void RestoreCellNodes (HandleType hc, ElementArray< Node > &ret)
 
realReal (HandleType h, const Tag &tag)
 
integerInteger (HandleType h, const Tag &tag)
 
bulkBulk (HandleType h, const Tag &tag)
 
referenceReference (HandleType h, const Tag &tag)
 
remote_referenceRemoteReference (HandleType h, const Tag &tag)
 
real_array RealArray (HandleType h, const Tag &tag)
 
integer_array IntegerArray (HandleType h, const Tag &tag)
 
bulk_array BulkArray (HandleType h, const Tag &tag)
 
reference_array ReferenceArray (HandleType h, const Tag &tag)
 
remote_reference_array RemoteReferenceArray (HandleType h, const Tag &tag)
 
realRealDF (HandleType h, const Tag &tag)
 
integerIntegerDF (HandleType h, const Tag &tag)
 
bulkBulkDF (HandleType h, const Tag &tag)
 
referenceReferenceDF (HandleType h, const Tag &tag)
 
remote_referenceRemoteReferenceDF (HandleType h, const Tag &tag)
 
real_array RealArrayDF (HandleType h, const Tag &tag)
 
integer_array IntegerArrayDF (HandleType h, const Tag &tag)
 
bulk_array BulkArrayDF (HandleType h, const Tag &tag)
 
reference_array ReferenceArrayDF (HandleType h, const Tag &tag)
 
remote_reference_array RemoteReferenceArrayDF (HandleType h, const Tag &tag)
 
realRealDV (HandleType h, const Tag &tag)
 
integerIntegerDV (HandleType h, const Tag &tag)
 
bulkBulkDV (HandleType h, const Tag &tag)
 
referenceReferenceDV (HandleType h, const Tag &tag)
 
remote_referenceRemoteReferenceDV (HandleType h, const Tag &tag)
 
real_array RealArrayDV (HandleType h, const Tag &tag)
 
integer_array IntegerArrayDV (HandleType h, const Tag &tag)
 
bulk_array BulkArrayDV (HandleType h, const Tag &tag)
 
reference_array ReferenceArrayDV (HandleType h, const Tag &tag)
 
remote_reference_array RemoteReferenceArrayDV (HandleType h, const Tag &tag)
 
varVariable (HandleType h, const Tag &tag)
 
varVariableDF (HandleType h, const Tag &tag)
 
varVariableDV (HandleType h, const Tag &tag)
 
var_array VariableArray (HandleType h, const Tag &tag)
 
var_array VariableArrayDF (HandleType h, const Tag &tag)
 
var_array VariableArrayDV (HandleType h, const Tag &tag)
 
void SetMarker (HandleType h, MarkerType n)
 
void SetPrivateMarker (HandleType h, MarkerType n)
 
void SetMarkerArray (const HandleType *h, enumerator n, MarkerType m)
 
void SetPrivateMarkerArray (const HandleType *h, enumerator n, MarkerType m)
 
bool GetMarker (HandleType h, MarkerType n) const
 
bool GetPrivateMarker (HandleType h, MarkerType n) const
 
void RemMarker (HandleType h, MarkerType n)
 
void RemPrivateMarker (HandleType h, MarkerType n)
 
void RemMarkerArray (const HandleType *h, enumerator n, MarkerType m)
 
void RemPrivateMarkerArray (const HandleType *h, enumerator n, MarkerType m)
 
void ClearMarkerSpace (HandleType h)
 Remove all the markers from the element. More...
 
void GetMarkerSpace (HandleType h, bulk copy[MarkerFields]) const
 
void SetMarkerSpace (HandleType h, bulk source[MarkerFields])
 
Element::adj_typeHighConn (HandleType h)
 
Element::adj_type const & HighConn (HandleType h) const
 Access directly higher order adjacencies of current element without right of modification. More...
 
Element::adj_typeLowConn (HandleType h)
 
Element::adj_type const & LowConn (HandleType h) const
 Access directly lower order adjacencies of current element without right of modification. More...
 
INMOST_DATA_ENUM_TYPE GetDataSize (HandleType h, const Tag &tag) const
 
INMOST_DATA_ENUM_TYPE GetDataCapacity (HandleType h, const Tag &tag) const
 
void SetDataSize (HandleType h, const Tag &tag, enumerator new_size)
 
void GetData (HandleType h, const Tag &tag, enumerator shift, enumerator size, void *data) const
 
void SetData (HandleType h, const Tag &tag, enumerator shift, enumerator size, const void *data)
 
void DelData (HandleType h, const Tag &tag)
 
void DelDenseData (HandleType h, const Tag &tag)
 
void DelSparseData (HandleType h, const Tag &tag)
 
bool HaveData (HandleType h, const Tag &tag) const
 
Element::GeometricType GetGeometricType (HandleType h) const
 
void SetGeometricType (HandleType h, Element::GeometricType type)
 
integerGlobalID (HandleType h)
 
integer GlobalID (HandleType h) const
 
integer DataLocalID (HandleType h) const
 
Element::Status GetStatus (HandleType h) const
 
void SetStatus (HandleType h, Element::Status s)
 
void Destroy (HandleType h)
 
void Destroy (const Storage &e)
 Shortcut for typed elements. More...
 
bool Hide (HandleType h)
 
bool Show (HandleType h)
 
bool Delete (HandleType h)
 
bool Hidden (HandleType h) const
 
bool New (HandleType h) const
 
void ComputeGeometricType (HandleType h)
 
INMOST_DATA_ENUM_TYPE GetArrayCapacity (integer etypenum)
 
void SetParallelStrategy (int strategy)
 
int GetParallelStrategy ()
 
void SetParallelFileStrategy (int strategy)
 
int GetParallelFileStrategy ()
 
int GetProcessorRank ()
 Get rank of current processor. More...
 
int GetProcessorsNumber ()
 Get number of processors. More...
 
INMOST_MPI_Comm GetCommunicator ()
 Retrieve MPI communicator. More...
 
void SetCommunicator (INMOST_MPI_Comm _comm)
 Set MPI communicator. More...
 
void ResolveShared ()
 
void RemoveGhost ()
 Delete all the ghost cells. More...
 
void RemoveGhostElements (const HandleType *ghost, enumerator num)
 
template<typename EType >
void RemoveGhostElements (const ElementArray< EType > &ghost)
 
void RemoveGhostElements (const ElementSet &ghost)
 
void AssignGlobalID (ElementType mask)
 
void ExchangeData (const Tag &tag, ElementType mask, MarkerType select)
 
void ExchangeDataBegin (const Tag &tag, ElementType mask, MarkerType select, exchange_data &storage)
 
void ExchangeDataEnd (const Tag &tag, ElementType mask, MarkerType select, exchange_data &storage)
 
void ExchangeData (const tag_set &tags, ElementType mask, MarkerType select)
 
void ExchangeDataBegin (const tag_set &tags, ElementType mask, MarkerType select, exchange_data &storage)
 
void ExchangeDataEnd (const tag_set &tags, ElementType mask, MarkerType select, exchange_data &storage)
 
void ReduceData (const Tag &tag, ElementType mask, MarkerType select, ReduceOperation op)
 Accumulation of data from ghost elements to shared elements. More...
 
void ReduceDataBegin (const Tag &tag, ElementType mask, MarkerType select, exchange_data &storage)
 
void ReduceDataEnd (const Tag &tag, ElementType mask, MarkerType select, ReduceOperation op, exchange_data &storage)
 
void ReduceData (const tag_set &tags, ElementType mask, MarkerType select, ReduceOperation op)
 
void ReduceDataBegin (const tag_set &tags, ElementType mask, MarkerType select, exchange_data &storage)
 
void ReduceDataEnd (const tag_set &tags, ElementType mask, MarkerType select, ReduceOperation op, exchange_data &storage)
 
void ExchangeMarked (enum Action action=AGhost)
 
void ExchangeGhost (integer layers, ElementType bridge)
 
void Redistribute ()
 
integer Enumerate (ElementType mask, Tag num_tag, integer start=0, bool define_sparse=false)
 
integer Enumerate (const HandleType *h, enumerator num, const Tag &num_tag, integer start=0, bool define_sparse=true)
 
template<typename EType >
integer Enumerate (const ElementArray< EType > &elements, const Tag &num_tag, integer start=0, bool define_sparse=true)
 
integer EnumerateSet (const ElementSet &set, const Tag &num_tag, integer start=0, bool define_sparse=true)
 
integer TotalNumberOf (ElementType mask)
 
real Integrate (real input)
 
integer Integrate (integer input)
 
void Integrate (real *input, integer size)
 
void Integrate (integer *input, integer size)
 
real Integrate (const Tag &t, enumerator entry, ElementType mask)
 
integer ExclusiveSum (integer input)
 
real AggregateMax (real input)
 
integer AggregateMax (integer input)
 
void AggregateMax (real *input, integer size)
 
void AggregateMax (integer *input, integer size)
 
real AggregateMin (real input)
 
integer AggregateMin (integer input)
 
void AggregateMin (real *input, integer size)
 
void AggregateMin (integer *input, integer size)
 
void RecomputeParallelStorage (ElementType mask)
 
ElementType SynchronizeElementType (ElementType etype)
 
void SynchronizeMarker (MarkerType marker, ElementType mask, SyncBitOp op)
 
void BeginSequentialCode ()
 
void EndSequentialCode ()
 
Element ElementByLocalID (integer etypenum, integer lid)
 
Element ElementByLocalID (ElementType etype, integer lid)
 
Element ElementByHandle (HandleType h)
 
HandleType NextHandle (HandleType h) const
 
HandleType PrevHandle (HandleType h) const
 
HandleType NextHandle (HandleType h, ElementType mask) const
 
HandleType PrevHandle (HandleType h, ElementType mask) const
 
HandleType FirstHandle () const
 
HandleType LastHandle () const
 
HandleType FirstHandle (ElementType etype) const
 
HandleType LastHandle (ElementType etype) const
 
Node NodeByLocalID (integer lid)
 
Edge EdgeByLocalID (integer lid)
 
Face FaceByLocalID (integer lid)
 
Cell CellByLocalID (integer lid)
 
ElementSet EsetByLocalID (integer lid)
 
integer NodeNextLocalID (integer lid) const
 
integer EdgeNextLocalID (integer lid) const
 
integer FaceNextLocalID (integer lid) const
 
integer CellNextLocalID (integer lid) const
 
integer EsetNextLocalID (integer lid) const
 
integer NodePrevLocalID (integer lid) const
 
integer EdgePrevLocalID (integer lid) const
 
integer FacePrevLocalID (integer lid) const
 
integer CellPrevLocalID (integer lid) const
 
integer EsetPrevLocalID (integer lid) const
 
__INLINE integer NodeLastLocalID () const
 
__INLINE integer EdgeLastLocalID () const
 
__INLINE integer FaceLastLocalID () const
 
__INLINE integer CellLastLocalID () const
 
__INLINE integer EsetLastLocalID () const
 
integer NextLocalID (ElementType etype, integer lid) const
 
integer PrevLocalID (ElementType etype, integer lid) const
 
integer FirstLocalID (ElementType etype) const
 
integer LastLocalID (integer n) const
 
integer LastLocalID (ElementType etype) const
 
__INLINE integer NumberOfSets () const
 
__INLINE integer NumberOfCells () const
 
__INLINE integer NumberOfFaces () const
 
__INLINE integer NumberOfEdges () const
 
__INLINE integer NumberOfNodes () const
 
__INLINE integer NumberOfElements () const
 
__INLINE integer NumberOfAll () const
 
integer NumberOf (ElementType t) const
 
iteratorStorage Begin (ElementType Types)
 These iterators skip invalid elements but don't skip modified elements. More...
 
iteratorStorage End ()
 
iteratorElement BeginElement (ElementType Types)
 
iteratorElement EndElement ()
 
iteratorSet BeginSet ()
 
iteratorSet EndSet ()
 
iteratorCell BeginCell ()
 
iteratorCell EndCell ()
 
iteratorFace BeginFace ()
 
iteratorFace EndFace ()
 
iteratorEdge BeginEdge ()
 
iteratorEdge EndEdge ()
 
iteratorNode BeginNode ()
 
iteratorNode EndNode ()
 
void SetFileOption (std::string, std::string)
 
std::string GetFileOption (std::string key)
 
void Load (std::string File)
 
void LoadMSH (std::string File)
 
void LoadECL (std::string File)
 
void LoadXML (std::string File)
 
void LoadPMF (std::string File)
 
void LoadVTK (std::string File)
 
void LoadPVTK (std::string File)
 
void LoadMKF (std::string File)
 
void Save (std::string File)
 
void SaveXML (std::string File)
 
void SavePMF (std::string File)
 
void SaveVTK (std::string File)
 
void SavePVTK (std::string File)
 
void SaveGMV (std::string File)
 
bool isParallelFileFormat (std::string File)
 
void PrepareGeometricData (GeomParam table)
 
void RemoveGeometricData (GeomParam table)
 
bool HaveGeometricData (GeometricData type, ElementType mask) const
 
void GetGeometricData (HandleType e, GeometricData type, real *ret)
 
const TagGetGeometricTag (GeometricData type) const
 
bool TestClosure (const HandleType *elements, integer num) const
 
ElementArray< FaceGatherBoundaryFaces ()
 
ElementArray< FaceGatherInteriorFaces ()
 
integer CountBoundaryFaces ()
 
integer CountInteriorFaces ()
 
void RecomputeGeometricData (HandleType e)
 
Element::GeometricType ComputeGeometricType (ElementType element_type, const HandleType *lower_adjacent, INMOST_DATA_ENUM_TYPE lower_adjacent_size) const
 
bool isMeshModified () const
 
MarkerType HideMarker () const
 
MarkerType NewMarker () const
 
void SwapModification ()
 
void BeginModification ()
 
void ApplyModification ()
 
void ResolveModification ()
 
void EndModification ()
 
enumerator getNext (const HandleType *arr, enumerator size, enumerator k, MarkerType marker) const
 
enumerator Count (const HandleType *arr, enumerator size, MarkerType marker) const
 
TopologyCheck BeginTopologyCheck (ElementType etype, const HandleType *adj, enumerator num)
 
TopologyCheck EndTopologyCheck (HandleType e)
 
Tag TopologyErrorTag () const
 
TopologyCheck GetTopologyCheck (TopologyCheck mask=ENUMUNDEF) const
 Retrieve currently set topology checks. More...
 
void SetTopologyCheck (TopologyCheck mask)
 Set topology checks. More...
 
void RemTopologyCheck (TopologyCheck mask)
 Remove topology checks. More...
 
void SetTopologyError (TopologyCheck mask)
 This will turn mesh into the state indicating that some topology error occured. More...
 
TopologyCheck GetTopologyError (TopologyCheck mask=ENUMUNDEF) const
 Retrieve topology error state, this indicates that some error have occured. More...
 
void ClearTopologyError (TopologyCheck mask=ENUMUNDEF)
 Revert mesh to clean topology error state. More...
 
void SortHandles (HandleType *h, enumerator num)
 
void SortByGlobalID (HandleType *h, enumerator num)
 
std::string GetMeshName ()
 Retrive the name of the current mesh. More...
 
void SetMeshName (std::string new_name)
 Be careful changing mesh name if you have already established remote links. More...
 
- Public Member Functions inherited from INMOST::TagManager
virtual ~TagManager ()
 
bool HaveTag (std::string name) const
 
Tag GetTag (std::string name) const
 
void ListTagNames (std::vector< std::string > &list) const
 
Tag CreateTag (Mesh *m, std::string name, DataType dtype, ElementType etype, ElementType sparse, INMOST_DATA_ENUM_TYPE size=ENUMUNDEF)
 
bool ElementDefined (Tag const &tag, ElementType etype) 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. More...
 
Storageoperator= (Storage const &other)
 
__INLINE bool operator< (const Storage &other) const
 Inline functions for class Storage //. More...
 
__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
 
virtual ~Storage ()
 
__INLINE realReal (const Tag &tag) const
 
__INLINE integerInteger (const Tag &tag) const
 
__INLINE bulkBulk (const Tag &tag) const
 
__INLINE referenceReference (const Tag &tag) const
 
__INLINE remote_referenceRemoteReference (const Tag &tag) const
 
__INLINE real_array RealArray (const Tag &tag) const
 
__INLINE integer_array IntegerArray (const Tag &tag) const
 
__INLINE bulk_array BulkArray (const Tag &tag) const
 
__INLINE reference_array ReferenceArray (const Tag &tag) const
 
__INLINE remote_reference_array RemoteReferenceArray (const Tag &tag) const
 
__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. More...
 
__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. More...
 
__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
 
__INLINE INMOST_DATA_ENUM_TYPE GetDataCapacity (const Tag &tag) const
 
__INLINE void SetDataSize (const Tag &tag, INMOST_DATA_ENUM_TYPE new_size) const
 
__INLINE void GetData (const Tag &tag, INMOST_DATA_ENUM_TYPE shift, INMOST_DATA_ENUM_TYPE size, void *data) const
 
__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 void DelSparseData (const Tag &tag) const
 Deallocates space allocated for sparse data, frees variable array if necessary. More...
 
__INLINE void DelDenseData (const Tag &tag) const
 Frees variable array or fills field with zeroes. More...
 
__INLINE bool HaveData (const Tag &tag) const
 Check if any data is associated with Tag. More...
 
__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
 
__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 void Initialize (int *argc, char ***argv)
 
static void Finalize ()
 Finalizes operation with MPI, recomended to call, otherwise MPI may produce warnings. More...
 
static MeshGetMesh (std::string name)
 Find mesh by name. More...
 

Additional Inherited Members

- Protected Types inherited from INMOST::TagManager
typedef chunk_array
< INMOST_DATA_ENUM_TYPE,
chunk_bits_empty > 
empty_data
 
typedef chunk_array< Tag,
chunk_bits_tags > 
tag_array_type
 
typedef chunk_bulk_array
< chunk_bits_elems > 
dense_sub_type
 
typedef chunk_array
< dense_sub_type,
chunk_bits_dense > 
dense_data_array_type
 
typedef array< sparse_sub_recordsparse_sub_type
 
typedef chunk_array
< sparse_sub_type,
chunk_bits_elems > 
sparse_data_array_type
 
typedef chunk_array
< INMOST_DATA_INTEGER_TYPE,
chunk_bits_elems > 
back_links_type
 
typedef tag_array_type::iterator tag_iterator
 
typedef
tag_array_type::const_iterator 
tag_const_iterator
 
- Protected Member Functions inherited from INMOST::TagManager
 TagManager ()
 
 TagManager (const TagManager &other)
 
TagManageroperator= (TagManager const &other)
 
void ReallocateData (const Tag &t, INMOST_DATA_INTEGER_TYPE etypenum, INMOST_DATA_ENUM_TYPE new_size)
 
void ReallocateData (INMOST_DATA_INTEGER_TYPE etypenum, INMOST_DATA_ENUM_TYPE new_size)
 
__INLINE sparse_sub_type const & GetSparseData (int etypenum, int local_id) const
 
__INLINE sparse_sub_typeGetSparseData (int etypenum, int local_id)
 
__INLINE dense_sub_type const & GetDenseData (int pos) const
 
__INLINE dense_sub_typeGetDenseData (int pos)
 
- Static Protected Member Functions inherited from INMOST::TagManager
static void CopyData (const Tag &t, void *adata, const void *bdata)
 
static void DestroyVariableData (const Tag &t, void *adata)
 
- Protected Attributes inherited from INMOST::TagManager
tag_array_type tags
 
empty_data empty_dense_data
 
dense_data_array_type dense_data
 
sparse_data_array_type sparse_data [NUM_ELEMENT_TYPS]
 
back_links_type back_links [NUM_ELEMENT_TYPS]
 
- Protected Attributes inherited from INMOST::Storage
HandleType handle
 
HandleTypehandle_link
 

Detailed Description

Definition at line 1205 of file inmost_mesh.h.

Member Typedef Documentation

Definition at line 2148 of file inmost_mesh.h.

typedef std::vector<HandleType> INMOST::Mesh::element_set

Definition at line 2147 of file inmost_mesh.h.

Definition at line 1210 of file inmost_mesh.h.

Definition at line 2151 of file inmost_mesh.h.

Definition at line 2992 of file inmost_mesh.h.

Definition at line 2849 of file inmost_mesh.h.

Definition at line 2851 of file inmost_mesh.h.

Definition at line 2847 of file inmost_mesh.h.

Definition at line 2850 of file inmost_mesh.h.

Definition at line 2852 of file inmost_mesh.h.

Definition at line 2848 of file inmost_mesh.h.

Definition at line 2845 of file inmost_mesh.h.

Definition at line 1212 of file inmost_mesh.h.

typedef std::pair<int, buffer_type > INMOST::Mesh::proc_buffer_type

Definition at line 2150 of file inmost_mesh.h.

typedef std::map<int, element_set > INMOST::Mesh::proc_elements

Definition at line 2149 of file inmost_mesh.h.

typedef void(* INMOST::Mesh::ReduceOperation)(const Tag &tag, const Element &element, const INMOST_DATA_BULK_TYPE *recv_data, INMOST_DATA_ENUM_TYPE recv_size)

Definition at line 2145 of file inmost_mesh.h.

Definition at line 1220 of file inmost_mesh.h.

Definition at line 1218 of file inmost_mesh.h.

Definition at line 1216 of file inmost_mesh.h.

typedef std::vector<Tag> INMOST::Mesh::tag_set

Definition at line 2146 of file inmost_mesh.h.

Member Enumeration Documentation

Enumerator
AGhost 
AMigrate 

Definition at line 2143 of file inmost_mesh.h.

Enumerator
Serial 
Parallel 

Definition at line 1208 of file inmost_mesh.h.

Enumerator
UnknownSize 
UnknownSource 

Definition at line 2144 of file inmost_mesh.h.

Constructor & Destructor Documentation

INMOST::Mesh::Mesh ( )
INMOST::Mesh::Mesh ( std::string  name)
INMOST::Mesh::Mesh ( const Mesh other)
INMOST::Mesh::~Mesh ( )

Member Function Documentation

real INMOST::Mesh::AggregateMax ( real  input)
integer INMOST::Mesh::AggregateMax ( integer  input)
void INMOST::Mesh::AggregateMax ( real input,
integer  size 
)
void INMOST::Mesh::AggregateMax ( integer input,
integer  size 
)
real INMOST::Mesh::AggregateMin ( real  input)
integer INMOST::Mesh::AggregateMin ( integer  input)
void INMOST::Mesh::AggregateMin ( real input,
integer  size 
)
void INMOST::Mesh::AggregateMin ( integer input,
integer  size 
)
void INMOST::Mesh::ApplyModification ( )

After this function any link to deleted element will be replaced by InvalidHandle(). This will modify DATA_REFERENCE tags and contents of sets, so that all deleted elements are not referenced anymore. If you have any tags of type DATA_REMOTE_REFERENCE on current mesh linking to the elements of the current mesh or there are other meshes that posses tags of type DATA_REMOTE_REFERENCE and link elements on the current mesh, you should check that there are no links to deleted elements manually with Element::Old().

Todo:
  1. maybe instead of forming set of deleted elements and subtracting set from other sets it is better to remove each modified element (done, check and compare)
  2. parent/child elements in set would not be replaced or reconnected, this may lead to wrong behavior (done, check and compare)
See Also
Element::Old
void INMOST::Mesh::AssignGlobalID ( ElementType  mask)

Assign unique numbers to elements. Internally this will create Mesh::GlobalIDTag and make call to Element::GlobalID and Mesh::GlobalID functions valid. Internally this will also set have_global_id variable that will indicate that all the comparisons in parallel algorithms should be performed using global identificators instead of centroids which is faster.

Todo:
  1. invoking function before loading mesh will not renew global identificators after load but would not unset have_global_id either. There are probably too many places when global ids may become invalid but no flag will be set. It may be benefitial to set such flags along with updating geometrical data which seems to be maintained fairly well during mesh modification
iteratorStorage INMOST::Mesh::Begin ( ElementType  Types)

These iterators skip invalid elements but don't skip modified elements.

iteratorCell INMOST::Mesh::BeginCell ( )
iteratorEdge INMOST::Mesh::BeginEdge ( )
iteratorElement INMOST::Mesh::BeginElement ( ElementType  Types)
iteratorFace INMOST::Mesh::BeginFace ( )
void INMOST::Mesh::BeginModification ( )
iteratorNode INMOST::Mesh::BeginNode ( )
void INMOST::Mesh::BeginSequentialCode ( )
iteratorSet INMOST::Mesh::BeginSet ( )
__INLINE iteratorTag INMOST::Mesh::BeginTag ( )
inline

Returns the first tag defined on the mesh. For safety while iterating through tags you should check for validity of the tag

Returns
first tag

Definition at line 1368 of file inmost_mesh.h.

Here is the call graph for this function:

TopologyCheck INMOST::Mesh::BeginTopologyCheck ( ElementType  etype,
const HandleType adj,
enumerator  num 
)

This function allows you to perform some topologycal checks before you create an element. Function is used internally by CreateEdge, CreateFace, CreateCell functions If you perform topological checks on your own, you'd probably better turn off checks before calling CreateXXX functions. Note that check for duplicates within mesh is performed by Mesh::FindSharedAdjacency.

Todo:
list checks performed inside in description
__INLINE const Tag& INMOST::Mesh::BridgeTag ( ) const
inline

Definition at line 1331 of file inmost_mesh.h.

bulk& INMOST::Mesh::Bulk ( HandleType  h,
const Tag tag 
)

Returns a reference in inner representation to the first element of array of bytes. Future recomendation: If variable size array was not allocated then this function will generate segmentation fault.

If you know that data is certanly dense and fixed or variable on elements you access then it is faster to use specialized variants of this function.

Reference to the data is guaranteed to be valid during mesh modification.

Parameters
helement handle
tagtag that represents data

Here is the caller graph for this function:

bulk_array INMOST::Mesh::BulkArray ( HandleType  h,
const Tag tag 
)

Returns an array of bytes.

If you know that data is certanly sparse or dense on elements you access then it is faster to use variants of this function with hint data structure.

Array data structure is guaranteed to be valid during mesh modification.

Parameters
helement handle
tagtag that represents data

Here is the caller graph for this function:

bulk_array INMOST::Mesh::BulkArrayDF ( HandleType  h,
const Tag tag 
)
inline

Returns an array of bytes in dense array. If you don't know any hint information about tag data you should not use this function.

Asserts will fire in debug mode if assumption that data is dense and fixed is incorrect, no checks performed in release mode (NDEBUG is set), likely to result in segfault.

Note that as array is fixed you shouldn't use any functions that alter size of the array as resize, erase, insert, you may use replace if initial and final size will match, in debug mode assert will fire if you try to do this in release (NDEBUG is set) it will lead to segfault.

Parameters
helement handle
tagtag that represents dense data of fixed size on given handle

Definition at line 1682 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

bulk_array INMOST::Mesh::BulkArrayDV ( HandleType  h,
const Tag tag 
)
inline

Returns an array of bytes in dense array of variable size. If you don't know any hint information about tag data you should not use this function.

Asserts will fire in debug mode if assumption that data is dense and variable is incorrect, no checks performed in release mode (NDEBUG is set).

Parameters
helement handle
tagtag that represents data

Definition at line 1836 of file inmost_mesh.h.

Here is the caller graph for this function:

bulk& INMOST::Mesh::BulkDF ( HandleType  h,
const Tag tag 
)
inline

Returns a reference in dense array to the first element of constant size array of bytes. If you don't know any hint information about tag data you should not use this function.

Asserts will fire in debug mode if assumption that data is dense and fixed is incorrect, no checks performed in release mode (NDEBUG is set).

Parameters
helement handle
tagtag that represents dense data of fixed size on given handle

Definition at line 1617 of file inmost_mesh.h.

Here is the caller graph for this function:

bulk& INMOST::Mesh::BulkDV ( HandleType  h,
const Tag tag 
)
inline

Returns a reference in dense array to the first element of variable size array of bytes. Future recomendation: If array was not allocated then this function will generate segmentation fault.

If you don't know any hint information about tag data you should not use this function.

Asserts will fire in debug mode if assumption that data is dense and variable is incorrect, no checks performed in release mode (NDEBUG is set).

Parameters
helement handle
tagtag that represents data
See Also
TagDenseVariable

Definition at line 1777 of file inmost_mesh.h.

Here is the caller graph for this function:

Cell INMOST::Mesh::CellByLocalID ( integer  lid)
inline

Definition at line 2809 of file inmost_mesh.h.

Here is the call graph for this function:

__INLINE integer INMOST::Mesh::CellLastLocalID ( ) const
inline

Definition at line 2827 of file inmost_mesh.h.

Here is the call graph for this function:

integer INMOST::Mesh::CellNextLocalID ( integer  lid) const
inline

Definition at line 2815 of file inmost_mesh.h.

integer INMOST::Mesh::CellPrevLocalID ( integer  lid) const
inline

Definition at line 2821 of file inmost_mesh.h.

void INMOST::Mesh::Clear ( )

Remove all data and all elements from the mesh Reset geometry service and topology check flags

void INMOST::Mesh::ClearMarkerSpace ( HandleType  h)

Remove all the markers from the element.

Here is the caller graph for this function:

void INMOST::Mesh::ClearTopologyError ( TopologyCheck  mask = ENUMUNDEF)
inline

Revert mesh to clean topology error state.

Definition at line 3080 of file inmost_mesh.h.

void INMOST::Mesh::ComputeGeometricType ( HandleType  h)

Recompute geometrical type of current element and set it to element.

Parameters
hhandle of element
Element::GeometricType INMOST::Mesh::ComputeGeometricType ( ElementType  element_type,
const HandleType lower_adjacent,
INMOST_DATA_ENUM_TYPE  lower_adjacent_size 
) const
__INLINE const Tag& INMOST::Mesh::CoordsTag ( ) const
inline

Definition at line 1322 of file inmost_mesh.h.

enumerator INMOST::Mesh::Count ( const HandleType arr,
enumerator  size,
MarkerType  marker 
) const
integer INMOST::Mesh::CountBoundaryFaces ( )
integer INMOST::Mesh::CountInteriorFaces ( )
std::pair<Cell,bool> INMOST::Mesh::CreateCell ( const ElementArray< Face > &  faces,
const ElementArray< Node > &  suggest_nodes_order = ElementArrayNode >(NULL) 
)
std::pair<Cell,bool> INMOST::Mesh::CreateCell ( const ElementArray< Node > &  c_f_nodes,
const integer c_f_numnodes,
integer  num_c_faces,
const ElementArray< Node > &  suggest_nodes_order = ElementArrayNode >(NULL) 
)
std::pair<Cell,bool> INMOST::Mesh::CreateCell ( const ElementArray< Node > &  c_nodes,
const integer c_f_nodeinds,
const integer c_f_numnodes,
integer  num_c_faces,
const ElementArray< Node > &  suggest_nodes_order = ElementArrayNode >(NULL) 
)
std::pair<Edge,bool> INMOST::Mesh::CreateEdge ( const ElementArray< Node > &  nodes)
std::pair<Face,bool> INMOST::Mesh::CreateFace ( const ElementArray< Edge > &  edges)
std::pair<Face,bool> INMOST::Mesh::CreateFace ( const ElementArray< Node > &  nodes)
MarkerType INMOST::Mesh::CreateMarker ( )

Allocate a new marker. Assert will fire in debug mode (NDEBUG not set) if you run out of space for markers, in this case you either use too many markers, then you can just increase MarkerFields variable (increasing by 1 gives you 8 more markers) or you forget to release markers after you use them.

In release mode (NDEBUG is set) if you run out of space for markers function will return InvalidMarker()

Returns
new marker or InvalidMarker(), see description
Node INMOST::Mesh::CreateNode ( const real coords)

Create node by given coordinates. This operation would not involve searching existing nodes for node with the same coordinates. It is potentially dangerous to have nodes whose coordinates differ by less then GetEpsilon since ResolveShared algorithm would not know how to resolve parallel statuses of the elements. However this may be subject to change, if ResolveShared algorithm will be rewritten to resolve cells first by their centroids and only then resolve all the rest elements by adjacency information.

Parameters
coordsarray of coordinates at least of size GetDimensions()
Returns
interface to created node
MarkerType INMOST::Mesh::CreatePrivateMarker ( )
std::pair<ElementSet,bool> INMOST::Mesh::CreateSet ( std::string  name)
std::pair<ElementSet,bool> INMOST::Mesh::CreateSetUnique ( std::string  name)

Same as Mesh::CreateSet without checking existance of the set.

Tag INMOST::Mesh::CreateTag ( std::string  name,
DataType  dtype,
ElementType  etype,
ElementType  sparse,
INMOST_DATA_ENUM_TYPE  size = ENUMUNDEF 
)

Create the tag by name, type and size. You cannot create the tag with the same name and different type or size.

You may make subsequent calls to the function with the same name, same type and same size (or undefined size, then it will be deduced) but different selection of element.

The following recomendation is for future: When you create data of variable size, every array of data for every element will be empty at first, so before accessing it through mechanism for single-valued data (Real, Integer, Bulk, Reference) you should first resize arrays otherwise your program very likely to be halted by segmentation fault. For this case arrays are not allocated automatically from performance considerations.

Parameters
namename of the tag
dtypetype of the tag
etypethe selection of elements on which the data of the tag is defined, you may use bitwise or operations to define tag on multiple types of elements, example CELL | FACE
sparsethe selection of elements from etype on which the tag is sparse, for example, if you know that the data is used on all cells and only on boundary faces, then you may should set etype = CELL | FACE and sparse = FACE
sizesize of associated data
Returns
returns the tag that represents the data

Here is the caller graph for this function:

integer INMOST::Mesh::DataLocalID ( HandleType  h) const
inline

Retrieve position of the data position of current element. After ReorderEmpty this number is guaranteed to be between 0 and NumberOf(type of element)

Parameters
hhandle of the element
Returns
local id of data

Definition at line 2060 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void INMOST::Mesh::DelData ( HandleType  h,
const Tag tag 
)

Remove tag data from given element. Removes data of variable size and sparse tag data. Clears to zero data of fixed size.

Parameters
hhandle to the element
tagtag that indicates the data

Here is the caller graph for this function:

void INMOST::Mesh::DelDenseData ( HandleType  h,
const Tag tag 
)

Removes data of variable size, clears to zero data of fixed size.

Parameters
hhandle to the element
tagtag that indicates the data

Here is the caller graph for this function:

bool INMOST::Mesh::Delete ( HandleType  h)

This function will hide element in modification state (between BeginModification and EndModification) or call Destroy in non-modification state.

Parameters
hhandle of the element
Returns
if true then element was deleted, otherwise it was hidden
See Also
Mesh::Hide
Mesh::BeginModification
Mesh::EndModification
Mesh::Destroy
Tag INMOST::Mesh::DeleteTag ( Tag  tag,
ElementType  mask = NODE|EDGE|FACE|CELL|ESET|MESH 
)
virtual

Remove the data that is represented by the tag from elements of selected type.

Parameters
tagtag that indicates the data
maskthe selection of the elements on which the data should be removed, may be set by bitwise or operation
Returns
returns tag that returns false on isValid() request if all the data was removed and the tag is no more occupied, otherwise returns the tag
See Also
Tag::isValid

Reimplemented from INMOST::TagManager.

void INMOST::Mesh::DelSparseData ( HandleType  h,
const Tag tag 
)

Removes data of variable size and sparse tag data.

Parameters
hhandle to the element
tagtag that indicates the data

Here is the caller graph for this function:

void INMOST::Mesh::Destroy ( HandleType  h)

Completely destroy element from mesh. This function bypass check that mesh is in modification state and will remove element immediatly. It will disconnect element from lower adjacencies and delete all the upper adjacencies that depend on current element. If you don't want upper adjacencies to be deleted you should first use Element::Disconnect function to explicitly disconnect current element and then destroy it.

Parameters
hhandle of the element
See Also
Element::Disconnect
void INMOST::Mesh::Destroy ( const Storage e)
inline

Shortcut for typed elements.

Definition at line 2092 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Edge INMOST::Mesh::EdgeByLocalID ( integer  lid)
inline

Definition at line 2807 of file inmost_mesh.h.

Here is the call graph for this function:

__INLINE integer INMOST::Mesh::EdgeLastLocalID ( ) const
inline

Definition at line 2825 of file inmost_mesh.h.

Here is the call graph for this function:

integer INMOST::Mesh::EdgeNextLocalID ( integer  lid) const
inline

Definition at line 2813 of file inmost_mesh.h.

integer INMOST::Mesh::EdgePrevLocalID ( integer  lid) const
inline

Definition at line 2819 of file inmost_mesh.h.

Element INMOST::Mesh::ElementByHandle ( HandleType  h)
inline

Definition at line 2795 of file inmost_mesh.h.

Element INMOST::Mesh::ElementByLocalID ( integer  etypenum,
integer  lid 
)
inline

Definition at line 2793 of file inmost_mesh.h.

Here is the call graph for this function:

Element INMOST::Mesh::ElementByLocalID ( ElementType  etype,
integer  lid 
)
inline

Definition at line 2794 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

iteratorStorage INMOST::Mesh::End ( )
iteratorCell INMOST::Mesh::EndCell ( )
iteratorEdge INMOST::Mesh::EndEdge ( )
iteratorElement INMOST::Mesh::EndElement ( )
iteratorFace INMOST::Mesh::EndFace ( )
void INMOST::Mesh::EndModification ( )
iteratorNode INMOST::Mesh::EndNode ( )
void INMOST::Mesh::EndSequentialCode ( )
iteratorSet INMOST::Mesh::EndSet ( )
__INLINE iteratorTag INMOST::Mesh::EndTag ( )
inline

Returns the indicator for loop to end iteration over tags.

Returns
the inexistant tag that is located the one position after the last tag

Definition at line 1374 of file inmost_mesh.h.

Here is the call graph for this function:

TopologyCheck INMOST::Mesh::EndTopologyCheck ( HandleType  e)

This function performs some topologycal checks after construction of element. Function is used internally by CreateEdge, CreateFace, CreateCell functions.

Todo:
list checks performed inside in description.
integer INMOST::Mesh::Enumerate ( ElementType  mask,
Tag  num_tag,
integer  start = 0,
bool  define_sparse = false 
)

Enumerate all elements begining with start and put numeration to data associated with num_tag for all elements with given type mask.

Collective operation.

Parameters
maskbitwise or of types of elements
num_taga tag that is associated with the data
startstarting value for enumeration
define_sparseif true then function will define sparse data on elements that don't have it, otherwise it will skip those elements
Returns
last value on all the processors
integer INMOST::Mesh::Enumerate ( const HandleType h,
enumerator  num,
const Tag num_tag,
integer  start = 0,
bool  define_sparse = true 
)

Enumerate all elements begining with start and put numeration to data associated with num_tag.

Collective operation.

Parameters
harray of handles
numnumber of handles
num_taga tag that is associated with the data
startstarting value for enumeration
define_sparseif true then function will define sparse data on elements that don't have it, otherwise it will skip those elements
Returns
last value on all the processors
template<typename EType >
integer INMOST::Mesh::Enumerate ( const ElementArray< EType > &  elements,
const Tag num_tag,
integer  start = 0,
bool  define_sparse = true 
)
inline

Enumerate all elements begining with start and put numeration to data associated with num_tag.

Collective operation.

Parameters
elementsarray of elements
num_taga tag that is associated with the data
startstarting value for enumeration
define_sparseif true then function will define sparse data on elements that don't have it, otherwise it will skip those elements
Returns
last value on all the processors

Definition at line 2679 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

integer INMOST::Mesh::EnumerateSet ( const ElementSet set,
const Tag num_tag,
integer  start = 0,
bool  define_sparse = true 
)

Enumerate all elements in the set.

Collective operation.

Parameters
sethandle of the set
num_taga tag that is associated with the data
startstarting value for enumeration
define_sparseif true then function will define sparse data on elements that don't have it, otherwise it will skip those elements
Returns
last value on all the processors
ElementSet INMOST::Mesh::EsetByLocalID ( integer  lid)
inline

Definition at line 2810 of file inmost_mesh.h.

Here is the call graph for this function:

__INLINE integer INMOST::Mesh::EsetLastLocalID ( ) const
inline

Definition at line 2828 of file inmost_mesh.h.

Here is the call graph for this function:

integer INMOST::Mesh::EsetNextLocalID ( integer  lid) const
inline

Definition at line 2816 of file inmost_mesh.h.

integer INMOST::Mesh::EsetPrevLocalID ( integer  lid) const
inline

Definition at line 2822 of file inmost_mesh.h.

void INMOST::Mesh::ExchangeData ( const Tag tag,
ElementType  mask,
MarkerType  select 
)

Update data from Shared elements to Ghost elements. For backward direction please see Mesh::ReduceData. If you have a tag of DATA_BULK type and you store your own custom data structure in it, it is highly recomended that you provide MPI information about your structure through Tag::SetBulkDataType, this would not do any difference on homogeneous architecture, but it may help you save a lot of time and nerves in heterogeneous parallel environment.

Todo:
see TODO in Mesh::ReduceData

Blocking, Collective point-2-point

Parameters
tagtag that represents data
maskbitwise or of element types
selectset the marker to filter elements that perform operation, set 0 to select all elements
See Also
Mesh::ReduceData
void INMOST::Mesh::ExchangeData ( const tag_set tags,
ElementType  mask,
MarkerType  select 
)

This function will perform exchange of multiple data tags.

Blocking, Collective point-2-point

Parameters
tagsmultiple tags that represents data
maskbitwise or of element types
selectset the marker to filter elements that perform operation, set 0 to select all elements
void INMOST::Mesh::ExchangeDataBegin ( const Tag tag,
ElementType  mask,
MarkerType  select,
exchange_data storage 
)

Start asynchronous synchronization of data. You should define object of type exchange_data that will hold temporary buffers for data. every Mesh::ExchangeDataBegin should be matched with Mesh::ExchangeDataEnd with the same exchange_data object. After matching Mesh::ExchangeDataEnd the exchange_data object may be reused If you will go out of the scope where exchange_data object was defined it will be deallocated and may result in segmentation fault.

You should also never put the same exchange_data object to any other Mesh::ExchangeDataBegin or Mesh::ReduceDataBegin, until matching Mesh::ExchangeDataEnd because it may override or reallocate buffers, internally used by MPI and remote processor will receive garbage instead of data.

Nonblocking, Collective point-2-point

Parameters
tagtag that represents data
maskbitwise or of element types
selectset the marker to filter elements that perform operation, set 0 to select all elements
storagebuffer that will temporary hold sended data
See Also
Mesh::ExchangeDataEnd
void INMOST::Mesh::ExchangeDataBegin ( const tag_set tags,
ElementType  mask,
MarkerType  select,
exchange_data storage 
)

This function will initialize exchange of multiple data tags. Using this function may lead to good overlapping between communication and computation.

Nonblocking, Collective point-2-point

Parameters
tagsmultiple tags that represents data
maskbitwise or of element types
selectset the marker to filter elements that perform operation, set 0 to select all elements
storagebuffer that will temporary hold sended data
void INMOST::Mesh::ExchangeDataEnd ( const Tag tag,
ElementType  mask,
MarkerType  select,
exchange_data storage 
)

Complete asynchronous synchronization of data.

Blocking

Parameters
tagtag that represents data
maskbitwise or of element types
selectset the marker to filter elements that perform operation, set 0 to select all elements
storagebuffer that will temporary hold sended data
See Also
Mesh::ExchangeDataBegin
void INMOST::Mesh::ExchangeDataEnd ( const tag_set tags,
ElementType  mask,
MarkerType  select,
exchange_data storage 
)

This function will finalize exchange of multiple data tags.

Blocking

Parameters
tagsmultiple tags that represents data
maskbitwise or of element types
selectset the marker to filter elements that perform operation, set 0 to select all elements
storagebuffer that will temporary hold sended data
void INMOST::Mesh::ExchangeGhost ( integer  layers,
ElementType  bridge 
)

Form several layers of ghosted cells that are adjacent through bridge elements to current cells. This function acceptes any mesh topology, failure on some mesh should be considered a bug and sample example should be provided for testing purposes.

This function internally calculates layer by layer and invokes ExchangeMarked for each layer, you can either reproduce the algorithm on your own if you want to bypass the function and call Mesh::ExchangeMarked directly, but then you will lose optimization in Mesh::Redistribute, that expects that layers are formed the same way they are formed in Mesh::ExchangeGhost. Internally it sets up LayersTag and BridgeTag for the mesh with provided values, which are used by Mesh::Redistribute but you are discouraged to override these tags since using non-matching algorithms is not tested and should be considered dangerous.

Nevertheless you can use this function first for layers then request any additional ghosted elements by ExchangeMarked.

Collective point-2-point.

Parameters
layersnumber of required layers of ghosted elements
bridgebitwise mask of elements for which neighbouring cells should be considered a layer
See Also
Mesh::ExchangeMarked
Mesh::Redistribute
void INMOST::Mesh::ExchangeMarked ( enum Action  action = AGhost)

This function realizes two algorithms: ghosting of elements and migration of elements. ghosting:

Creates ghosted elements at other processors prescribed in SendtoTag() performs sending and receiving of elements and all operations to keep parallel state of the mesh.

Given that all the data was up to date among processors all the data at the end of the algorithm will be also up to data

migration:

To correctly perform migration of elements it is necessery to set up tags besides SendToTag(), which indicates to where every element should be sent:

  • tag "TEMPORARY_NEW_PROCESSORS", of type DATA_INTEGER with variable size, tells which processors will have copy of the element after migration;
  • tag "TEMPORARY_NEW_OWNER", of type DATA_INTEGER of size 1, tells which processor will have main copy of the element.

if there is no current processor in "TEMPORARY_NEW_PROCESSORS", then current processor will remove copy of the element. All this actions are performed automatically by Mesh::Redistribute based on information provided in Mesh::RedistributeTag which effectively contains new owner.

Given that all the data was up to date among processors all the data at the end of the algorithm will be also up to data

Todo:
  1. test halo exchange algorithm (if used then change collective point-2-point to collective)
  2. see TODO 2 in Mesh::Redistribute

Collective point-2-point.

Parameters
action
See Also
Mesh::SendtoTag
Mesh::Redistribute
integer INMOST::Mesh::ExclusiveSum ( integer  input)

Compute sum of integer values for all processors with rank lower then current, excluding current processor.

Collective operation.

Parameters
inputvalue on current processor
Returns
described sum
Face INMOST::Mesh::FaceByLocalID ( integer  lid)
inline

Definition at line 2808 of file inmost_mesh.h.

Here is the call graph for this function:

__INLINE integer INMOST::Mesh::FaceLastLocalID ( ) const
inline

Definition at line 2826 of file inmost_mesh.h.

Here is the call graph for this function:

integer INMOST::Mesh::FaceNextLocalID ( integer  lid) const
inline

Definition at line 2814 of file inmost_mesh.h.

integer INMOST::Mesh::FacePrevLocalID ( integer  lid) const
inline

Definition at line 2820 of file inmost_mesh.h.

static void INMOST::Mesh::Finalize ( )
static

Finalizes operation with MPI, recomended to call, otherwise MPI may produce warnings.

HandleType INMOST::Mesh::FindSharedAdjacency ( const HandleType arr,
enumerator  num 
) const

Retrieve upper adjacent that is shared by multiple lower adjacencies.

Returns
handle of found element or InvalidHandle()
HandleType INMOST::Mesh::FirstHandle ( ) const
inline

Definition at line 2801 of file inmost_mesh.h.

Here is the call graph for this function:

HandleType INMOST::Mesh::FirstHandle ( ElementType  etype) const
inline

Definition at line 2803 of file inmost_mesh.h.

Here is the call graph for this function:

integer INMOST::Mesh::FirstLocalID ( ElementType  etype) const
ElementArray<Face> INMOST::Mesh::GatherBoundaryFaces ( )
ElementArray<Face> INMOST::Mesh::GatherInteriorFaces ( )
__INLINE const Tag& INMOST::Mesh::GeomTypeTag ( ) const
inline

Definition at line 1326 of file inmost_mesh.h.

Here is the caller graph for this function:

INMOST_DATA_ENUM_TYPE INMOST::Mesh::GetArrayCapacity ( integer  etypenum)

This function is needed by TagManager, may be made private in future follows definition of chunk_array to estimate current occupancy of arrays

INMOST_MPI_Comm INMOST::Mesh::GetCommunicator ( )

Retrieve MPI communicator.

void INMOST::Mesh::GetData ( HandleType  h,
const Tag tag,
enumerator  shift,
enumerator  size,
void *  data 
) const

Copy inner data array of size elements to provided array begining from shift element. It is assumed that user-provided array don't overlap inner data.

Parameters
hhandle of element
tagtag that represents data
shiftfor which element to start to copy
sizehow many elements to copy
datauser-provided array where data should be copied

Here is the caller graph for this function:

INMOST_DATA_ENUM_TYPE INMOST::Mesh::GetDataCapacity ( HandleType  h,
const Tag tag 
) const

Return the size of the structure required to represent the data on current element. This is equal to GetDataSize times Tag::GetBytesSize for all the data types, except for DATA_VARIABLE, that requires a larger structure to accomodate derivatives.

Parameters
hhandle of element
tagtag that represents the data

Here is the caller graph for this function:

INMOST_DATA_ENUM_TYPE INMOST::Mesh::GetDataSize ( HandleType  h,
const Tag tag 
) const

Return the size of the array. For variable size arrays returns current size of the array. For constant size array returns the same value that may be obtained through GetSize.

Parameters
hhandle of element
tagtag that represents the data
See Also
Tag::GetSize

Here is the caller graph for this function:

__INLINE integer INMOST::Mesh::GetDimensions ( ) const
inline

Get number of dimensions of mesh. Size of the array returned by Node::Coords will match this number.

See Also
Node::Coords

Definition at line 1317 of file inmost_mesh.h.

__INLINE real INMOST::Mesh::GetEpsilon ( ) const
inline

Retrieve tolerance for coordinates comparison.

Returns
real value

Definition at line 1307 of file inmost_mesh.h.

std::string INMOST::Mesh::GetFileOption ( std::string  key)

Get current option corresponding to key.

Parameters
keyoptions for which options should be retrieven
void INMOST::Mesh::GetGeometricData ( HandleType  e,
GeometricData  type,
real ret 
)
const Tag& INMOST::Mesh::GetGeometricTag ( GeometricData  type) const
Element::GeometricType INMOST::Mesh::GetGeometricType ( HandleType  h) const
inline

Definition at line 2040 of file inmost_mesh.h.

Here is the call graph for this function:

bool INMOST::Mesh::GetMarker ( HandleType  h,
MarkerType  n 
) const
inline

Check whether the marker is set one the element.

Parameters
helement handle
nstores byte number and byte bit mask that represent marker

Definition at line 1911 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void INMOST::Mesh::GetMarkerSpace ( HandleType  h,
bulk  copy[MarkerFields] 
) const

Get a copy of the bytes that store markers on the element.

Parameters
helement handle
copystorage to put data to

Here is the caller graph for this function:

static Mesh* INMOST::Mesh::GetMesh ( std::string  name)
static

Find mesh by name.

std::string INMOST::Mesh::GetMeshName ( )

Retrive the name of the current mesh.

__INLINE MeshState INMOST::Mesh::GetMeshState ( ) const
inline

Get parallel state of the mesh

Returns
either Mesh::Serial or Mesh::Parallel

Definition at line 1320 of file inmost_mesh.h.

enumerator INMOST::Mesh::getNext ( const HandleType arr,
enumerator  size,
enumerator  k,
MarkerType  marker 
) const
int INMOST::Mesh::GetParallelFileStrategy ( )
inline

Retrieve currently set parallel strategy for ".pmf" files

See Also
Mesh::GetParallelStrategy

Definition at line 2348 of file inmost_mesh.h.

int INMOST::Mesh::GetParallelStrategy ( )
inline

Retrieve currently set parallel strategy.

See Also
Mesh::SetParallelStrategy

Definition at line 2304 of file inmost_mesh.h.

bool INMOST::Mesh::GetPrivateMarker ( HandleType  h,
MarkerType  n 
) const

Here is the caller graph for this function:

int INMOST::Mesh::GetProcessorRank ( )

Get rank of current processor.

int INMOST::Mesh::GetProcessorsNumber ( )

Get number of processors.

ElementSet INMOST::Mesh::GetSet ( std::string  name)

Retrieve set by name.

Parameters
nameset name
Returns
set whose name match or InvalidHandle()
ElementArray<ElementSet> INMOST::Mesh::GetSetsByPrefix ( std::string  prefix)

Retrieve all the sets whose names start with given prefix.

Element::Status INMOST::Mesh::GetStatus ( HandleType  h) const
inline

Retrieve parallel status of the element. If mesh is in Serial state then call always returns Element::Owned. otherwise it will return:

  • Element::Owned if there is a single copy of the element on the current processor
  • Element::Shared if the main copy of the element is located on the current processor
  • Element::Ghost if current processor stores dependent copy of the element
    Parameters
    hhandle of the element
    Returns
    Element::Status, see function description

Definition at line 2069 of file inmost_mesh.h.

Here is the call graph for this function:

TopologyCheck INMOST::Mesh::GetTopologyCheck ( TopologyCheck  mask = ENUMUNDEF) const
inline

Retrieve currently set topology checks.

Definition at line 3070 of file inmost_mesh.h.

TopologyCheck INMOST::Mesh::GetTopologyError ( TopologyCheck  mask = ENUMUNDEF) const
inline

Retrieve topology error state, this indicates that some error have occured.

Definition at line 3078 of file inmost_mesh.h.

integer& INMOST::Mesh::GlobalID ( HandleType  h)
inline

Retrieve global id of the element with right of modification (dangerous to modify). Run AssignGlobalID so that tag is automatically allocated and shortcut is set within mesh, otherwise tag is not created and call will fail.

Parameters
hhandle of the element
Returns
global id
See Also
Mesh::AssignGlobalID

Definition at line 2048 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

integer INMOST::Mesh::GlobalID ( HandleType  h) const
inline

Retrieve global id of the element without right of modification. Run AssignGlobalID so that tag is automatically allocated and shortcut is set within mesh, otherwise tag is not created and call will fail.

Parameters
hhandle of the element
Returns
global id
See Also
Mesh::AssignGlobalID

Definition at line 2055 of file inmost_mesh.h.

Here is the call graph for this function:

__INLINE const Tag& INMOST::Mesh::GlobalIDTag ( ) const
inline

Definition at line 1321 of file inmost_mesh.h.

Here is the caller graph for this function:

integer INMOST::Mesh::HandleDataPos ( HandleType  h)
inline

For debug purposes.

Definition at line 1272 of file inmost_mesh.h.

Here is the call graph for this function:

bool INMOST::Mesh::HaveData ( HandleType  h,
const Tag tag 
) const

Check whether data is present on given element. Always returns true for dense tag data.

Parameters
hhandle to the element
tagtag that indicates data
Returns
true, if data exists otherwise false

Here is the caller graph for this function:

bool INMOST::Mesh::HaveGeometricData ( GeometricData  type,
ElementType  mask 
) const
inline

Definition at line 3000 of file inmost_mesh.h.

Here is the call graph for this function:

bool INMOST::Mesh::Hidden ( HandleType  h) const

Check whether element is hidden.

Returns
true if hidden
See Also
Mesh::Hide
bool INMOST::Mesh::Hide ( HandleType  h)

Hide element from mesh. All the functions (except direct access like LowConn,HighConn or ElementSet::getElementsHandles) involving adjacencies retrival would not return this element. Works only inside BeginModification and EndModification, on EndModification all Hidden elements are destroyed.

Parameters
hhandle of the element
Returns
if true then element was hidden
See Also
Mesh::BeginModification
Mesh::EndModification
MarkerType INMOST::Mesh::HideMarker ( ) const
inline

Definition at line 3019 of file inmost_mesh.h.

Element::adj_type& INMOST::Mesh::HighConn ( HandleType  h)
inline

Access directly higher order adjacencies of current element with right of modification. This function gives direct access to elements and allows you to overwrite handles which is not recomended. You bypass topology checks, correct connectivity estableshment and geometric data updates. If you do so then check connectivity afterwards by Element::CheckElementConnectivity for debugging purposes. Then for correct function of geometrical algorithms in order from lower modified adjacenices to upper modified adjacencies (if some element have lower adjacencies updated then it should be updated otherwise it shouldn't) call ComputeGeometricType to deduce geometric representation or force it by SetGeometricType, then for element of type CELL call RestoreCellNodes, clear current mutual connection to the nodes and establish new mutual connections from nodes returned by RestoreCellNodes; then for all elements call RecomputeGeometricData to automatically recompute all geometric quantities. Don't forget that edges of the face should be ordered for correct retrival of nodes, otherwise Face::getNodes and Element::getNodes for FACE in 3 dimensions or Cell::getNodes and Element::getNodes for CELL in 2 dimensions will return garbage

  • For NODE this returns edges that are connected to this node;
  • For EDGE this returns faces that are connected to this edge;
  • For FACE this returns cells that are connected to this face
  • For CELL this returns nodes of the cell
  • For ESET first three entries are parent, sibling, child then records represent empty positions in LowConn
Parameters
hhandle of the element
Returns
see description
See Also
Element::CheckElementConnectivity
Element::Connect
Element::Disconnect
Mesh::SetGeometricType
Mesh::ComputeGeometricType
Mesh::RestoreCellNodes
Mesh::RecomputeGeometricData
Face::FixNormalOrientation
Mesh::LowConn

Definition at line 1966 of file inmost_mesh.h.

Here is the call graph for this function:

Element::adj_type const& INMOST::Mesh::HighConn ( HandleType  h) const
inline

Access directly higher order adjacencies of current element without right of modification.

Definition at line 1968 of file inmost_mesh.h.

Here is the call graph for this function:

__INLINE const Tag& INMOST::Mesh::HighConnTag ( ) const
inline

Definition at line 1324 of file inmost_mesh.h.

Here is the caller graph for this function:

static void INMOST::Mesh::Initialize ( int *  argc,
char ***  argv 
)
static

Initial initialization. Calls MPI_Initialize, if MPI was not initialized it is necessery to invoke this function if you plan to use any parallel algorithms Accepts arguments passed to console aplication or NULL

Parameters
argcnumber of arguments for command line
argvstrings of arguments of command line
integer& INMOST::Mesh::Integer ( HandleType  h,
const Tag tag 
)

Returns a reference to inner memory location of the first element of the array of integer values. Future recomendation: If variable size array was not allocated then this function will generate segmentation fault.

If you know that data is certanly dense and fixed or variable on elements you access then it is faster to use specialized variants of this function.

Reference to the data is guaranteed to be valid during mesh modification.

Parameters
helement handle
tagtag that represents data

Here is the caller graph for this function:

integer_array INMOST::Mesh::IntegerArray ( HandleType  h,
const Tag tag 
)

Returns an array of integer values. If you know that data is certanly dense and fixed or variable on elements you access then it is faster to use specialized variants of this function. variants of this function with hint data structure.

Array data structure is guaranteed to be valid during mesh modification.

Parameters
helement handle
tagtag that represents data

Here is the caller graph for this function:

integer_array INMOST::Mesh::IntegerArrayDF ( HandleType  h,
const Tag tag 
)
inline

Returns an array of integer values in dense array. If you don't know any hint information about tag data you should not use this function.

Asserts will fire in debug mode if assumption that data is dense and fixed is incorrect, no checks performed in release mode (NDEBUG is set), likely to result in segfault.

Note that as array is fixed you shouldn't use any functions that alter size of the array as resize, erase, insert, you may use replace if initial and final size will match, in debug mode assert will fire if you try to do this in release (NDEBUG is set) it will lead to segfault.

Parameters
helement handle
tagtag that represents dense data of fixed size on given handle

Definition at line 1669 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

integer_array INMOST::Mesh::IntegerArrayDV ( HandleType  h,
const Tag tag 
)
inline

Returns an array of integer values in dense array of variable size. If you don't know any hint information about tag data you should not use this function.

Asserts will fire in debug mode if assumption that data is dense and variable is incorrect, no checks performed in release mode (NDEBUG is set).

Parameters
helement handle
tagtag that represents data

Definition at line 1827 of file inmost_mesh.h.

Here is the caller graph for this function:

integer& INMOST::Mesh::IntegerDF ( HandleType  h,
const Tag tag 
)
inline

Returns a reference to inner memory location of the first element of the array of integer values. If you don't know any hint information about tag data you should not use this function.

Asserts will fire in debug mode if assumption that data is dense and fixed is incorrect, no checks performed in release mode (NDEBUG is set).

Parameters
helement handle
tagtag that represents dense data of fixed size on given handle

Definition at line 1608 of file inmost_mesh.h.

Here is the caller graph for this function:

integer& INMOST::Mesh::IntegerDV ( HandleType  h,
const Tag tag 
)
inline

Returns a reference in dense array to the first element of variable size array of integer values. Future recomendation: If array was not allocated then this function will generate segmentation fault.

If you don't know any hint information about tag data you should not use this function.

Asserts will fire in debug mode if assumption that data is dense and variable is incorrect, no checks performed in release mode (NDEBUG is set).

Parameters
helement handle
tagtag that represents data

Definition at line 1764 of file inmost_mesh.h.

Here is the caller graph for this function:

real INMOST::Mesh::Integrate ( real  input)

Integrate real value over all processors.

Collective operation.

Parameters
inputValue on current processor
Returns
Sum over all processors
integer INMOST::Mesh::Integrate ( integer  input)

Integrate integer value over all processors.

Collective operation.

Parameters
inputValue on current processor
Returns
Sum over all processors
void INMOST::Mesh::Integrate ( real input,
integer  size 
)

Integrate an array of real values over all processors.

Collective operation.

Parameters
inputAn array of values on current processor.
sizeSize of the array.
Returns
sum over all processors.
void INMOST::Mesh::Integrate ( integer input,
integer  size 
)

Integrate an array of integer values over all processors.

Collective operation.

Parameters
inputAn array of values on current processor.
sizeSize of the array.
Returns
Sum over all processors.
real INMOST::Mesh::Integrate ( const Tag t,
enumerator  entry,
ElementType  mask 
)

Integrate data corresponding to tag between all processors. Elements without the data defined on them or when entry not present will be skipped.

Collective operation.

Parameters
ttag that correspond to data to be integrated
entryin the array of data
maskbitwise or of types of elements on which to integrate
Returns
sum between all processors
bool INMOST::Mesh::isMeshModified ( ) const
inline

Check whether code runs between Mesh::BeginModification, Mesh::EndModification scope. In case mesh is modified, on element construction Mesh::TieElements will always place elements to the end of the array as a result all the newly created elements will be iterated after current or hidden elements.

Definition at line 3018 of file inmost_mesh.h.

bool INMOST::Mesh::isParallelFileFormat ( std::string  File)
bool INMOST::Mesh::isValidCell ( integer  lid) const
inline

Definition at line 1406 of file inmost_mesh.h.

Here is the call graph for this function:

bool INMOST::Mesh::isValidEdge ( integer  lid) const
inline

Definition at line 1408 of file inmost_mesh.h.

Here is the call graph for this function:

bool INMOST::Mesh::isValidElement ( integer  etypenum,
integer  lid 
) const
inline

Definition at line 1404 of file inmost_mesh.h.

Here is the caller graph for this function:

bool INMOST::Mesh::isValidElement ( ElementType  etype,
integer  lid 
) const
inline

Definition at line 1405 of file inmost_mesh.h.

Here is the call graph for this function:

bool INMOST::Mesh::isValidElement ( HandleType  h) const
inline

Definition at line 1411 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

bool INMOST::Mesh::isValidElementSet ( integer  lid) const
inline

Definition at line 1410 of file inmost_mesh.h.

Here is the call graph for this function:

bool INMOST::Mesh::isValidFace ( integer  lid) const
inline

Definition at line 1407 of file inmost_mesh.h.

Here is the call graph for this function:

bool INMOST::Mesh::isValidHandleRange ( HandleType  h) const
bool INMOST::Mesh::isValidNode ( integer  lid) const
inline

Definition at line 1409 of file inmost_mesh.h.

Here is the call graph for this function:

HandleType INMOST::Mesh::LastCreated ( ) const
inline

Definition at line 1401 of file inmost_mesh.h.

HandleType INMOST::Mesh::LastHandle ( ) const
inline

Definition at line 2802 of file inmost_mesh.h.

Here is the call graph for this function:

HandleType INMOST::Mesh::LastHandle ( ElementType  etype) const
inline

Definition at line 2804 of file inmost_mesh.h.

Here is the call graph for this function:

integer INMOST::Mesh::LastLocalID ( integer  n) const
inline

Definition at line 2832 of file inmost_mesh.h.

Here is the call graph for this function:

integer INMOST::Mesh::LastLocalID ( ElementType  etype) const
inline

Definition at line 2833 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

__INLINE const Tag& INMOST::Mesh::LayersTag ( ) const
inline

Definition at line 1330 of file inmost_mesh.h.

void INMOST::Mesh::Load ( std::string  File)

Acceptable file formats for reading

  • ".vtk" - legacy vtk format for unstructured grid
  • ".pvtk" - legacy parallel vtk format
  • ".gmv" - format acceptable by general mesh viewer
  • ".msh" - gmsh generator format
  • ".grdecl" - eclipse format (under construction)
  • ".grid" - mesh format by Mohammad Karimi-Fard
  • ".pmf" - internal parallel portable binary format, saves all features
Parameters
Filepath to the file
Todo:
  1. When loading mesh with the same tag name but different type or size, load will fail.
  2. When loading tags in internal format should remember definition and sparsity masks for subsequent data loading. This will cure the case when tags were already priviously defined on mesh with different masks and data will be red incorrectly.
void INMOST::Mesh::LoadECL ( std::string  File)
void INMOST::Mesh::LoadMKF ( std::string  File)
void INMOST::Mesh::LoadMSH ( std::string  File)
void INMOST::Mesh::LoadPMF ( std::string  File)
void INMOST::Mesh::LoadPVTK ( std::string  File)
void INMOST::Mesh::LoadVTK ( std::string  File)
void INMOST::Mesh::LoadXML ( std::string  File)
Element::adj_type& INMOST::Mesh::LowConn ( HandleType  h)
inline

Access directly lower order adjacencies of current element with right of modification. This function gives direct access to elements and allows you to overwrite handles. If you are going to overwrite them then read recomendations in description for HighConn function.

  • For NODE this returns cells that are connected to this node;
  • For EDGE this returns nodes of the edge
  • For FACE this returns edges of the face
  • For CELL this returns faces of the cell
  • For ESET handles of the elements that this set contain
    Parameters
    hhandle of the element
    Returns
    see description
    See Also
    Mesh::HighConn

Definition at line 1980 of file inmost_mesh.h.

Here is the call graph for this function:

Element::adj_type const& INMOST::Mesh::LowConn ( HandleType  h) const
inline

Access directly lower order adjacencies of current element without right of modification.

Definition at line 1982 of file inmost_mesh.h.

Here is the call graph for this function:

__INLINE const Tag& INMOST::Mesh::LowConnTag ( ) const
inline

Definition at line 1323 of file inmost_mesh.h.

Here is the caller graph for this function:

__INLINE const Tag& INMOST::Mesh::MarkersTag ( ) const
inline

Definition at line 1325 of file inmost_mesh.h.

Here is the caller graph for this function:

enumerator INMOST::Mesh::MemoryUsage ( HandleType  h)

For parmetis return total number in bytes of occupied memory by element and its data

bool INMOST::Mesh::New ( HandleType  h) const

Check whether element is new. Works only in modification state (between BeginModification and EndModification), when you create elements all of them are marked.

Returns
true if new
See Also
Mesh::BeginModification
Mesh::EndModification
MarkerType INMOST::Mesh::NewMarker ( ) const
inline

Definition at line 3020 of file inmost_mesh.h.

HandleType INMOST::Mesh::NextHandle ( HandleType  h) const
HandleType INMOST::Mesh::NextHandle ( HandleType  h,
ElementType  mask 
) const
integer INMOST::Mesh::NextLocalID ( ElementType  etype,
integer  lid 
) const
inline

Definition at line 2829 of file inmost_mesh.h.

Here is the call graph for this function:

Node INMOST::Mesh::NodeByLocalID ( integer  lid)
inline

Definition at line 2806 of file inmost_mesh.h.

Here is the call graph for this function:

__INLINE integer INMOST::Mesh::NodeLastLocalID ( ) const
inline

Definition at line 2824 of file inmost_mesh.h.

Here is the call graph for this function:

integer INMOST::Mesh::NodeNextLocalID ( integer  lid) const
inline

Definition at line 2812 of file inmost_mesh.h.

integer INMOST::Mesh::NodePrevLocalID ( integer  lid) const
inline

Definition at line 2818 of file inmost_mesh.h.

integer INMOST::Mesh::NumberOf ( ElementType  t) const
__INLINE integer INMOST::Mesh::NumberOfAll ( ) const
inline

Definition at line 2842 of file inmost_mesh.h.

Here is the call graph for this function:

__INLINE integer INMOST::Mesh::NumberOfCells ( ) const
inline

Definition at line 2837 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

__INLINE integer INMOST::Mesh::NumberOfEdges ( ) const
inline

Definition at line 2839 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

__INLINE integer INMOST::Mesh::NumberOfElements ( ) const
inline

Definition at line 2841 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

__INLINE integer INMOST::Mesh::NumberOfFaces ( ) const
inline

Definition at line 2838 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

__INLINE integer INMOST::Mesh::NumberOfNodes ( ) const
inline

Definition at line 2840 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

__INLINE integer INMOST::Mesh::NumberOfSets ( ) const
inline

Definition at line 2836 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

__INLINE enumerator INMOST::Mesh::NumberOfTags ( ) const
inline

Retrieve the total number of valid tags.

Returns
returns the number of valid tags

Definition at line 1371 of file inmost_mesh.h.

Here is the call graph for this function:

Mesh& INMOST::Mesh::operator= ( Mesh const &  other)
__INLINE const Tag& INMOST::Mesh::OwnerTag ( ) const
inline

Definition at line 1329 of file inmost_mesh.h.

void INMOST::Mesh::PrepareGeometricData ( GeomParam  table)
HandleType INMOST::Mesh::PrevHandle ( HandleType  h) const
HandleType INMOST::Mesh::PrevHandle ( HandleType  h,
ElementType  mask 
) const
integer INMOST::Mesh::PrevLocalID ( ElementType  etype,
integer  lid 
) const
inline

Definition at line 2830 of file inmost_mesh.h.

Here is the call graph for this function:

__INLINE const Tag& INMOST::Mesh::ProcessorsTag ( ) const
inline

Definition at line 1332 of file inmost_mesh.h.

real& INMOST::Mesh::Real ( HandleType  h,
const Tag tag 
)

Returns a reference to inner memory location of the first element of the array of real values. Future recomendation: If variable size array was not allocated then this function will generate segmentation fault.

If you know that data is certanly dense and fixed or variable on elements you access then it is faster to use specialized variants of this function.

Reference to the data is guaranteed to be valid during mesh modification.

Parameters
helement handle
tagtag that represents data
See Also
Mesh::RealDF
Mesh::RealDV

Here is the caller graph for this function:

real_array INMOST::Mesh::RealArray ( HandleType  h,
const Tag tag 
)

Returns an array of real values. If you know that data is certanly dense on elements you access then it is faster to use variants of this function with hint data structure.

Array data structure is guaranteed to be valid during mesh modification.

Parameters
helement handle
tagtag that represents data

Here is the caller graph for this function:

real_array INMOST::Mesh::RealArrayDF ( HandleType  h,
const Tag tag 
)
inline

Returns an array of real values in dense array. If you don't know any hint information about tag data you should not use this function.

Asserts will fire in debug mode if assumption that data is dense and fixed is incorrect, no checks performed in release mode (NDEBUG is set).

Note that as array is fixed you shouldn't use any functions that alter size of the array as resize, erase, insert, you may use replace if initial and final size will match, in debug mode assert will fire if you try to do this in release (NDEBUG is set) it will lead to segfault.

Parameters
helement handle
tagtag that represents dense data of fixed size on given handle

Definition at line 1656 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

real_array INMOST::Mesh::RealArrayDV ( HandleType  h,
const Tag tag 
)
inline

Returns an array of real values in dense array of variable size. If you don't know any hint information about tag data you should not use this function.

Asserts will fire in debug mode if assumption that data is dense and variable is incorrect, no checks performed in release mode (NDEBUG is set).

Parameters
helement handle
tagtag that represents data

Definition at line 1818 of file inmost_mesh.h.

Here is the caller graph for this function:

real& INMOST::Mesh::RealDF ( HandleType  h,
const Tag tag 
)
inline

Returns a reference to inner memory location of the first element of the array of real values. If you don't know any hint information about tag data you should not use this function.

Asserts will fire in debug mode if assumption that data is dense and fixed is incorrect, no checks performed in release mode (NDEBUG is set).

Parameters
helement handle
tagtag that represents data

Definition at line 1599 of file inmost_mesh.h.

Here is the caller graph for this function:

real& INMOST::Mesh::RealDV ( HandleType  h,
const Tag tag 
)
inline

Returns a reference in dense array to the first element of variable size array of real values. Future recomendation: If array was not allocated (resized) then this function will generate segmentation fault.

If you don't know any hint information about tag data you should not use this function.

Asserts will fire in debug mode if assumption that data is dense and variable is incorrect, no checks performed in release mode (NDEBUG is set).

Parameters
helement handle
tagtag that represents data

Definition at line 1752 of file inmost_mesh.h.

Here is the caller graph for this function:

void INMOST::Mesh::RecomputeGeometricData ( HandleType  e)
void INMOST::Mesh::RecomputeParallelStorage ( ElementType  mask)

Regather ghosted and shared element sets for data exchange. This function will be quite useful if you change statuses of elements or modify mesh on your own bypassing internal algorithms.

No action will be performed if USE_PARALLEL_STORAGE is not set in inmost_common.h, since all the elements are computed during exchange phase.

Generally this is not needed if you use high-level algorithms for mesh modification or mesh redistribution.

Parameters
maskbitwise type mask
See Also
Mesh::BeginModification
Mesh::EndModification
Mesh::ExchangeMarked
Mesh::RemoveGhostElements
void INMOST::Mesh::Redistribute ( )

Migrate all the elements to the new owners prescribed in data corresponding to RedistributeTag. This will perform all the actions to send mesh elements and data and reproduce new mesh partitions on remote elements and correctly resolve parallel state of the mesh. If you have priviously prescribed number of layers through ExchangeGhost, then minimal number of actions will be performed to reproduce layers of ghosted elements whithout involving removal of all ghosted elements.

Internally function sets up following data on elements using provided information:

  • "TEMPORARY_NEW_PROCESSORS" - new set processors that contain copy of the element
  • "TEMPORARY_NEW_OWNER" - new owner for each processor (effectively RedistributeTag)

Action of this function regarding restoration of layers of ghosted elements in the case you have modified mesh without involving Mesh::ResolveModification is yet to be tested and should be considered dangerous.

If you have output from Zoltan or ParMetis for cells of the mesh then just write this output to RedistributeTag and call Mesh::Redistribute.

Todo:
  1. introduce "TEMPORARY_KEEP_GHOSTED" tag that will store processors on which copy of element should be kept, internally just merge it with "TEMPORARY_NEW_PROCESSORS" tag this will allow user to control ghosting of certain elements and not to invoke ExchangeMarked every time after Redistribute. This is probably already done using Mesh::SendtoTag, because function fills it without clearing and ExchangeMarked performs initial action based on SendtoTag, it is due to check that SendtoTag is properly merged with "TEMPORARY_NEW_PROCESSORS" before call to ExchangeMarked and received elements are not deleted by accident.
  2. let user provide any integer tag as input without involving RedistributeTag

Collective point-2-point.

See Also
Mesh::RedistributeTag
Mesh::ExchangeGhost
__INLINE Tag INMOST::Mesh::RedistributeTag ( )
inline

Don't put this shortcut to any function directly, as it creates tag inside assign to other object of type Tag and put this object to functions.

Definition at line 1337 of file inmost_mesh.h.

Here is the call graph for this function:

void INMOST::Mesh::ReduceData ( const Tag tag,
ElementType  mask,
MarkerType  select,
ReduceOperation  op 
)

Accumulation of data from ghost elements to shared elements.

Accumulation is performed based on user-provided function. When processor - owner of the element receives data addressed to this element then it calls user-defined op function. Since there may be multiple ghost elements per one shared element, function may be called multiple times.

Several examples of reduction functions may be found within the mesh_parallel.cpp source.

Remember that the result will be up to date only on the owner processor of the element. You will have to run Mesh::ExchangeData to make the data up to date among all of the processors.

If you have a tag of DATA_BULK type and you store your own custom data structure in it, it is highly recomended that you provide MPI information about your structure through Tag::SetBulkDataType, this would not do any difference on homogeneous architecture, but it may help you save a lot of time and nerves in heterogeneous parallel environment.

Exchanging tags of DATA_REFERNCE is not implemented, TODO 14.

Todo:
  1. Exchanging DATA_REFERENCE,DATA_REMOTE_REFERENCE tags not implemented, this is due to the absence of any conclusion
  • on how it should behave: either only search within elements owned by the other processor and establish references and set InvalidHandle() to elements that are not found (fairly easy, will involve search operations to check against owned elements for similar entry, efficient implementation will require bounding search trees (see TODO 49);
  • or: send all the referenced elements through PackElementsData and establish all the links within elements reproduced by UnpackElementsData (UnpackElementsData calls UnpackTagData with set of unpacked elements using which it will be very comfortable to establish references on remote processor). Drawback is that exchanging laplacian operator in such a manner should result in the whole grid being shared among all the processors.

Blocking, Collective point-2-point

Parameters
tagtag that represents data
maskbitwise or of element types
selectset the marker to filter elements that perform operation, set 0 to select all elements
opuser-defined operation on received data
See Also
Mesh::ExchangeData
void INMOST::Mesh::ReduceData ( const tag_set tags,
ElementType  mask,
MarkerType  select,
ReduceOperation  op 
)

This function will perform reduction of multiple data tags. Note that function will be the same for all tags, you can differentiate behavior of function depending on tag name (may be expensive).

Blocking, collective point-2-point

Parameters
tagsmultiple tags that represents data
maskbitwise or of element types
selectset the marker to filter elements that perform operation, set 0 to select all elements
opuser-defined operation on received data
void INMOST::Mesh::ReduceDataBegin ( const Tag tag,
ElementType  mask,
MarkerType  select,
exchange_data storage 
)

This function intializes data reduction. Read recomendations about exchange_storage object in Mesh::ExchangeDataBegin

Nonblocking, Collective point-2-point

Parameters
tagtag that represents data
maskbitwise or of element types
selectset the marker to filter elements that perform operation, set 0 to select all elements
storagebuffer that will temporary hold sended data
See Also
Mesh::ReduceData
Mesh::ExchangeDataBegin
void INMOST::Mesh::ReduceDataBegin ( const tag_set tags,
ElementType  mask,
MarkerType  select,
exchange_data storage 
)

This function will initialize reduction of multiple data tags.

Nonblocking, collective point-2-point

Parameters
tagsmultiple tags that represents data
maskbitwise or of element types
selectset the marker to filter elements that perform operation, set 0 to select all elements
storagebuffer that will temporary hold sended data
void INMOST::Mesh::ReduceDataEnd ( const Tag tag,
ElementType  mask,
MarkerType  select,
ReduceOperation  op,
exchange_data storage 
)

This function completes data reduction. Read Mesh::ReduceData for information about op function

Blocking

Parameters
tagtag that represents data
maskbitwise or of element types
selectset the marker to filter elements that perform operation, set 0 to select all elements
storagebuffer that will temporary hold sended data
opuser-defined operation on received data
See Also
Mesh::ReduceData
void INMOST::Mesh::ReduceDataEnd ( const tag_set tags,
ElementType  mask,
MarkerType  select,
ReduceOperation  op,
exchange_data storage 
)

This function will finalize exchange of multiple data tags.

Blocking

Parameters
tagsmultiple tags that represents data
maskbitwise or of element types
selectset the marker to filter elements that perform operation, set 0 to select all elements
storagebuffer that will temporary hold sended data
opuser-defined operation on received data
reference& INMOST::Mesh::Reference ( HandleType  h,
const Tag tag 
)

Returns a reference in an inner representation to the first element of array of element handles. Future recomendation: If variable size array was not allocated then this function will generate segmentation fault.

If you know that data is certanly dense and fixed or variable on elements you access then it is faster to use specialized variants of this function.

Reference to the data is guaranteed to be valid during mesh modification.

Using handle you can construct objects of type Storage, Element, Node, Edge, Face, Cell, ElementSet by calling their constructor with pointer to mesh and handle as arguments.

Parameters
helement handle
tagtag that represents data

Here is the caller graph for this function:

reference_array INMOST::Mesh::ReferenceArray ( HandleType  h,
const Tag tag 
)

Returns an array of element handles.

If you know that data is certanly sparse or dense on elements you access then it is faster to use variants of this function with hint data structure.

The class reference_array that is used to represent array of elements stores handles inside but accessing them through square scopes [] or by arrow -> in iterator will automatically form object of type Element. If you are not sure that stored handles are valid, you should either check that by Element::isValid (involves deep check) or test handle against InvalidHandle (simple check). To obtain handle you may use reference_array::at function or dereference * operator for iterator. If you need custom object like Node, Edge, Face, Cell or ElementSet you may use Element::getAsNode, Element::getAsEdge, Element::getAsFace, Element::getAsCell and Element::getAsSet functions.

Array data structure is guaranteed to be valid during mesh modification. If you delete elements by Mesh::Delete or Element::Delete all the references are also will be valid and reverted to InvalidHandle on Mesh::ApplyModification. If you use Mesh::Destroy to delete mesh elements or you delete elements not within modification state then references may become either invalid but not testable against InvalidHandle (situation may be tested by Element::isValid or Mesh::isValidHandle) or reference may be reused by another element. If you mix deletion and construction of elements then there is no way to resolve this situation, except if you have created only one element, then it may be retrieved by Mesh::LastHandle.

Parameters
helement handle
tagtag that represents data
See Also
InvalidHandle
Element::isValid
Element::getAsNode
Element::getAsEdge
Element::getAsFace
Element::getAsCell
Element::getAsSet

Here is the caller graph for this function:

reference_array INMOST::Mesh::ReferenceArrayDF ( HandleType  h,
const Tag tag 
)
inline

Returns an array of element handles in dense array. If you don't know any hint information about tag data you should not use this function.

Asserts will fire in debug mode if assumption that data is dense and fixed is incorrect, no checks performed in release mode (NDEBUG is set), likely to result in segfault.

Note that as array is fixed you shouldn't use any functions that alter size of the array as resize, erase, insert, you may use replace if initial and final size will match, in debug mode assert will fire if you try to do this in release (NDEBUG is set) it will lead to segfault.

The class reference_array that is used to represent array of elements stores handles inside but accessing them through square scopes [] or by arrow -> in iterator will automatically form object of type Element. If you are not sure that stored handles are valid, you should either check that by Element::isValid (involves deep check) or test handle against InvalidHandle (simple check). To obtain handle you may use reference_array::at function or dereference * operator for iterator. If you need custom object like Node, Edge, Face, Cell or ElementSet you may use Element::getAsNode, Element::getAsEdge, Element::getAsFace, Element::getAsCell and Element::getAsSet functions.

Parameters
helement handle
tagtag that represents dense data of fixed size on given handle
See Also
InvalidHandle
Element::isValid
Element::getAsNode
Element::getAsEdge
Element::getAsFace
Element::getAsCell
Element::getAsSet

Definition at line 1711 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

reference_array INMOST::Mesh::ReferenceArrayDV ( HandleType  h,
const Tag tag 
)
inline

Returns an array of element handles in dense array of variable size. If you don't know any hint information about tag data you should not use this function.

Asserts will fire in debug mode if assumption that data is dense and variable is incorrect, no checks performed in release mode (NDEBUG is set).

The class reference_array that is used to represent array of elements stores handles inside but accessing them through square scopes [] or by arrow -> in iterator will automatically form object of type Element. If you are not sure that stored handles are valid, you should either check that by Element::isValid (involves deep check) or test handle against InvalidHandle (simple check). To obtain handle you may use reference_array::at function or dereference * operator for iterator. If you need custom object like Node, Edge, Face, Cell or ElementSet you may use Element::getAsNode, Element::getAsEdge, Element::getAsFace, Element::getAsCell and Element::getAsSet functions.

Parameters
helement handle
tagtag that represents data
See Also
InvalidHandle
Element::isValid
Element::getAsNode
Element::getAsEdge
Element::getAsFace
Element::getAsCell
Element::getAsSet

Definition at line 1861 of file inmost_mesh.h.

Here is the caller graph for this function:

reference& INMOST::Mesh::ReferenceDF ( HandleType  h,
const Tag tag 
)
inline

Returns a reference in dense array to the first element of constant size array of element handles. If you don't know any hint information about tag data you should not use this function.

Asserts will fire in debug mode if assumption that data is dense and fixed is incorrect, no checks performed in release mode (NDEBUG is set).

Using handle you can construct objects of type Storage, Element, Node, Edge, Face, Cell, ElementSet by calling their constructor with pointer to mesh and handle as arguments.

Parameters
helement handle
tagtag that represents dense data of fixed size on given handle

Definition at line 1630 of file inmost_mesh.h.

Here is the caller graph for this function:

reference& INMOST::Mesh::ReferenceDV ( HandleType  h,
const Tag tag 
)
inline

Returns a reference in dense array to the first element of variable size array of element handles. Future recomendation: If array was not allocated then this function will generate segmentation fault.

If you don't know any hint information about tag data you should not use this function.

Asserts will fire in debug mode if assumption that data is dense and variable is incorrect, no checks performed in release mode (NDEBUG is set).

Using handle you can construct objects of type Storage, Element, Node, Edge, Face, Cell, ElementSet by calling their constructor with pointer to mesh and handle as arguments.

Parameters
helement handle
tagtag that represents data

Definition at line 1793 of file inmost_mesh.h.

Here is the caller graph for this function:

void INMOST::Mesh::ReleaseMarker ( MarkerType  n)

Release marker back for reuse. This function will only notice mesh that the marker is free to be reused, this will not clear markers from elements. Before releasing the marker you should ensure that all the marker is removed from all the elements. Since many inner algorithms use markers, not properly clearing markers from elements may lead to undefined behavior.

Since it is expensive to check asserts will fire in debug mode (NDEBUG not set) only if you define CHECKS_MARKERS in inmost_common.h, no checks will be performed in release mode(NDEBUG is set).

Parameters
nbyte position and byte bit mask
void INMOST::Mesh::ReleasePrivateMarker ( MarkerType  n)
void INMOST::Mesh::RemMarker ( HandleType  h,
MarkerType  n 
)
inline

Remove the marker from the element.

Parameters
helement handle
nstores byte number and byte bit mask that represent marker

Definition at line 1916 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void INMOST::Mesh::RemMarkerArray ( const HandleType h,
enumerator  n,
MarkerType  m 
)
inline

Remove the marker from the set of handles.

Parameters
hset of handles
nnumber of handles
mstores byte number and byte bit mask that represent marker
See Also
Mesh::RemMarker

Definition at line 1923 of file inmost_mesh.h.

Here is the call graph for this function:

remote_reference& INMOST::Mesh::RemoteReference ( HandleType  h,
const Tag tag 
)

Returns a reference in an inner representation to the first element of array of element remote handles. Future recomendation: If variable size array was not allocated then this function will generate segmentation fault.

If you know that data is certanly dense and fixed or variable on elements you access then it is faster to use specialized variants of this function.

Reference to the data is guaranteed to be valid during mesh modification.

Using remote handle you can construct objects of type Element with the function MakeElement or MakeElementRef.

Parameters
helement handle
tagtag that represents data
See Also
MakeElement
MakeElementRef

Here is the caller graph for this function:

remote_reference_array INMOST::Mesh::RemoteReferenceArray ( HandleType  h,
const Tag tag 
)

Returns an array of element remote handles. If you know that data is certanly sparse or dense on elements you access then it is faster to use variants of this function with hint data structure.

The class reference_array that is used to represent array of elements stores remote handles inside but accessing them through square scopes [] or by arrow -> in iterator will automatically form an object of type Element. If you are not sure that stored handles are valid, you should either check that by Element::isValid (involves deep check) or test handle against InvalidHandle (simple check). To obtain remote handle you may use remote_reference_array::at function or dereference * operator for iterator. If you need custom object like Node, Edge, Face, Cell or ElementSet you may use Element::getAsNode, Element::getAsEdge, Element::getAsFace, Element::getAsCell and Element::getAsSet functions.

Array data structure is guaranteed to be valid during mesh modification. If you delete elements by Mesh::Delete or Element::Delete all the references are also will be valid and reverted to InvalidHandle on Mesh::ApplyModification. If you use Mesh::Destroy to delete mesh elements or you delete elements not within modification state then references may become either invalid but not testable against InvalidHandle (situation may be tested by Element::isValid or Mesh::isValidHandle) or reference may be reused by another element. If you mix deletion and construction of elements then there is no way to resolve this situation, except if you have created only one element, then it may be retrieved by Mesh::LastHandle.

Parameters
helement handle
tagtag that represents data
See Also
InvalidHandle
Element::isValid
Element::getAsNode
Element::getAsEdge
Element::getAsFace
Element::getAsCell
Element::getAsSet

Here is the caller graph for this function:

remote_reference_array INMOST::Mesh::RemoteReferenceArrayDF ( HandleType  h,
const Tag tag 
)
inline

Returns an array of element remote handles in dense array. If you don't know any hint information about tag data you should not use this function.

Asserts will fire in debug mode if assumption that data is dense and fixed is incorrect, no checks performed in release mode (NDEBUG is set), likely to result in segfault.

Note that as array is fixed you shouldn't use any functions that alter size of the array as resize, erase, insert, you may use replace if initial and final size will match, in debug mode assert will fire if you try to do this in release (NDEBUG is set) it will lead to segfault.

The class remote_reference_array that is used to represent array of elements stores handles inside but accessing them through square scopes [] or by arrow -> in iterator will automatically form object of type Element. If you are not sure that stored handles are valid, you should either check that by Element::isValid (involves deep check) or test handle against InvalidHandle (simple check). To obtain handle you may use reference_array::at function or dereference * operator for iterator. If you need custom object like Node, Edge, Face, Cell or ElementSet you may use Element::getAsNode, Element::getAsEdge, Element::getAsFace, Element::getAsCell and Element::getAsSet functions.

Parameters
helement handle
tagtag that represents dense data of fixed size on given handle
See Also
InvalidHandle
Element::isValid
Element::getAsNode
Element::getAsEdge
Element::getAsFace
Element::getAsCell
Element::getAsSet

Definition at line 1740 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

remote_reference_array INMOST::Mesh::RemoteReferenceArrayDV ( HandleType  h,
const Tag tag 
)
inline

Returns an array of element remote handles in dense array of variable size. If you don't know any hint information about tag data you should not use this function.

Asserts will fire in debug mode if assumption that data is dense and variable is incorrect, no checks performed in release mode (NDEBUG is set).

The class remote_reference_array that is used to represent array of elements stores remote handles inside but accessing them through square scopes [] or by arrow -> in iterator will automatically form object of type Element. If you are not sure that stored handles are valid, you should either check that by Element::isValid (involves deep check) or test handle against InvalidHandle (simple check). To obtain handle you may use reference_array::at function or dereference * operator for iterator. If you need custom object like Node, Edge, Face, Cell or ElementSet you may use Element::getAsNode, Element::getAsEdge, Element::getAsFace, Element::getAsCell and Element::getAsSet functions.

Parameters
helement handle
tagtag that represents data
See Also
InvalidHandle
Element::isValid
Element::getAsNode
Element::getAsEdge
Element::getAsFace
Element::getAsCell
Element::getAsSet

Definition at line 1886 of file inmost_mesh.h.

Here is the caller graph for this function:

remote_reference& INMOST::Mesh::RemoteReferenceDF ( HandleType  h,
const Tag tag 
)
inline

Returns a reference in dense array to the first element of constant size array of element remote handles. If you don't know any hint information about tag data you should not use this function.

Asserts will fire in debug mode if assumption that data is dense and fixed is incorrect, no checks performed in release mode (NDEBUG is set).

Using handle you can construct objects of type Storage, Element, Node, Edge, Face, Cell, ElementSet by calling their constructor with pointer to mesh and handle as arguments.

Parameters
helement handle
tagtag that represents dense data of fixed size on given handle

Definition at line 1643 of file inmost_mesh.h.

Here is the caller graph for this function:

remote_reference& INMOST::Mesh::RemoteReferenceDV ( HandleType  h,
const Tag tag 
)
inline

Returns a reference in dense array to the first element of variable size array of element remote handles. Future recomendation: If array was not allocated then this function will generate segmentation fault.

If you don't know any hint information about tag data you should not use this function.

Asserts will fire in debug mode if assumption that data is dense and variable is incorrect, no checks performed in release mode (NDEBUG is set).

Using handle you can construct objects of type Storage, Element, Node, Edge, Face, Cell, ElementSet by calling their constructor with pointer to mesh and handle as arguments.

Parameters
helement handle
tagtag that represents data

Definition at line 1809 of file inmost_mesh.h.

Here is the caller graph for this function:

void INMOST::Mesh::RemoveGeometricData ( GeomParam  table)
void INMOST::Mesh::RemoveGhost ( )

Delete all the ghost cells.

void INMOST::Mesh::RemoveGhostElements ( const HandleType ghost,
enumerator  num 
)

Delete some ghost cells provided in array. Non-ghost elements will also be deleted.

This algorithm will properly communicate between processors so that parallel states of deleted elements properly updated on remote processors. Internally function invokes Destroy function, not Delete, which hides elements during modification state, currently it is not expected that any parallel algorithms will be performed between BeginModification and EndModification since modification may break parallel state though it is never checked whether the mesh is in the modification state, so you are free to experiment. This behavior may change in future.

Collective point-2-point.

Parameters
ghostarray of handles
numnumber of handles
Todo:
  1. Currently request for deletion of elements of lower level then cell will be simply ignored, ensure in future that algorithm will properly rise deletion data from lower to upper adjacencies to delete all the upper adjacencies that depend on deleted lower adjacencies
template<typename EType >
void INMOST::Mesh::RemoveGhostElements ( const ElementArray< EType > &  ghost)
inline

Definition at line 2380 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void INMOST::Mesh::RemoveGhostElements ( const ElementSet ghost)
inline

Definition at line 2381 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void INMOST::Mesh::RemPrivateMarker ( HandleType  h,
MarkerType  n 
)

Here is the caller graph for this function:

void INMOST::Mesh::RemPrivateMarkerArray ( const HandleType h,
enumerator  n,
MarkerType  m 
)
inline

Definition at line 1924 of file inmost_mesh.h.

Here is the call graph for this function:

void INMOST::Mesh::RemTopologyCheck ( TopologyCheck  mask)

Remove topology checks.

void INMOST::Mesh::ReorderApply ( Tag  index,
ElementType  mask 
)
void INMOST::Mesh::ReorderEmpty ( ElementType  reordertypes)
void INMOST::Mesh::ResolveModification ( )

This function is not yet implemented. It should correctly resolve parallel state of newly created elements, provide them valid global identificators, resolve owners of the elements potentially optimized using information from BridgeTag and LayersTag May use ResolveShared function as basis but instead the whole mesh run the same algorithm for subset.

void INMOST::Mesh::ResolveShared ( )
void INMOST::Mesh::RestoreCellNodes ( HandleType  hc,
ElementArray< Node > &  ret 
)
void INMOST::Mesh::Save ( std::string  File)

Acceptable file formats for writing

  • ".vtk" - legacy vtk format for unstructured grid
  • ".pvtk" - legacy parallel vtk format
  • ".gmv" - format acceptable by general mesh viewer
  • ".pmf" - internal parallel portable binary format, saves all features

Remeber: .pmf stores all references to elements. If reference are broken due to mesh modification, saving or loading such a mesh may lead to seagfault. To automatically maintain correct references modify mesh using BeginModification, ApplyModification, EndModification

Parameters
Filepath to the file
Todo:
  1. Markers are not saved in internal format due to possible conflict during load.
void INMOST::Mesh::SaveGMV ( std::string  File)
void INMOST::Mesh::SavePMF ( std::string  File)
void INMOST::Mesh::SavePVTK ( std::string  File)
void INMOST::Mesh::SaveVTK ( std::string  File)
void INMOST::Mesh::SaveXML ( std::string  File)
__INLINE const Tag& INMOST::Mesh::SendtoTag ( ) const
inline

Definition at line 1327 of file inmost_mesh.h.

void INMOST::Mesh::SetCommunicator ( INMOST_MPI_Comm  _comm)

Set MPI communicator.

__INLINE const Tag& INMOST::Mesh::SetComparatorTag ( ) const
inline

Definition at line 1334 of file inmost_mesh.h.

void INMOST::Mesh::SetData ( HandleType  h,
const Tag tag,
enumerator  shift,
enumerator  size,
const void *  data 
)

Copy into inner data array of size elements from provided array begining from shift element.

Parameters
hhandle of element
tagtag that represents data
shiftfor which element to start to copy
sizehow many elements to copy
datauser-provided array where data should be copied

Here is the caller graph for this function:

void INMOST::Mesh::SetDataSize ( HandleType  h,
const Tag tag,
enumerator  new_size 
)

Sets the size of the array for data of variable size. If you try to change size of data of constant size then if size is different from current then in debug mode (NDEBUG not set) assertion will fail, in release mode nothing happens.

Parameters
hhandle of element
tagtag that represents the data
new_sizenew size of the array

Here is the caller graph for this function:

void INMOST::Mesh::SetDimensions ( integer  dim)

Set number of dimensions for mesh. It sets the size for number of internally stored coordinates. Size of the array returned by Node::Coords will match this number. When you change number of dimensions and there are nodes with bigger number of dimensions then first dim coordinates are copied and the rest are dropped.

See Also
Node::Coords
__INLINE void INMOST::Mesh::SetEpsilon ( real  e)
inline

Set tolerance for coordinates comparison. This tolerance is used in comparators when two meshes are merged during loading, in ResolveShared to check that nodes on different processors match and in UnpackElementsData

Parameters
esmall real value

Definition at line 1304 of file inmost_mesh.h.

void INMOST::Mesh::SetFileOption ( std::string  ,
std::string   
)

Set file option. Current availible file options:

  • "VTK_GRID_DIMS" - set "2" for two-dimensional vtk grids, "3" for three-dimensional vtk grids
  • "VERBOSITY" - set "2" for progress messages, "1" for reports, "0" for silence
Todo:
introduce "SET_TAGS_LOAD", "SET_TAGS_SAVE" to explicitly provide set of tags to write or "SKIP_TAGS_LOAD", "SKIP_TAGS_SAVE" tags to skip
void INMOST::Mesh::SetGeometricType ( HandleType  h,
Element::GeometricType  type 
)
inline

Definition at line 2041 of file inmost_mesh.h.

Here is the call graph for this function:

void INMOST::Mesh::SetMarker ( HandleType  h,
MarkerType  n 
)
inline

Set a marker on the element represented by handle.

Parameters
helement handle
nstores byte number and byte bit mask that represent marker

Definition at line 1899 of file inmost_mesh.h.

Here is the caller graph for this function:

void INMOST::Mesh::SetMarkerArray ( const HandleType h,
enumerator  n,
MarkerType  m 
)
inline

Set a marker on the set of handles.

Parameters
hset of handles
nnumber of handles
mstores byte number and byte bit mask that represent marker
See Also
Mesh::SetMarker

Definition at line 1906 of file inmost_mesh.h.

Here is the call graph for this function:

void INMOST::Mesh::SetMarkerSpace ( HandleType  h,
bulk  source[MarkerFields] 
)

Overwrite the bytes that store markers on the element.

Parameters
helement handle
sourcestorage to get data from

Here is the caller graph for this function:

void INMOST::Mesh::SetMeshName ( std::string  new_name)

Be careful changing mesh name if you have already established remote links.

__INLINE const Tag& INMOST::Mesh::SetNameTag ( ) const
inline

Definition at line 1333 of file inmost_mesh.h.

void INMOST::Mesh::SetParallelFileStrategy ( int  strategy)
inline

This strategy correspond only to internal ".pmf" mesh format. There are two availible strategies for ".pmf" files loading and saving:

strategy = 0

  • on save
    1. every processor gather local data to some buffer
    2. MPI_Gather to obtain sizes of data among processors
    3. MPI_Gatherv to obtain the whole data on zeros processor
    4. the first processor writes all the data to disk by std::fstream
  • on load
    1. first processors reads the whole file by std::fstream
    2. MPI_Scatter distributes block sizes among processors
    3. MPI_Scatterv distributes blocks among processors
    4. Each processor parses it's block

This strategy requires one processor to hold all the data, which is quite bad for large files. New strategy may be created from this one in future when each processors consequently obtain access to the file using std::fstream and writes the data.

strategy = 1

  • on save it will perform:
    1. MPI_Gather to obtain sizes of data among processors on zeroth processor
    2. MPI_File_open to get parallel handle for the file
    3. MPI_File_write_shared called by processor with zeroth rank to write header
    4. MPI_File_write_ordered to write contents of individual data
    5. MPI_File_close to close parallel file handle
  • on load it will perform

    1. MPI_File_open to open the file in parallel
    2. MPI_File_read_shared to get contents of header on zeroth processor
    3. MPI_Scatter to distribute block sizes among processors
    4. MPI_File_read_ordered to obtain contents
    5. MPI_File_close to close parallel file handle

    Availible only when USE_MPI_P2P is set because it rely on MPI-2 api that begins with MPI_File_xxx some MPI-1 standards contain this api as extension.

The strategy 1 appeared to be considerably slower on INM cluster then strategy 0, this may happen due to lack of read-write devices that able to work in parallel. On IBM Bluegene/p strategy 1 was not working due to same old problem with shared file pointers in their MPI realization

Definition at line 2345 of file inmost_mesh.h.

void INMOST::Mesh::SetParallelStrategy ( int  strategy)
inline

Set parallel strategy for inner communications. There are three possible scenaries in parallel communication associated in accordance to enum Prepare structre:

  1. The communicating processors and sizes of the messages are known apriori
  2. UnknownSize: Communicating processors are known but sizes are unknown
  3. unknownSource: Communicationg processors are unknown

Currently with UnknownSize it will run following algorithm none for strategy 0, following for strategies 1 and 2:

  1. Post asynchronous receive with MPI_Irecv of size of buffer to be sent
  2. Post asynchronous send with MPI_Isend for required corresponding receive buffer size
  3. Wait for all asynchronous operations by MPI_Waitall

With UnknownSource there are two options depending from the USE_MPI_P2P define. If USE_MPI_P2P is defined then MPI-2 api operations will be used

  1. MPI_Win_fence to start operations
  2. MPI_Put from specially allocated memory location to remote processor of array size is performed
  3. MPI_Win_fence to stop operations

if USE_MPI_P2P not set then MPI-1 api will be used

  1. MPI_Allgather for number of processors to which current processor wants to send data
  2. MPI_Allgatherv for sizes and destinations for each processors

Initially it was intended to mainly use MPI-2 functionality for both scenarios but it was realized that there is no availible hardware on which MPI-2 functionalty performs match better then MPI-1 counterparts, especially in the case of UnknownSize. Probably this happens due to lack of support of RDMA operations. If you believe it will be better to use MPI-2 in both cases you are free to uncomment definition of PREFFER_MPI_P2P in inmost_common.h then MPI-2 will be used in both scenaries. These algorthms above are implemented in Mesh::ExchangeBufferInner.

After first problem was resolved following strategies are availible for main communication: strategy = 0

  1. Asyncronous send of data by MPI_Isend;
  2. Check incoming messages by MPI_Probe;
  3. Check incoming message size by MPI_Get_size;
  4. Allocation of buffers of required size;
  5. Asynchronous receive of data
  6. MPI_Waitsome to copy received results to buffers

This strategy shows to be the fastest on mac with intel core 2 duo it appears to be independend on apriori knowledge of sizes of incoming messages and skips the step of determining sizes in all the cases but still it requires establishing knowledge of communicating processors Asynchronous sending and receiving may be performed by breaking the steps 1) and 2-5) but should be considered bad since it will be performed without appropriate receive buffers posted for sends, as a result messages will stuck in network pipeline and would be repeatedly rejected resulting in bad networking performance especially if processors have small memory. As a result non-asynchronous communication is realized with this stategy breaking steps 1-5) and 6) when you as for asynchronous communication startegy = 1

  1. Post asynchronous receive of data by MPI_Irecv
  2. Post asynchronous send of data by MPI_Isend
  3. MPI_Waitsome for any received data

True asynchronous behavior is reproduced by breaking 1-2) and 3) strategy = 2

  1. Post asynchronous receive of data by MPI_Irecv
  2. Set MPI_Barrier to ensure that all the receives were properly set by the time
  1. Perform direct send of data by MPI_Irsend
  2. MPI_Waitsome for any received data

For asynchronous communication algorithm is broken into 1-3) and 4) which is fairly asynchronous. The only provisional benefit it may have on machines with small memory since it should bypass any allocation of buffers for sent and received data by MPI and probably not perform any randezvous communication to ensure data allocation. But MPI_Barrier looks like elephant here.

Algorithms above are implemented in Mesh::ExchangeBuffersInner

See Also
Mesh::PrepareReceiveInner
Mesh::ExchangeBuffersInner

Definition at line 2301 of file inmost_mesh.h.

void INMOST::Mesh::SetPrivateMarker ( HandleType  h,
MarkerType  n 
)

Here is the caller graph for this function:

void INMOST::Mesh::SetPrivateMarkerArray ( const HandleType h,
enumerator  n,
MarkerType  m 
)
inline

Definition at line 1907 of file inmost_mesh.h.

Here is the call graph for this function:

void INMOST::Mesh::SetStatus ( HandleType  h,
Element::Status  s 
)
inline

Set parallel status of the element. If mesh is in Serial state then call will fire asserts in debug mode and segfault in relese mode.

Parallel status controls how exchange of data between elements will be performed, it is expected that number of elements and copies of elements do match between processors. This kind of check is never performed and if you fail to setup statuses correctly, you may end up with data being copied to incorrect elements. If you modify statuses on your own don't forget to call RecomputeParallelStorage, otherwise exchange will be performed by old status guidelines.

Parameters
hhandle of the element
snew status of the element

Definition at line 2081 of file inmost_mesh.h.

Here is the call graph for this function:

void INMOST::Mesh::SetTopologyCheck ( TopologyCheck  mask)

Set topology checks.

void INMOST::Mesh::SetTopologyError ( TopologyCheck  mask)
inline

This will turn mesh into the state indicating that some topology error occured.

Definition at line 3076 of file inmost_mesh.h.

__INLINE const Tag& INMOST::Mesh::SharedTag ( ) const
inline

Definition at line 1328 of file inmost_mesh.h.

Here is the caller graph for this function:

bool INMOST::Mesh::Show ( HandleType  h)

Show element from mesh.

Parameters
hhandle of the element
Returns
true then element was recovered
See Also
Mesh::Hide
void INMOST::Mesh::SortByGlobalID ( HandleType h,
enumerator  num 
)
Todo:
TODO 53 check that putting global ids to array will be faster
void INMOST::Mesh::SortHandles ( HandleType h,
enumerator  num 
)
void INMOST::Mesh::SwapModification ( )
ElementType INMOST::Mesh::SynchronizeElementType ( ElementType  etype)

Synchronize bitwise mask of element types between processors.

Collective operation

Parameters
etypebitwise type mask
Returns
bitwise result among processors
void INMOST::Mesh::SynchronizeMarker ( MarkerType  marker,
ElementType  mask,
SyncBitOp  op 
)

Syncronize marker on elements between processors using provided operation. Depending on requested operation following action is performed:

  • SYNC_BIT_SET - value on ghost elements is set by value on corresponding shared processors;
  • SYNC_BIT_OR - bitwise OR between values in ghosted and shared elements;
  • SYNC_BIT_AND - bitwise AND between values in ghosted and shared elements;
  • SYNC_BIT_XOR - bitwise XOR between values in ghosted and shared elements.
    Parameters
    markermarker to be synchronized
    maskbitwise or type mask
    opoperation, one of SYNC_BIT_SET, SYNC_BIT_OR, SYNC_BIT_XOR, SYNC_BIT_AND
bool INMOST::Mesh::TestClosure ( const HandleType elements,
integer  num 
) const
Tag INMOST::Mesh::TopologyErrorTag ( ) const
inline

This will return tag by which you can retrieve error mark to any element on which topogy check failed. As this is sparse tag you can check presence of error by Element::HaveData or Mesh::HaveData check. This tag will be valid only if you pass MARK_ON_ERROR to Mesh::GetTopologyCheck and will be deleted if you pass MARK_ON_ERROR to Mesh::RemTopologyCheck

Definition at line 3068 of file inmost_mesh.h.

integer INMOST::Mesh::TotalNumberOf ( ElementType  mask)

Sum of all physical elements, it excludes ghosted copies. To compute total number including ghosted copies run Integrate(NumberOf(mask))

Collective operation.

Parameters
maskbitwise mask of element types, example: NODE | CELL
Returns
sum of elements
See Also
Mesh::NumberOf
var& INMOST::Mesh::Variable ( HandleType  h,
const Tag tag 
)

Here is the caller graph for this function:

var_array INMOST::Mesh::VariableArray ( HandleType  h,
const Tag tag 
)

Here is the caller graph for this function:

var_array INMOST::Mesh::VariableArrayDF ( HandleType  h,
const Tag tag 
)
inline

Definition at line 1893 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

var_array INMOST::Mesh::VariableArrayDV ( HandleType  h,
const Tag tag 
)
inline

Definition at line 1894 of file inmost_mesh.h.

Here is the caller graph for this function:

var& INMOST::Mesh::VariableDF ( HandleType  h,
const Tag tag 
)
inline

Definition at line 1890 of file inmost_mesh.h.

Here is the caller graph for this function:

var& INMOST::Mesh::VariableDV ( HandleType  h,
const Tag tag 
)
inline

Definition at line 1891 of file inmost_mesh.h.

Here is the caller graph for this function:


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