INMOST
A toolkit for distributed mathematical modeling
INMOST::ElementSet Class Reference
Inheritance diagram for INMOST::ElementSet:
Collaboration diagram for INMOST::ElementSet:

Classes

class  iterator
 

Public Types

typedef INMOST_DATA_BULK_TYPE ComparatorType
 
- Public Types inherited from INMOST::Element
typedef INMOST_DATA_BULK_TYPE GeometricType
 
typedef INMOST_DATA_BULK_TYPE Status
 
typedef inner_reference_array adj_type
 
typedef adj_type::iterator adj_iterator
 
typedef adj_type::const_iterator const_adj_iterator
 
typedef adj_type::reverse_iterator adj_reverse_iterator
 
typedef adj_type::const_reverse_iterator const_adj_reverse_iterator
 
- Public Types inherited from INMOST::Storage
typedef INMOST_DATA_REAL_TYPE real
 Storage type for representing real values.
 
typedef INMOST_DATA_INTEGER_TYPE integer
 Storage type for representing integer values.
 
typedef INMOST_DATA_BULK_TYPE bulk
 Storage type for representing one byte of abstract data.
 
typedef INMOST_DATA_ENUM_TYPE enumerator
 type for representing unsigned integer values.
 
typedef HandleType reference
 Storage type for representing references to Element.
 
typedef RemoteHandleType remote_reference
 Storage type for representing references to Element in another Mesh.
 
typedef shell< realreal_array
 Storage type for representing arrays of real values.
 
typedef shell< integerinteger_array
 Storage type for representing arrays of integer values.
 
typedef shell< bulkbulk_array
 Storage type for representing abstract data as a series of bytes.
 
typedef variable var
 Storage type for representing real value with vector of variations.
 
typedef shell< variablevar_array
 Storage type for representing array of values with vectors of variations.
 

Public Member Functions

 ElementSet (Mesh *m, HandleType h)
 
 ElementSet (Mesh *m, HandleType *h)
 
 ElementSet (const ElementSet &other)
 
__INLINE ElementSetoperator= (ElementSet const &other)
 
__INLINE ElementSetoperator-> ()
 
__INLINE const ElementSetoperator-> () const
 
__INLINE ElementSetself ()
 
__INLINE const ElementSetself () const
 
std::string GetName () const
 Get name of the set.
 
ElementSet GetParent () const
 Retrieve parent of the set.
 
ElementSet GetSibling () const
 Retrieve sibling set of the set, this will be next child for the parent.
 
ElementSet GetChild () const
 Retrieve child set of the set. More...
 
void AddSibling (const ElementSet &sibling) const
 This will create new child for the parent.
 
void AddChild (const ElementSet &child) const
 Add child to current set.
 
void RemSibling (const ElementSet &sibling) const
 This will erase sibling or parent's child.
 
void RemChild (const ElementSet &child) const
 This will erase my child.
 
enumerator CountSiblings () const
 How many there are siblings to the right of me including me.
 
enumerator CountChildren () const
 How many children I have.
 
bool HaveSibling () const
 
bool HaveParent () const
 
bool HaveChild () const
 
HandleType * getHandles () const
 Direct raw access to stored elements, no copy involved. More...
 
enumerator nbHandles () const
 Retrieve number of stored handles, including invalid. More...
 
enumerator nbSorted () const
 Retrieve position after last sorted element. More...
 
enumerator nbAdjElements (ElementType etype) const
 Retrieve all elements by type.
 
enumerator nbAdjElements (ElementType etype, MarkerType select, bool invert=false) const
 Retrieve number of adjacent elements with marker. More...
 
ElementArray< ElementgetAdjElements (ElementType etype) const
 Retrieve all elements by type.
 
ElementArray< ElementgetAdjElements (ElementType etype, MarkerType select, bool invert=false) const
 Retrieve unordered array of adjacent elements with marker. More...
 
ElementArray< NodegetNodes () const
 Retrieve only nodes.
 
ElementArray< NodegetNodes (MarkerType select, bool invert=false) const
 
ElementArray< EdgegetEdges () const
 Retrieve only edges.
 
ElementArray< EdgegetEdges (MarkerType select, bool invert=false) const
 
ElementArray< FacegetFaces () const
 Retrieve only faces.
 
ElementArray< FacegetFaces (MarkerType select, bool invert=false) const
 
ElementArray< CellgetCells () const
 Retrieve only cells.
 
ElementArray< CellgetCells (MarkerType select, bool invert=false) const
 
void PutElement (HandleType e) const
 Put one element without checking of the existence of duplicate. More...
 
void PutElement (const Storage &e) const
 Put one element without checking of the existence of duplicate. More...
 
void PutElements (const HandleType *handles, enumerator num) const
 Put multiple handles without checking of the existence of duplicate.
 
void PutElements (const ElementSet &other) const
 Put multiple handles of the other set without checking of the existence of duplicate.
 
template<typename EType >
void PutElements (const ElementArray< EType > &elems) const
 Put multiple handles without checking.
 
void AddElement (HandleType e) const
 Put one element with checking of the existence of duplicate. More...
 
void AddElement (const Storage &e) const
 Put one element with checking of the existence of duplicate. More...
 
void AddElements (const HandleType *handles, enumerator num) const
 Add multiple elements with checking of the existence of duplicate. More...
 
void AddElements (const ElementSet &other)
 Add elements of other set.
 
template<typename EType >
void AddElements (const ElementArray< EType > &elems) const
 Add multiple elements with checking of the existence of duplicate.
 
void RemoveElement (const Storage &e) const
 
void RemoveElements (const HandleType *handles, enumerator num) const
 
template<typename EType >
void RemoveElements (const ElementArray< EType > &elems) const
 Remove multiple elements from the set.
 
ElementArray< ElementUnion (const ElementSet &other) const
 Compute and return union with other set. More...
 
ElementArray< ElementUnion (const HandleType *handles, enumerator num) const
 Compute and return union with raw handles. More...
 
template<typename EType >
ElementArray< ElementUnion (const ElementArray< EType > &elems) const
 Compute and return union with elements.
 
ElementArray< ElementDifference (const ElementSet &other) const
 
ElementArray< ElementDifference (const HandleType *handles, enumerator num) const
 Compute and return difference with raw handles. More...
 
template<typename EType >
ElementArray< ElementDifference (const ElementArray< EType > &elems) const
 Compute and return difference with elements.
 
ElementArray< ElementIntersection (const ElementSet &other) const
 
ElementArray< ElementIntersection (const HandleType *handles, enumerator num) const
 Compute and return intersection with raw handles. More...
 
template<typename EType >
ElementArray< ElementIntersection (const ElementArray< EType > &elems) const
 Compute and return intersection with elements.
 
void Unite (const ElementSet &other) const
 Compute and store union with raw handles.
 
void Unite (const HandleType *handles, enumerator num) const
 Compute and store union with raw handles.
 
template<typename EType >
void Unite (const ElementArray< EType > &elems) const
 Compute and store union with elements.
 
void Subtract (const ElementSet &other) const
 Compute and store difference with raw handles. More...
 
void Subtract (const HandleType *handles, enumerator num) const
 Compute and store difference with raw handles.
 
template<typename EType >
void Subtract (const ElementArray< EType > &elems) const
 Compute and store difference with elements.
 
void Intersect (const ElementSet &other) const
 Compute and store intersection with raw handles.
 
void Intersect (const HandleType *handles, enumerator num) const
 Compute and store intersection with raw handles.
 
template<typename EType >
void Intersect (const ElementArray< EType > &elems) const
 Compute and store intersection with elements.
 
void SortSet (ComparatorType comp) const
 Performs sort of the set of elements. More...
 
Element FindElementByGlobalID (integer global_id) const
 Sets the synchronization regime for set elements. More...
 
Element FindElementByCentroid (real *centroid) const
 Perform binary search by centroid. More...
 
bool FindHandle (HandleType h, bool use_comparator) const
 Performs linear search in unsorted set. More...
 
void SetMarkerElements (MarkerType m, ElementType etype=ESET|CELL|FACE|EDGE|NODE) const
 Set markers on all the elements of given type.
 
void SetPrivateMarkerElements (MarkerType m, ElementType etype=ESET|CELL|FACE|EDGE|NODE) const
 
void RemMarkerElements (MarkerType m, ElementType etype=ESET|CELL|FACE|EDGE|NODE) const
 Remove markers from all the elements of given type.
 
void RemPrivateMarkerElements (MarkerType m, ElementType etype=ESET|CELL|FACE|EDGE|NODE) const
 
iterator Begin () const
 Provides forward iterator that skips deleted and hidden elements within set. More...
 
iterator End () const
 Provides end for forward iterator to stop the loop. More...
 
iterator EndSorted () const
 Provides iterator that points to element located after the last element that belong to presorted part of the set as well as on the first element of unsorted part. More...
 
iterator Erase (iterator pos) const
 Erase one element pointed by iterator and return next valid element.
 
void Erase (iterator beg, iterator end) const
 Erase set of elements pointed by iterators.
 
ComparatorType GetComparator () const
 Retrieve current set comparator.
 
void ReorderEmpty () const
 Retrieve current set exchange type. More...
 
bool Empty () const
 Is there any elements in the set.
 
enumerator Size () const
 Get total number of elements.
 
void Clear ()
 Remove all elements, clear all data, removes sorted marker.
 
bool DeleteSet ()
 Remove the set and resolve it's hierarchical structure. More...
 
bool DeleteSetTree ()
 Remove the set and all it's children. More...
 
void SynchronizeSetElements ()
 Asks all the elements to be sent to other processors. More...
 
void SynchronizeSetElementsWithOwner ()
 Asks all the elements of ghost sets to be sent to the owner processors. More...
 
void SynchronizeSetChildren ()
 Asks all the children to be sent to other processors. More...
 
void SynchronizeSetParents ()
 Asks all the parents upwards to be sent to other processors. More...
 
- Public Member Functions inherited from INMOST::Element
 Element (Mesh *m, HandleType h)
 
 Element (Mesh *m, HandleType *h)
 
 Element (const Element &other)
 
Elementoperator= (Element const &other)
 
Elementoperator-> ()
 
const Elementoperator-> () const
 
Elementself ()
 
const Elementself () const
 
ElementArray< ElementBridgeAdjacencies (ElementType Bridge, ElementType Dest, MarkerType bridge_mask=0, bool bridge_invert=false, MarkerType target_mask=0, bool target_invert=false) const
 
ElementArray< NodeBridgeAdjacencies2Node (ElementType Bridge, MarkerType bridge_mask=0, bool bridge_invert=false, MarkerType target_mask=0, bool target_invert=false) const
 
ElementArray< EdgeBridgeAdjacencies2Edge (ElementType Bridge, MarkerType bridge_mask=0, bool bridge_invert=false, MarkerType target_mask=0, bool target_invert=false) const
 
ElementArray< FaceBridgeAdjacencies2Face (ElementType Bridge, MarkerType bridge_mask=0, bool bridge_invert=false, MarkerType target_mask=0, bool target_invert=false) const
 
ElementArray< CellBridgeAdjacencies2Cell (ElementType Bridge, MarkerType bridge_mask=0, bool bridge_invert=false, MarkerType target_mask=0, bool target_invert=false) const
 
GeometricType GetGeometricType () const
 
unsigned int GetElementDimension () const
 
Status GetStatus () const
 
void SetStatus (Status status) const
 
Storage::integerGlobalID () const
 
bool CheckElementConnectivity () const
 
void PrintElementConnectivity () const
 
void CastRay (const real *pos, const real *dir, std::map< HandleType, real > &hits) const
 
void ComputeGeometricType () const
 
void Centroid (real *cnt) const
 
void Barycenter (real *cnt) const
 
Storage::real Mean (const MeanFunc &f, real time) const
 
Storage::real Mean (real(*func)(real *x, real t), real time) const
 
bool Boundary () const
 Determine that the element is on the boundary. More...
 
bool Planarity () const
 
bool Hide () const
 If the function returns true then element was hidden, works only inside BeginModification and EndModification, on EndModification all Hidden elements are deleted. More...
 
bool Show () const
 If the function returns true then element was recovered from hidden state, works only inside BeginModification and EndModification. More...
 
bool Delete ()
 Remove element from mesh. More...
 
bool Hidden () const
 
bool New () const
 
void Disconnect (bool delete_upper_adjacent) const
 
void Disconnect (const HandleType *adjacent, INMOST_DATA_ENUM_TYPE num) const
 Disconnect element. More...
 
void Connect (const HandleType *adjacent, INMOST_DATA_ENUM_TYPE num) const
 Connects lower adjacencies to current element. More...
 
void SendTo (std::set< Storage::integer > &procs) const
 Update geometric data for element, calls RecomputeGeometricData from Mesh. More...
 
void SendTo (std::vector< Storage::integer > &procs) const
 
void SendTo (Storage::integer_array procs) const
 
- Public Member Functions inherited from INMOST::Storage
 Storage (const Storage &other)
 
 Storage (Mesh *mesh, HandleType handle)
 
 Storage (Mesh *mesh, HandleType *handle)
 This constructor allows for remote handle modification.
 
Storageoperator= (Storage const &other)
 If there is a link to handle provided (automatically by ElementArray and reference_array), then remote handle value will be modified.
 
__INLINE bool operator< (const Storage &other) const
 
__INLINE bool operator> (const Storage &other) const
 
__INLINE bool operator<= (const Storage &other) const
 
__INLINE bool operator>= (const Storage &other) const
 
__INLINE bool operator== (const Storage &other) const
 
__INLINE bool operator!= (const Storage &other) const
 
__INLINE Storageoperator-> ()
 
__INLINE const Storageoperator-> () const
 
__INLINE Storageself ()
 
__INLINE const Storageself () const
 
__INLINE realReal (const Tag &tag) const
 Retrieve real value associated with Tag. More...
 
__INLINE integerInteger (const Tag &tag) const
 Retrieve integer value associated with Tag. More...
 
__INLINE bulkBulk (const Tag &tag) const
 Retrieve one byte of abstract data associated with Tag. More...
 
__INLINE referenceReference (const Tag &tag) const
 Retrieve Element reference associated with Tag. More...
 
__INLINE remote_referenceRemoteReference (const Tag &tag) const
 Retrieve remote Element reference associated with Tag. More...
 
__INLINE real_array RealArray (const Tag &tag) const
 Retrieve array of real values associated with Tag. More...
 
__INLINE integer_array IntegerArray (const Tag &tag) const
 Retrieve array of integer values associated with Tag. More...
 
__INLINE bulk_array BulkArray (const Tag &tag) const
 Retrieve abstract data associated with Tag as a series of bytes. More...
 
__INLINE reference_array ReferenceArray (const Tag &tag) const
 Retrieve array of Element references associated with Tag. More...
 
__INLINE remote_reference_array RemoteReferenceArray (const Tag &tag) const
 Retrieve array of Element references associated with Tag. More...
 
__INLINE real_array RealArrayDF (const Tag &tag) const
 
__INLINE integer_array IntegerArrayDF (const Tag &tag) const
 
__INLINE bulk_array BulkArrayDF (const Tag &tag) const
 
__INLINE reference_array ReferenceArrayDF (const Tag &tag) const
 
__INLINE remote_reference_array RemoteReferenceArrayDF (const Tag &tag) const
 
__INLINE realRealDF (const Tag &tag) const
 
__INLINE integerIntegerDF (const Tag &tag) const
 
__INLINE bulkBulkDF (const Tag &tag) const
 
__INLINE referenceReferenceDF (const Tag &tag) const
 
__INLINE remote_referenceRemoteReferenceDF (const Tag &tag) const
 
__INLINE real_array RealArrayDV (const Tag &tag) const
 
__INLINE integer_array IntegerArrayDV (const Tag &tag) const
 
__INLINE bulk_array BulkArrayDV (const Tag &tag) const
 
__INLINE reference_array ReferenceArrayDV (const Tag &tag) const
 
__INLINE remote_reference_array RemoteReferenceArrayDV (const Tag &tag) const
 
__INLINE realRealDV (const Tag &tag) const
 
__INLINE integerIntegerDV (const Tag &tag) const
 
__INLINE bulkBulkDV (const Tag &tag) const
 
__INLINE referenceReferenceDV (const Tag &tag) const
 
__INLINE remote_referenceRemoteReferenceDV (const Tag &tag) const
 
__INLINE varVariable (const Tag &tag) const
 Retrieve variable reference associated with Tag.
 
__INLINE varVariableDF (const Tag &tag) const
 
__INLINE varVariableDV (const Tag &tag) const
 
__INLINE var_array VariableArray (const Tag &tag) const
 Retrieve array of variables associated with Tag.
 
__INLINE var_array VariableArrayDF (const Tag &tag) const
 
__INLINE var_array VariableArrayDV (const Tag &tag) const
 
__INLINE INMOST_DATA_ENUM_TYPE GetDataSize (const Tag &tag) const
 Return the data length associated with Tag. More...
 
__INLINE INMOST_DATA_ENUM_TYPE GetDataCapacity (const Tag &tag) const
 Return the size of the structure required to represent the data on current element. More...
 
__INLINE void SetDataSize (const Tag &tag, INMOST_DATA_ENUM_TYPE new_size) const
 Set the length of data associated with Tag. More...
 
__INLINE void GetData (const Tag &tag, INMOST_DATA_ENUM_TYPE shift, INMOST_DATA_ENUM_TYPE size, void *data) const
 Extract part of the data associated with Tag. More...
 
__INLINE void SetData (const Tag &tag, INMOST_DATA_ENUM_TYPE shift, INMOST_DATA_ENUM_TYPE size, const void *data) const
 
__INLINE void DelData (const Tag &tag) const
 
__INLINE bool DelSparseData (const Tag &tag) const
 Deallocates space allocated for sparse data, frees variable array if necessary.
 
__INLINE void DelDenseData (const Tag &tag) const
 Frees variable array or fills field with zeroes.
 
__INLINE bool HaveData (const Tag &tag) const
 Check if any data is associated with Tag.
 
__INLINE ElementType GetElementType () const
 
__INLINE integer GetElementNum () const
 
__INLINE void SetMarker (MarkerType n) const
 
__INLINE bool GetMarker (MarkerType n) const
 
__INLINE void RemMarker (MarkerType n) const
 
__INLINE void SetPrivateMarker (MarkerType n) const
 
__INLINE bool GetPrivateMarker (MarkerType n) const
 
__INLINE void RemPrivateMarker (MarkerType n) const
 
__INLINE void ClearMarkerSpace () const
 
__INLINE void GetMarkerSpace (bulk copy[MarkerFields]) const
 
__INLINE void SetMarkerSpace (bulk source[MarkerFields]) const
 
__INLINE integer LocalID () const
 
__INLINE integer DataLocalID () const
 This number is guaranteed to be between 0 and Mesh::NumberOf(type of element) after Mesh::ReorderEmpty.
 
__INLINE bool isValid () const
 
__INLINE MeshGetMeshLink () const
 
__INLINE HandleType GetHandle () const
 
__INLINE Element getAsElement () const
 
__INLINE Node getAsNode () const
 
__INLINE Edge getAsEdge () const
 
__INLINE Face getAsFace () const
 
__INLINE Cell getAsCell () const
 
__INLINE ElementSet getAsSet () const
 

Static Public Member Functions

static __INLINE HandleType & hParent (Element::adj_type &arr)
 
static __INLINE HandleType & hSibling (Element::adj_type &arr)
 
static __INLINE HandleType & hChild (Element::adj_type &arr)
 
static __INLINE HandleType & hSorted (Element::adj_type &arr)
 
- Static Public Member Functions inherited from INMOST::Element
static const char * GeometricTypeName (GeometricType t)
 
static integer GetGeometricDimension (GeometricType m_type)
 
static const char * StatusName (Status s)
 
static bool CheckConnectivity (Mesh *m)
 

Static Public Attributes

static const enumerator high_conn_reserved = 4
 Number of reserved positions in HighConn array. More...
 
static const ComparatorType UNSORTED_COMPARATOR = 0
 
static const ComparatorType GLOBALID_COMPARATOR = 1
 
static const ComparatorType CENTROID_COMPARATOR = 2
 
static const ComparatorType HIERARCHY_COMPARATOR = 3
 
static const ComparatorType HANDLE_COMPARATOR = 4
 
- Static Public Attributes inherited from INMOST::Element
static const GeometricType Unset = 0
 
static const GeometricType Vertex = 1
 
static const GeometricType Line = 2
 
static const GeometricType MultiLine = 3
 
static const GeometricType Tri = 4
 
static const GeometricType Quad = 5
 
static const GeometricType Polygon = 6
 
static const GeometricType MultiPolygon = 7
 
static const GeometricType Tet = 8
 
static const GeometricType Hex = 9
 
static const GeometricType Prism = 10
 
static const GeometricType Pyramid = 11
 
static const GeometricType Polyhedron = 12
 
static const GeometricType Set = 253
 
static const GeometricType MeshPart = 254
 
static const GeometricType MaxType = 255
 
static const Status Owned = 1
 
static const Status Shared = 2
 
static const Status Ghost = 4
 
static const Status Any = 0
 

Additional Inherited Members

- Protected Member Functions inherited from INMOST::Element
void SetGeometricType (GeometricType t)
 
- Protected Attributes inherited from INMOST::Storage
HandleType handle
 
HandleType * handle_link
 

Detailed Description

Definition at line 960 of file inmost_mesh.h.

Member Function Documentation

◆ AddElement() [1/2]

void INMOST::ElementSet::AddElement ( const Storage e) const
inline

Put one element with checking of the existence of duplicate.

Preserves order for sorted set, thus may be expensive.

Definition at line 1081 of file inmost_mesh.h.

◆ AddElement() [2/2]

void INMOST::ElementSet::AddElement ( HandleType  e) const

Put one element with checking of the existence of duplicate.

Preserves order for sorted set, thus may be expensive.

◆ AddElements()

void INMOST::ElementSet::AddElements ( const HandleType *  handles,
enumerator  num 
) const

Add multiple elements with checking of the existence of duplicate.

Preserves order for sorted set, thus may be expensive. This will also remove any duplicates in unsorted part of the set. If you inserted duplicated elements through PutElements into previously sorted array then this operation does not guarantee that those duplications will be stored.

Todo:
Recheck usage of markers.

◆ Begin()

iterator INMOST::ElementSet::Begin ( ) const

Provides forward iterator that skips deleted and hidden elements within set.

The iterator will be valid during removal or insertion of elements. While that may seem useful, many functions like AddElements, SortSet, Union will internally reorder handles thus making iterators useless. To correctly resolve situation when size of array shrink due to removal of elements use less than (<) instead of not equal (!=) operator to check for end of the loop. Note that iterators would not let you change underlying handles, you can use getHandles for that instead.

Returns
iterator that points to the first valid element

◆ DeleteSet()

bool INMOST::ElementSet::DeleteSet ( )

Remove the set and resolve it's hierarchical structure.

This will not remove childrens of the tree. To remove set as a tree, see ElementSet::DeleteSetTree.

Returns
Same as Element::Delete.

◆ DeleteSetTree()

bool INMOST::ElementSet::DeleteSetTree ( )

Remove the set and all it's children.

Returns
Same as Element::Delete.

◆ Difference()

ElementArray<Element> INMOST::ElementSet::Difference ( const HandleType *  handles,
enumerator  num 
) const

Compute and return difference with raw handles.

If initial set was ordered, result will preserve the order. All elements will be unique.

◆ End()

iterator INMOST::ElementSet::End ( ) const

Provides end for forward iterator to stop the loop.

Returns
iterator that points to the position after last element

◆ EndSorted()

iterator INMOST::ElementSet::EndSorted ( ) const

Provides iterator that points to element located after the last element that belong to presorted part of the set as well as on the first element of unsorted part.

Returns
see description

◆ FindElementByCentroid()

Element INMOST::ElementSet::FindElementByCentroid ( real centroid) const

Perform binary search by centroid.

In set sorted with CENTROID_COMPARATOR in O(log(n)) time otherwise search needs O(n) comparisons

◆ FindElementByGlobalID()

Element INMOST::ElementSet::FindElementByGlobalID ( integer  global_id) const

Sets the synchronization regime for set elements.

Parameters
compone of the synchronization types from description. Perform binary search by global id. In set sorted with GLOBALID_COMPARATOR in O(log(n)) time otherwise search needs O(n) comparisons

◆ FindHandle()

bool INMOST::ElementSet::FindHandle ( HandleType  h,
bool  use_comparator 
) const

Performs linear search in unsorted set.

  • binary search by handle in set sorted with HANDLE_COMPARATOR
  • binary search by centroid in set sorted with CENTROID_COMPARATOR
  • binary search by global id in set sorted with GLOBALID_COMPARATOR
  • binary search by hierarchy in set sorted with HIERARCHY_COMPARATOR (may be too expensive)

If you have a lot of elements to test against set, then you'd better first put marker on elements of the set by SetMarkerElements then test which of your elements have marker and then remove markers by RemMarkerElements. This will consume only O(n+m) operations where n is the number of my elements and m is the size of the test set.

Parameters
hhandle of element
use_comparatoruse information about current comparator or perform linear search
Returns
true if element is present
See also
ElementSet::SetMarkerElements
ElementSet::RemMarkerElements

◆ getAdjElements()

ElementArray<Element> INMOST::ElementSet::getAdjElements ( ElementType  etype,
MarkerType  mask,
bool  invert_mask = false 
) const
virtual

Retrieve unordered array of adjacent elements with marker.

Parameters
etypebitwise mask of element types
maskmarker to be set
invert_maskif true then those are selected on wich marker is not set
Returns
array of elements

Reimplemented from INMOST::Element.

◆ GetChild()

ElementSet INMOST::ElementSet::GetChild ( ) const

Retrieve child set of the set.

Following example shows how to iterate through children of current set: for(ElementSet it = set->GetChild(); it->isValid(); it = it->GetSibling()) ...

◆ getHandles()

HandleType* INMOST::ElementSet::getHandles ( ) const

Direct raw access to stored elements, no copy involved.

The actual pointer may change when you add new elements due to reallocation of memory. Modify at your own risk.

◆ Intersection()

ElementArray<Element> INMOST::ElementSet::Intersection ( const HandleType *  handles,
enumerator  num 
) const

Compute and return intersection with raw handles.

If initial set was ordered, result will preserve the order. All elements will be unique.

◆ nbAdjElements()

enumerator INMOST::ElementSet::nbAdjElements ( ElementType  etype,
MarkerType  mask,
bool  invert_mask = false 
) const
virtual

Retrieve number of adjacent elements with marker.

As etype you can either pass one type as CELL, or several types as bitwise mask: NODE | CELL

Parameters
etypebitwise mask of element types
maskmarker to be set
invert_maskif true then those are selected on wich marker is not set
Returns
number of adjacent elements.

Reimplemented from INMOST::Element.

◆ nbHandles()

enumerator INMOST::ElementSet::nbHandles ( ) const

Retrieve number of stored handles, including invalid.

If you want to get number of valid elements use ElementSet::Size

◆ nbSorted()

enumerator INMOST::ElementSet::nbSorted ( ) const

Retrieve position after last sorted element.

This does not correctly represent total number of sorted elements, since some of them may be deleted

◆ PutElement() [1/2]

void INMOST::ElementSet::PutElement ( const Storage e) const
inline

Put one element without checking of the existence of duplicate.

For sorted set new element will appear at unsorted part

Definition at line 1068 of file inmost_mesh.h.

◆ PutElement() [2/2]

void INMOST::ElementSet::PutElement ( HandleType  e) const

Put one element without checking of the existence of duplicate.

For sorted set new element will appear at unsorted part.

◆ ReorderEmpty()

void INMOST::ElementSet::ReorderEmpty ( ) const

Retrieve current set exchange type.

Compact holes in inner representation

◆ SortSet()

void INMOST::ElementSet::SortSet ( ComparatorType  comp) const

Performs sort of the set of elements.

If the set was previously sorted but have unsorted part, then unsorted part will be sorted and two parts will be merged. If you need all the set to be resorted (for example in the case global ids were changed) then invoke SortSet with UNSORTED_COMPARATOR first and then with needed comparator.

Internally it uses:

  • std::sort with Mesh::CentroidComparator for CENTROID_COMPARATOR
  • std::sort with Mesh::IerarhyComparator for HIERARCHY_COMPARATOR
  • radix sort starting from certain size for GLOBALID_COMPARATOR
  • radix sort starting from certain size for HANDLE_COMPARATOR
  • only changes state, no sort performed for UNSORTED_COMPARATOR

After the set was sorted all the invalid handles should appear at the end of the set and then removed from array, so it will implicitly work as ReorderEmpty function. No checks that elements are hidden performed (Maybe this checks should be done in comparators) In the case you formed the set by running over all mesh elements from NODE to ESET in increasing order then your set will be automatically sorted by handles, in this case you are encouraged to override Mesh::SetComparatorTag with HANDLE_COMPARATOR on the set without invoking SortSet, so that SortSet does not redundantly perform any work. You are encouraged to do so even if you are not going to use this information - some internal algorithms may benefit from it.

Todo:
!TODO 52 - check radix sort on big endian computer
Parameters
compone of the comparators from description.
See also
Mesh::SetComparatorTag

◆ Subtract()

void INMOST::ElementSet::Subtract ( const ElementSet other) const

Compute and store difference with raw handles.

Todo:
If other and current sets are sorted in same way, may perform narrowing traversal by retrieving mutual lower_bound/higher_bound O(log(n)) operations for detecting common subsets in sorted sets. May work good when deleting handles by small chunks, ApplyModification may greatly benefit.

◆ SynchronizeSetChildren()

void INMOST::ElementSet::SynchronizeSetChildren ( )

Asks all the children to be sent to other processors.

Call ExchangeMarked afterwards.

See also
Mesh::ExchangeMarked

◆ SynchronizeSetElements()

void INMOST::ElementSet::SynchronizeSetElements ( )

Asks all the elements to be sent to other processors.

Call ExchangeMarked afterwards.

See also
Mesh::ExchangeMarked

◆ SynchronizeSetElementsWithOwner()

void INMOST::ElementSet::SynchronizeSetElementsWithOwner ( )

Asks all the elements of ghost sets to be sent to the owner processors.

Call ExchangeMarked afterwards.

See also
Mesh::ExchangeMarked

◆ SynchronizeSetParents()

void INMOST::ElementSet::SynchronizeSetParents ( )

Asks all the parents upwards to be sent to other processors.

This function does not ask children of the parents to be synchronized, for this traverse to the uppermost parent and call ElementSet::SynchronizeSetChildren Call ExchangeMarked afterwards.

See also
Mesh::ExchangeMarked

◆ Union() [1/2]

ElementArray<Element> INMOST::ElementSet::Union ( const ElementSet other) const

Compute and return union with other set.

Result is unordered. All elements will be unique.

◆ Union() [2/2]

ElementArray<Element> INMOST::ElementSet::Union ( const HandleType *  handles,
enumerator  num 
) const

Compute and return union with raw handles.

Result is unordered. All elements will be unique.

Member Data Documentation

◆ high_conn_reserved

const enumerator INMOST::ElementSet::high_conn_reserved = 4
static

Number of reserved positions in HighConn array.

The first position is the handle to parent set. The second position is handle to sibling set. The third position is handle to child set. The fourth position is number of sorted elements in the set. All the rest are positions of deleted elements.

Definition at line 969 of file inmost_mesh.h.


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