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 | Static Public Attributes | List of all members
INMOST::ElementSet Class Reference

#include <inmost_mesh.h>

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. 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

 ElementSet ()
 
 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. More...
 
ElementSet GetParent () const
 Retrieve parent of the set. More...
 
ElementSet GetSibling () const
 Retrieve sibling set of the set, this will be next child for the parent. More...
 
ElementSet GetChild () const
 
void AddSibling (const ElementSet &sibling) const
 This will create new child for the parent. More...
 
void AddChild (const ElementSet &child) const
 Add child to current set. More...
 
void RemSibling (const ElementSet &sibling) const
 This will erase sibling or parent's child. More...
 
void RemChild (const ElementSet &child) const
 This will erase my child. More...
 
enumerator CountSiblings () const
 How many there are siblings to the right of me including me. More...
 
enumerator CountChildren () const
 How many children I have. More...
 
bool HaveSibling () const
 
bool HaveParent () const
 
bool HaveChild () const
 
HandleTypegetHandles () const
 
enumerator nbHandles () const
 
enumerator nbSorted () const
 
enumerator nbAdjElements (ElementType etype) const
 Retrieve all elements by type. More...
 
enumerator nbAdjElements (ElementType etype, MarkerType select, bool invert=false) const
 
ElementArray< ElementgetAdjElements (ElementType etype) const
 Retrieve all elements by type. More...
 
ElementArray< ElementgetAdjElements (ElementType etype, MarkerType select, bool invert=false) const
 
ElementArray< NodegetNodes () const
 Retrieve only nodes. More...
 
ElementArray< NodegetNodes (MarkerType select, bool invert=false) const
 
ElementArray< EdgegetEdges () const
 Retrieve only edges. More...
 
ElementArray< EdgegetEdges (MarkerType select, bool invert=false) const
 
ElementArray< FacegetFaces () const
 Retrieve only faces. More...
 
ElementArray< FacegetFaces (MarkerType select, bool invert=false) const
 
ElementArray< CellgetCells () const
 Retrieve only cells. More...
 
ElementArray< CellgetCells (MarkerType select, bool invert=false) const
 
void PutElement (HandleType e) const
 
void PutElement (const Storage &e) const
 
void PutElements (const HandleType *handles, enumerator num) const
 Put multiple handles without checking of the existance of duplicate. More...
 
void PutElements (const ElementSet &other) const
 Put multiple handles of the other set without checking of the existance of duplicate. More...
 
template<typename EType >
void PutElements (const ElementArray< EType > &elems) const
 Put multiple handles without checking. More...
 
void AddElement (HandleType e) const
 
void AddElement (const Storage &e) const
 
void AddElements (const HandleType *handles, enumerator num) const
 
void AddElements (const ElementSet &other)
 Add elements of other set. More...
 
template<typename EType >
void AddElements (const ElementArray< EType > &elems) const
 Add multiple elements with checking of the existance of duplicate. More...
 
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. More...
 
ElementArray< ElementUnion (const ElementSet &other) const
 
ElementArray< ElementUnion (const HandleType *handles, enumerator num) const
 
template<typename EType >
ElementArray< ElementUnion (const ElementArray< EType > &elems) const
 Compute and return union with elements. More...
 
ElementArray< ElementDifference (const ElementSet &other) const
 
ElementArray< ElementDifference (const HandleType *handles, enumerator num) const
 
template<typename EType >
ElementArray< ElementDifference (const ElementArray< EType > &elems) const
 Compute and return difference with elements. More...
 
ElementArray< ElementIntersection (const ElementSet &other) const
 
ElementArray< ElementIntersection (const HandleType *handles, enumerator num) const
 
template<typename EType >
ElementArray< ElementIntersection (const ElementArray< EType > &elems) const
 Compute and return intersection with elements. More...
 
void Unite (const ElementSet &other) const
 Compute and store union with raw handles. More...
 
void Unite (const HandleType *handles, enumerator num) const
 Compute and store union with raw handles. More...
 
template<typename EType >
void Unite (const ElementArray< EType > &elems) const
 Compute and store union with elements. More...
 
void Subtract (const ElementSet &other) const
 
void Subtract (const HandleType *handles, enumerator num) const
 Compute and store difference with raw handles. More...
 
template<typename EType >
void Subtract (const ElementArray< EType > &elems) const
 Compute and store difference with elements. More...
 
void Intersect (const ElementSet &other) const
 Compute and store intersection with raw handles. More...
 
void Intersect (const HandleType *handles, enumerator num) const
 Compute and store intersection with raw handles. More...
 
template<typename EType >
void Intersect (const ElementArray< EType > &elems) const
 Compute and store intersection with elements. More...
 
void SortSet (ComparatorType comp) const
 
Element FindElementByGlobalID (integer global_id) const
 
Element FindElementByCentroid (real *centroid) const
 
bool FindHandle (HandleType h, bool use_comparator) const
 
void SetMarkerElements (MarkerType m, ElementType etype=ESET|CELL|FACE|EDGE|NODE) const
 Set markers on all the elements of given type. More...
 
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. More...
 
void RemPrivateMarkerElements (MarkerType m, ElementType etype=ESET|CELL|FACE|EDGE|NODE) const
 
iterator Begin () const
 
iterator End () const
 
iterator EndSorted () const
 
iterator Erase (iterator pos) const
 Erase one element pointed by iterator and return next valid element. More...
 
void Erase (iterator beg, iterator end) const
 Erase set of elements pointed by iterators. More...
 
ComparatorType GetComparator () const
 Retrieve current set comparator. More...
 
void ReorderEmpty () const
 Compact holes in inner representation. More...
 
bool Empty () const
 Is there any elements in the set. More...
 
enumerator Size () const
 Get total number of elements. More...
 
void Clear () const
 Remove all elements, clear all data, removes sorted marker. More...
 
bool DeleteSet ()
 Remove the set and resolve it's ierarchical structure. More...
 
- Public Member Functions inherited from INMOST::Element
 Element ()
 
 Element (Mesh *m, HandleType h)
 
 Element (Mesh *m, HandleType *h)
 
 Element (const Element &other)
 
Elementoperator= (Element const &other)
 
Elementoperator-> ()
 
const Elementoperator-> () const
 
Elementself ()
 
const Elementself () const
 
virtual ~Element ()
 
ElementArray< ElementBridgeAdjacencies (ElementType Bridge, ElementType Dest, MarkerType mask=0, bool invert_mask=false) const
 
ElementArray< NodeBridgeAdjacencies2Node (ElementType Bridge, MarkerType mask=0, bool invert_mask=false) const
 
ElementArray< EdgeBridgeAdjacencies2Edge (ElementType Bridge, MarkerType mask=0, bool invert_mask=false) const
 
ElementArray< FaceBridgeAdjacencies2Face (ElementType Bridge, MarkerType mask=0, bool invert_mask=false) const
 
ElementArray< CellBridgeAdjacencies2Cell (ElementType Bridge, MarkerType mask=0, bool invert_mask=false) const
 
GeometricType GetGeometricType () const
 
unsigned int GetElementDimension () const
 
Status GetStatus () const
 
void SetStatus (Status status) const
 
Storage::integerGlobalID () const
 
bool CheckElementConnectivity () const
 
void PrintElementConnectivity () const
 
void CastRay (real *pos, real *dir, dynarray< std::pair< Element, real >, 16 > &hits) const
 
void ComputeGeometricType () const
 
void Centroid (real *cnt) const
 
void Barycenter (real *cnt) const
 
Storage::real Mean (real(*func)(real *x, real t), real time) const
 
bool Boundary () const
 
bool Planarity () const
 
bool Hide () const
 
bool Show () const
 
bool Delete ()
 
bool Hidden () const
 
bool New () const
 
void Disconnect (bool delete_upper_adjacent) const
 
void Disconnect (const HandleType *adjacent, INMOST_DATA_ENUM_TYPE num) const
 
void Connect (const HandleType *adjacent, INMOST_DATA_ENUM_TYPE num) const
 Connects lower adjacencies to current element. Geometric data and cell nodes are updated automatically. More...
 
void UpdateGeometricData () const
 Update geometric data for element, calls RecomputeGeometricData from Mesh. More...
 
- 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 __INLINE HandleTypehParent (Element::adj_type &arr)
 
static __INLINE HandleTypehSibling (Element::adj_type &arr)
 
static __INLINE HandleTypehChild (Element::adj_type &arr)
 
static __INLINE HandleTypehSorted (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
 
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
 
HandleTypehandle_link
 

Detailed Description

Definition at line 906 of file inmost_mesh.h.

Member Typedef Documentation

Definition at line 920 of file inmost_mesh.h.

Constructor & Destructor Documentation

INMOST::ElementSet::ElementSet ( )
inline

Definition at line 926 of file inmost_mesh.h.

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

Definition at line 927 of file inmost_mesh.h.

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

Definition at line 928 of file inmost_mesh.h.

INMOST::ElementSet::ElementSet ( const ElementSet other)
inline

Definition at line 929 of file inmost_mesh.h.

Member Function Documentation

void INMOST::ElementSet::AddChild ( const ElementSet child) const

Add child to current set.

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

Put one element with checking of the existance of duplicate. Preserves order for sorted set, thus may be expensive

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

Put one element with checking of the existance of duplicate. Preserves order for sorted set, thus may be expensive

Definition at line 1012 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Add multiple elements with checking of the existance 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.
void INMOST::ElementSet::AddElements ( const ElementSet other)
inline

Add elements of other set.

Definition at line 1021 of file inmost_mesh.h.

Here is the call graph for this function:

template<typename EType >
void INMOST::ElementSet::AddElements ( const ElementArray< EType > &  elems) const
inline

Add multiple elements with checking of the existance of duplicate.

Definition at line 1024 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void INMOST::ElementSet::AddSibling ( const ElementSet sibling) const

This will create new child for the parent.

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 usefull, 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 then (<) instead of not equal (!=) operator to check for end of the loop. Note that iterators would not let you change underlaying handles, you can use getHandles for that instead.

Returns
iterator that points to the first valid element
void INMOST::ElementSet::Clear ( ) const

Remove all elements, clear all data, removes sorted marker.

enumerator INMOST::ElementSet::CountChildren ( ) const

How many children I have.

enumerator INMOST::ElementSet::CountSiblings ( ) const

How many there are siblings to the right of me including me.

bool INMOST::ElementSet::DeleteSet ( )

Remove the set and resolve it's ierarchical structure.

ElementArray<Element> INMOST::ElementSet::Difference ( const ElementSet other) const
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.

template<typename EType >
ElementArray<Element> INMOST::ElementSet::Difference ( const ElementArray< EType > &  elems) const
inline

Compute and return difference with elements.

Definition at line 1051 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

bool INMOST::ElementSet::Empty ( ) const

Is there any elements in the set.

iterator INMOST::ElementSet::End ( ) const

Provides end for forward iterator to stop the loop.

Returns
iterator that points to the position after last element
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
iterator INMOST::ElementSet::Erase ( iterator  pos) const

Erase one element pointed by iterator and return next valid element.

void INMOST::ElementSet::Erase ( iterator  beg,
iterator  end 
) const

Erase set of elements pointed by iterators.

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

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

Perform binary search by global id. In set sorted with GLOBALID_COMPARATOR in O(log(n)) time otherwise search needs O(n) comparisons

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 ierarhy 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
ElementArray<Element> INMOST::ElementSet::getAdjElements ( ElementType  etype) const
virtual

Retrieve all elements by type.

Reimplemented from INMOST::Element.

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.

ElementArray<Cell> INMOST::ElementSet::getCells ( ) const
virtual

Retrieve only cells.

Reimplemented from INMOST::Element.

ElementArray<Cell> INMOST::ElementSet::getCells ( MarkerType  select,
bool  invert = false 
) const
virtual

Reimplemented from INMOST::Element.

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()) ...

ComparatorType INMOST::ElementSet::GetComparator ( ) const

Retrieve current set comparator.

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

Retrieve only edges.

Reimplemented from INMOST::Element.

ElementArray<Edge> INMOST::ElementSet::getEdges ( MarkerType  select,
bool  invert = false 
) const
virtual

Reimplemented from INMOST::Element.

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

Retrieve only faces.

Reimplemented from INMOST::Element.

ElementArray<Face> INMOST::ElementSet::getFaces ( MarkerType  select,
bool  invert = false 
) const
virtual

Reimplemented from INMOST::Element.

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.

Here is the caller graph for this function:

std::string INMOST::ElementSet::GetName ( ) const

Get name of the set.

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

Retrieve only nodes.

Reimplemented from INMOST::Element.

ElementArray<Node> INMOST::ElementSet::getNodes ( MarkerType  select,
bool  invert = false 
) const
virtual

Reimplemented from INMOST::Element.

ElementSet INMOST::ElementSet::GetParent ( ) const

Retrieve parent of the set.

ElementSet INMOST::ElementSet::GetSibling ( ) const

Retrieve sibling set of the set, this will be next child for the parent.

bool INMOST::ElementSet::HaveChild ( ) const
bool INMOST::ElementSet::HaveParent ( ) const
bool INMOST::ElementSet::HaveSibling ( ) const
static __INLINE HandleType& INMOST::ElementSet::hChild ( Element::adj_type arr)
inlinestatic

Definition at line 918 of file inmost_mesh.h.

static __INLINE HandleType& INMOST::ElementSet::hParent ( Element::adj_type arr)
inlinestatic

Definition at line 916 of file inmost_mesh.h.

static __INLINE HandleType& INMOST::ElementSet::hSibling ( Element::adj_type arr)
inlinestatic

Definition at line 917 of file inmost_mesh.h.

static __INLINE HandleType& INMOST::ElementSet::hSorted ( Element::adj_type arr)
inlinestatic

Definition at line 919 of file inmost_mesh.h.

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

Compute and store intersection with raw handles.

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

Compute and store intersection with raw handles.

template<typename EType >
void INMOST::ElementSet::Intersect ( const ElementArray< EType > &  elems) const
inline

Compute and store intersection with elements.

Definition at line 1089 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

ElementArray<Element> INMOST::ElementSet::Intersection ( const ElementSet other) const
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.

template<typename EType >
ElementArray<Element> INMOST::ElementSet::Intersection ( const ElementArray< EType > &  elems) const
inline

Compute and return intersection with elements.

Definition at line 1060 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

enumerator INMOST::ElementSet::nbAdjElements ( ElementType  etype) const
virtual

Retrieve all elements by type.

Reimplemented from INMOST::Element.

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.

enumerator INMOST::ElementSet::nbHandles ( ) const

Retrieve number of stored handles, including invalid. If you want to get number of valid elements use ElementSet::Size

Here is the caller graph for this function:

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

__INLINE ElementSet* INMOST::ElementSet::operator-> ( )
inline

Definition at line 931 of file inmost_mesh.h.

__INLINE const ElementSet* INMOST::ElementSet::operator-> ( ) const
inline

Definition at line 932 of file inmost_mesh.h.

__INLINE ElementSet& INMOST::ElementSet::operator= ( ElementSet const &  other)
inline

Definition at line 930 of file inmost_mesh.h.

Here is the call graph for this function:

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

Put one element without checking of the existance of duplicate. For sorted set new element will appear at unsorted part.

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

Put one element without checking of the existance of duplicate. For sorted set new element will appear at unsorted part

Definition at line 999 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Put multiple handles without checking of the existance of duplicate.

void INMOST::ElementSet::PutElements ( const ElementSet other) const
inline

Put multiple handles of the other set without checking of the existance of duplicate.

Definition at line 1003 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename EType >
void INMOST::ElementSet::PutElements ( const ElementArray< EType > &  elems) const
inline

Put multiple handles without checking.

Definition at line 1006 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void INMOST::ElementSet::RemChild ( const ElementSet child) const

This will erase my child.

void INMOST::ElementSet::RemMarkerElements ( MarkerType  m,
ElementType  etype = ESET|CELL|FACE|EDGE|NODE 
) const

Remove markers from all the elements of given type.

void INMOST::ElementSet::RemoveElement ( const Storage e) const
void INMOST::ElementSet::RemoveElements ( const HandleType handles,
enumerator  num 
) const
template<typename EType >
void INMOST::ElementSet::RemoveElements ( const ElementArray< EType > &  elems) const
inline

Remove multiple elements from the set.

Definition at line 1030 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void INMOST::ElementSet::RemPrivateMarkerElements ( MarkerType  m,
ElementType  etype = ESET|CELL|FACE|EDGE|NODE 
) const
void INMOST::ElementSet::RemSibling ( const ElementSet sibling) const

This will erase sibling or parent's child.

void INMOST::ElementSet::ReorderEmpty ( ) const

Compact holes in inner representation.

__INLINE ElementSet& INMOST::ElementSet::self ( )
inline

Definition at line 933 of file inmost_mesh.h.

__INLINE const ElementSet& INMOST::ElementSet::self ( ) const
inline

Definition at line 934 of file inmost_mesh.h.

void INMOST::ElementSet::SetMarkerElements ( MarkerType  m,
ElementType  etype = ESET|CELL|FACE|EDGE|NODE 
) const

Set markers on all the elements of given type.

void INMOST::ElementSet::SetPrivateMarkerElements ( MarkerType  m,
ElementType  etype = ESET|CELL|FACE|EDGE|NODE 
) const
enumerator INMOST::ElementSet::Size ( ) const

Get total number of elements.

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
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 retriving 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.
void INMOST::ElementSet::Subtract ( const HandleType handles,
enumerator  num 
) const

Compute and store difference with raw handles.

template<typename EType >
void INMOST::ElementSet::Subtract ( const ElementArray< EType > &  elems) const
inline

Compute and store difference with elements.

Definition at line 1080 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Compute and return union with other set. Result is unordered. All elements will be unique.

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.

template<typename EType >
ElementArray<Element> INMOST::ElementSet::Union ( const ElementArray< EType > &  elems) const
inline

Compute and return union with elements.

Definition at line 1042 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Compute and store union with raw handles.

Here is the caller graph for this function:

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

Compute and store union with raw handles.

template<typename EType >
void INMOST::ElementSet::Unite ( const ElementArray< EType > &  elems) const
inline

Compute and store union with elements.

Definition at line 1068 of file inmost_mesh.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

const ComparatorType INMOST::ElementSet::CENTROID_COMPARATOR = 2
static

Definition at line 923 of file inmost_mesh.h.

const ComparatorType INMOST::ElementSet::GLOBALID_COMPARATOR = 1
static

Definition at line 922 of file inmost_mesh.h.

const ComparatorType INMOST::ElementSet::HANDLE_COMPARATOR = 4
static

Definition at line 925 of file inmost_mesh.h.

const ComparatorType INMOST::ElementSet::HIERARCHY_COMPARATOR = 3
static

Definition at line 924 of file inmost_mesh.h.

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 915 of file inmost_mesh.h.

const ComparatorType INMOST::ElementSet::UNSORTED_COMPARATOR = 0
static

Definition at line 921 of file inmost_mesh.h.


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