2 #ifndef INMOST_MESH_H_INCLUDED
3 #define INMOST_MESH_H_INCLUDED
5 #include "inmost_common.h"
6 #include "inmost_data.h"
26 typedef INMOST_DATA_BULK_TYPE GeometricData;
27 static const GeometricData CENTROID = 0;
28 static const GeometricData NORMAL = 1;
29 static const GeometricData ORIENTATION = 2;
30 static const GeometricData MEASURE = 3;
31 static const GeometricData BARYCENTER = 4;
33 typedef INMOST_DATA_BULK_TYPE SyncBitOp;
34 static const SyncBitOp SYNC_BIT_SET = 0;
35 static const SyncBitOp SYNC_BIT_OR = 1;
36 static const SyncBitOp SYNC_BIT_XOR = 2;
37 static const SyncBitOp SYNC_BIT_AND = 3;
43 typedef INMOST_DATA_ENUM_TYPE TopologyCheck;
45 static const TopologyCheck THROW_EXCEPTION = 0x00000001;
47 static const TopologyCheck PRINT_NOTIFY = 0x00000002;
49 static const TopologyCheck DELETE_ON_ERROR = 0x00000004;
52 static const TopologyCheck MARK_ON_ERROR = 0x00000008;
54 static const TopologyCheck DUPLICATE_EDGE = 0x00000010;
56 static const TopologyCheck DUPLICATE_FACE = 0x00000020;
58 static const TopologyCheck DUPLICATE_CELL = 0x00000040;
60 static const TopologyCheck DEGENERATE_EDGE = 0x00000080;
62 static const TopologyCheck DEGENERATE_FACE = 0x00000100;
64 static const TopologyCheck DEGENERATE_CELL = 0x00000200;
66 static const TopologyCheck FACE_ORIENTATION = 0x00000400;
68 static const TopologyCheck FACE_PLANARITY = 0x00000800;
70 static const TopologyCheck INTERLEAVED_FACES = 0x00001000;
73 static const TopologyCheck TRIPLE_SHARED_FACE = 0x00002000;
75 static const TopologyCheck FLATTENED_CELL = 0x00004000;
77 static const TopologyCheck ADJACENT_DUPLICATE = 0x00008000;
79 static const TopologyCheck ADJACENT_HIDDEN = 0x00010000;
81 static const TopologyCheck ADJACENT_VALID = 0x00020000;
83 static const TopologyCheck ADJACENT_DIMENSION = 0x00040000;
86 static const TopologyCheck PROHIBIT_MULTILINE = 0x00080000;
88 static const TopologyCheck PROHIBIT_POLYGON = 0x00100000;
91 static const TopologyCheck PROHIBIT_MULTIPOLYGON = 0x00200000;
93 static const TopologyCheck PROHIBIT_POLYHEDRON = 0x00400000;
95 static const TopologyCheck FACE_EDGES_ORDER = 0x00800000;
98 static const TopologyCheck PROHIBIT_CONCAVE_FACE = 0x01000000;
101 static const TopologyCheck PROHIBIT_CONCAVE_CELL = 0x02000000;
104 static const TopologyCheck PROHIBIT_NONSTAR_FACE = 0x04000000;
107 static const TopologyCheck PROHIBIT_NONSTAR_CELL = 0x08000000;
110 static const TopologyCheck FACE_SELF_INTERSECTION = 0x10000000;
113 static const TopologyCheck CELL_SELF_INTERSECTION = 0x20000000;
116 static const TopologyCheck NEED_TEST_CLOSURE = 0x40000000;
118 static const TopologyCheck DISABLE_2D = 0x80000000;
120 static const TopologyCheck GRID_CONFORMITY = NEED_TEST_CLOSURE
122 | PROHIBIT_MULTIPOLYGON
124 | TRIPLE_SHARED_FACE;
126 static const TopologyCheck DEFAULT_CHECK = THROW_EXCEPTION
133 const char * TopologyCheckNotifyString(TopologyCheck c);
137 template <
typename StorageType>
141 typedef std::vector<HandleType> cont_t;
142 typedef cont_t::size_type size_type;
147 const cont_t & GetContainer() {
return container;}
151 ElementArray(
Mesh * m_link, size_type n, HandleType h = InvalidHandle()) : m_link(m_link), container(n,h) {}
152 ElementArray(
Mesh * m_link,
const cont_t & c) : m_link(m_link), container(c) {}
154 template<
class InputIterator>
155 ElementArray(
Mesh * m_link, InputIterator first, InputIterator last) :m_link(m_link), container(first,last) {}
156 ElementArray & operator=(
ElementArray const & other) {m_link = other.m_link; container = other.container;
return *
this;}
162 iterator(
Mesh * m,
const cont_t::iterator & other ) : cont_t::iterator(other) , m_link(m){assert(m_link);}
163 iterator(
const iterator & other ) : cont_t::iterator(other), m_link(other.m_link) {assert(m_link);}
164 ptrdiff_t operator -(
const iterator & other)
const {
return static_cast<const cont_t::iterator
>(*this)-
static_cast<const cont_t::iterator
>(other);}
165 iterator operator +(
size_t n)
const{
return iterator(m_link,cont_t::iterator::operator +(n));}
166 iterator operator -(
size_t n)
const{
return iterator(m_link,cont_t::iterator::operator -(n));}
167 iterator & operator ++() {cont_t::iterator::operator++();
return *
this;}
168 iterator operator ++(
int) {
iterator ret(*
this); cont_t::iterator::operator++();
return ret;}
169 iterator & operator --() {cont_t::iterator::operator--();
return *
this;}
170 iterator operator --(
int) {
iterator ret(*
this); cont_t::iterator::operator--();
return ret;}
171 iterator & operator =(
iterator const & other) {m_link = other.m_link; cont_t::iterator::operator=(
static_cast<cont_t::iterator
const &
>(other));
return *
this; }
172 HandleType & operator *()
const {
return cont_t::iterator::operator *(); }
173 StorageType operator->()
const {
return StorageType(m_link,&cont_t::iterator::operator *()); }
179 reverse_iterator(
Mesh * m,
const cont_t::reverse_iterator & other ) : cont_t::reverse_iterator(other), m_link(m) {assert(m_link);}
181 ptrdiff_t operator -(
const reverse_iterator & other)
const {
return static_cast<const cont_t::reverse_iterator
>(*this)-
static_cast<const cont_t::reverse_iterator
>(other);}
184 reverse_iterator & operator ++() {cont_t::reverse_iterator::operator++();
return *
this;}
186 reverse_iterator & operator --() {cont_t::reverse_iterator::operator--();
return *
this;}
188 reverse_iterator & operator =(
reverse_iterator const & other) {m_link = other.m_link; cont_t::reverse_iterator::operator=(
static_cast<cont_t::reverse_iterator
const &
>(other));
return *
this; }
189 HandleType & operator *()
const {
return cont_t::reverse_iterator::operator *(); }
190 StorageType operator->()
const {
return StorageType(m_link,&cont_t::reverse_iterator::operator *()); }
196 const_iterator(
Mesh * m,
const cont_t::const_iterator & other ) : cont_t::const_iterator(other), m_link(m) {assert(m_link);}
198 ptrdiff_t operator -(
const const_iterator & other)
const {
return static_cast<const cont_t::const_iterator
>(*this)-
static_cast<const cont_t::const_iterator
>(other);}
199 const_iterator & operator ++() {cont_t::const_iterator::operator++();
return *
this;}
201 const_iterator & operator --() {cont_t::const_iterator::operator--();
return *
this;}
203 const_iterator & operator =(
const_iterator const & other) {m_link = other.m_link; cont_t::const_iterator::operator=(
static_cast<cont_t::const_iterator
const &
>(other));
return *
this; }
204 const HandleType & operator *()
const {
return cont_t::const_iterator::operator *(); }
205 StorageType operator->()
const {
return StorageType(m_link,cont_t::const_iterator::operator *()); }
211 const_reverse_iterator(
Mesh * m,
const cont_t::const_reverse_iterator & other) : cont_t::const_reverse_iterator(other), m_link(m) {assert(m_link);}
213 ptrdiff_t operator -(
const const_reverse_iterator & other)
const {
return static_cast<const cont_t::const_reverse_iterator
>(*this)-
static_cast<const cont_t::const_reverse_iterator
>(other);}
219 const HandleType & operator *()
const {
return cont_t::const_reverse_iterator::operator *(); }
220 StorageType operator->()
const {
return StorageType(m_link,cont_t::const_reverse_iterator::operator *()); }
223 template<
class InputIterator>
224 __INLINE
void insert (
iterator pos,InputIterator pbeg, InputIterator pend) {container.insert(
static_cast<cont_t::iterator
>(pos),pbeg,pend);}
225 __INLINE iterator erase (iterator pos) {
return iterator(m_link,container.erase(
static_cast<cont_t::iterator
>(pos)));}
227 __INLINE iterator begin () {
return iterator(m_link,container.begin()); }
228 __INLINE iterator end () {
return iterator(m_link,container.end()); }
229 __INLINE reverse_iterator rbegin () {
return reverse_iterator(m_link,container.rbegin()); }
230 __INLINE reverse_iterator rend () {
return reverse_iterator(m_link,container.rend()); }
231 __INLINE const_iterator begin ()
const {
return const_iterator(m_link,container.begin()); }
232 __INLINE const_iterator end ()
const {
return const_iterator(m_link,container.end()); }
233 __INLINE const_reverse_iterator rbegin()
const {
return const_reverse_iterator(m_link,container.rbegin()); }
234 __INLINE const_reverse_iterator rend ()
const {
return const_reverse_iterator(m_link,container.rend()); }
236 __INLINE StorageType operator [] (size_type n) {assert(m_link);
return StorageType(m_link,&container[n]);}
237 __INLINE StorageType operator [] (size_type n)
const {assert(m_link);
return StorageType(m_link,container[n]);}
238 __INLINE StorageType front () {assert(m_link);
return StorageType(m_link,&container.front()); }
239 __INLINE StorageType front ()
const {assert(m_link);
return StorageType(m_link,container.front()); }
240 __INLINE StorageType back () {assert(m_link);
return StorageType(m_link,&container.back()); }
241 __INLINE StorageType back ()
const {assert(m_link);
return StorageType(m_link,container.back()); }
242 __INLINE HandleType atfront ()
const {
return container.front(); }
243 __INLINE HandleType atback ()
const {
return container.back(); }
244 __INLINE HandleType & atfront () {
return container.front(); }
245 __INLINE HandleType & atback () {
return container.back(); }
246 __INLINE HandleType & at (size_type n) {
return container.at(n); }
247 __INLINE HandleType at (size_type n)
const {
return container.at(n); }
248 __INLINE
void swap (ElementArray<StorageType> & other) {Mesh * t = m_link; m_link = other.m_link; other.m_link = t; container.swap(other.container);}
249 __INLINE
void push_back (
const Storage & x) {
if( m_link == NULL ) m_link = x.GetMeshLink(); assert(x.GetMeshLink() == m_link); container.push_back(x.GetHandle());}
251 __INLINE
void push_back (HandleType x) {assert(m_link != NULL); container.push_back(x);}
252 __INLINE
void pop_back () {container.pop_back();}
253 __INLINE
void resize (size_type n) {container.resize(n);}
254 __INLINE
bool empty ()
const {
return container.empty();}
255 __INLINE
void clear () {container.clear();}
256 __INLINE
void reserve (size_type n) {container.reserve(n);}
257 __INLINE size_type size ()
const {
return container.size(); }
258 __INLINE HandleType * data () {
return container.empty() ? NULL : &container[0];}
259 __INLINE
const HandleType*data ()
const {
return container.empty() ? NULL : &container[0];}
260 __INLINE Mesh * GetMeshLink ()
const {assert(m_link);
return m_link;}
261 __INLINE
void SetMeshLink (Mesh * m) {m_link = m;}
263 void Unite (
const HandleType * h, INMOST_DATA_ENUM_TYPE num);
264 void Subtract (
const HandleType * h, INMOST_DATA_ENUM_TYPE num);
265 void Intersect (
const HandleType * h, INMOST_DATA_ENUM_TYPE num);
266 template<
typename EType>
267 void Unite (
const ElementArray<EType> & other) {Unite(other.data(),
static_cast<INMOST_DATA_ENUM_TYPE
>(other.size()));}
268 template<
typename EType>
269 void Subtract (
const ElementArray<EType> & other) {Subtract(other.data(),
static_cast<INMOST_DATA_ENUM_TYPE
>(other.size()));}
270 template<
typename EType>
271 void Intersect (
const ElementArray<EType> & other) {Intersect(other.data(),
static_cast<INMOST_DATA_ENUM_TYPE
>(other.size()));}
272 void SetMarker (MarkerType n)
const;
273 void RemMarker (MarkerType n)
const;
274 void SetPrivateMarker (MarkerType n)
const;
275 void RemPrivateMarker (MarkerType n)
const;
276 template<
typename Etype>
277 ElementArray<Etype> Convert() {
return ElementArray<Etype>(m_link,container);}
292 typedef INMOST_DATA_BULK_TYPE GeometricType;
293 static const GeometricType Unset = 0;
294 static const GeometricType Vertex = 1;
295 static const GeometricType Line = 2;
296 static const GeometricType MultiLine = 3;
297 static const GeometricType Tri = 4;
298 static const GeometricType Quad = 5;
299 static const GeometricType Polygon = 6;
300 static const GeometricType MultiPolygon = 7;
301 static const GeometricType Tet = 8;
302 static const GeometricType Hex = 9;
303 static const GeometricType Prism = 10;
304 static const GeometricType Pyramid = 11;
305 static const GeometricType Polyhedron = 12;
306 static const GeometricType Set = 253;
307 static const GeometricType MeshPart = 254;
308 static const GeometricType MaxType = 255;
310 static const char * GeometricTypeName(GeometricType t);
311 static integer GetGeometricDimension(GeometricType m_type);
312 typedef INMOST_DATA_BULK_TYPE Status;
313 static const Status Owned = 1;
314 static const Status Shared = 2;
315 static const Status Ghost = 4;
316 static const Status Any = 0;
317 static const char * StatusName(Status s);
328 void SetGeometricType (GeometricType t);
335 Element * operator ->() {
return this;}
336 const Element * operator ->()
const {
return this;}
337 Element &
self() {
return *
this;}
338 const Element &
self()
const {
return *
this;}
368 ElementArray<Element> BridgeAdjacencies (ElementType Bridge, ElementType Dest, MarkerType bridge_mask = 0,
bool bridge_invert =
false, MarkerType target_mask = 0,
bool target_invert =
false)
const;
369 ElementArray<Node> BridgeAdjacencies2Node (ElementType Bridge, MarkerType bridge_mask = 0,
bool bridge_invert =
false, MarkerType target_mask = 0,
bool target_invert =
false)
const;
370 ElementArray<Edge> BridgeAdjacencies2Edge (ElementType Bridge, MarkerType bridge_mask = 0,
bool bridge_invert =
false, MarkerType target_mask = 0,
bool target_invert =
false)
const;
371 ElementArray<Face> BridgeAdjacencies2Face (ElementType Bridge, MarkerType bridge_mask = 0,
bool bridge_invert =
false, MarkerType target_mask = 0,
bool target_invert =
false)
const;
372 ElementArray<Cell> BridgeAdjacencies2Cell (ElementType Bridge, MarkerType bridge_mask = 0,
bool bridge_invert =
false, MarkerType target_mask = 0,
bool target_invert =
false)
const;
434 GeometricType GetGeometricType ()
const;
435 unsigned int GetElementDimension ()
const {
return GetGeometricDimension(GetGeometricType());}
436 Status GetStatus ()
const;
437 void SetStatus (Status status)
const;
439 bool CheckElementConnectivity()
const;
440 void PrintElementConnectivity()
const;
441 static bool CheckConnectivity (
Mesh * m);
443 void CastRay (
const real * pos,
const real * dir, std::map<HandleType, real> & hits)
const;
445 void ComputeGeometricType ()
const;
446 void Centroid (
real * cnt)
const;
447 void Barycenter (
real * cnt)
const;
459 bool Planarity ()
const;
481 bool Hidden ()
const;
483 void Disconnect (
bool delete_upper_adjacent)
const;
488 void Disconnect (
const HandleType * adjacent, INMOST_DATA_ENUM_TYPE num)
const;
496 void Connect (
const HandleType * adjacent, INMOST_DATA_ENUM_TYPE num)
const;
501 void SendTo (std::set<Storage::integer> & procs)
const;
502 void SendTo (std::vector<Storage::integer> & procs)
const;
506 __INLINE
const Element & InvalidElement() {
static Element ret(NULL,InvalidHandle());
return ret;}
515 Node & operator =(
Node const & other) {Element::operator =(other);
return *
this;}
516 Node * operator ->() {
return this;}
517 const Node * operator ->()
const {
return this;}
518 Node &
self() {
return *
this;}
519 const Node &
self()
const {
return *
this;}
532 __INLINE
const Node & InvalidNode() {
static Node ret(NULL,InvalidHandle());
return ret;}
541 Edge & operator =(
Edge const & other) {Element::operator =(other);
return *
this;}
542 Edge * operator ->() {
return this;}
543 const Edge * operator ->()
const {
return this;}
544 Edge &
self() {
return *
this;}
545 const Edge &
self()
const {
return *
this;}
556 Node getBeg ()
const;
557 Node getEnd ()
const;
560 static bool TestUniteEdges (
const ElementArray<Edge> & edges, MarkerType del_protect);
572 __INLINE
const Edge & InvalidEdge() {
static Edge ret(NULL,InvalidHandle());
return ret;}
602 Face & operator =(
Face const & other) {Element::operator =(other);
return *
this;}
603 Face * operator ->() {
return this;}
604 const Face * operator ->()
const {
return this;}
605 Face &
self() {
return *
this;}
606 const Face &
self()
const {
return *
this;}
618 Node getBeg ()
const;
619 Node getEnd ()
const;
636 bool FaceOrientedOutside (
Cell c)
const;
637 void ReorderEdges ()
const;
638 bool CheckEdgeOrder ()
const;
639 bool FixEdgeOrder ()
const;
642 static bool TestUniteFaces (
const ElementArray<Face> & faces, MarkerType del_protect);
651 void Normal (
real * nrm)
const;
652 void UnitNormal (
real * nrm)
const;
653 void OrientedNormal (
Cell c,
real * nrm)
const;
654 void OrientedUnitNormal (
Cell c,
real * nrm)
const;
655 bool FixNormalOrientation (
bool allow_swap =
true)
const;
656 bool CheckNormalOrientation ()
const;
657 bool Closure ()
const;
662 bool Inside (
const real * point)
const;
665 __INLINE
const Face & InvalidFace() {
static Face ret(NULL,InvalidHandle());
return ret;}
751 const Cell &
self()
const {
return *
this;}
938 bool InsidePrint (
const real * point, std::ostream & sout = std::cout)
const;
954 bool CheckConvexity ()
const;
958 __INLINE
const Cell & InvalidCell() {
static Cell ret(NULL,InvalidHandle());
return ret;}
972 __INLINE
static HandleType & hChild (Element::adj_type & arr) {
return arr[2];}
973 __INLINE
static HandleType & hSorted (Element::adj_type & arr) {
return arr[3];}
974 typedef INMOST_DATA_BULK_TYPE ComparatorType;
975 static const ComparatorType UNSORTED_COMPARATOR = 0;
976 static const ComparatorType GLOBALID_COMPARATOR = 1;
977 static const ComparatorType CENTROID_COMPARATOR = 2;
978 static const ComparatorType HIERARCHY_COMPARATOR= 3;
979 static const ComparatorType HANDLE_COMPARATOR = 4;
984 ElementSet () : Element() {}
985 ElementSet (Mesh * m, HandleType h) : Element(m,h) {}
986 ElementSet (Mesh * m, HandleType * h) : Element(m,h) {}
987 ElementSet (
const ElementSet & other) : Element(other) {}
988 __INLINE ElementSet & operator = (ElementSet
const & other) {Element::operator =(other);
return *
this;}
989 __INLINE ElementSet * operator -> () {
return this;}
990 __INLINE
const ElementSet * operator -> ()
const {
return this;}
991 __INLINE ElementSet &
self () {
return *
this;}
992 __INLINE
const ElementSet &
self ()
const {
return *
this;}
997 void CollectProcessors (std::set<Storage::integer> & procs,
char dir)
const;
1001 void SetSendTo(std::set<Storage::integer> & procs,
char dir)
const;
1002 void SetSendTo(std::vector<Storage::integer> & procs,
char dir)
const;
1030 bool HaveSibling()
const;
1031 bool HaveParent()
const;
1032 bool HaveChild()
const;
1074 template<
typename EType>
1092 template<
typename EType>
1095 void RemoveElement(
const Storage & e)
const;
1096 void RemoveElements(
const HandleType * handles,
enumerator num)
const;
1098 template<
typename EType>
1110 template<
typename EType>
1119 template<
typename EType>
1128 template<
typename EType>
1136 template<
typename EType>
1148 template<
typename EType>
1157 template<
typename EType>
1213 void SetPrivateMarkerElements(MarkerType m, ElementType etype = ESET|CELL|FACE|EDGE|NODE)
const;
1216 void RemPrivateMarkerElements(MarkerType m, ElementType etype = ESET|CELL|FACE|EDGE|NODE)
const;
1221 Element::adj_type::size_type pos;
1223 typedef std::forward_iterator_tag iterator_category;
1224 iterator() : m(NULL), ptr(NULL), pos(0) {}
1225 iterator(
const iterator & other) : m(other.m), ptr(other.ptr), pos(other.pos) {}
1227 iterator & operator = (
iterator const & other) {m = other.m; ptr = other.ptr; pos = other.pos;
return *
this;}
1229 iterator & operator ++(
int) {
iterator ret(*
this); operator++();
return *
this;}
1230 bool operator ==(
const iterator & other)
const {assert(ptr == other.ptr);
return pos == other.pos;}
1231 bool operator !=(
const iterator & other)
const {assert(ptr == other.ptr);
return pos != other.pos;}
1232 bool operator < (
const iterator & other)
const {assert(ptr == other.ptr);
return pos < other.pos;}
1233 bool operator > (
const iterator & other)
const {assert(ptr == other.ptr);
return pos > other.pos;}
1234 bool operator <=(
const iterator & other)
const {assert(ptr == other.ptr);
return pos <= other.pos;}
1235 bool operator >=(
const iterator & other)
const {assert(ptr == other.ptr);
return pos >= other.pos;}
1236 const HandleType & operator *()
const {
return ptr->at(pos);}
1301 __INLINE
const ElementSet & InvalidElementSet() {
static ElementSet ret(NULL,InvalidHandle());
return ret;}
1306 #if defined(CHECKS_MARKERS)
1307 bool check_shared_mrk, check_private_mrk;
1309 enum MeshState {Serial, Parallel};
1320 typedef sparse_type::size_type
1324 std::map<std::string,HandleType> set_search;
1325 std::vector<Tag> orient_tags;
1335 Tag * tag_private_markers;
1338 Tag tag_setcomparator;
1342 HandleType last_created;
1346 INMOST_DATA_BIG_ENUM_TYPE parallel_mesh_unique_id;
1347 INMOST_MPI_Comm comm;
1353 Tag tag_redistribute;
1356 void AllocatePrivateMarkers();
1357 void DeallocatePrivateMarkers();
1358 __INLINE
static sparse_rec mkrec (
const Tag & t) {
sparse_rec ret; ret.tag = t.mem; ret.rec = NULL;
return ret;}
1361 __INLINE
sparse_type const & MGetSparseLink (HandleType h)
const {
return MGetSparseLink(GetHandleElementNum(h),GetHandleID(h));}
1362 __INLINE
sparse_type & MGetSparseLink (HandleType h) {
return MGetSparseLink(GetHandleElementNum(h),GetHandleID(h));}
1363 __INLINE
const void * MGetSparseLink (HandleType h,
const Tag & t)
const {
sparse_type const & s = MGetSparseLink(GetHandleElementNum(h),GetHandleID(h));
for(senum i = 0; i < s.size(); ++i)
if( s[i].tag == t.mem )
return s[i].rec;
return NULL;}
1364 void*& MGetSparseLink (HandleType h,
const Tag& t);
1365 __INLINE
const void * MGetDenseLink (
integer n,
integer ID,
const Tag & t)
const {assert(links[n][ID] != -1);
return &(
GetDenseData(t.GetPositionByDim(n))[links[n][ID]]);}
1366 __INLINE
void * MGetDenseLink (
integer n,
integer ID,
const Tag & t) {assert(links[n][ID] != -1);
return &(
GetDenseData(t.GetPositionByDim(n))[links[n][ID]]);}
1367 __INLINE
const void * MGetDenseLink (HandleType h,
const Tag & t)
const {
return MGetDenseLink(GetHandleElementNum(h),GetHandleID(h),t);}
1368 __INLINE
void * MGetDenseLink (HandleType h,
const Tag & t) {
return MGetDenseLink(GetHandleElementNum(h),GetHandleID(h),t);}
1369 __INLINE
const void * MGetLink (HandleType h,
const Tag & t)
const {
if( !t.isSparseByDim(GetHandleElementNum(h)) )
return MGetDenseLink(h,t);
else return MGetSparseLink(h,t);}
1370 __INLINE
void * MGetLink (HandleType h,
const Tag & t) {
if( !t.isSparseByDim(GetHandleElementNum(h)) )
return MGetDenseLink(h,t);
else {
void * & q = MGetSparseLink(h,t);
if( q == NULL ) AllocateSparseData(q,t);
return q;}}
1371 void AllocateSparseData (
void * & q,
const Tag & t);
1372 void Init (std::string name);
1399 Mesh (std::string name);
1401 Mesh & operator = (
Mesh const & other);
1411 MarkerType CreatePrivateMarker ();
1422 void ReleasePrivateMarker(MarkerType n, ElementType cleanup = NONE);
1444 __INLINE
const Tag & GlobalIDTag ()
const {
return tag_global_id;}
1445 __INLINE
const Tag & CoordsTag ()
const {
return tag_coords;}
1446 __INLINE
const Tag & LowConnTag ()
const {
return tag_low_conn;}
1447 __INLINE
const Tag & HighConnTag ()
const {
return tag_high_conn;}
1448 __INLINE
const Tag & MarkersTag ()
const {
return tag_markers;}
1449 __INLINE
const Tag & GeomTypeTag ()
const {
return tag_geom_type;}
1450 __INLINE
const Tag & SendtoTag ()
const {
return tag_sendto;}
1451 __INLINE
const Tag & SharedTag ()
const {
return tag_shared;}
1452 __INLINE
const Tag & OwnerTag ()
const {
return tag_owner;}
1453 __INLINE
const Tag & LayersTag ()
const {
return tag_layers;}
1454 __INLINE
const Tag & BridgeTag ()
const {
return tag_bridge;}
1455 __INLINE
const Tag & ProcessorsTag ()
const {
return tag_processors;}
1456 __INLINE
const Tag & SetNameTag ()
const {
return tag_setname;}
1457 __INLINE
const Tag & SetComparatorTag ()
const {
return tag_setcomparator;}
1482 Tag CreateTag (std::string name, DataType dtype, ElementType etype,ElementType sparse, INMOST_DATA_ENUM_TYPE size = ENUMUNDEF);
1492 __INLINE iteratorTag
BeginTag () {
return tags.begin(); }
1498 __INLINE iteratorTag
EndTag () {
return tags.end(); }
1516 std::pair<ElementSet,bool> CreateSet (std::string name);
1525 HandleType LastCreated ()
const {
return last_created;}
1527 bool isValidHandleRange (HandleType h)
const;
1528 bool isValidElementNum (
integer etypenum,
integer lid)
const {
return links[etypenum][lid] != -1;}
1529 bool isValidElement (ElementType etype,
integer lid)
const {
return links[ElementNum(etype)][lid] != -1;}
1530 bool isValidCell (
integer lid)
const {
return links[ElementNum(CELL)][lid] != -1;}
1531 bool isValidFace (
integer lid)
const {
return links[ElementNum(FACE)][lid] != -1;}
1532 bool isValidEdge (
integer lid)
const {
return links[ElementNum(EDGE)][lid] != -1;}
1533 bool isValidNode (
integer lid)
const {
return links[ElementNum(NODE)][lid] != -1;}
1534 bool isValidElementSet (
integer lid)
const {
return links[ElementNum(ESET)][lid] != -1;}
1535 bool isValidElement (HandleType h)
const {
return isValidHandleRange(h) && isValidElementNum(GetHandleElementNum(h),GetHandleID(h));}
1539 void ReorderEmpty (ElementType reordertypes);
1541 void ReorderApply (
Tag index, ElementType mask);
1545 void Asserts (HandleType h,
const Tag & tag, DataType expected)
const;
1546 void AssertsDF (HandleType h,
const Tag & tag, DataType expected)
const;
1547 void AssertsDV (HandleType h,
const Tag & tag, DataType expected)
const;
1723 real &
RealDF (HandleType h,
const Tag & tag) {AssertsDF(h,tag,DATA_REAL );
return static_cast<real *
>(MGetDenseLink(h,tag))[0];}
1741 bulk &
BulkDF (HandleType h,
const Tag & tag) {AssertsDF(h,tag,DATA_BULK );
return static_cast<bulk *
>(MGetDenseLink(h,tag))[0];}
2012 #if defined(USE_AUTODIFF)
2013 var & Variable (HandleType h,
const Tag & tag);
2014 var & VariableDF (HandleType h,
const Tag & tag) {AssertsDF(h,tag,DATA_VARIABLE);
return static_cast<var *
>(MGetDenseLink(h,tag))[0];}
2015 var & VariableDV (HandleType h,
const Tag & tag) {AssertsDV(h,tag,DATA_VARIABLE);
return static_cast<inner_variable_array *
>(MGetDenseLink(h,tag))->at_safe(0);}
2016 var_array VariableArray (HandleType h,
const Tag & tag);
2017 var_array VariableArrayDF (HandleType h,
const Tag & tag) {AssertsDF(h,tag,DATA_VARIABLE);
return var_array(
static_cast<var *
>(MGetDenseLink(h,tag)),tag.GetSize());}
2018 var_array VariableArrayDV (HandleType h,
const Tag & tag) {AssertsDV(h,tag,DATA_VARIABLE);
return var_array(*
static_cast<inner_variable_array*
>(MGetDenseLink(h,tag)));}
2023 __INLINE
void SetMarker (HandleType h,MarkerType n) {assert(!isPrivate(n));
static_cast<bulk *
>(MGetDenseLink(h,MarkersTag()))[n >> MarkerShift] |=
static_cast<bulk>(n & MarkerMask);}
2024 void SetPrivateMarker (HandleType h,MarkerType n);
2025 __INLINE
void SetAnyMarker (HandleType h, MarkerType n) {
return isPrivate(n) ? SetPrivateMarker(h, n) :
SetMarker(h, n); }
2033 __INLINE
void SetPrivateMarkerArray (
const HandleType * h,
enumerator n, MarkerType m) {
for(
enumerator i = 0; i < n; ++i)
if( h[i] != InvalidHandle() )SetPrivateMarker(h[i],m);}
2034 __INLINE
void SetAnyMarkerArray (
const HandleType* h,
enumerator n, MarkerType m) {
return isPrivate(n) ? SetPrivateMarkerArray(h, n, m) :
SetMarkerArray(h, n, m); }
2038 __INLINE
bool GetMarker (HandleType h,MarkerType n)
const {assert(!isPrivate(n));
return (
static_cast<const bulk *
>(MGetDenseLink(h,MarkersTag()))[n >> MarkerShift] &
static_cast<bulk>(n & MarkerMask)) != 0;}
2039 bool GetPrivateMarker (HandleType h,MarkerType n)
const;
2040 __INLINE
bool GetAnyMarker (HandleType h, MarkerType n)
const {
return isPrivate(n) ? GetPrivateMarker(h, n) :
GetMarker(h, n); }
2044 __INLINE
void RemMarker (HandleType h,MarkerType n) {assert(!isPrivate(n));
static_cast<bulk *
>(MGetDenseLink(h,MarkersTag()))[n >> MarkerShift] &= ~
static_cast<bulk>(n & MarkerMask);}
2045 void RemPrivateMarker (HandleType h,MarkerType n);
2046 __INLINE
void RemAnyMarker (HandleType h, MarkerType n) {
return isPrivate(n) ? RemPrivateMarker(h, n) :
RemMarker(h, n); }
2053 void RemPrivateMarkerArray (
const HandleType * h,
enumerator n, MarkerType m) {
for(
enumerator i = 0; i < n; ++i)
if( h[i] != InvalidHandle() ) RemPrivateMarker(h[i],m);}
2139 INMOST_DATA_ENUM_TYPE
GetDataCapacity (
const INMOST_DATA_BULK_TYPE * data, INMOST_DATA_ENUM_TYPE size,
const Tag & tag)
const;
2188 Element::GeometricType GetGeometricType (HandleType h)
const {
return static_cast<const bulk *
>(MGetDenseLink(h,GeomTypeTag()))[0];}
2189 void SetGeometricType (HandleType h, Element::GeometricType type) {
static_cast<bulk *
>(MGetDenseLink(h,GeomTypeTag()))[0] = type;}
2217 Element::Status
GetStatus (HandleType h)
const {
if( SharedTag().isValid() )
return static_cast<const bulk *
>(MGetDenseLink(h,SharedTag()))[0];
return Element::Owned;}
2273 bool New (HandleType h)
const;
2284 void SyncDimensions ();
2293 enum Action {AGhost, AMigrate};
2294 enum Prepare {UnknownSize, UnknownSource};
2295 typedef void (*ReduceOperation)(
const Tag & tag,
const Element & element,
const INMOST_DATA_BULK_TYPE * recv_data, INMOST_DATA_ENUM_TYPE recv_size);
2296 typedef std::vector<Tag> tag_set;
2297 typedef std::vector<HandleType> element_set;
2298 typedef std::vector<INMOST_DATA_BULK_TYPE> buffer_type;
2299 typedef std::map<int, element_set > proc_elements;
2300 typedef std::pair<int, buffer_type > proc_buffer_type;
2301 typedef std::vector< proc_buffer_type > exch_buffer_type;
2302 typedef std::vector<INMOST_MPI_Request> exch_reqs_type;
2305 std::vector<unsigned> buf;
2306 std::vector<unsigned> cnt;
2307 std::vector<INMOST_MPI_Request> requests;
2311 for(
size_t i = 0; i < cnt.size(); ++i)
2327 exch_reqs_type send_reqs;
2329 exch_buffer_type send_buffers, recv_buffers;
2334 private:
unsigned int n,a,c,m;
2336 Random(
unsigned int seed = 50);
2338 unsigned int Number();
2344 element_set container[6];
2349 element_set & operator [](
int i){
return container[i]; }
2350 const element_set & operator [](
int i)
const {
return container[i]; }
2351 bool empty() {
bool ret =
true;
for(
int i = 0; i < 6 && ret; i++) ret &= container[i].empty();
return ret;}
2352 unsigned size() {
unsigned ret = 0;
for(
int i = 0; i < 6; ++i) ret += (
unsigned)container[i].size();
return ret;}
2354 typedef std::map<int, elements_by_type > parallel_storage;
2356 typedef std::map<int, elements_by_type > proc_elements_by_type;
2358 #if defined(USE_PARALLEL_STORAGE)
2359 parallel_storage shared_elements;
2360 parallel_storage ghost_elements;
2362 #if defined(USE_PARALLEL_WRITE_TIME)
2365 mutable std::fstream out_time;
2368 mutable int func_id;
2370 #if defined(USE_MPI_P2P)
2371 INMOST_MPI_Win window;
2372 INMOST_DATA_BIG_ENUM_TYPE * shared_space;
2374 int parallel_file_strategy;
2376 void ListTags (tag_set & list);
2377 std::vector<int> ComputeSharedProcs (
const parallel_storage & from,
const parallel_storage & to);
2378 std::vector<int> ComputeSharedProcs (ElementType etype);
2379 proc_elements ComputeSharedSkinSet(ElementType bridge, MarkerType marker = 0);
2380 void PackElementsGather (
elements_by_type & selems,
const elements_by_type & elements,
int destination, ElementType mask, MarkerType select,
const tag_set & tag_list,
bool force_send,
bool send_links_to_owner,
bool pack_by_gids);
2383 void PackTagData (
const Tag & tag,
const elements_by_type & elements,
int destination, ElementType mask, MarkerType select, buffer_type & buffer,
TagInteger pack_position);
2384 void UnpackTagData (
const Tag & tag,
const elements_by_type & elements,
int source, ElementType mask, MarkerType select, buffer_type & buffer,
size_t & buffer_position, ReduceOperation op,
const elements_by_type & unpack_elements);
2385 void PackElementsData (
elements_by_type & input, buffer_type & buffer,
int destination,
const tag_set & tag_list,
TagInteger pack_position,
bool pack_gids);
2386 void UnpackElementsData (
elements_by_type & output, buffer_type & buffer,
int source,
size_t & buffer_position, tag_set & tag_list);
2387 void PrepareReceiveInner(Prepare todo, exch_buffer_type & send_bufs, exch_buffer_type & recv_bufs);
2388 void ExchangeDataInnerBegin(
const tag_set & tag,
const parallel_storage & from,
const parallel_storage & to, ElementType mask, MarkerType select,
exchange_data & storage);
2389 void ExchangeDataInnerEnd(
const tag_set & tag,
const parallel_storage & from,
const parallel_storage & to, ElementType mask, MarkerType select, ReduceOperation op,
exchange_data & storage);
2390 void ExchangeBuffersInner(exch_buffer_type & send_bufs, exch_buffer_type & recv_bufs, exch_reqs_type & send_reqs,
exch_recv_reqs_type & recv_reqs);
2392 void SortParallelStorage(parallel_storage & ghost, parallel_storage & shared,ElementType mask);
2393 void ReportParallelStorage();
2394 void GatherParallelStorage(parallel_storage & ghost, parallel_storage & shared, ElementType mask);
2395 void InformElementsOwners(proc_elements_by_type & send_elements,
exchange_data & storage);
2396 void RemoveLinksToDeletedElements(MarkerType mrk);
2398 HandleType FindSharedGhost(ElementType etype,
Storage::integer global_id,
int source_proc,
int owner_proc);
2399 #if defined(USE_PARALLEL_WRITE_TIME)
2401 void Enter ()
const;
2403 int & GetFuncID ()
const {
return func_id;}
2404 std::fstream & GetStream ();
2405 std::ostream & WriteTab (std::ostream & f)
const;
2406 void FinalizeFile ();
2407 static void AtExit (
void);
2580 template<
typename EType>
2661 void ExchangeData (
const tag_set & tags, ElementType mask, MarkerType select = 0);
2732 void ReduceData (
const Tag & tag, ElementType mask, MarkerType select, ReduceOperation op );
2767 void ReduceData (
const tag_set & tags, ElementType mask, MarkerType select, ReduceOperation op );
2904 template<
typename EType>
3052 void BeginSequentialCode();
3053 void EndSequentialCode ();
3056 Element ElementByLocalIDNum(
integer etypenum,
integer lid) {assert((etypenum < 5 && (lid >= 0 && lid <
static_cast<integer>(links[etypenum].size()))) || (etypenum == 5 && lid == 0));
return Element(
this,ComposeHandleNum(etypenum,lid));}
3057 Element ElementByLocalID (ElementType etype,
integer lid) {
return ElementByLocalIDNum(ElementNum(etype),lid);}
3058 Element ElementByHandle (HandleType h) {
return Element(
this,h);}
3060 HandleType NextHandle (HandleType h)
const;
3061 HandleType PrevHandle (HandleType h)
const;
3062 HandleType NextHandle (HandleType h, ElementType mask)
const;
3063 HandleType PrevHandle (HandleType h, ElementType mask)
const;
3064 HandleType FirstHandle ()
const {
return ComposeHandleNum(ElementNum(NODE),0);}
3065 HandleType LastHandle ()
const {
return ComposeHandleNum(ElementNum(MESH),1);}
3066 HandleType FirstHandle (ElementType etype)
const {
return ComposeHandleNum(ElementNum(etype),0);}
3067 HandleType LastHandle (ElementType etype)
const {
integer num = ElementNum(etype);
return ComposeHandleNum(num,
static_cast<integer>(links[num].size()));}
3069 Node NodeByLocalID (
integer lid) { assert(lid >= 0 && lid <
static_cast<integer>(links[0].size()));
return Node(
this,ComposeHandleNum(0,lid)); }
3070 Edge EdgeByLocalID (
integer lid) { assert(lid >= 0 && lid <
static_cast<integer>(links[1].size()));
return Edge(
this,ComposeHandleNum(1,lid)); }
3071 Face FaceByLocalID (
integer lid) { assert(lid >= 0 && lid <
static_cast<integer>(links[2].size()));
return Face(
this,ComposeHandleNum(2,lid));}
3072 Cell CellByLocalID (
integer lid) { assert(lid >= 0 && lid <
static_cast<integer>(links[3].size()));
return Cell(
this,ComposeHandleNum(3,lid)); }
3073 ElementSet EsetByLocalID (
integer lid) { assert(lid >= 0 && lid <
static_cast<integer>(links[4].size()));
return ElementSet(
this,ComposeHandleNum(4,lid)); }
3075 integer NodeNextLocalID (
integer lid)
const {++lid;
while(lid <
static_cast<integer>(links[0].size()) && links[0][lid] == -1) ++lid;
return lid;}
3076 integer EdgeNextLocalID (
integer lid)
const {++lid;
while(lid <
static_cast<integer>(links[1].size()) && links[1][lid] == -1) ++lid;
return lid;}
3077 integer FaceNextLocalID (
integer lid)
const {++lid;
while(lid <
static_cast<integer>(links[2].size()) && links[2][lid] == -1) ++lid;
return lid;}
3078 integer CellNextLocalID (
integer lid)
const {++lid;
while(lid <
static_cast<integer>(links[3].size()) && links[3][lid] == -1) ++lid;
return lid;}
3079 integer EsetNextLocalID (
integer lid)
const {++lid;
while(lid <
static_cast<integer>(links[4].size()) && links[4][lid] == -1) ++lid;
return lid;}
3081 integer NodePrevLocalID (
integer lid)
const {--lid;
while(lid >= 0 && links[0][lid] == -1) --lid;
return lid;}
3082 integer EdgePrevLocalID (
integer lid)
const {--lid;
while(lid >= 0 && links[1][lid] == -1) --lid;
return lid;}
3083 integer FacePrevLocalID (
integer lid)
const {--lid;
while(lid >= 0 && links[2][lid] == -1) --lid;
return lid;}
3084 integer CellPrevLocalID (
integer lid)
const {--lid;
while(lid >= 0 && links[3][lid] == -1) --lid;
return lid;}
3085 integer EsetPrevLocalID (
integer lid)
const {--lid;
while(lid >= 0 && links[4][lid] == -1) --lid;
return lid;}
3087 __INLINE
integer NodeLastLocalID ()
const {
return static_cast<integer>(links[0].size());}
3088 __INLINE
integer EdgeLastLocalID ()
const {
return static_cast<integer>(links[1].size());}
3089 __INLINE
integer FaceLastLocalID ()
const {
return static_cast<integer>(links[2].size());}
3090 __INLINE
integer CellLastLocalID ()
const {
return static_cast<integer>(links[3].size());}
3091 __INLINE
integer EsetLastLocalID ()
const {
return static_cast<integer>(links[4].size());}
3093 integer LastLocalIDNum (
integer n)
const {assert(n >= 0 && n < 6);
return n == 5 ? 1 :
static_cast<integer>(links[n].size());}
3095 integer NextLocalID (ElementType etype,
integer lid)
const {
integer q = ElementNum(etype); ++lid;
while(lid <
static_cast<integer>(links[q].size()) && links[q][lid] == -1) ++lid;
return lid;}
3096 integer PrevLocalID (ElementType etype,
integer lid)
const {
integer q = ElementNum(etype); --lid;
while(lid > 0 && links[q][lid] == -1) --lid;
return lid;}
3097 integer FirstLocalID (ElementType etype)
const;
3098 integer LastLocalID (ElementType etype)
const {assert(OneType(etype));
return LastLocalIDNum(ElementNum(etype));}
3105 integer LastLocalIDThr (ElementType etype)
const;
3106 integer FirstLocalIDThr (ElementType etype)
const;
3108 __INLINE
integer NumberOfSets ()
const {
return static_cast<integer>(links[4].size() - empty_links[4].size()) - hidden_count[4]; }
3109 __INLINE
integer NumberOfCells ()
const {
return static_cast<integer>(links[3].size() - empty_links[3].size()) - hidden_count[3];}
3110 __INLINE
integer NumberOfFaces ()
const {
return static_cast<integer>(links[2].size() - empty_links[2].size()) - hidden_count[2]; }
3111 __INLINE
integer NumberOfEdges ()
const {
return static_cast<integer>(links[1].size() - empty_links[1].size()) - hidden_count[1]; }
3112 __INLINE
integer NumberOfNodes ()
const {
return static_cast<integer>(links[0].size() - empty_links[0].size()) - hidden_count[0]; }
3113 __INLINE
integer NumberOfElements ()
const {
return NumberOfCells() + NumberOfFaces() + NumberOfEdges() + NumberOfNodes(); }
3114 __INLINE
integer NumberOfAll ()
const {
return NumberOfSets() + NumberOfElements(); }
3115 integer NumberOf (ElementType t)
const;
3117 template<
typename EType>
class base_iterator;
3118 typedef base_iterator<Storage> iteratorStorage;
3119 typedef base_iterator<Element> iteratorElement;
3120 typedef base_iterator<ElementSet> iteratorSet;
3121 typedef base_iterator<Cell> iteratorCell;
3122 typedef base_iterator<Face> iteratorFace;
3123 typedef base_iterator<Edge> iteratorEdge;
3124 typedef base_iterator<Node> iteratorNode;
3142 template<
typename EType>
3153 typedef HandleType * pointer;
3154 typedef HandleType & reference;
3155 typedef HandleType value_type;
3156 typedef ptrdiff_t difference_type;
3157 typedef std::bidirectional_iterator_tag iterator_category;
3165 __INLINE value_type operator * () {
return ComposeHandle(etype,lid);}
3166 __INLINE EType operator ->() {
return EType(m,ComposeHandle(etype,lid));}
3167 __INLINE
base_iterator & operator = (
base_iterator const & other) {m = other.m; lid = other.lid; types = other.types; etype = other.etype;
return *
this;}
3168 __INLINE
bool operator ==(
const base_iterator & other)
const {
return lid == other.lid && etype == other.etype;}
3169 __INLINE
bool operator !=(
const base_iterator & other)
const {
return lid != other.lid || etype != other.etype;}
3170 __INLINE
bool operator < (
const base_iterator & other)
const {
return (etype < other.etype) || (etype == other.etype && lid < other.lid);}
3171 __INLINE
bool operator > (
const base_iterator & other)
const {
return (etype > other.etype) || (etype == other.etype && lid > other.lid);}
3172 __INLINE
bool operator <=(
const base_iterator & other)
const {
return (etype < other.etype) || (etype == other.etype && lid <= other.lid);}
3173 __INLINE
bool operator >=(
const base_iterator & other)
const {
return (etype > other.etype) || (etype == other.etype && lid >= other.lid);}
3191 std::vector< std::pair<std::string, std::string> > file_options;
3235 bool CheckLoadSkip(std::string name,
const std::set<std::string> & noload,
const std::set<std::string> & loadonly)
const;
3237 bool CheckSaveSkip(std::string name,
const std::set<std::string> & noload,
const std::set<std::string> & loadonly)
const;
3254 void LoadMSH(std::string File);
3255 void LoadECL(std::string File);
3256 void LoadXML(std::string File);
3257 void LoadPMF(std::string File);
3258 void LoadVTK(std::string File);
3259 void LoadVTU(std::string File);
3260 void LoadPVTK(std::string File);
3261 void LoadPVTU(std::string File);
3262 void LoadMKF(std::string File);
3277 void SaveXML(std::string File);
3278 void SavePMF(std::string File);
3279 void SaveVTK(std::string File);
3280 void SaveVTU(std::string File);
3281 void SavePVTK(std::string File);
3282 void SavePVTU(std::string File);
3283 void SaveGMV(std::string File);
3284 bool isParallelFileFormat(std::string File);
3294 bool remember[5][3];
3296 void RestoreGeometricTags();
3298 void RepairGeometricTags();
3300 bool HideGeometricData(GeometricData type, ElementType mask) { remember[type][ElementNum(mask) - 1] =
false;
return remember[type][ElementNum(mask) - 1]; }
3301 bool ShowGeometricData(GeometricData type, ElementType mask) { remember[type][ElementNum(mask) - 1] =
true;
return remember[type][ElementNum(mask) - 1]; }
3303 typedef std::map<GeometricData, ElementType> GeomParam;
3314 void CollectCentroidsNormals(
const HandleType * faces,
enumerator size,
real* x,
real* n);
3317 bool CheckConvexity(
const HandleType * faces,
enumerator size);
3318 void PrepareGeometricData(GeomParam table);
3319 void RemoveGeometricData(GeomParam table);
3320 bool HaveGeometricData (GeometricData type, ElementType mask)
const {
return remember[type][ElementNum(mask)-1];}
3321 void GetGeometricData (HandleType e, GeometricData type,
real * ret);
3322 const Tag & GetGeometricTag (GeometricData type)
const;
3323 bool TestClosure (
const HandleType * elements,
integer num)
const;
3324 ElementArray<Face> GatherBoundaryFaces();
3325 ElementArray<Face> GatherInteriorFaces();
3326 integer CountBoundaryFaces ();
3327 integer CountInteriorFaces ();
3328 bool FixEdgeOrder(HandleType* edges,
enumerator nedges)
const;
3329 void RecomputeGeometricData(HandleType e);
3330 void RecomputeGeometricData(HandleType e, GeometricData d);
3331 Element::GeometricType
ComputeGeometricType(ElementType element_type,
const HandleType * lower_adjacent, INMOST_DATA_ENUM_TYPE lower_adjacent_size);
3332 void ComputeCentroid(Element e, TagRealArray coords,
real * x)
const;
3333 void ComputeBarycenter(Element e, TagRealArray coords,
real * x)
const;
3334 void ComputeNormal(Element e, TagRealArray coords,
real * n)
const;
3335 void ComputeMeasure(Element e, TagRealArray coords,
real & m)
const;
3336 #if defined(USE_AUTODIFF)
3337 void ComputeCentroid(Element e, TagVariableArray coords, variable * x)
const;
3338 void ComputeBarycenter(Element e, TagVariableArray coords, variable * x)
const;
3339 void ComputeNormal(Element e, TagVariableArray coords, variable * n)
const;
3340 void ComputeMeasure(Element e, TagVariableArray coords, variable & m)
const;
3370 MarkerType hide_element, new_element, temp_hide_element;
3378 MarkerType HideMarker ()
const {
return hide_element;}
3379 MarkerType NewMarker ()
const {
return new_element;}
3381 void SwapModification (
bool recompute_geometry);
3382 void BeginModification ();
3401 void EndModification ();
3404 void EquilibrateGhost ();
3417 void CheckGIDs(std::string file,
int line, ElementType mask = NODE | EDGE | FACE | CELL | ESET);
3429 Tag tag_topologyerror;
3430 TopologyCheck checkset;
3431 TopologyCheck errorset;
3453 TopologyCheck
GetTopologyCheck (TopologyCheck mask = ENUMUNDEF)
const {
return checkset & mask;}
3461 TopologyCheck
GetTopologyError (TopologyCheck mask = ENUMUNDEF)
const {
return errorset & mask;}
3473 int Compare(
const real * a,
const real * b)
const;
3474 int Compare(HandleType a, HandleType b)
const;
3475 bool operator() (HandleType a, HandleType b)
const;
3476 bool operator() (HandleType a,
const real * b)
const;
3477 bool operator() (
const real * a, HandleType b)
const;
3487 bool operator() (HandleType a, HandleType b)
const {
if( a == InvalidHandle() || b == InvalidHandle() )
return a > b;
return m->
GlobalID(a) < m->
GlobalID(b);}
3488 bool operator() (HandleType a,
integer gid)
const {
if( a == InvalidHandle() )
return false;
return m->
GlobalID(a) < gid;}
3496 bool operator()(HandleType a, HandleType b)
const
3498 if( a == InvalidHandle() || b == InvalidHandle() )
return a > b;
3501 int Compare(
const std::string& a,
const std::string& b)
const;
3502 int Compare(HandleType a, HandleType b)
const;
3512 int CompareNodes(HandleType a, HandleType b)
const;
3513 int CompareElements(HandleType a, HandleType b)
const;
3514 bool operator() (HandleType a, HandleType b)
const {
if( a == InvalidHandle() || b == InvalidHandle() )
return a > b;
return CompareElements(a,b) < 0;}
3524 bool operator() (HandleType a, HandleType b)
const {
if( a == InvalidHandle() || b == InvalidHandle() )
return a > b;
return m->
Real(a,t) < m->
Real(b,t);}
3525 bool operator() (HandleType a,
real b)
const {
if( a == InvalidHandle() )
return true;
return m->
Real(a,t) < b;}
3535 bool operator() (HandleType a, HandleType b)
const {
if( a == InvalidHandle() || b == InvalidHandle() )
return a > b;
return m->
Integer(a,t) < m->
Integer(b,t);}
3536 bool operator() (HandleType a,
integer b)
const {
if( a == InvalidHandle() )
return true;
return m->
Integer(a,t) < b;}
3546 bool operator() (HandleType a, HandleType b)
const {
if( a == InvalidHandle() || b == InvalidHandle() )
return a > b;
return m->
Bulk(a,t) < m->
Bulk(b,t);}
3547 bool operator() (HandleType a,
bulk b)
const {
if( a == InvalidHandle() )
return true;
return m->
Bulk(a,t) < b;}
3557 bool operator() (HandleType a, HandleType b)
const {
if( a == InvalidHandle() || b == InvalidHandle() )
return a > b;
return m->
RealDF(a,t) < m->
RealDF(b,t);}
3558 bool operator() (HandleType a,
real b)
const {
if( a == InvalidHandle() )
return true;
return m->
RealDF(a,t) < b;}
3568 bool operator() (HandleType a, HandleType b)
const {
if( a == InvalidHandle() || b == InvalidHandle() )
return a > b;
return m->
IntegerDF(a,t) < m->
IntegerDF(b,t);}
3569 bool operator() (HandleType a,
integer b)
const {
if( a == InvalidHandle() )
return true;
return m->
IntegerDF(a,t) < b;}
3579 bool operator() (HandleType a, HandleType b)
const {
if( a == InvalidHandle() || b == InvalidHandle() )
return a > b;
return m->
BulkDF(a,t) < m->
BulkDF(b,t);}
3580 bool operator() (HandleType a,
bulk b)
const {
if( a == InvalidHandle() )
return true;
return m->
BulkDF(a,t) < b;}
3590 bool operator() (HandleType a, HandleType b)
const
3592 if( a == InvalidHandle() || b == InvalidHandle() )
3594 INMOST_DATA_REAL_TYPE ma, mb;
3595 m->GetGeometricData(a,MEASURE,&ma);
3596 m->GetGeometricData(b,MEASURE,&mb);
3599 bool operator() (HandleType a,
bulk b)
const
3601 if( a == InvalidHandle() )
3603 INMOST_DATA_REAL_TYPE ma;
3604 m->GetGeometricData(a,MEASURE,&ma);
3611 Mesh * m; MarkerType mrk;
bool inverse;
3613 MarkerComparator(
Mesh * m, MarkerType mrk,
bool inverse =
false) :m(m), mrk(mrk), inverse(inverse) {assert(!isPrivate(mrk));}
3616 bool operator() (HandleType a, HandleType b)
const {
if( a == InvalidHandle() || b == InvalidHandle() )
return a > b;
return ((inverse ^ m->
GetMarker(a,mrk))? 1 : 0) < ((inverse ^ m->
GetMarker(b,mrk)) ? 1 : 0);}
3617 bool operator() (HandleType a,
bool b)
const {
if( a == InvalidHandle() )
return true;
return ((inverse ^ m->
GetMarker(a,mrk))? 1 : 0) < (b ? 1 : 0);}
3622 Mesh * m; MarkerType mrk;
bool inverse;
3624 PrivateMarkerComparator(
Mesh * m, MarkerType mrk,
bool inverse =
false) :m(m), mrk(mrk), inverse(inverse) {assert(isPrivate(mrk));}
3627 bool operator() (HandleType a, HandleType b)
const {
if( a == InvalidHandle() || b == InvalidHandle() )
return a > b;
return ((inverse ^ m->GetPrivateMarker(a,mrk))? 1 : 0) < ((inverse ^ m->GetPrivateMarker(b,mrk))? 1 : 0);}
3628 bool operator() (HandleType a,
bool b)
const {
if( a == InvalidHandle() )
return true;
return ((inverse ^ m->GetPrivateMarker(a,mrk))? 1 : 0) < (b ? 1 : 0);}
3632 void SortHandles(HandleType * h,
enumerator num);
3657 inline static bool cell_point_print(
const Cell& c,
const Storage::real p[3], std::ostream & sout) {
return c.InsidePrint(p,sout); }
3658 template<
typename bbox_type>
3659 inline static int bbox_point(
const Storage::real p[3],
const bbox_type bbox[6]);
3660 template<
typename bbox_type>
3661 inline static int bbox_point_print(
const Storage::real p[3],
const bbox_type bbox[6], std::ostream& sout = std::cout);
3662 template<
typename bbox_type>
3664 template<
typename bbox_type>
3673 struct entry & operator =(
const struct entry & other)
3676 xyz[0] = other.xyz[0];
3677 xyz[1] = other.xyz[1];
3678 xyz[2] = other.xyz[2];
3683 INMOST_DATA_ENUM_TYPE size;
3686 static int cmpElements0(
const void * a,
const void * b);
3687 static int cmpElements1(
const void * a,
const void * b);
3688 static int cmpElements2(
const void * a,
const void * b);
3689 inline static unsigned int flip(
const unsigned int * fp);
3690 void radix_sort(
int dim,
struct entry * temp);
3691 void kdtree_build(
int dim,
int & done,
int total,
struct entry * temp);
3692 SearchKDTree() : set(NULL), m(NULL), size(0), bbox(), children(NULL) {}
3696 void clear_children();
3698 inline int ray_bbox(
double pos[3],
double ray[3],
double closest)
const;
3717 Cell SearchCellPrint(
const Storage::real* point, std::ostream & sout = std::cout)
const;
3731 return GetMeshLink()->
Real(GetHandle(),tag);
3735 return GetMeshLink()->
Integer(GetHandle(),tag);
3739 return GetMeshLink()->
Bulk(GetHandle(),tag);
3743 return GetMeshLink()->
Reference(GetHandle(),tag);
3751 return GetMeshLink()->
RealArray(GetHandle(),tag);
3759 return GetMeshLink()->
BulkArray(GetHandle(),tag);
3771 return GetMeshLink()->
RealArrayDF(GetHandle(),tag);
3779 return GetMeshLink()->
BulkArrayDF(GetHandle(),tag);
3781 __INLINE Storage::reference_array Storage::ReferenceArrayDF(
const Tag & tag)
const
3785 __INLINE Storage::remote_reference_array Storage::RemoteReferenceArrayDF(
const Tag & tag)
const
3789 __INLINE
Storage::real & Storage::RealDF(
const Tag & tag)
const
3791 return GetMeshLink()->
RealDF(GetHandle(),tag);
3795 return GetMeshLink()->
IntegerDF(GetHandle(),tag);
3797 __INLINE
Storage::bulk & Storage::BulkDF(
const Tag & tag)
const
3799 return GetMeshLink()->
BulkDF(GetHandle(),tag);
3803 return GetMeshLink()->
ReferenceDF(GetHandle(),tag);
3811 return GetMeshLink()->
RealArrayDV(GetHandle(),tag);
3819 return GetMeshLink()->
BulkArrayDV(GetHandle(),tag);
3821 __INLINE Storage::reference_array Storage::ReferenceArrayDV(
const Tag & tag)
const
3825 __INLINE Storage::remote_reference_array Storage::RemoteReferenceArrayDV(
const Tag & tag)
const
3829 __INLINE
Storage::real & Storage::RealDV(
const Tag & tag)
const
3831 return GetMeshLink()->
RealDV(GetHandle(),tag);
3835 return GetMeshLink()->
IntegerDV(GetHandle(),tag);
3837 __INLINE
Storage::bulk & Storage::BulkDV(
const Tag & tag)
const
3839 return GetMeshLink()->
BulkDV(GetHandle(),tag);
3843 return GetMeshLink()->
ReferenceDV(GetHandle(),tag);
3849 __INLINE
Storage::real & TagReal::operator [](HandleType h)
const
3851 return GetMeshLink()->
Real(h,*
static_cast<const Tag*
>(
this));
3855 return GetMeshLink()->
Integer(h,*
static_cast<const Tag*
>(
this));
3857 __INLINE
Storage::bulk & TagBulk::operator [](HandleType h)
const
3859 return GetMeshLink()->
Bulk(h,*
static_cast<const Tag*
>(
this));
3863 return GetMeshLink()->
Reference(h,*
static_cast<const Tag*
>(
this));
3867 return GetMeshLink()->
RealArray(h,*
static_cast<const Tag*
>(
this));
3869 __INLINE Matrix<Storage::real,Storage::real_array> TagRealArray::operator ()(HandleType h,
int n,
int m)
const
3872 assert((
int)data.size() == n*m);
3873 return Matrix<Storage::real,Storage::real_array>(data,n,m);
3877 return GetMeshLink()->
IntegerArray(h,*
static_cast<const Tag*
>(
this));
3881 return GetMeshLink()->
BulkArray(h,*
static_cast<const Tag*
>(
this));
3883 __INLINE Storage::reference_array TagReferenceArray::operator [](HandleType h)
const
3885 return GetMeshLink()->
ReferenceArray(h,*
static_cast<const Tag*
>(
this));
3887 #if defined(USE_AUTODIFF)
3890 return GetMeshLink()->Variable(GetHandle(),tag);
3894 return GetMeshLink()->VariableDF(GetHandle(),tag);
3896 __INLINE
Storage::var & Storage::VariableDV(
const Tag & tag)
const
3898 return GetMeshLink()->VariableDV(GetHandle(),tag);
3902 return GetMeshLink()->VariableArray(GetHandle(),tag);
3906 return GetMeshLink()->VariableArrayDF(GetHandle(),tag);
3910 return GetMeshLink()->VariableArrayDV(GetHandle(),tag);
3912 __INLINE
Storage::var & TagVariable::operator [](HandleType h)
const
3914 return GetMeshLink()->Variable(h,*
static_cast<const Tag*
>(
this));
3918 return GetMeshLink()->VariableArray(h,*
static_cast<const Tag*
>(
this));
3920 __INLINE Matrix<Storage::var,Storage::var_array> TagVariableArray::operator ()(HandleType h,
int n,
int m)
const
3922 Storage::var_array data = GetMeshLink()->VariableArray(h,*
static_cast<const Tag*
>(
this));
3923 assert((
int)data.size() == n*m);
3924 return Matrix<Storage::var,Storage::var_array>(data,n,m);
3931 return GetMeshLink()->
HaveData(GetHandle(),tag);
3935 return GetMeshLink()->
GetDataSize(GetHandle(),tag);
3943 GetMeshLink()->
SetDataSize(GetHandle(),tag,new_size);
3945 __INLINE ElementType Storage::GetElementType()
const
3947 return GetHandleElementType(handle);
3951 return GetHandleElementNum(handle);
3953 __INLINE
void Storage::GetData(
const Tag & tag,INMOST_DATA_ENUM_TYPE shift, INMOST_DATA_ENUM_TYPE size,
void * data_out)
const
3955 GetMeshLink()->
GetData(GetHandle(),tag,shift,size,data_out);
3957 __INLINE
void Storage::SetData(
const Tag & tag,INMOST_DATA_ENUM_TYPE shift, INMOST_DATA_ENUM_TYPE size,
const void * data_in)
const
3959 GetMeshLink()->
SetData(GetHandle(),tag,shift,size,data_in);
3961 __INLINE
void Storage::DelData(
const Tag & tag)
const
3963 GetMeshLink()->
DelData(GetHandle(),tag);
3973 __INLINE
void Storage::SetMarker(MarkerType n)
const
3975 assert( isValid() );
3976 GetMeshLink()->
SetMarker(GetHandle(),n);
3978 __INLINE
bool Storage::GetMarker(MarkerType n)
const
3980 assert( isValid() );
3981 return GetMeshLink()->
GetMarker(GetHandle(),n);
3983 __INLINE
void Storage::RemMarker(MarkerType n)
const
3985 assert( isValid() );
3986 GetMeshLink()->
RemMarker(GetHandle(),n);
3988 __INLINE
void Storage::SetPrivateMarker(MarkerType n)
const
3990 assert( isValid() );
3991 GetMeshLink()->SetPrivateMarker(GetHandle(),n);
3993 __INLINE
bool Storage::GetPrivateMarker(MarkerType n)
const
3995 assert( isValid() );
3996 return GetMeshLink()->GetPrivateMarker(GetHandle(),n);
3998 __INLINE
void Storage::RemPrivateMarker(MarkerType n)
const
4000 assert( isValid() );
4001 GetMeshLink()->RemPrivateMarker(GetHandle(),n);
4003 __INLINE
void Storage::ClearMarkerSpace()
const
4007 __INLINE
void Storage::GetMarkerSpace(
Storage::bulk copy[MarkerFields])
const
4011 __INLINE
void Storage::SetMarkerSpace(
Storage::bulk source[MarkerFields])
const
4015 __INLINE
bool Storage::isValid()
const
4017 return handle != InvalidHandle() && GetMeshLink() != NULL && GetMeshLink()->isValidElement(handle);
4021 return GetHandleID(handle);
4027 __INLINE
Element Storage::getAsElement()
const
4029 assert(GetElementType() & (NODE | EDGE | FACE | CELL | ESET) );
4030 return Element(GetMeshLink(), GetHandle());
4032 __INLINE Node Storage::getAsNode()
const
4034 assert(GetElementType() == NODE);
4035 return Node(GetMeshLink(),GetHandle());
4037 __INLINE Edge Storage::getAsEdge()
const
4039 assert(GetElementType() == EDGE);
4040 return Edge(GetMeshLink(),GetHandle());
4042 __INLINE Face Storage::getAsFace()
const
4044 assert(GetElementType() == FACE);
4045 return Face(GetMeshLink(),GetHandle());
4047 __INLINE Cell Storage::getAsCell()
const
4049 assert(GetElementType() == CELL);
4050 return Cell(GetMeshLink(),GetHandle());
4052 __INLINE ElementSet Storage::getAsSet()
const
4054 assert(GetElementType() == ESET);
4055 return ElementSet(GetMeshLink(),GetHandle());
4057 __INLINE Mesh * Storage::GetMeshLink()
const
4061 __INLINE HandleType Storage::GetHandle()
const
An interface for elements of type CELL.
bool Inside(const real *point) const
Determine, if point lies inside element.
void SwapBackCell() const
For each adjacent cell make me a front cell and fix normal orientation accordingly.
bool FixEdgeOrder() const
Repair the sequence of edges so that each edge have node that matches one of the nodes at the next ed...
Cell(const Cell &other)
Copy constructor.
Cell(Mesh *m, HandleType *h)
Basic constructor with an assignable handle.
Cell & operator=(Cell const &other)
Assignment operator.
ElementArray< Node > getNodes() const
Get all the nodes of the current cell.
Cell * operator->()
Operator of dereference to pointer.
ElementArray< Edge > getEdges(MarkerType mask, bool invert_mask=false) const
Get the subset of the edges of the current cell that are (not) marked by provided marker.
ElementArray< Face > getFaces() const
Get all the faces of the current cell.
Cell Neighbour(Face face) const
Get a cell that share a face with the current cell.
Cell(Mesh *m, HandleType h)
Basic constructor with fixed handle.
ElementArray< Cell > NeighbouringCells() const
Get all cells that share the face with the current cell.
static bool TestUniteCells(const ElementArray< Cell > &cells, MarkerType del_protect)
Test that no marked element will be deleted during union of given cells.
real Volume() const
Return volume of the cell.
static Cell UniteCells(const ElementArray< Cell > &cells, MarkerType del_protect)
Unite a set of given cells into one cell.
bool CheckEdgeOrder() const
Check that sequence of edges form a closed loop and each edge have a node that matches one of the nod...
ElementArray< Face > getFaces(MarkerType mask, bool invert_mask=false) const
Get the subset of the faces of the current cell that are (not) marked by provided marker.
ElementArray< Edge > getEdges() const
Get all the edges of the current cell.
static bool TestSplitCell(Cell cell, const ElementArray< Face > &faces, MarkerType del_protect)
This functions checks is it possible to split the cell by the given set of faces without deleting mar...
ElementArray< Node > getNodes(MarkerType mask, bool invert_mask=false) const
Get the subset of the nodes of the current cell that are (not) marked by provided marker.
static ElementArray< Cell > SplitCell(Cell cell, const ElementArray< Face > &faces, MarkerType del_protect)
Separate a cell according to the set of provided faces.
bool Closure() const
Test that faces of the cell form the closed set.
ElementArray< Node > getNodes() const
Retrieve all the nodes of the element.
void SwapEnds()
Swap positions of first node and last node.
ElementArray< Face > getFaces() const
Retrieve all the faces of the element.
ElementArray< Cell > getCells() const
Return all the cells of the element.
iterator Begin() const
Provides forward iterator that skips deleted and hidden elements within set.
void SynchronizeSetElements()
Asks all the elements to be sent to other processors.
void PutElements(const ElementSet &other) const
Put multiple handles of the other set without checking of the existence of duplicate.
void RemMarkerElements(MarkerType m, ElementType etype=ESET|CELL|FACE|EDGE|NODE) const
Remove markers from all the elements of given type.
void RemChild(const ElementSet &child) const
This will erase my child.
bool DeleteSet()
Remove the set and resolve it's hierarchical structure.
ElementArray< Cell > getCells() const
Retrieve only cells.
std::string GetName() const
Get name of the set.
void SetMarkerElements(MarkerType m, ElementType etype=ESET|CELL|FACE|EDGE|NODE) const
Set markers on all the elements of given type.
void Intersect(const ElementSet &other) const
Compute and store intersection with raw handles.
void Subtract(const ElementSet &other) const
Compute and store difference with raw handles.
ElementArray< Element > Intersection(const HandleType *handles, enumerator num) const
Compute and return intersection with raw handles.
void AddElements(const HandleType *handles, enumerator num) const
Add multiple elements with checking of the existence of duplicate.
void Unite(const HandleType *handles, enumerator num) const
Compute and store union with raw handles.
static const enumerator high_conn_reserved
Number of reserved positions in HighConn array.
void RemSibling(const ElementSet &sibling) const
This will erase sibling or parent's child.
ElementArray< Element > Union(const ElementSet &other) const
Compute and return union with other set.
enumerator Size() const
Get total number of elements.
void ReorderEmpty() const
Retrieve current set exchange type.
ElementArray< Element > Intersection(const ElementArray< EType > &elems) const
Compute and return intersection with elements.
ElementArray< Node > getNodes() const
Retrieve only nodes.
void Intersect(const HandleType *handles, enumerator num) const
Compute and store intersection with raw handles.
void AddElements(const ElementArray< EType > &elems) const
Add multiple elements with checking of the existence of duplicate.
void RemoveElements(const ElementArray< EType > &elems) const
Remove multiple elements from the set.
void PutElements(const ElementArray< EType > &elems) const
Put multiple handles without checking.
void AddChild(const ElementSet &child) const
Add child to current set.
iterator Erase(iterator pos) const
Erase one element pointed by iterator and return next valid element.
ElementArray< Edge > getEdges() const
Retrieve only edges.
ElementArray< Element > getAdjElements(ElementType etype, MarkerType select, bool invert=false) const
Retrieve unordered array of adjacent elements with marker.
enumerator nbAdjElements(ElementType etype, MarkerType select, bool invert=false) const
Retrieve number of adjacent elements with marker.
void AddSibling(const ElementSet &sibling) const
This will create new child for the parent.
HandleType * getHandles() const
Direct raw access to stored elements, no copy involved.
ElementArray< Element > getAdjElements(ElementType etype) const
Retrieve all elements by type.
ElementArray< Element > Union(const HandleType *handles, enumerator num) const
Compute and return union with raw handles.
Element FindElementByGlobalID(integer global_id) const
Sets the synchronization regime for set elements.
enumerator nbHandles() const
Retrieve number of stored handles, including invalid.
void Erase(iterator beg, iterator end) const
Erase set of elements pointed by iterators.
void SortSet(ComparatorType comp) const
Performs sort of the set of elements.
void Unite(const ElementArray< EType > &elems) const
Compute and store union with elements.
void PutElement(HandleType e) const
Put one element without checking of the existence of duplicate.
void PutElement(const Storage &e) const
Put one element without checking of the existence of duplicate.
void Intersect(const ElementArray< EType > &elems) const
Compute and store intersection with elements.
ComparatorType GetComparator() const
Retrieve current set comparator.
ElementArray< Element > Union(const ElementArray< EType > &elems) const
Compute and return union with elements.
ElementSet GetParent() const
Retrieve parent of the set.
Element FindElementByCentroid(real *centroid) const
Perform binary search by centroid.
enumerator nbAdjElements(ElementType etype) const
Retrieve all elements by type.
enumerator nbSorted() const
Retrieve position after last sorted element.
void SynchronizeSetChildren()
Asks all the children to be sent to other processors.
enumerator CountChildren() const
How many children I have.
void PutElements(const HandleType *handles, enumerator num) const
Put multiple handles without checking of the existence of duplicate.
ElementSet GetChild() const
Retrieve child set of the set.
bool Empty() const
Is there any elements in the set.
void SynchronizeSetParents()
Asks all the parents upwards to be sent to other processors.
bool FindHandle(HandleType h, bool use_comparator) const
Performs linear search in unsorted set.
enumerator CountSiblings() const
How many there are siblings to the right of me including me.
iterator End() const
Provides end for forward iterator to stop the loop.
bool DeleteSetTree()
Remove the set and all it's children.
void AddElement(HandleType e) const
Put one element with checking of the existence of duplicate.
void AddElement(const Storage &e) const
Put one element with checking of the existence of duplicate.
void Clear()
Remove all elements, clear all data, removes sorted marker.
void AddElements(const ElementSet &other)
Add elements of other set.
iterator EndSorted() const
Provides iterator that points to element located after the last element that belong to presorted part...
void Subtract(const ElementArray< EType > &elems) const
Compute and store difference with elements.
void SynchronizeSetElementsWithOwner()
Asks all the elements of ghost sets to be sent to the owner processors.
ElementArray< Element > Difference(const ElementArray< EType > &elems) const
Compute and return difference with elements.
void Subtract(const HandleType *handles, enumerator num) const
Compute and store difference with raw handles.
ElementArray< Element > Difference(const HandleType *handles, enumerator num) const
Compute and return difference with raw handles.
ElementArray< Face > getFaces() const
Retrieve only faces.
ElementSet GetSibling() const
Retrieve sibling set of the set, this will be next child for the parent.
void Unite(const ElementSet &other) const
Compute and store union with raw handles.
virtual ElementArray< Face > getFaces() const
Retrieve all the faces of the element.
virtual ElementArray< Cell > getCells() const
Return all the cells of the element.
virtual enumerator nbAdjElements(ElementType etype, MarkerType mask, bool invert_mask=false) const
Retrieve number of adjacent elements with marker.
bool Hide() const
If the function returns true then element was hidden, works only inside BeginModification and EndModi...
void SendTo(std::set< Storage::integer > &procs) const
Update geometric data for element, calls RecomputeGeometricData from Mesh.
virtual ElementArray< Edge > getEdges() const
Retrieve all the edges of the element.
void Connect(const HandleType *adjacent, INMOST_DATA_ENUM_TYPE num) const
Connects lower adjacencies to current element.
virtual ElementArray< Element > getAdjElements(ElementType etype) const
Retrieve unordered array of adjacent elements.
virtual enumerator nbAdjElements(ElementType etype) const
Retrieve number of adjacent elements.
bool Delete()
Remove element from mesh.
virtual ElementArray< Node > getNodes() const
Retrieve all the nodes of the element.
bool Show() const
If the function returns true then element was recovered from hidden state, works only inside BeginMod...
void Disconnect(const HandleType *adjacent, INMOST_DATA_ENUM_TYPE num) const
Disconnect element.
virtual ElementArray< Element > getAdjElements(ElementType etype, MarkerType mask, bool invert_mask=false) const
Retrieve unordered array of adjacent elements with marker.
bool Boundary() const
Determine that the element is on the boundary.
An interface for elements of type FACE.
Cell BackCell() const
Retrieve the cell for which the normal points outwards.
ElementArray< Node > getNodes() const
Retrieve all the nodes of the element.
Cell FrontCell() const
Retrieve the cell for which the normal points inwards.
ElementArray< Edge > getEdges() const
Retrieve all the edges of the element.
void SwapCells() const
This function changes Face::BackCell() with Face::FrontCell().
ElementArray< Cell > getCells() const
Return all the cells of the element.
integer EnumerateSet(const ElementSet &set, const Tag &num_tag, integer start=0, bool define_sparse=true)
Enumerate all elements in the set.
Tag CreateTag(std::string name, DataType dtype, ElementType etype, ElementType sparse, INMOST_DATA_ENUM_TYPE size=ENUMUNDEF)
Create the tag by name, type and size.
ElementArray< ElementSet > GetSetsByPrefix(std::string prefix)
Retrieve all the sets whose names start with given prefix.
bulk_array BulkArrayDV(HandleType h, const Tag &tag)
Returns an array of bytes in dense array of variable size.
void SetDimensions(integer dim)
Set number of dimensions for mesh.
void FacesOrientation(const ElementArray< Face > &faces, MarkerType rev)
Marks face with the orientation direction by marker.
void ReduceDataBegin(const Tag &tag, ElementType mask, MarkerType select, exchange_data &storage)
This function intializes data reduction.
void GetData(HandleType h, const Tag &tag, enumerator shift, enumerator size, void *data) const
Copy inner data array of size elements to provided array beginning from shift element.
INMOST_DATA_ENUM_TYPE GetDataSize(HandleType h, const Tag &tag) const
Return the size of the array.
real_array RealArray(HandleType h, const Tag &tag)
Returns an array of real values.
void SetFileOption(std::string, std::string)
Set file option.
INMOST_DATA_ENUM_TYPE GetArrayCapacity(integer etypenum)
This function is needed by TagManager, may be made private in future follows definition of chunk_arra...
void ResolveSets()
Find sets that are common between processors.
void ResolveShared(bool only_new=false)
Find elements that are common between processors.
void Destroy(HandleType h)
Completely destroy element from mesh.
void ExchangeData(const Tag &tag, ElementType mask, MarkerType select=0)
Update data from Shared elements to Ghost elements.
void CheckProcsSorted(std::string file, int line)
Check that processors are sorted on every element.
void RemMarkerArray(const HandleType *h, enumerator n, MarkerType m)
Remove the marker from the set of handles.
integer DataLocalID(HandleType h) const
Retrieve position of the data position of current element.
__INLINE Tag RedistributeTag()
Don't put this shortcut to any function directly, as it creates tag inside assign to other object of ...
void ClearTopologyError(TopologyCheck mask=ENUMUNDEF)
Revert mesh to clean topology error state.
bool HaveGlobalID(ElementType types) const
Test whether global identificator was set on certain type of elements.
void CheckProcessors()
Let ghost elements send owner processor to master elements and see if they match.
__INLINE enumerator NumberOfTags() const
Retrieve the total number of valid tags.
Element::adj_type & HighConn(HandleType h)
Access directly higher order adjacencies of current element with right of modification.
void ApplyModification()
After this function any link to deleted element will be replaced by InvalidHandle().
void RecordParallelStorage(ElementType mask)
Outputs parallel storage into xml log files.
void SetMeshName(std::string new_name)
Be careful changing mesh name if you have already established remote links.
__INLINE void RemMarker(HandleType h, MarkerType n)
Remove the marker from the element.
INMOST_DATA_ENUM_TYPE GetDataCapacity(HandleType h, const Tag &tag) const
Return the size of the structure in bytes required to represent the data on current element.
void Integrate(enumerator *input, integer size)
Integrate an array of unsigned integer values over all processors.
__INLINE iteratorTag BeginTag()
Returns the first tag defined on the mesh.
std::pair< ElementSet, bool > CreateSetUnique(std::string name)
Same as Mesh::CreateSet without checking existence of the set.
bool Hide(HandleType h)
Hide element from mesh.
void ReduceData(const Tag &tag, ElementType mask, MarkerType select, ReduceOperation op)
Accumulation of data from ghost elements to shared elements.
void SetData(HandleType h, const Tag &tag, enumerator shift, enumerator size, const void *data)
Copy into inner data array of size elements from provided array beginning from shift element.
void SetParallelFileStrategy(int strategy)
Set parallel strategy for inner communications.
Node CreateNode(const real *coords)
Create node by given coordinates.
bulk & BulkDV(HandleType h, const Tag &tag)
Returns a reference in dense array to the first element of variable size array of bytes.
void ExchangeDataBegin(const Tag &tag, ElementType mask, MarkerType select, exchange_data &storage)
Start asynchronous synchronization of data.
void RemTopologyCheck(TopologyCheck mask)
Remove topology checks.
int GetLocalProcessorNumber() const
Get number of processors in shared environment (OpenMP)
void RemoveLowerAdjacencies(ElementType mask=(EDGE|FACE|CELL))
Delete all upper adjacencies, access to HighConn should fire assertion and retrieval of upper adjacen...
std::string GetMeshName()
Retrieve the name of the current mesh.
bool Show(HandleType h)
Show element from mesh.
void RestoreUpperAdjacencies(ElementType mask=(NODE|EDGE|FACE))
Restore all upper adjacencies.
MarkerType CreateMarker()
Allocate a new marker.
integer & IntegerDF(HandleType h, const Tag &tag)
Returns a reference to inner memory location of the first element of the array of integer values.
void SortParallelStorage(ElementType mask)
Sort parallel storage.
void ReleaseMarker(MarkerType n, ElementType cleanup=NONE)
Release marker back for reuse.
void ExchangeDataBegin(const tag_set &tags, ElementType mask, MarkerType select, exchange_data &storage)
This function will initialize exchange of multiple data tags.
void CheckSetLinks(std::string file, int line)
Checks that there are no invalid links in sets.
ElementType HaveLowerAdjacencies() const
Check that upper adjacencies are stored.
void ExchangeDataEnd(const Tag &tag, ElementType mask, MarkerType select, exchange_data &storage)
Complete asynchronous synchronization of data.
bool New(HandleType h) const
Check whether element is new.
void ExchangeData(const tag_set &tags, ElementType mask, MarkerType select=0)
This function will perform exchange of multiple data tags.
Element::adj_type const & HighConn(HandleType h) const
Access directly higher order adjacencies of current element without right of modification.
void ClearMarkerSpace(HandleType h)
Remove all the markers from the element.
bool DelSparseData(HandleType h, const Tag &tag)
Removes data of variable size and sparse tag data.
void MarkNormalOrientation(MarkerType mrk)
This function should be used to detect normal inversion on ghost interfaces with respect to normal or...
remote_reference & RemoteReferenceDF(HandleType h, const Tag &tag)
Returns a reference in dense array to the first element of constant size array of element remote hand...
ElementSet GetSet(std::string name)
Retrieve set by name.
bulk_array BulkArrayDF(HandleType h, const Tag &tag)
Returns an array of bytes in dense array.
integer Integrate(integer input)
Integrate integer value over all processors.
TopologyCheck BeginTopologyCheck(ElementType etype, const HandleType *adj, enumerator num)
This function allows you to perform some topological checks before you create an element.
void WachspressInterpolation2D(const real *x, const Face &f, std::map< HandleType, real > &nodes_stencil) const
Compute node-centered interpolation on 2d face for point.
__INLINE void SetMarker(HandleType h, MarkerType n)
Set a marker on the element represented by handle.
void RecomputeParallelStorage(ElementType mask)
Regather ghost and shared element sets for data exchange.
bool Delete(HandleType h)
This function will hide element in modification state (between BeginModification and EndModification)...
void ReportConnection(HandleType h)
Go through all elements and detect presence of prescribed element in any reference data tag.
void OrientTag(Face f, Tag t)
Swap sign for oriented data of a single tag.
void SetTopologyError(TopologyCheck mask)
This will turn mesh into the state indicating that some topology error occurred.
void RemoveGhostElements(const HandleType *ghost, enumerator num)
Delete some ghost cells provided in array.
void DelDenseData(void *data, const Tag &tag)
Removes data of variable size, clears to zero data of fixed size.
integer Enumerate(const HandleType *h, enumerator num, const Tag &num_tag, integer start=0, bool define_sparse=true)
Enumerate all elements beginning with start and put numeration to data associated with num_tag.
void Load(std::string File)
Acceptable file formats for reading.
bool CheckSaveSkip(std::string name, const std::set< std::string > &noload, const std::set< std::string > &loadonly) const
Check if tag saving should be skipped.
void RemoveUpperAdjacencies(ElementType mask=(NODE|EDGE|FACE))
Delete all upper adjacencies, access to HighConn should fire assertion and retrieval of upper adjacen...
void ResolveModification()
This function is not yet implemented.
remote_reference_array RemoteReferenceArrayDV(HandleType h, const Tag &tag)
Returns an array of element remote handles in dense array of variable size.
int GetProcessorRank() const
Get rank of current processor.
void CheckGhostSharedCount(std::string file, int line, ElementType etype=ESET|CELL|FACE|EDGE|NODE)
Check that number of ghost and shared elements match to each other.
void Destroy(const Storage &e)
Shortcut for typed elements.
void SetStatus(HandleType h, Element::Status s)
Set parallel status of the element.
real & RealDV(HandleType h, const Tag &tag)
Returns a reference in dense array to the first element of variable size array of real values.
TopologyCheck GetTopologyCheck(TopologyCheck mask=ENUMUNDEF) const
Retrieve currently set topology checks.
void CheckGIDs(std::string file, int line, ElementType mask=NODE|EDGE|FACE|CELL|ESET)
Let ghost elements send global ids to master elements and see if they match.
void RemOrientedTag(Tag t)
Remove a data tag that follows normal orientation.
remote_reference & RemoteReference(HandleType h, const Tag &tag)
Returns a reference in an inner representation to the first element of array of element remote handle...
void ReduceDataBegin(const tag_set &tags, ElementType mask, MarkerType select, exchange_data &storage)
This function will initialize reduction of multiple data tags.
void MarkBoundaryFaces(MarkerType boundary_marker)
Sets marker for all the faces that have only one neighbouring cell, works correctly in parallel envir...
__INLINE integer GetDimensions() const
Get number of dimensions of mesh.
int GetParallelFileStrategy() const
Retrieve currently set parallel strategy for ".pmf" files.
remote_reference & RemoteReferenceDV(HandleType h, const Tag &tag)
Returns a reference in dense array to the first element of variable size array of element remote hand...
bool Hidden(HandleType h) const
Check whether element is hidden.
remote_reference_array RemoteReferenceArray(HandleType h, const Tag &tag)
Returns an array of element remote handles.
bool HaveData(HandleType h, const Tag &tag) const
Check whether data is present on given element.
void ReduceData(const tag_set &tags, ElementType mask, MarkerType select, ReduceOperation op)
This function will perform reduction of multiple data tags.
INMOST_MPI_Group GetGroup() const
Retrieve MPI group corresponding to the communicator.
void GetMarkerSpace(HandleType h, bulk copy[MarkerFields]) const
Get a copy of the bytes that store markers on the element.
real_array RealArrayDF(HandleType h, const Tag &tag)
Returns an array of real values in dense array.
int GetLocalProcessorRank() const
Get rank of current processor in shared environment (OpenMP)
bulk & BulkDF(HandleType h, const Tag &tag)
Returns a reference in dense array to the first element of constant size array of bytes.
void ComputeGeometricType(HandleType h)
Recompute geometrical type of current element and set it to element.
integer ExclusiveSum(integer input)
Compute sum of integer values for all processors with rank lower then current, excluding current proc...
void SetDataSize(HandleType h, const Tag &tag, enumerator new_size)
Sets the size of the array for data of variable size.
void SynchronizeMarker(MarkerType marker, ElementType mask, SyncBitOp op)
Synchronize marker on elements between processors using provided operation.
__INLINE void SetEpsilon(real e)
Set tolerance for coordinates comparison.
static void Initialize(int *argc, char ***argv)
Initial initialization.
void Integrate(integer *input, integer size)
Integrate an array of integer values over all processors.
real & RealDF(HandleType h, const Tag &tag)
Returns a reference to inner memory location of the first element of the array of real values.
void RestoreLowerAdjacencies(ElementType mask=(EDGE|FACE|CELL))
Restore all upper adjacencies.
__INLINE bool GetMarker(HandleType h, MarkerType n) const
Check whether the marker is set one the element.
reference_array ReferenceArrayDF(HandleType h, const Tag &tag)
Returns an array of element handles in dense array.
integer Enumerate(const ElementArray< EType > &elements, const Tag &num_tag, integer start=0, bool define_sparse=true)
Enumerate all elements beginning with start and put numeration to data associated with num_tag.
bool EndTopologyCheck(HandleType e, TopologyCheck begin_check)
This function performs some topological checks after construction of element.
integer Enumerate(ElementType mask, Tag num_tag, integer start=0, bool define_sparse=false)
Enumerate all elements beginning with start and put numeration to data associated with num_tag for al...
HandleType FindSharedAdjacency(const HandleType *arr, enumerator num) const
Retrieve upper adjacent that is shared by multiple lower adjacencies.
void ExchangeOrientedData(const tag_set &tags, ElementType mask, MarkerType select=0, MarkerType orient=0)
This function is similar to ExchangeData, except that it will change the orientation of recieved data...
static Mesh * GetMesh(std::string name)
Find mesh by name.
ElementType SynchronizeElementType(ElementType etype)
Synchronize bitwise mask of element types between processors.
integer_array IntegerArrayDF(HandleType h, const Tag &tag)
Returns an array of integer values in dense array.
bulk & Bulk(HandleType h, const Tag &tag)
Returns a reference in inner representation to the first element of array of bytes.
void ExchangeGhost(integer layers, ElementType bridge, MarkerType select=0, bool delete_ghost=true)
Form several layers of ghost cells that are adjacent through bridge elements to current cells.
void SortByGlobalID(HandleType *h, enumerator num)
INMOST_DATA_ENUM_TYPE GetDataCapacity(const INMOST_DATA_BULK_TYPE *data, INMOST_DATA_ENUM_TYPE size, const Tag &tag) const
Returns the number of bytes in data used for given type of tag.
reference_array ReferenceArrayDV(HandleType h, const Tag &tag)
Returns an array of element handles in dense array of variable size.
std::string GetFileOption(std::string key) const
Get current option corresponding to key.
INMOST_MPI_Comm GetCommunicator() const
Retrieve MPI communicator.
void ExchangeDataEnd(const tag_set &tags, ElementType mask, MarkerType select, exchange_data &storage)
This function will finalize exchange of multiple data tags.
void ReduceDataEnd(const Tag &tag, ElementType mask, MarkerType select, ReduceOperation op, exchange_data &storage)
This function completes data reduction.
remote_reference_array RemoteReferenceArrayDF(HandleType h, const Tag &tag)
Returns an array of element remote handles in dense array.
integer & Integer(HandleType h, const Tag &tag)
Returns a reference to inner memory location of the first element of the array of integer values.
void Clear()
Remove all data and all elements from the mesh Reset geometry service and topology check flags.
void ReduceDataEnd(const tag_set &tags, ElementType mask, MarkerType select, ReduceOperation op, exchange_data &storage)
This function will finalize exchange of multiple data tags.
void SetMarkerSpace(HandleType h, bulk source[MarkerFields])
Overwrite the bytes that store markers on the element.
static void Finalize()
Finalizes operation with MPI, recommended to call, otherwise MPI may produce warnings.
iteratorStorage Begin(ElementType Types)
These iterators skip invalid elements but don't skip modified elements.
void CheckCentroids(std::string file, int line)
Check that centroids of ghost and shared elements match to each other.
void Integrate(real *input, integer size)
Integrate an array of real values over all processors.
TopologyCheck GetTopologyError(TopologyCheck mask=ENUMUNDEF) const
Retrieve topology error state, this indicates that some error have occurred.
enumerator MemoryUsage(HandleType h)
For parmetis return total number in bytes of occupied memory by element and its data.
ElementType HaveUpperAdjacencies() const
Check that upper adjacencies are stored.
reference & ReferenceDF(HandleType h, const Tag &tag)
Returns a reference in dense array to the first element of constant size array of element handles.
void SetCommunicator(INMOST_MPI_Comm _comm)
Set MPI communicator.
std::set< std::string > TagOptions(std::string name) const
Collect file options related to records Tag:TAGNAME.
void OrientTags(Face f)
Swap sign for oriented data.
void AddOrientedTag(Tag t)
Add a data tag that follows normal orientation.
real Integrate(real input)
Integrate real value over all processors.
integer & GlobalID(HandleType h)
Retrieve global id of the element with right of modification (dangerous to modify).
void DelDenseData(HandleType h, const Tag &tag)
Removes data of variable size, clears to zero data of fixed size.
real Integrate(const Tag &t, enumerator entry, ElementType mask)
Integrate data corresponding to tag between all processors.
integer_array IntegerArray(HandleType h, const Tag &tag)
Returns an array of integer values.
void Save(std::string File)
Acceptable file formats for writing.
reference_array ReferenceArray(HandleType h, const Tag &tag)
Returns an array of element handles.
bool isMeshModified() const
Check whether code runs between Mesh::BeginModification, Mesh::EndModification scope.
Element::Status GetStatus(HandleType h) const
Retrieve parallel status of the element.
reference & ReferenceDV(HandleType h, const Tag &tag)
Returns a reference in dense array to the first element of variable size array of element handles.
__INLINE void SetMarkerArray(const HandleType *h, enumerator n, MarkerType m)
Set a marker on the set of handles.
void RemoveGhost(MarkerType marker=0)
Delete all the ghost cells.
integer TotalNumberOf(ElementType mask)
Sum of all physical elements, it excludes ghost copies.
reference & Reference(HandleType h, const Tag &tag)
Returns a reference in an inner representation to the first element of array of element handles.
void WachspressInterpolation3D(const real *x, const Cell &c, std::map< HandleType, real > &nodes_stencil) const
Compute node-centered interpolation on 3d cell for point Point should be inside cell or on its bounda...
static void CopyData(Element a, Element b)
Copy all the data from b to a (a = b).
Element::adj_type & LowConn(HandleType h)
Access directly lower order adjacencies of current element with right of modification.
integer_array IntegerArrayDV(HandleType h, const Tag &tag)
Returns an array of integer values in dense array of variable size.
enumerator Integrate(enumerator input)
Integrate unsigned integer value over all processors.
__INLINE MeshState GetMeshState() const
Get parallel state of the mesh.
void Redistribute()
Migrate all the elements to the new owners prescribed in data corresponding to RedistributeTag.
integer GlobalID(HandleType h) const
Retrieve global id of the element without right of modification.
void CheckOwners(std::string file, int line)
Let ghost elements send processors list to master elements and see if they match.
void AssignGlobalID(ElementType mask)
Assign unique numbers to elements.
__INLINE real GetEpsilon() const
Retrieve tolerance for coordinates comparison.
Tag DeleteTag(Tag tag, ElementType mask=NODE|EDGE|FACE|CELL|ESET|MESH)
Remove the data that is represented by the tag from elements of selected type.
void ExchangeMarked(enum Action action=AGhost)
This function realizes two algorithms: ghosting of elements and migration of elements.
bulk_array BulkArray(HandleType h, const Tag &tag)
Returns an array of bytes.
void ExchangeOrientedData(const Tag &tag, ElementType mask, MarkerType select=0, MarkerType orient=0)
This function is similar to ExchangeData, except that it will change the orientation of recieved data...
__INLINE iteratorTag EndTag()
Returns the indicator for loop to end iteration over tags.
real_array RealArrayDV(HandleType h, const Tag &tag)
Returns an array of real values in dense array of variable size.
integer & IntegerDV(HandleType h, const Tag &tag)
Returns a reference in dense array to the first element of variable size array of integer values.
int GetProcessorsNumber() const
Get number of processors.
bool CheckLoadSkip(std::string name, const std::set< std::string > &noload, const std::set< std::string > &loadonly) const
Check if tag loading should be skipped.
Tag TopologyErrorTag() const
This will return tag by which you can retrieve error mark to any element on which topology check fail...
void SetTopologyCheck(TopologyCheck mask)
Set topology checks.
real & Real(HandleType h, const Tag &tag)
Returns a reference to inner memory location of the first element of the array of real values.
void DelData(HandleType h, const Tag &tag)
Remove tag data from given element.
Element::adj_type const & LowConn(HandleType h) const
Access directly lower order adjacencies of current element without right of modification.
ElementArray< Cell > getCells() const
Return all the cells of the element.
ElementArray< Face > getFaces() const
Retrieve all the faces of the element.
ElementArray< Edge > getEdges() const
Retrieve all the edges of the element.
This structure is a helper structure to aid with search of cells by position.
Storage type for representing arrays of Element references.
Storage type for representing arrays of Element references on another Mesh.
Base class for Mesh, Element, and ElementSet classes.
__INLINE integer & Integer(const Tag &tag) const
Retrieve integer value associated with Tag.
Storage & operator=(Storage const &other)
If there is a link to handle provided (automatically by ElementArray and reference_array),...
RemoteHandleType remote_reference
Storage type for representing references to Element in another Mesh.
variable var
Storage type for representing real value with vector of variations.
__INLINE void DelDenseData(const Tag &tag) const
Frees variable array or fills field with zeroes.
__INLINE var_array VariableArray(const Tag &tag) const
Retrieve array of variables associated with Tag.
shell< real > real_array
Storage type for representing arrays of real values.
__INLINE INMOST_DATA_ENUM_TYPE GetDataCapacity(const Tag &tag) const
Return the size of the structure required to represent the data on current element.
shell< integer > integer_array
Storage type for representing arrays of integer values.
__INLINE var & Variable(const Tag &tag) const
Retrieve variable reference associated with Tag.
__INLINE bulk_array BulkArray(const Tag &tag) const
Retrieve abstract data associated with Tag as a series of bytes.
shell< bulk > bulk_array
Storage type for representing abstract data as a series of bytes.
shell< variable > var_array
Storage type for representing array of values with vectors of variations.
__INLINE remote_reference_array RemoteReferenceArray(const Tag &tag) const
Retrieve array of Element references associated with Tag.
__INLINE reference & Reference(const Tag &tag) const
Retrieve Element reference associated with Tag.
INMOST_DATA_REAL_TYPE real
Storage type for representing real values.
HandleType reference
Storage type for representing references to Element.
__INLINE integer_array IntegerArray(const Tag &tag) const
Retrieve array of integer values associated with Tag.
__INLINE remote_reference & RemoteReference(const Tag &tag) const
Retrieve remote Element reference associated with Tag.
__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.
__INLINE void SetDataSize(const Tag &tag, INMOST_DATA_ENUM_TYPE new_size) const
Set the length of data associated with Tag.
__INLINE real & Real(const Tag &tag) const
Retrieve real value associated with Tag.
__INLINE reference_array ReferenceArray(const Tag &tag) const
Retrieve array of Element references associated with Tag.
__INLINE bulk & Bulk(const Tag &tag) const
Retrieve one byte of abstract data associated with Tag.
__INLINE real_array RealArray(const Tag &tag) const
Retrieve array of real values associated with Tag.
__INLINE INMOST_DATA_ENUM_TYPE GetDataSize(const Tag &tag) const
Return the data length associated with Tag.
INMOST_DATA_ENUM_TYPE enumerator
type for representing unsigned integer values.
INMOST_DATA_BULK_TYPE bulk
Storage type for representing one byte of abstract data.
__INLINE integer DataLocalID() const
This number is guaranteed to be between 0 and Mesh::NumberOf(type of element) after Mesh::ReorderEmpt...
__INLINE bool DelSparseData(const Tag &tag) const
Deallocates space allocated for sparse data, frees variable array if necessary.
__INLINE bool HaveData(const Tag &tag) const
Check if any data is associated with Tag.
INMOST_DATA_INTEGER_TYPE integer
Storage type for representing integer values.
__INLINE sparse_sub_type const & GetSparseData(int etypenum, int local_id) const
Retrieve substructure for representation of the sparse data without permission for modification.
__INLINE dense_sub_type const & GetDenseData(int pos) const
Retrieve substructure for representation of the dense data without permission for modification.
This class provides the access to the individual mesh datum and general information about it.
A class that represents a variable with multiple first order variations.