INMOST
Mathematical Modelling Toolkit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
inmost_mesh.h
Go to the documentation of this file.
1 
2 #ifndef INMOST_MESH_H_INCLUDED
3 #define INMOST_MESH_H_INCLUDED
4 
5 #include "inmost_common.h"
6 #include "inmost_data.h"
7 
8 #if defined(USE_MESH)
9 
10 
11 
12 namespace INMOST
13 {
14 
15 
16  class Mesh;
17  class Storage;
18  class Element;
19  class TagManager;
20  class Node;
21  class Edge;
22  class Face;
23  class Cell;
24  class ElementSet;
25 
26 
27 
29  static const GeometricData CENTROID = 0;
30  static const GeometricData NORMAL = 1;
31  static const GeometricData ORIENTATION = 2;
32  static const GeometricData MEASURE = 3;
33  static const GeometricData BARYCENTER = 4;
34 
35  typedef INMOST_DATA_BULK_TYPE SyncBitOp; //< This type is used for marker synchronization
36  static const SyncBitOp SYNC_BIT_SET = 0;
37  static const SyncBitOp SYNC_BIT_OR = 1;
38  static const SyncBitOp SYNC_BIT_XOR = 2;
39  static const SyncBitOp SYNC_BIT_AND = 3;
40 
41 
46  static const TopologyCheck THROW_EXCEPTION = 0x00000001;
48  static const TopologyCheck PRINT_NOTIFY = 0x00000002;
50  static const TopologyCheck DELETE_ON_ERROR = 0x00000004;
53  static const TopologyCheck MARK_ON_ERROR = 0x00000008;
55  static const TopologyCheck DUPLICATE_EDGE = 0x00000010;
57  static const TopologyCheck DUPLICATE_FACE = 0x00000020;
59  static const TopologyCheck DUPLICATE_CELL = 0x00000040;
61  static const TopologyCheck DEGENERATE_EDGE = 0x00000080;
63  static const TopologyCheck DEGENERATE_FACE = 0x00000100;
65  static const TopologyCheck DEGENERATE_CELL = 0x00000200;
67  static const TopologyCheck FACE_ORIENTATION = 0x00000400;
69  static const TopologyCheck FACE_PLANARITY = 0x00000800;
71  static const TopologyCheck INTERLEAVED_FACES = 0x00001000;
74  static const TopologyCheck TRIPLE_SHARED_FACE = 0x00002000;
76  static const TopologyCheck FLATTENED_CELL = 0x00004000;
78  static const TopologyCheck ADJACENT_DUPLICATE = 0x00008000;
80  static const TopologyCheck ADJACENT_HIDDEN = 0x00010000;
82  static const TopologyCheck ADJACENT_VALID = 0x00020000;
84  static const TopologyCheck ADJACENT_DIMENSION = 0x00040000;
87  static const TopologyCheck PROHIBIT_MULTILINE = 0x00080000;
89  static const TopologyCheck PROHIBIT_POLYGON = 0x00100000;
92  static const TopologyCheck PROHIBIT_MULTIPOLYGON = 0x00200000;
94  static const TopologyCheck PROHIBIT_POLYHEDRON = 0x00400000;
96  static const TopologyCheck FACE_EDGES_ORDER = 0x00800000;
99  static const TopologyCheck PROHIBIT_CONCAVE_FACE = 0x01000000;
102  static const TopologyCheck PROHIBIT_CONCAVE_CELL = 0x02000000;
105  static const TopologyCheck PROHIBIT_NONSTAR_FACE = 0x04000000;
108  static const TopologyCheck PROHIBIT_NONSTAR_CELL = 0x08000000;
111  static const TopologyCheck FACE_SELF_INTERSECTION = 0x10000000;
114  static const TopologyCheck CELL_SELF_INTERSECTION = 0x20000000;
117  static const TopologyCheck NEED_TEST_CLOSURE = 0x40000000;
119  static const TopologyCheck DISABLE_2D = 0x80000000;
121  static const TopologyCheck GRID_CONFORMITY = NEED_TEST_CLOSURE
122  | PROHIBIT_MULTILINE
123  | PROHIBIT_MULTIPOLYGON
124  | INTERLEAVED_FACES
125  | TRIPLE_SHARED_FACE;
127  static const TopologyCheck DEFAULT_CHECK = THROW_EXCEPTION
128  | DUPLICATE_EDGE
129  | DUPLICATE_FACE
130  | DUPLICATE_CELL
131  | PRINT_NOTIFY;
135 
136 
137 
138  template <typename StorageType>
140  {
141  public:
144  private:
145  Mesh * m_link;
146  cont_t container;
147  public:
148  const cont_t & GetContainer() {return container;}
150  ElementArray() : m_link(NULL) {}
151  ElementArray(Mesh * m_link) : m_link(m_link) {}
152  ElementArray(Mesh * m_link, size_type n, HandleType h = InvalidHandle()) : m_link(m_link), container(n,h) {}
153  ElementArray(Mesh * m_link, const cont_t & c) : m_link(m_link), container(c) {}
154  ElementArray(const ElementArray & other) : m_link(other.m_link), container(other.container) {}
155  template<class InputIterator>
156  ElementArray(Mesh * m_link, InputIterator first, InputIterator last) :m_link(m_link), container(first,last) {}
157  ElementArray & operator=(ElementArray const & other) {m_link = other.m_link; container = other.container; return *this;}
158  public:
159  class iterator : public cont_t::iterator
160  {
161  Mesh * m_link;
162  public:
163  iterator(Mesh * m, const cont_t::iterator & other ) : cont_t::iterator(other) , m_link(m){assert(m_link);}
164  iterator(const iterator & other ) : cont_t::iterator(other), m_link(other.m_link) {assert(m_link);}
165  ptrdiff_t operator -(const iterator & other) const {return static_cast<const cont_t::iterator>(*this)-static_cast<const cont_t::iterator>(other);}
166  iterator operator +(size_t n){iterator ret(*this); ret.cont_t::iterator::operator+(n); return ret;}
167  iterator operator -(size_t n){iterator ret(*this); ret.cont_t::iterator::operator-(n); return ret;}
168  iterator & operator ++() {cont_t::iterator::operator++(); return *this;}
169  iterator operator ++(int) {iterator ret(*this); cont_t::iterator::operator++(); return ret;}
170  iterator & operator --() {cont_t::iterator::operator--(); return *this;}
171  iterator operator --(int) {iterator ret(*this); cont_t::iterator::operator--(); return ret;}
172  iterator & operator =(iterator const & other) {m_link = other.m_link; cont_t::iterator::operator=(static_cast<cont_t::iterator const &>(other)); return *this; }
174  StorageType operator->() { return StorageType(m_link,&cont_t::iterator::operator *()); }
175  };
177  {
178  Mesh * m_link;
179  public:
180  reverse_iterator(Mesh * m, const cont_t::reverse_iterator & other ) : cont_t::reverse_iterator(other), m_link(m) {assert(m_link);}
181  reverse_iterator(const reverse_iterator & other ) : cont_t::reverse_iterator(other), m_link(other.m_link) {assert(m_link);}
182  ptrdiff_t operator -(const reverse_iterator & other) const {return static_cast<const cont_t::reverse_iterator>(other)-static_cast<const cont_t::reverse_iterator>(*this);}
183  reverse_iterator operator +(size_t n){reverse_iterator ret(*this); ret.cont_t::reverse_iterator::operator+(n); return ret;}
184  reverse_iterator operator -(size_t n){reverse_iterator ret(*this); ret.cont_t::reverse_iterator::operator-(n); return ret;}
185  reverse_iterator & operator ++() {cont_t::reverse_iterator::operator++(); return *this;}
186  reverse_iterator operator ++(int) {reverse_iterator ret(*this); cont_t::reverse_iterator::operator++(); return ret;}
187  reverse_iterator & operator --() {cont_t::reverse_iterator::operator--(); return *this;}
188  reverse_iterator operator --(int) {reverse_iterator ret(*this); cont_t::reverse_iterator::operator--(); return ret;}
189  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; }
191  StorageType operator->() { return StorageType(m_link,&cont_t::reverse_iterator::operator *()); }
192  };
194  {
195  Mesh * m_link;
196  public:
197  const_iterator(Mesh * m, const cont_t::const_iterator & other ) : cont_t::const_iterator(other), m_link(m) {assert(m_link);}
198  const_iterator(const const_iterator & other ) : cont_t::const_iterator(other), m_link(other.m_link) {assert(m_link);}
199  const_iterator & operator ++() {cont_t::const_iterator::operator++(); return *this;}
200  const_iterator operator ++(int) {const_iterator ret(*this); cont_t::const_iterator::operator++(); return ret;}
201  const_iterator & operator --() {cont_t::const_iterator::operator--(); return *this;}
202  const_iterator operator --(int) {const_iterator ret(*this); cont_t::const_iterator::operator--(); return ret;}
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; }
205  StorageType operator->() { return StorageType(m_link,cont_t::const_iterator::operator *()); }
206  };
208  {
209  Mesh * m_link;
210  public:
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);}
212  const_reverse_iterator(const const_reverse_iterator & other ) : cont_t::const_reverse_iterator(other), m_link(other.m_link) {assert(m_link);}
213  const_reverse_iterator & operator ++() {cont_t::const_reverse_iterator::operator++(); return *this;}
214  const_reverse_iterator operator ++(int) {const_reverse_iterator ret(*this); cont_t::const_reverse_iterator::operator++(); return ret;}
215  const_reverse_iterator & operator --() {cont_t::const_reverse_iterator::operator--(); return *this;}
216  const_reverse_iterator operator --(int) {const_reverse_iterator ret(*this); cont_t::const_reverse_iterator::operator--(); return ret;}
217  const_reverse_iterator & operator =(const_reverse_iterator const & other) { cont_t::const_reverse_iterator::operator=(static_cast<cont_t::const_reverse_iterator const &>(other)); return *this; }
219  StorageType operator->() { return StorageType(m_link,cont_t::const_reverse_iterator::operator *()); }
220  };
221  public:
222  template<class InputIterator>
223  __INLINE void insert (iterator pos,InputIterator pbeg, InputIterator pend) {container.insert(static_cast<cont_t::iterator>(pos),pbeg,pend);}
224  __INLINE iterator erase (iterator pos) {return iterator(m_link,container.erase(static_cast<cont_t::iterator>(pos)));}
225 
226  __INLINE iterator begin () { return iterator(m_link,container.begin()); }
227  __INLINE iterator end () { return iterator(m_link,container.end()); }
228  __INLINE reverse_iterator rbegin () { return reverse_iterator(m_link,container.rbegin()); }
229  __INLINE reverse_iterator rend () { return reverse_iterator(m_link,container.rend()); }
230  __INLINE const_iterator begin () const { return const_iterator(m_link,container.begin()); }
231  __INLINE const_iterator end () const { return const_iterator(m_link,container.end()); }
232  __INLINE const_reverse_iterator rbegin() const { return const_reverse_iterator(m_link,container.rbegin()); }
233  __INLINE const_reverse_iterator rend () const { return const_reverse_iterator(m_link,container.rend()); }
234 
235  __INLINE StorageType operator [] (size_type n) {assert(m_link); return StorageType(m_link,&container[n]);}
236  __INLINE StorageType operator [] (size_type n) const {assert(m_link); return StorageType(m_link,container[n]);}
237  __INLINE StorageType front () {assert(m_link); return StorageType(m_link,&container.front()); }
238  __INLINE StorageType front () const {assert(m_link); return StorageType(m_link,container.front()); }
239  __INLINE StorageType back () {assert(m_link); return StorageType(m_link,&container.back()); }
240  __INLINE StorageType back () const {assert(m_link); return StorageType(m_link,container.back()); }
241  __INLINE HandleType atfront () const { return container.front(); }
242  __INLINE HandleType atback () const { return container.back(); }
243  __INLINE HandleType & atfront () { return container.front(); }
244  __INLINE HandleType & atback () { return container.back(); }
245  __INLINE HandleType & at (size_type n) { return container.at(n); }
246  __INLINE HandleType at (size_type n) const { return container.at(n); }
247  __INLINE void swap (ElementArray<StorageType> & other) {Mesh * t = m_link; m_link = other.m_link; other.m_link = t; container.swap(other.container);}
248  __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());}
249  //__INLINE void push_back (const StorageType & x) {container.push_back(x.GetHandle());}
250  __INLINE void push_back (HandleType x) {assert(m_link != NULL); container.push_back(x);}
251  __INLINE void pop_back () {container.pop_back();}
252  __INLINE void resize (size_type n) {container.resize(n);}
253  __INLINE bool empty () const {return container.empty();}
254  __INLINE void clear () {container.clear();}
255  __INLINE void reserve (size_type n) {container.reserve(n);}
256  __INLINE size_type size () const {return container.size(); }
257  __INLINE HandleType * data () {return container.data();}
258  __INLINE const HandleType*data () const {return container.data();}
259  __INLINE Mesh * GetMeshLink () const {assert(m_link); return m_link;}
260  __INLINE void SetMeshLink (Mesh * m) {m_link = m;}
261  //implemented in mesh_array.cpp
262  void Unite (const HandleType * h, INMOST_DATA_ENUM_TYPE num);
263  void Subtract (const HandleType * h, INMOST_DATA_ENUM_TYPE num);
264  void Intersect (const HandleType * h, INMOST_DATA_ENUM_TYPE num);
265  template<typename EType>
266  void Unite (const ElementArray<EType> & other) {Unite(other.data(),static_cast<INMOST_DATA_ENUM_TYPE>(other.size()));}
267  template<typename EType>
268  void Subtract (const ElementArray<EType> & other) {Subtract(other.data(),static_cast<INMOST_DATA_ENUM_TYPE>(other.size()));}
269  template<typename EType>
270  void Intersect (const ElementArray<EType> & other) {Intersect(other.data(),static_cast<INMOST_DATA_ENUM_TYPE>(other.size()));}
271  void SetMarker (MarkerType n) const;
272  void RemMarker (MarkerType n) const;
273  void SetPrivateMarker (MarkerType n) const;
274  void RemPrivateMarker (MarkerType n) const;
275  template<typename Etype>
276  ElementArray<Etype> Convert() {return ElementArray<Etype>(m_link,container);}
277  };
278 
279 
280  class Element : public Storage //implemented in element.cpp
281  {
282  public:
284  static const GeometricType Unset = 0;
285  static const GeometricType Vertex = 1;
286  static const GeometricType Line = 2;
287  static const GeometricType MultiLine = 3;
288  static const GeometricType Tri = 4;
289  static const GeometricType Quad = 5;
290  static const GeometricType Polygon = 6;
291  static const GeometricType MultiPolygon = 7;
292  static const GeometricType Tet = 8;
293  static const GeometricType Hex = 9;
294  static const GeometricType Prism = 10;
295  static const GeometricType Pyramid = 11;
296  static const GeometricType Polyhedron = 12;
297  static const GeometricType Set = 253;
298  static const GeometricType MeshPart = 254;
299  static const GeometricType MaxType = 255;
300  //enum GeometricType {Unset,Vertex,Line,MultiLine,Tri,Quad,Polygon,MultiPolygon,Tet,Hex,Prism,Pyramid,Polyhedron,Set};
301  static const char * GeometricTypeName(GeometricType t);
304  static const Status Owned = 1;
305  static const Status Shared = 2;
306  static const Status Ghost = 4;
307  static const Status Any = 0;
308  static const char * StatusName(Status s);
309  public:
315  public:
316  //adj_type & HighConn () const;
317  //adj_type & LowConn () const;
318  protected:
320  public:
322  Element(Mesh * m, HandleType h) : Storage(m,h) {}
323  Element(Mesh * m, HandleType * h) : Storage(m,h) {}
324  Element(const Element & other) : Storage(other) {}
325  Element & operator =(Element const & other) {Storage::operator =(other); return *this;}
326  Element * operator ->() {return this;}
327  const Element * operator ->() const {return this;}
328  Element & self() {return *this;}
329  const Element & self() const {return *this;}
330  virtual ~Element() {}
331  public:
337  virtual enumerator nbAdjElements (ElementType etype) const;
344  virtual ElementArray<Element> getAdjElements (ElementType etype) const; //unordered
352  virtual enumerator nbAdjElements (ElementType etype, MarkerType mask, bool invert_mask = false) const;
358  virtual ElementArray<Element> getAdjElements (ElementType etype, MarkerType mask, bool invert_mask = false) const; //unordered
359  ElementArray<Element> BridgeAdjacencies (ElementType Bridge, ElementType Dest, MarkerType mask = 0, bool invert_mask = false) const;
360  ElementArray<Node> BridgeAdjacencies2Node (ElementType Bridge, MarkerType mask = 0, bool invert_mask = false) const;
361  ElementArray<Edge> BridgeAdjacencies2Edge (ElementType Bridge, MarkerType mask = 0, bool invert_mask = false) const;
362  ElementArray<Face> BridgeAdjacencies2Face (ElementType Bridge, MarkerType mask = 0, bool invert_mask = false) const;
363  ElementArray<Cell> BridgeAdjacencies2Cell (ElementType Bridge, MarkerType mask = 0, bool invert_mask = false) const;
382  virtual ElementArray<Node> getNodes () const; //unordered
394  virtual ElementArray<Edge> getEdges () const; //unordered
406  virtual ElementArray<Face> getFaces () const; //unordered
420  virtual ElementArray<Cell> getCells () const; //unordered
421  virtual ElementArray<Node> getNodes (MarkerType mask,bool invert_mask = false) const; //unordered
422  virtual ElementArray<Edge> getEdges (MarkerType mask,bool invert_mask = false) const; //unordered
423  virtual ElementArray<Face> getFaces (MarkerType mask,bool invert_mask = false) const; //unordered
424  virtual ElementArray<Cell> getCells (MarkerType mask,bool invert_mask = false) const; //unordered
426  unsigned int GetElementDimension () const {return GetGeometricDimension(GetGeometricType());}
427  Status GetStatus () const;
428  void SetStatus (Status status) const;
429  Storage::integer & GlobalID () const;
430  bool CheckElementConnectivity() const;
431  void PrintElementConnectivity() const;
432  static bool CheckConnectivity (Mesh * m);
433  //implemented in geometry.cpp
434  void CastRay (real * pos, real * dir, dynarray< std::pair<Element, real> , 16 > & hits) const;
435  void ComputeGeometricType () const;
436  void Centroid (real * cnt) const;
437  void Barycenter (real * cnt) const;
438  Storage::real Mean (real (*func)(real* x,real t),real time) const;
439  bool Boundary () const;
440  bool Planarity () const; // check that all nodes lay on one plane
441  //implemented in modify.cpp
442  bool Hide () const; // if true then element was hidden, works only inside BeginModification and EndModification, on EndModification all Hidden elements are deleted
443  bool Show () const; // if true then element was recovered
445  bool Delete (); // if true then element was deleted, otherwise it was hidden
446  bool Hidden () const;
447  bool New () const;
448  void Disconnect (bool delete_upper_adjacent) const; //disconnect all elements, delete upper dependent
453  void Disconnect (const HandleType * adjacent, INMOST_DATA_ENUM_TYPE num) const;
461  void Connect (const HandleType * adjacent, INMOST_DATA_ENUM_TYPE num) const;
463  void UpdateGeometricData () const;
464  };
465 
466  __INLINE const Element & InvalidElement() {static Element ret(NULL,InvalidHandle()); return ret;}
467 
468  class Node : public Element //implemented in node.cpp
469  {
470  public:
471  Node() : Element() {}
472  Node(const Node & other) : Element(other) {}
473  Node(Mesh * m, HandleType h) : Element(m,h) {}
474  Node(Mesh * m, HandleType * h) : Element(m,h) {}
475  Node & operator =(Node const & other) {Element::operator =(other); return *this;}
476  Node * operator ->() {return this;}
477  const Node * operator ->() const {return this;}
478  Node & self() {return *this;}
479  const Node & self() const {return *this;}
480  public:
481  ElementArray<Edge> getEdges () const; //unordered
482  ElementArray<Face> getFaces () const; //unordered
483  ElementArray<Cell> getCells () const; //unordered
484 
485  ElementArray<Edge> getEdges (MarkerType mask,bool invert_mask = false) const; //unordered
486  ElementArray<Face> getFaces (MarkerType mask,bool invert_mask = false) const; //unordered
487  ElementArray<Cell> getCells (MarkerType mask,bool invert_mask = false) const; //unordered
488 
489  Storage::real_array Coords () const;
490  };
491 
492  __INLINE const Node & InvalidNode() {static Node ret(NULL,InvalidHandle()); return ret;}
493 
494  class Edge : public Element //implemented in edge.cpp
495  {
496  public:
497  Edge() : Element() {}
498  Edge(const Edge & other) : Element(other) {}
499  Edge(Mesh * m, HandleType h) : Element(m,h) {}
500  Edge(Mesh * m, HandleType * h) : Element(m,h) {}
501  Edge & operator =(Edge const & other) {Element::operator =(other); return *this;}
502  Edge * operator ->() {return this;}
503  const Edge * operator ->() const {return this;}
504  Edge & self() {return *this;}
505  const Edge & self() const {return *this;}
506  public:
507 
508  ElementArray<Node> getNodes () const; //ordered
509  ElementArray<Face> getFaces () const; //unordered
510  ElementArray<Cell> getCells () const; //unordered
511 
512  ElementArray<Node> getNodes (MarkerType mask,bool invert_mask = false) const; //ordered
513  ElementArray<Face> getFaces (MarkerType mask,bool invert_mask = false) const; //unordered
514  ElementArray<Cell> getCells (MarkerType mask,bool invert_mask = false) const; //unordered
515 
516  Node getBeg () const;
517  Node getEnd () const;
518  //implemented in modify.cpp
519  static Edge UniteEdges (ElementArray<Edge> & edges, MarkerType del_protect);
520  static bool TestUniteEdges (const ElementArray<Edge> & edges, MarkerType del_protect);
521  static ElementArray<Edge> SplitEdge (Edge e, const ElementArray<Node> & nodes, MarkerType del_protect); //provide ordered array of nodes, that lay between former nodes of the edge
522  static bool TestSplitEdge (Edge e, const ElementArray<Node> & nodes, MarkerType del_protect);
523  //implemented in geometry.cpp
524  Storage::real Length () const;
525  };
526 
527  __INLINE const Edge & InvalidEdge() {static Edge ret(NULL,InvalidHandle()); return ret;}
528 
529 
550  class Face : public Element //implemented in face.cpp
551  {
552  public:
553  Face() : Element() {}
554  Face(const Face & other) : Element(other) {}
555  Face(Mesh * m, HandleType h) : Element(m,h) {}
556  Face(Mesh * m, HandleType * h) : Element(m,h) {}
557  Face & operator =(Face const & other) {Element::operator =(other); return *this;}
558  Face * operator ->() {return this;}
559  const Face * operator ->() const {return this;}
560  Face & self() {return *this;}
561  const Face & self() const {return *this;}
562  public:
563 
564  ElementArray<Node> getNodes () const; //ordered
565  ElementArray<Edge> getEdges () const; //ordered
566  ElementArray<Cell> getCells () const; //unordered
567 
568  ElementArray<Node> getNodes (MarkerType mask,bool invert_mask = false) const; //ordered
569  ElementArray<Edge> getEdges (MarkerType mask,bool invert_mask = false) const; //ordered
570  ElementArray<Cell> getCells (MarkerType mask,bool invert_mask = false) const; //unordered
571 
572  //this is for 2d case when the face is represented by segment
573  Node getBeg () const;
574  Node getEnd () const;
582  Cell BackCell () const;
590  Cell FrontCell () const;
591  bool FaceOrientedOutside (Cell c) const;
592  void ReorderEdges () const;
593  bool CheckEdgeOrder () const; //not implemented// returns true if edges of face form an ordered closed loop
594  bool FixEdgeOrder () const; //not implemented// returns true if edges were successfully reordered to form a closed loop
595  //implemented in modify.cpp
596  static Face UniteFaces (ElementArray<Face> & faces, MarkerType del_protect);
597  static bool TestUniteFaces (const ElementArray<Face> & faces, MarkerType del_protect);
598  static ElementArray<Face> SplitFace (Face face, const ElementArray<Edge> & edges, MarkerType del_protect); //provide all edges that lay inside face
599  static bool TestSplitFace (Face face, const ElementArray<Edge> & edges, MarkerType del_protect);
600  void SwapCells (); //swap back cell and front cell
601  //implemented in geometry.cpp
602  Storage::real Area () const;
603  void Normal (real * nrm) const;
604  void UnitNormal (real * nrm) const;
605  void OrientedNormal (Cell c, real * nrm) const;
606  void OrientedUnitNormal (Cell c, real * nrm) const;
607  bool FixNormalOrientation () const; //returns true if orientation was corrected, otherwise returns false
608  bool CheckNormalOrientation () const; //returns true if orientation is correct, otherwise returns false
609  bool Closure () const; // test integrity of polygon
610  };
611 
612  __INLINE const Face & InvalidFace() {static Face ret(NULL,InvalidHandle()); return ret;}
613 
614  //implemented in cell.cpp
635  class Cell : public Element
636  {
637  public:
641  Cell() : Element() {}
648  Cell(Mesh * m, HandleType h) : Element(m,h) {}
659  Cell(Mesh * m, HandleType * h) : Element(m,h) {}
665  Cell(const Cell & other) : Element(other) {}
674  Cell & operator =(Cell const & other) {Element::operator =(other); return *this;}
675  Cell * operator ->() {return this;}
686  const Cell * operator ->() const {return this;}
692  Cell & self() {return *this;}
698  const Cell & self() const {return *this;}
699  public:
711  ElementArray<Node> getNodes () const;
735  ElementArray<Edge> getEdges () const;
744  ElementArray<Face> getFaces () const;
762  ElementArray<Node> getNodes (MarkerType mask,bool invert_mask = false) const;
776  ElementArray<Edge> getEdges (MarkerType mask,bool invert_mask = false) const;
791  ElementArray<Face> getFaces (MarkerType mask,bool invert_mask = false) const;
802  bool CheckEdgeOrder () const; //not implemented//2D only, returns true if edges of face form an ordered closed loop
815  bool FixEdgeOrder () const; //not implemented//2D only, returns true if edges were successfully reordered to form a closed loop
816  //implemented in modify.cpp
826  static Cell UniteCells (ElementArray<Cell> & cells, MarkerType del_protect);
831  static bool TestUniteCells (const ElementArray<Cell> & cells, MarkerType del_protect);
857  static ElementArray<Cell> SplitCell (Cell cell, const ElementArray<Face> & faces, MarkerType del_protect); //provide all faces, that lay inside cell
864  static bool TestSplitCell (Cell cell, const ElementArray<Face> & faces, MarkerType del_protect);
865  //implemented in geometry.cpp
873  Cell Neighbour (Face face) const;
876  ElementArray<Cell> NeighbouringCells () const; // get all cells that share any face with current
888  bool Inside (const real * point) const; //is point inside cell, check for 2d case
894  real Volume () const;
900  bool Closure () const; // test integrity of cell
901  };
902 
904  __INLINE const Cell & InvalidCell() {static Cell ret(NULL,InvalidHandle()); return ret;}
905 
906  class ElementSet : public Element //implemented in eset.cpp
907  {
908  public:
915  static const enumerator high_conn_reserved = 4;
916  __INLINE static HandleType & hParent (Element::adj_type & arr) {return arr[0];}
917  __INLINE static HandleType & hSibling (Element::adj_type & arr) {return arr[1];}
918  __INLINE static HandleType & hChild (Element::adj_type & arr) {return arr[2];}
919  __INLINE static HandleType & hSorted (Element::adj_type & arr) {return arr[3];}
926  ElementSet () : Element() {}
927  ElementSet (Mesh * m, HandleType h) : Element(m,h) {}
928  ElementSet (Mesh * m, HandleType * h) : Element(m,h) {}
929  ElementSet (const ElementSet & other) : Element(other) {}
930  __INLINE ElementSet & operator = (ElementSet const & other) {Element::operator =(other); return *this;}
931  __INLINE ElementSet * operator -> () {return this;}
932  __INLINE const ElementSet * operator -> () const {return this;}
933  __INLINE ElementSet & self () {return *this;}
934  __INLINE const ElementSet & self () const {return *this;}
935  public:
937  std::string GetName() const;
939  ElementSet GetParent() const;
941  ElementSet GetSibling() const;
945  ElementSet GetChild() const;
946 
948  void AddSibling(const ElementSet & sibling) const;
950  void AddChild(const ElementSet & child) const;
951 
953  void RemSibling(const ElementSet & sibling) const;
955  void RemChild(const ElementSet & child) const;
957  enumerator CountSiblings() const;
959  enumerator CountChildren() const;
960 
961  bool HaveSibling() const;
962  bool HaveParent() const;
963  bool HaveChild() const;
964 
968  HandleType * getHandles() const;
971  enumerator nbHandles() const;
974  enumerator nbSorted() const;
976  enumerator nbAdjElements(ElementType etype) const;
977  enumerator nbAdjElements(ElementType etype, MarkerType select, bool invert = false) const;
980  ElementArray<Element> getAdjElements(ElementType etype, MarkerType select, bool invert = false) const;
981 
984  ElementArray<Node> getNodes(MarkerType select, bool invert = false) const;
987  ElementArray<Edge> getEdges(MarkerType select, bool invert = false) const;
990  ElementArray<Face> getFaces(MarkerType select, bool invert = false) const;
993  ElementArray<Cell> getCells(MarkerType select, bool invert = false) const;
996  void PutElement(HandleType e) const;
999  void PutElement(const Storage & e) const {PutElement(e->GetHandle());}
1001  void PutElements(const HandleType * handles, enumerator num) const;
1003  void PutElements(const ElementSet & other) const {PutElements(other->getHandles(),other->nbHandles());}
1005  template<typename EType>
1006  void PutElements(const ElementArray<EType> & elems) const {PutElements(elems.data(),static_cast<enumerator>(elems.size()));}
1009  void AddElement(HandleType e) const;
1012  void AddElement(const Storage & e) const {AddElement(e->GetHandle());}
1019  void AddElements(const HandleType * handles, enumerator num) const;
1021  void AddElements(const ElementSet & other) {Unite(other);}
1023  template<typename EType>
1024  void AddElements(const ElementArray<EType> & elems) const {AddElements(elems.data(),static_cast<enumerator>(elems.size()));}
1025 
1026  void RemoveElement(const Storage & e) const;
1027  void RemoveElements(const HandleType * handles, enumerator num) const;
1029  template<typename EType>
1030  void RemoveElements(const ElementArray<EType> & elems) const {RemoveElements(elems.data(),static_cast<enumerator>(elems.size()));}
1031 
1035  ElementArray<Element> Union(const ElementSet & other) const;
1039  ElementArray<Element> Union(const HandleType * handles, enumerator num) const;
1041  template<typename EType>
1042  ElementArray<Element> Union(const ElementArray<EType> & elems) const {return Union(elems.data(),static_cast<enumerator>(elems.size()));}
1043 
1044  ElementArray<Element> Difference(const ElementSet & other) const;
1048  ElementArray<Element> Difference(const HandleType * handles, enumerator num) const;
1050  template<typename EType>
1051  ElementArray<Element> Difference(const ElementArray<EType> & elems) const {return Difference(elems.data(),static_cast<enumerator>(elems.size()));}
1052 
1053  ElementArray<Element> Intersection(const ElementSet & other) const;
1057  ElementArray<Element> Intersection(const HandleType * handles, enumerator num) const;
1059  template<typename EType>
1060  ElementArray<Element> Intersection(const ElementArray<EType> & elems) const {return Intersection(elems.data(),static_cast<enumerator>(elems.size()));}
1061 
1063  void Unite(const ElementSet & other) const;
1065  void Unite(const HandleType * handles, enumerator num) const;
1067  template<typename EType>
1068  void Unite(const ElementArray<EType> & elems) const {Unite(elems.data(),static_cast<enumerator>(elems.size()));}
1069 
1075  void Subtract(const ElementSet & other) const;
1077  void Subtract(const HandleType * handles, enumerator num) const;
1079  template<typename EType>
1080  void Subtract(const ElementArray<EType> & elems) const {Subtract(elems.data(),static_cast<enumerator>(elems.size()));}
1081 
1082 
1084  void Intersect(const ElementSet & other) const;
1086  void Intersect(const HandleType * handles, enumerator num) const;
1088  template<typename EType>
1089  void Intersect(const ElementArray<EType> & elems) const {Intersect(elems.data(),static_cast<enumerator>(elems.size()));}
1116  void SortSet(ComparatorType comp) const;
1119  Element FindElementByGlobalID(integer global_id) const;
1122  Element FindElementByCentroid(real * centroid) const;
1138  bool FindHandle(HandleType h, bool use_comparator) const;
1140  void SetMarkerElements(MarkerType m, ElementType etype = ESET|CELL|FACE|EDGE|NODE) const;
1141  void SetPrivateMarkerElements(MarkerType m, ElementType etype = ESET|CELL|FACE|EDGE|NODE) const;
1143  void RemMarkerElements(MarkerType m, ElementType etype = ESET|CELL|FACE|EDGE|NODE) const;
1144  void RemPrivateMarkerElements(MarkerType m, ElementType etype = ESET|CELL|FACE|EDGE|NODE) const;
1145  class iterator
1146  {
1147  Mesh * m;
1148  Element::adj_type const * ptr;
1150  public:
1151  typedef std::forward_iterator_tag iterator_category;
1152  iterator() : m(NULL), ptr(NULL), pos(0) {}
1153  iterator(const iterator & other) : m(other.m), ptr(other.ptr), pos(other.pos) {}
1154  iterator(Mesh * m, Element::adj_type const * ptr, Element::adj_type::size_type pos) : m(m), ptr(ptr), pos(pos) {}
1155  iterator & operator = (iterator const & other) {m = other.m; ptr = other.ptr; pos = other.pos; return *this;}
1156  iterator & operator ++();
1157  iterator & operator ++(int) {iterator ret(*this); operator++(); return *this;}
1158  bool operator ==(const iterator & other) const {assert(ptr == other.ptr); return pos == other.pos;}
1159  bool operator !=(const iterator & other) const {assert(ptr == other.ptr); return pos != other.pos;}
1160  bool operator < (const iterator & other) const {assert(ptr == other.ptr); return pos < other.pos;}
1161  bool operator > (const iterator & other) const {assert(ptr == other.ptr); return pos > other.pos;}
1162  bool operator <=(const iterator & other) const {assert(ptr == other.ptr); return pos <= other.pos;}
1163  bool operator >=(const iterator & other) const {assert(ptr == other.ptr); return pos >= other.pos;}
1164  const HandleType & operator *() const {return ptr->at(pos);}
1165  Element operator->() const {return Element(m,ptr->at(pos));}
1166  friend class ElementSet;
1167  };
1177  iterator Begin() const;
1180  iterator End() const;
1184  iterator EndSorted() const;
1186  iterator Erase(iterator pos) const;
1188  void Erase(iterator beg, iterator end) const;
1190  ComparatorType GetComparator() const;
1192  void ReorderEmpty() const;
1194  bool Empty() const;
1196  enumerator Size() const;
1198  void Clear() const;
1200  bool DeleteSet();
1201  };
1202 
1203  __INLINE const ElementSet & InvalidElementSet() {static ElementSet ret(NULL,InvalidHandle()); return ret;}
1204 
1205  class Mesh : public TagManager, public Storage //implemented in mesh.cpp
1206  {
1207  public:
1213  //typedef std::vector<integer> empty_container;
1214  //typedef std::vector<integer> links_container;
1219  typedef sparse_type::size_type
1221  private:
1222  std::string name;
1223  Storage::real epsilon;
1224  empty_container empty_space[6];
1225  empty_container empty_links[6];
1226  links_container links[6];
1227  Tag tag_global_id;
1228  Tag tag_coords;
1229  Tag tag_low_conn;
1230  Tag tag_high_conn;
1231  Tag tag_markers;
1232  Tag * tag_private_markers;
1233  Tag tag_geom_type;
1234  Tag tag_setname;
1235  Tag tag_setcomparator;
1236  MeshState m_state;
1237  integer dim;
1238  HandleType last_created;
1239  private:
1240  ElementType have_global_id;
1241  INMOST_DATA_BIG_ENUM_TYPE parallel_mesh_unique_id;
1242  INMOST_MPI_Comm comm;
1243  Tag tag_shared;
1244  Tag tag_owner;
1245  Tag tag_processors;
1246  Tag tag_layers;
1247  Tag tag_sendto;
1248  Tag tag_bridge;
1249  Tag tag_redistribute;
1250  private:
1251  void AllocatePrivateMarkers();
1252  void DeallocatePrivateMarkers();
1253  __INLINE static sparse_rec mkrec (const Tag & t) {sparse_rec ret; ret.tag = t.mem; ret.rec = NULL; return ret;}
1254  __INLINE sparse_type const & MGetSparseLink (integer etypenum, integer ID) const {return GetSparseData(etypenum,links[etypenum][ID]);}
1255  __INLINE sparse_type & MGetSparseLink (integer etypenum, integer ID) {return GetSparseData(etypenum,links[etypenum][ID]);}
1256  __INLINE sparse_type const & MGetSparseLink (HandleType h) const {return MGetSparseLink(GetHandleElementNum(h),GetHandleID(h));}
1257  __INLINE sparse_type & MGetSparseLink (HandleType h) {return MGetSparseLink(GetHandleElementNum(h),GetHandleID(h));}
1258  __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;}
1259  __INLINE void * & MGetSparseLink (HandleType h, const Tag & t) {sparse_type & s = MGetSparseLink(GetHandleElementNum(h),GetHandleID(h)); for(senum i = 0; i < s.size(); ++i) if( s[i].tag == t.mem ) return s[i].rec; s.push_back(mkrec(t)); return s.back().rec;}
1260  __INLINE const void * MGetDenseLink (integer n, integer id, const Tag & t) const {return &(GetDenseData(t.GetPositionByDim(n))[links[n][id]]);}
1261  __INLINE void * MGetDenseLink (integer n, integer id, const Tag & t) {return &(GetDenseData(t.GetPositionByDim(n))[links[n][id]]);}
1262  __INLINE const void * MGetDenseLink (HandleType h, const Tag & t) const {return MGetDenseLink(GetHandleElementNum(h),GetHandleID(h),t);}
1263  __INLINE void * MGetDenseLink (HandleType h, const Tag & t) {return MGetDenseLink(GetHandleElementNum(h),GetHandleID(h),t);}
1264  __INLINE const void * MGetLink (HandleType h, const Tag & t) const {if( !t.isSparseByDim(GetHandleElementNum(h)) ) return MGetDenseLink(h,t); else return MGetSparseLink(h,t);}
1265  __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 ) q = calloc(1,t.GetRecordSize()); return q;}}
1266  void Init (std::string name);
1267  public:
1270  void Clear();
1276  Mesh ();
1277  Mesh (std::string name);
1278  Mesh (const Mesh & other);
1279  Mesh & operator = (Mesh const & other);
1280  ~Mesh ();
1298  void ReleaseMarker (MarkerType n);
1304  __INLINE void SetEpsilon (real e) {epsilon = e;}
1307  __INLINE real GetEpsilon () const {return epsilon;}
1313  void SetDimensions (integer dim);
1317  __INLINE integer GetDimensions () const {return dim;}
1320  __INLINE MeshState GetMeshState () const {return m_state;}
1321  __INLINE const Tag & GlobalIDTag () const {return tag_global_id;}
1322  __INLINE const Tag & CoordsTag () const {return tag_coords;}
1323  __INLINE const Tag & LowConnTag () const {return tag_low_conn;}
1324  __INLINE const Tag & HighConnTag () const {return tag_high_conn;}
1325  __INLINE const Tag & MarkersTag () const {return tag_markers;}
1326  __INLINE const Tag & GeomTypeTag () const {return tag_geom_type;}
1327  __INLINE const Tag & SendtoTag () const {return tag_sendto;}
1328  __INLINE const Tag & SharedTag () const {return tag_shared;}
1329  __INLINE const Tag & OwnerTag () const {return tag_owner;}
1330  __INLINE const Tag & LayersTag () const {return tag_layers;}
1331  __INLINE const Tag & BridgeTag () const {return tag_bridge;}
1332  __INLINE const Tag & ProcessorsTag () const {return tag_processors;}
1333  __INLINE const Tag & SetNameTag () const {return tag_setname;}
1334  __INLINE const Tag & SetComparatorTag () const {return tag_setcomparator;}
1337  __INLINE Tag RedistributeTag () {return CreateTag("TEMPORARY_NEW_OWNER",DATA_INTEGER,CELL,NONE,1);}
1358  Tag CreateTag (std::string name, DataType dtype, ElementType etype,ElementType sparse, INMOST_DATA_ENUM_TYPE size = ENUMUNDEF);
1364  Tag DeleteTag (Tag tag, ElementType mask = NODE | EDGE | FACE | CELL | ESET | MESH);
1371  __INLINE enumerator NumberOfTags () const { return static_cast<INMOST_DATA_ENUM_TYPE>(tags.size()); }
1383  Node CreateNode (const real * coords);
1384  std::pair<Edge,bool> CreateEdge (const ElementArray<Node> & nodes);
1385  std::pair<Face,bool> CreateFace (const ElementArray<Edge> & edges);
1386  std::pair<Face,bool> CreateFace (const ElementArray<Node> & nodes);
1387  std::pair<Cell,bool> CreateCell (const ElementArray<Face> & faces, const ElementArray<Node> & suggest_nodes_order = ElementArray<Node>(NULL));
1388  std::pair<Cell,bool> CreateCell (const ElementArray<Node> & c_f_nodes, const integer * c_f_numnodes, integer num_c_faces,
1389  const ElementArray<Node> & suggest_nodes_order = ElementArray<Node>(NULL));
1390  std::pair<Cell,bool> CreateCell (const ElementArray<Node> & c_nodes, const integer * c_f_nodeinds, const integer * c_f_numnodes, integer num_c_faces,
1391  const ElementArray<Node> & suggest_nodes_order = ElementArray<Node>(NULL));
1392  std::pair<ElementSet,bool> CreateSet (std::string name);
1394  std::pair<ElementSet,bool> CreateSetUnique (std::string name);
1398  ElementSet GetSet (std::string name);
1400  ElementArray<ElementSet> GetSetsByPrefix (std::string prefix);
1401  HandleType LastCreated () const {return last_created;}
1402 
1403  bool isValidHandleRange (HandleType h) const; //for asserts
1404  bool isValidElement (integer etypenum, integer lid) const {return links[etypenum][lid] != -1;}
1405  bool isValidElement (ElementType etype, integer lid) const {return links[ElementNum(etype)][lid] != -1;}
1406  bool isValidCell (integer lid) const {return links[ElementNum(CELL)][lid] != -1;}
1407  bool isValidFace (integer lid) const {return links[ElementNum(FACE)][lid] != -1;}
1408  bool isValidEdge (integer lid) const {return links[ElementNum(EDGE)][lid] != -1;}
1409  bool isValidNode (integer lid) const {return links[ElementNum(NODE)][lid] != -1;}
1410  bool isValidElementSet (integer lid) const {return links[ElementNum(ESET)][lid] != -1;}
1414  HandleType FindSharedAdjacency(const HandleType * arr, enumerator num) const;
1415  void ReorderEmpty (ElementType reordertypes);
1416  //Bug inside: sort would not work on chunk_array, because it is not contiguous in memory
1417  void ReorderApply (Tag index, ElementType mask);
1419  private:
1420  //those functions contain asserts for debug purposes, in release mode (NDEBUG is set) they are empty and call should be optimized out in worst case by linker
1421  void Asserts (HandleType h, const Tag & tag, DataType expected) const;
1422  void AssertsDF (HandleType h, const Tag & tag, DataType expected) const;
1423  void AssertsDV (HandleType h, const Tag & tag, DataType expected) const;
1424  public:
1438  real & Real (HandleType h, const Tag & tag);
1450  integer & Integer (HandleType h, const Tag & tag);
1462  bulk & Bulk (HandleType h, const Tag & tag);
1478  reference & Reference (HandleType h, const Tag & tag);
1495  remote_reference & RemoteReference (HandleType h, const Tag & tag);
1504  real_array RealArray (HandleType h, const Tag & tag);
1514  integer_array IntegerArray (HandleType h, const Tag & tag);
1524  bulk_array BulkArray (HandleType h, const Tag & tag);
1557  reference_array ReferenceArray (HandleType h, const Tag & tag);
1590  remote_reference_array RemoteReferenceArray(HandleType h, const Tag & tag);
1599  real & RealDF (HandleType h, const Tag & tag) {AssertsDF(h,tag,DATA_REAL ); return static_cast<real *>(MGetDenseLink(h,tag))[0];}
1608  integer & IntegerDF (HandleType h, const Tag & tag) {AssertsDF(h,tag,DATA_INTEGER ); return static_cast<integer *>(MGetDenseLink(h,tag))[0];}
1617  bulk & BulkDF (HandleType h, const Tag & tag) {AssertsDF(h,tag,DATA_BULK ); return static_cast<bulk *>(MGetDenseLink(h,tag))[0];}
1630  reference & ReferenceDF (HandleType h, const Tag & tag) {AssertsDF(h,tag,DATA_REFERENCE); return static_cast<reference*>(MGetDenseLink(h,tag))[0];}
1643  remote_reference & RemoteReferenceDF (HandleType h, const Tag & tag) {AssertsDF(h,tag,DATA_REMOTE_REFERENCE); return static_cast<remote_reference*>(MGetDenseLink(h,tag))[0];}
1656  real_array RealArrayDF (HandleType h, const Tag & tag) {AssertsDF(h,tag,DATA_REAL ); return real_array (static_cast<real *>(MGetDenseLink(h,tag)),tag.GetSize());}
1669  integer_array IntegerArrayDF (HandleType h, const Tag & tag) {AssertsDF(h,tag,DATA_INTEGER ); return integer_array (static_cast<integer *>(MGetDenseLink(h,tag)),tag.GetSize());}
1682  bulk_array BulkArrayDF (HandleType h, const Tag & tag) {AssertsDF(h,tag,DATA_BULK ); return bulk_array (static_cast<bulk *>(MGetDenseLink(h,tag)),tag.GetSize());}
1711  reference_array ReferenceArrayDF (HandleType h, const Tag & tag) {AssertsDF(h,tag,DATA_REFERENCE); return reference_array(this,static_cast<reference*>(MGetDenseLink(h,tag)),tag.GetSize());}
1740  remote_reference_array RemoteReferenceArrayDF(HandleType h, const Tag & tag) {AssertsDF(h,tag,DATA_REMOTE_REFERENCE); return remote_reference_array(static_cast<remote_reference*>(MGetDenseLink(h,tag)),tag.GetSize());}
1752  real & RealDV (HandleType h, const Tag & tag) {AssertsDV(h,tag,DATA_REAL ); return static_cast<inner_real_array *>(MGetDenseLink(h,tag))->at_safe(0);}
1764  integer & IntegerDV (HandleType h, const Tag & tag) {AssertsDV(h,tag,DATA_INTEGER ); return static_cast<inner_integer_array *>(MGetDenseLink(h,tag))->at_safe(0);}
1777  bulk & BulkDV (HandleType h, const Tag & tag) {AssertsDV(h,tag,DATA_BULK ); return static_cast<inner_bulk_array *>(MGetDenseLink(h,tag))->at_safe(0);}
1793  reference & ReferenceDV (HandleType h, const Tag & tag) {AssertsDV(h,tag,DATA_REFERENCE); return static_cast<inner_reference_array*>(MGetDenseLink(h,tag))->at_safe(0);}
1809  remote_reference & RemoteReferenceDV (HandleType h, const Tag & tag) {AssertsDV(h,tag,DATA_REMOTE_REFERENCE); return static_cast<inner_remote_reference_array*>(MGetDenseLink(h,tag))->at_safe(0);}
1818  real_array RealArrayDV (HandleType h, const Tag & tag) {AssertsDV(h,tag,DATA_REAL ); return real_array (*static_cast<inner_real_array *>(MGetDenseLink(h,tag)));}
1827  integer_array IntegerArrayDV (HandleType h, const Tag & tag) {AssertsDV(h,tag,DATA_INTEGER ); return integer_array (*static_cast<inner_integer_array *>(MGetDenseLink(h,tag)));}
1836  bulk_array BulkArrayDV (HandleType h, const Tag & tag) {AssertsDV(h,tag,DATA_BULK ); return bulk_array (*static_cast<inner_bulk_array *>(MGetDenseLink(h,tag)));}
1861  reference_array ReferenceArrayDV (HandleType h, const Tag & tag) {AssertsDV(h,tag,DATA_REFERENCE); return reference_array(this,*static_cast<inner_reference_array*>(MGetDenseLink(h,tag)));}
1886  remote_reference_array RemoteReferenceArrayDV(HandleType h, const Tag & tag) {AssertsDV(h,tag,DATA_REMOTE_REFERENCE); return remote_reference_array(*static_cast<inner_remote_reference_array*>(MGetDenseLink(h,tag)));}
1887 
1888 #if defined(USE_AUTODIFF)
1889  var & Variable (HandleType h, const Tag & tag);
1890  var & VariableDF (HandleType h, const Tag & tag) {AssertsDF(h,tag,DATA_VARIABLE); return static_cast<var *>(MGetDenseLink(h,tag))[0];}
1891  var & VariableDV (HandleType h, const Tag & tag) {AssertsDV(h,tag,DATA_VARIABLE); return static_cast<inner_variable_array *>(MGetDenseLink(h,tag))->at_safe(0);}
1892  var_array VariableArray (HandleType h, const Tag & tag);
1893  var_array VariableArrayDF (HandleType h, const Tag & tag) {AssertsDF(h,tag,DATA_VARIABLE); return var_array(static_cast<var *>(MGetDenseLink(h,tag)),tag.GetSize());}
1894  var_array VariableArrayDV (HandleType h, const Tag & tag) {AssertsDV(h,tag,DATA_VARIABLE); return var_array(*static_cast<inner_variable_array*>(MGetDenseLink(h,tag)));}
1895 #endif
1896  void SetMarker (HandleType h,MarkerType n) {assert(!isPrivate(n)); static_cast<bulk *>(MGetDenseLink(h,MarkersTag()))[n >> MarkerShift] |= static_cast<bulk>(n & MarkerMask);}
1906  void SetMarkerArray (const HandleType * h, enumerator n, MarkerType m) {for(enumerator i = 0; i < n; ++i) if( h[i] != InvalidHandle() )SetMarker(h[i],m);}
1907  void SetPrivateMarkerArray (const HandleType * h, enumerator n, MarkerType m) {for(enumerator i = 0; i < n; ++i) if( h[i] != InvalidHandle() )SetPrivateMarker(h[i],m);}
1911  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;}
1912  bool GetPrivateMarker (HandleType h,MarkerType n) const;
1916  void RemMarker (HandleType h,MarkerType n) {assert(!isPrivate(n)); static_cast<bulk *>(MGetDenseLink(h,MarkersTag()))[n >> MarkerShift] &= ~static_cast<bulk>(n & MarkerMask);}
1923  void RemMarkerArray (const HandleType * h, enumerator n, MarkerType m) {for(enumerator i = 0; i < n; ++i) if( h[i] != InvalidHandle() ) RemMarker(h[i],m);}
1924  void RemPrivateMarkerArray (const HandleType * h, enumerator n, MarkerType m) {for(enumerator i = 0; i < n; ++i) if( h[i] != InvalidHandle() ) RemPrivateMarker(h[i],m);}
1926  void ClearMarkerSpace (HandleType h);
1930  void GetMarkerSpace (HandleType h,bulk copy [MarkerFields]) const;
1934  void SetMarkerSpace (HandleType h,bulk source[MarkerFields]);
1966  Element::adj_type & HighConn (HandleType h) {return *static_cast<inner_reference_array*>(MGetDenseLink(h,HighConnTag()));}
1968  Element::adj_type const& HighConn (HandleType h) const {return *static_cast<const inner_reference_array*>(MGetDenseLink(h,HighConnTag()));}
1980  Element::adj_type & LowConn (HandleType h) {return *static_cast<inner_reference_array*>(MGetDenseLink(h,LowConnTag()));}
1982  Element::adj_type const& LowConn (HandleType h) const {return *static_cast<const inner_reference_array*>(MGetDenseLink(h,LowConnTag()));}
1989  INMOST_DATA_ENUM_TYPE GetDataSize (HandleType h,const Tag & tag) const; //For DATA_BULK return number of bytes, otherwise return the length of array
1995  INMOST_DATA_ENUM_TYPE GetDataCapacity (HandleType h,const Tag & tag) const;
2003  void SetDataSize (HandleType h,const Tag & tag, enumerator new_size);
2011  void GetData (HandleType h,const Tag & tag, enumerator shift, enumerator size, void * data) const;
2018  void SetData (HandleType h,const Tag & tag, enumerator shift, enumerator size, const void * data);
2024  void DelData (HandleType h,const Tag & tag);
2028  void DelDenseData (HandleType h,const Tag & tag);
2032  void DelSparseData (HandleType h,const Tag & tag);
2038  bool HaveData (HandleType h,const Tag & tag) const;
2039 
2040  Element::GeometricType GetGeometricType (HandleType h) const {return static_cast<const bulk *>(MGetDenseLink(h,GeomTypeTag()))[0];}
2041  void SetGeometricType (HandleType h, Element::GeometricType type) {static_cast<bulk *>(MGetDenseLink(h,GeomTypeTag()))[0] = type;}
2048  integer & GlobalID (HandleType h) {return static_cast<integer *>(MGetDenseLink(h,GlobalIDTag()))[0];}
2055  integer GlobalID (HandleType h) const {return static_cast<const integer *>(MGetDenseLink(h,GlobalIDTag()))[0];}
2060  integer DataLocalID (HandleType h) const {return static_cast<integer>(links[GetHandleElementNum(h)][GetHandleID(h)]);}
2069  Element::Status GetStatus (HandleType h) const { if( SharedTag().isValid() ) return static_cast<const bulk *>(MGetDenseLink(h,SharedTag()))[0]; return Element::Owned;}
2082  //implemented in modify.
2090  void Destroy (HandleType h);
2092  void Destroy (const Storage & e) {Destroy(e->GetHandle());}
2101  bool Hide (HandleType h);
2106  bool Show (HandleType h);
2115  bool Delete (HandleType h);
2119  bool Hidden (HandleType h) const;
2125  bool New (HandleType h) const;
2126  //geometry.cpp
2130  //mesh.cpp
2134  private:
2136  void MoveStorage (integer etypenum, integer old_addr, integer new_addr);
2138  void UntieElement (integer etypenum, integer ID);
2140  integer TieElement (integer etypenum);
2141  public:
2142  //implemented in mesh_parallel.cpp
2145  typedef void (*ReduceOperation)(const Tag & tag, const Element & element, const INMOST_DATA_BULK_TYPE * recv_data, INMOST_DATA_ENUM_TYPE recv_size);
2146  typedef std::vector<Tag> tag_set;
2147  typedef std::vector<HandleType> element_set;
2148  typedef std::vector<INMOST_DATA_BULK_TYPE> buffer_type;
2149  typedef std::map<int, element_set > proc_elements;
2150  typedef std::pair<int, buffer_type > proc_buffer_type;
2151  typedef std::vector< proc_buffer_type > exch_buffer_type;
2153  {
2154  public:
2155  std::vector<INMOST_MPI_Request> send_reqs, recv_reqs;
2157  };
2158  private:
2159  class Random // random generator to provide tag for communication
2160  {
2161  private: unsigned int n,a,c,m;
2162  public:
2163  Random(unsigned int seed = 50);
2164  Random(const Random & other);
2165  unsigned int Number();
2166  } randomizer;
2167  class elements_by_type
2168  {
2169  private:
2170  element_set container[4];
2171  public:
2172  elements_by_type() {}
2173  elements_by_type(const elements_by_type & other) {for(int i = 0; i < 4; i++) container[i] = other.container[i];}
2174  ~elements_by_type(){}
2175  element_set & operator [](int i){ return container[i]; }
2176  const element_set & operator [](int i) const { return container[i]; }
2177  };
2178  typedef std::map<int, elements_by_type > parallel_storage;
2179  private:
2180 #if defined(USE_PARALLEL_STORAGE)
2181  parallel_storage shared_elements;
2182  parallel_storage ghost_elements;
2183 #endif
2184 #if defined(USE_PARALLEL_WRITE_TIME)
2185  int num_exchanges;
2186  std::fstream out_time;
2187  int tab;
2188  int func_id;
2189 #endif
2190 #if defined(USE_MPI_P2P)
2191  INMOST_MPI_Win window;
2192  unsigned * shared_space;
2193 #endif
2194  int parallel_strategy;
2195  int parallel_file_strategy;
2196  private:
2197  void ComputeSharedProcs ();
2198  proc_elements ComputeSharedSkinSet(ElementType bridge);
2199  void PackTagData (const Tag & tag, const elements_by_type & elements, ElementType mask, MarkerType select, buffer_type & buffer);
2200  void UnpackTagData (const Tag & tag, const elements_by_type & elements, ElementType mask, MarkerType select, buffer_type & buffer, int & position, ReduceOperation op);
2201  void PackElementsData (element_set & input, buffer_type & buffer, int destination, const std::vector<std::string> & tag_list);
2202  void UnpackElementsData (element_set & output, buffer_type & buffer, int source, std::vector<std::string> & tag_list);
2203  void PrepareReceiveInner(Prepare todo, exch_buffer_type & send_bufs, exch_buffer_type & recv_bufs);
2204  void ExchangeDataInnerBegin(const tag_set & tag, const parallel_storage & from, const parallel_storage & to, ElementType mask, MarkerType select, exchange_data & storage);
2205  void ExchangeDataInnerEnd(const tag_set & tag, const parallel_storage & from, const parallel_storage & to, ElementType mask, MarkerType select, ReduceOperation op, exchange_data & storage);
2206  void ExchangeBuffersInner(exch_buffer_type & send_bufs, exch_buffer_type & recv_bufs,std::vector<INMOST_MPI_Request> & send_reqs, std::vector<INMOST_MPI_Request> & recv_reqs);
2207  std::vector<int> FinishRequests (std::vector<INMOST_MPI_Request> & recv_reqs);
2208  void GatherParallelStorage(parallel_storage & ghost, parallel_storage & shared, ElementType mask);
2209  public:
2210 #if defined(USE_PARALLEL_WRITE_TIME)
2211  //this part is needed to test parallel performance
2212  void Enter ();
2213  void Exit ();
2214  int & GetFuncID () {return func_id;}
2215  std::fstream & GetStream ();
2216  std::ostream & WriteTab (std::ostream & f);
2217  void FinalizeFile ();
2218  static void AtExit (void);
2219 #endif
2220  static void Initialize (int * argc, char *** argv);
2227  static void Finalize ();
2301  void SetParallelStrategy(int strategy){assert( !(strategy < 0 || strategy > 3) ); parallel_strategy = strategy;}
2304  int GetParallelStrategy() {return parallel_strategy;}
2345  void SetParallelFileStrategy(int strategy){assert( !(strategy < 0 || strategy > 1) ); parallel_file_strategy = strategy;}
2348  int GetParallelFileStrategy() {return parallel_file_strategy;}
2350  int GetProcessorRank ();
2352  int GetProcessorsNumber();
2356  void SetCommunicator (INMOST_MPI_Comm _comm);
2357  void ResolveShared ();
2359  void RemoveGhost ();
2378  void RemoveGhostElements(const HandleType * ghost, enumerator num);
2379  template<typename EType>
2380  void RemoveGhostElements(const ElementArray<EType> & ghost) {RemoveGhostElements(ghost.data(),static_cast<enumerator>(ghost.size()));}
2394  void AssignGlobalID (ElementType mask);
2410  void ExchangeData (const Tag & tag, ElementType mask, MarkerType select);
2429  void ExchangeDataBegin (const Tag & tag, ElementType mask, MarkerType select, exchange_data & storage);
2439  void ExchangeDataEnd (const Tag & tag, ElementType mask, MarkerType select, exchange_data & storage);
2447  void ExchangeData (const tag_set & tags, ElementType mask, MarkerType select);
2457  void ExchangeDataBegin (const tag_set & tags, ElementType mask, MarkerType select, exchange_data & storage);
2466  void ExchangeDataEnd (const tag_set & tags, ElementType mask, MarkerType select, exchange_data & storage);
2506  void ReduceData (const Tag & tag, ElementType mask, MarkerType select, ReduceOperation op );
2518  void ReduceDataBegin (const Tag & tag, ElementType mask, MarkerType select, exchange_data & storage);
2530  void ReduceDataEnd (const Tag & tag, ElementType mask, MarkerType select, ReduceOperation op, exchange_data & storage );
2541  void ReduceData (const tag_set & tags, ElementType mask, MarkerType select, ReduceOperation op );
2550  void ReduceDataBegin (const tag_set & tags, ElementType mask, MarkerType select, exchange_data & storage);
2560  void ReduceDataEnd (const tag_set & tags, ElementType mask, MarkerType select, ReduceOperation op, exchange_data & storage );
2592  void ExchangeMarked (enum Action action = AGhost);
2614  void ExchangeGhost (integer layers, ElementType bridge);
2647  void Redistribute ();
2657  integer Enumerate (ElementType mask, Tag num_tag, integer start = 0, bool define_sparse = false);
2668  integer Enumerate (const HandleType * h, enumerator num, const Tag & num_tag, integer start = 0, bool define_sparse = true);
2678  template<typename EType>
2679  integer Enumerate (const ElementArray<EType> & elements, const Tag & num_tag, integer start = 0, bool define_sparse = true) {return Enumerate(elements.data(),static_cast<enumerator>(elements.size()),num_tag,start,define_sparse);}
2689  integer EnumerateSet (const ElementSet & set, const Tag & num_tag, integer start = 0, bool define_sparse = true);
2705  real Integrate (real input);
2712  integer Integrate (integer input);
2720  void Integrate (real * input, integer size);
2728  void Integrate (integer * input, integer size);
2738  real Integrate (const Tag & t, enumerator entry, ElementType mask);
2745  integer ExclusiveSum (integer input);
2746  real AggregateMax (real input);
2747  integer AggregateMax (integer input);
2748  void AggregateMax (real * input, integer size);
2749  void AggregateMax (integer * input, integer size);
2750 
2751  real AggregateMin (real input);
2752  integer AggregateMin (integer input);
2753  void AggregateMin (real * input, integer size);
2754  void AggregateMin (integer * input, integer size);
2787  void SynchronizeMarker (MarkerType marker, ElementType mask, SyncBitOp op);
2788  //for debug
2789  void BeginSequentialCode();
2790  void EndSequentialCode ();
2791  //iterator.cpp::::::::::::::::::::::::::::::::::::::::::::::::::
2792  public:
2793  Element ElementByLocalID (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));}
2796 
2797  HandleType NextHandle (HandleType h) const;
2798  HandleType PrevHandle (HandleType h) const; //returns InvalidHandle() when go beyond first element
2799  HandleType NextHandle (HandleType h, ElementType mask) const;
2800  HandleType PrevHandle (HandleType h, ElementType mask) const; //returns InvalidHandle() when go beyond first element
2802  HandleType LastHandle () const {return ComposeHandleNum(ElementNum(MESH),1);}
2804  HandleType LastHandle (ElementType etype) const {integer num = ElementNum(etype); return ComposeHandleNum(num,static_cast<integer>(links[num].size()));}
2805 
2806  Node NodeByLocalID (integer lid) { assert(lid >= 0 && lid < static_cast<integer>(links[0].size())); return Node(this,ComposeHandleNum(0,lid)); }
2807  Edge EdgeByLocalID (integer lid) { assert(lid >= 0 && lid < static_cast<integer>(links[1].size())); return Edge(this,ComposeHandleNum(1,lid)); }
2808  Face FaceByLocalID (integer lid) { assert(lid >= 0 && lid < static_cast<integer>(links[2].size())); return Face(this,ComposeHandleNum(2,lid));}
2809  Cell CellByLocalID (integer lid) { assert(lid >= 0 && lid < static_cast<integer>(links[3].size())); return Cell(this,ComposeHandleNum(3,lid)); }
2810  ElementSet EsetByLocalID (integer lid) { assert(lid >= 0 && lid < static_cast<integer>(links[4].size())); return ElementSet(this,ComposeHandleNum(4,lid)); }
2811 
2812  integer NodeNextLocalID (integer lid) const {++lid; while(lid < static_cast<integer>(links[0].size()) && links[0][lid] == -1) ++lid; return lid;}
2813  integer EdgeNextLocalID (integer lid) const {++lid; while(lid < static_cast<integer>(links[1].size()) && links[1][lid] == -1) ++lid; return lid;}
2814  integer FaceNextLocalID (integer lid) const {++lid; while(lid < static_cast<integer>(links[2].size()) && links[2][lid] == -1) ++lid; return lid;}
2815  integer CellNextLocalID (integer lid) const {++lid; while(lid < static_cast<integer>(links[3].size()) && links[3][lid] == -1) ++lid; return lid;}
2816  integer EsetNextLocalID (integer lid) const {++lid; while(lid < static_cast<integer>(links[4].size()) && links[4][lid] == -1) ++lid; return lid;}
2817 
2818  integer NodePrevLocalID (integer lid) const {--lid; while(lid >= 0 && links[0][lid] == -1) --lid; return lid;}
2819  integer EdgePrevLocalID (integer lid) const {--lid; while(lid >= 0 && links[1][lid] == -1) --lid; return lid;}
2820  integer FacePrevLocalID (integer lid) const {--lid; while(lid >= 0 && links[2][lid] == -1) --lid; return lid;}
2821  integer CellPrevLocalID (integer lid) const {--lid; while(lid >= 0 && links[3][lid] == -1) --lid; return lid;}
2822  integer EsetPrevLocalID (integer lid) const {--lid; while(lid >= 0 && links[4][lid] == -1) --lid; return lid;}
2823 
2824  __INLINE integer NodeLastLocalID () const {return static_cast<integer>(links[0].size());}
2825  __INLINE integer EdgeLastLocalID () const {return static_cast<integer>(links[1].size());}
2826  __INLINE integer FaceLastLocalID () const {return static_cast<integer>(links[2].size());}
2827  __INLINE integer CellLastLocalID () const {return static_cast<integer>(links[3].size());}
2828  __INLINE integer EsetLastLocalID () const {return static_cast<integer>(links[4].size());}
2829  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;}
2830  integer PrevLocalID (ElementType etype, integer lid) const {integer q = ElementNum(etype); --lid; while(lid > 0 && links[q][lid] == -1) --lid; return lid;}
2831  integer FirstLocalID (ElementType etype) const;
2832  integer LastLocalID (integer n) const {assert(n >= 0 && n < 6); return n == 5 ? 1 : static_cast<integer>(links[n].size());}
2833  integer LastLocalID (ElementType etype) const {assert(OneType(etype)); return LastLocalID(ElementNum(etype));}
2834 
2835 
2836  __INLINE integer NumberOfSets () const { return static_cast<integer>(links[4].size() - empty_links[4].size()); }
2837  __INLINE integer NumberOfCells () const { return static_cast<integer>(links[3].size() - empty_links[3].size());}
2838  __INLINE integer NumberOfFaces () const { return static_cast<integer>(links[2].size() - empty_links[2].size()); }
2839  __INLINE integer NumberOfEdges () const { return static_cast<integer>(links[1].size() - empty_links[1].size()); }
2840  __INLINE integer NumberOfNodes () const { return static_cast<integer>(links[0].size() - empty_links[0].size()); }
2843  integer NumberOf (ElementType t) const;
2844 
2845  template<typename EType> class base_iterator;
2855  iteratorStorage End ();
2858  iteratorSet BeginSet ();
2859  iteratorSet EndSet ();
2861  iteratorCell EndCell ();
2863  iteratorFace EndFace ();
2865  iteratorEdge EndEdge ();
2867  iteratorNode EndNode ();
2868 
2869 
2870  template<typename EType>
2871  class base_iterator
2872  {
2873  protected:
2874  Mesh * m;
2878  base_iterator(ElementType Types, Mesh * mesh, bool last);
2879  base_iterator(Mesh * mesh) {m = mesh; etype = NONE; types = NONE; lid = -1;}
2880  public:
2881  typedef HandleType * pointer;
2884  typedef ptrdiff_t difference_type;
2885  typedef std::bidirectional_iterator_tag iterator_category;
2886  base_iterator() {m = NULL; lid = -1; etype = types = NONE;}
2887  base_iterator(const base_iterator & other) {m = other.m; lid = other.lid; types = other.types; etype = other.etype;}
2888  virtual ~base_iterator() {}
2894  __INLINE EType operator ->() {return EType(m,ComposeHandle(etype,lid));}
2895  __INLINE base_iterator & operator = (base_iterator const & other) {m = other.m; lid = other.lid; types = other.types; etype = other.etype; return *this;}
2896  __INLINE bool operator ==(const base_iterator & other) const {return lid == other.lid && etype == other.etype;}
2897  __INLINE bool operator !=(const base_iterator & other) const {return lid != other.lid || etype != other.etype;}
2898  __INLINE bool operator < (const base_iterator & other) const {return (etype < other.etype) || (etype == other.etype && lid < other.lid);}
2899  __INLINE bool operator > (const base_iterator & other) const {return (etype > other.etype) || (etype == other.etype && lid > other.lid);}
2900  __INLINE bool operator <=(const base_iterator & other) const {return (etype < other.etype) || (etype == other.etype && lid <= other.lid);}
2901  __INLINE bool operator >=(const base_iterator & other) const {return (etype > other.etype) || (etype == other.etype && lid >= other.lid);}
2902  void Print();
2903  friend iteratorStorage Mesh::Begin(ElementType Types);
2904  friend iteratorStorage Mesh::End();
2907  friend iteratorSet Mesh::BeginSet();
2908  friend iteratorSet Mesh::EndSet();
2909  friend iteratorCell Mesh::BeginCell();
2910  friend iteratorCell Mesh::EndCell();
2911  friend iteratorFace Mesh::BeginFace();
2912  friend iteratorFace Mesh::EndFace();
2913  friend iteratorEdge Mesh::BeginEdge();
2914  friend iteratorEdge Mesh::EndEdge();
2915  friend iteratorNode Mesh::BeginNode();
2916  friend iteratorNode Mesh::EndNode();
2917  };
2918  private:
2919  std::vector< std::pair<std::string, std::string> > file_options;
2920  public:
2929  void SetFileOption(std::string,std::string);
2932  std::string GetFileOption(std::string key);
2948  void Load(std::string File);
2949  void LoadMSH(std::string File);
2950  void LoadECL(std::string File);
2951  void LoadXML(std::string File);
2952  void LoadPMF(std::string File);
2953  void LoadVTK(std::string File);
2954  void LoadPVTK(std::string File);
2955  void LoadMKF(std::string File);
2969  void Save(std::string File);
2970  void SaveXML(std::string File);
2971  void SavePMF(std::string File);
2972  void SaveVTK(std::string File);
2973  void SavePVTK(std::string File);
2974  void SaveGMV(std::string File);
2975  bool isParallelFileFormat(std::string File);
2976  public:
2977 
2978  //implemented in geometry.cpp
2979  private:
2980  Tag measure_tag;
2981  Tag centroid_tag;
2982  Tag normal_tag;
2983  Tag barycenter_tag;
2984  Tag boundary_tag;
2985  bool remember[5][3];
2986  private:
2987  void RestoreGeometricTags();
2988  void RepairGeometricTags();
2989  bool HideGeometricData (GeometricData type, ElementType mask) {return remember[type][ElementNum(mask)-1] = false;}
2990  bool ShowGeometricData (GeometricData type, ElementType mask) {return remember[type][ElementNum(mask)-1] = true;}
2991  public:
2993  // types for MEASURE: EDGE | FACE | CELL (length, area, volume)
2994  // types for CENTROID: EDGE | FACE | CELL
2995  // types for BARYCENTER: EDGE | FACE | CELL
2996  // types for NORMAL: FACE | CELL (may precompute normal for cells in 2d case)
2997  // types for ORIENTATION: FACE
2998  void PrepareGeometricData(GeomParam table);
2999  void RemoveGeometricData(GeomParam table);
3000  bool HaveGeometricData (GeometricData type, ElementType mask) const {return remember[type][ElementNum(mask)-1];} // requests to only one geometric and element type allowed
3001  void GetGeometricData (HandleType e, GeometricData type, real * ret);
3002  const Tag & GetGeometricTag (GeometricData type) const;
3003  bool TestClosure (const HandleType * elements, integer num) const;
3008  void RecomputeGeometricData(HandleType e); // Update all stored geometric data, runs automatically on element construction
3009  Element::GeometricType ComputeGeometricType(ElementType element_type, const HandleType * lower_adjacent, INMOST_DATA_ENUM_TYPE lower_adjacent_size) const;
3010  //implemented in modify.cpp
3011  private:
3012  MarkerType hide_element, new_element, temp_hide_element;
3013  public:
3018  bool isMeshModified () const {return new_element != 0;}
3019  MarkerType HideMarker () const {return hide_element;}
3020  MarkerType NewMarker () const {return new_element;}
3021  void SwapModification (); // swap hidden and new elements, so that old mesh is recovered
3022  void BeginModification (); //allow elements to be hidden
3035  void ApplyModification (); //modify DATA_REFERENCE, tags so that links to hidden elements are converted to NULL and removed from sets
3040  void ResolveModification(); //resolve parallel state of newly created elements, restore ghost layers; not implemented, resuse ResolveShared code
3041  void EndModification (); //delete hidden elements
3042  enumerator getNext (const HandleType * arr, enumerator size, enumerator k, MarkerType marker) const;
3043  enumerator Count (const HandleType * arr, enumerator size, MarkerType marker) const;
3044  //implemented in mesh.cpp
3045  private:
3046  Tag tag_topologyerror;
3047  TopologyCheck checkset;
3048  TopologyCheck errorset;
3049  public:
3063  TopologyCheck EndTopologyCheck (HandleType e); //check created element
3068  Tag TopologyErrorTag () const {return tag_topologyerror;}
3070  TopologyCheck GetTopologyCheck (TopologyCheck mask = ENUMUNDEF) const {return checkset & mask;}
3072  void SetTopologyCheck (TopologyCheck mask);
3074  void RemTopologyCheck (TopologyCheck mask);
3076  void SetTopologyError (TopologyCheck mask) {errorset = errorset | mask;}
3078  TopologyCheck GetTopologyError (TopologyCheck mask = ENUMUNDEF) const {return errorset & mask;}
3080  void ClearTopologyError (TopologyCheck mask = ENUMUNDEF) {errorset = errorset & ~mask;}
3081  //implemented in comparator.cpp
3082  public:
3084  {
3085  Mesh * m;
3086  public:
3087  CentroidComparator(Mesh * m) :m(m) {}
3088  CentroidComparator(const CentroidComparator & other) :m(other.m){}
3089  CentroidComparator & operator = (CentroidComparator const & other) { m = other.m; return *this;}
3090  int Compare(const real * a, const real * b) const;
3091  bool operator() (HandleType a, HandleType b) const;
3092  bool operator() (HandleType a, const real * b) const;
3093  bool operator() (const real * a, HandleType b) const;
3094  };
3095 
3097  {
3098  Mesh * m;
3099  public:
3100  GlobalIDComparator(Mesh * m) :m(m) {}
3101  GlobalIDComparator(const GlobalIDComparator & other) :m(other.m){}
3102  GlobalIDComparator & operator = (GlobalIDComparator const & other) { m = other.m; return *this;}
3103  bool operator() (HandleType a, HandleType b) const {if( a == InvalidHandle() || b == InvalidHandle() ) return a > b; return m->GlobalID(a) < m->GlobalID(b);}
3104  bool operator() (HandleType a, integer gid) const {if( a == InvalidHandle() ) return false; return m->GlobalID(a) < gid;}
3105  };
3106 
3108  {
3109  Mesh * m;
3110  public:
3112  HierarchyComparator(const HierarchyComparator & other) :m(other.m){}
3113  HierarchyComparator & operator = (HierarchyComparator const & other) { m = other.m; return *this;}
3114  int CompareNodes(HandleType a, HandleType b) const;
3115  int CompareElements(HandleType a, HandleType b) const;
3116  bool operator() (HandleType a, HandleType b) const {if( a == InvalidHandle() || b == InvalidHandle() ) return a > b; return CompareElements(a,b) < 0;}
3117  };
3118 
3120  {
3121  Mesh * m; Tag t;
3122  public:
3123  RealComparator(Mesh * m, Tag t) :m(m), t(t) {}
3124  RealComparator(const RealComparator & other) :m(other.m), t(other.t){}
3125  RealComparator & operator = (RealComparator const & other) { m = other.m; t = other.t; return *this;}
3126  bool operator() (HandleType a, HandleType b) const {if( a == InvalidHandle() || b == InvalidHandle() ) return a > b; return m->Real(a,t) < m->Real(b,t);}
3127  bool operator() (HandleType a, real b) const {if( a == InvalidHandle() ) return true; return m->Real(a,t) < b;}
3128  };
3129 
3131  {
3132  Mesh * m; Tag t;
3133  public:
3134  IntegerComparator(Mesh * m, Tag t) :m(m), t(t) {}
3135  IntegerComparator(const IntegerComparator & other) :m(other.m), t(other.t){}
3136  IntegerComparator & operator = (IntegerComparator const & other) { m = other.m; t = other.t; return *this;}
3137  bool operator() (HandleType a, HandleType b) const {if( a == InvalidHandle() || b == InvalidHandle() ) return a > b; return m->Integer(a,t) < m->Integer(b,t);}
3138  bool operator() (HandleType a, integer b) const {if( a == InvalidHandle() ) return true; return m->Integer(a,t) < b;}
3139  };
3140 
3142  {
3143  Mesh * m; Tag t;
3144  public:
3145  BulkComparator(Mesh * m, Tag t) :m(m), t(t) {}
3146  BulkComparator(const BulkComparator & other) :m(other.m), t(other.t){}
3147  BulkComparator & operator = (BulkComparator const & other) { m = other.m; t = other.t; return *this;}
3148  bool operator() (HandleType a, HandleType b) const {if( a == InvalidHandle() || b == InvalidHandle() ) return a > b; return m->Bulk(a,t) < m->Bulk(b,t);}
3149  bool operator() (HandleType a, bulk b) const {if( a == InvalidHandle() ) return true; return m->Bulk(a,t) < b;}
3150  };
3151 
3153  {
3154  Mesh * m; Tag t;
3155  public:
3156  RealDFComparator(Mesh * m, Tag t) :m(m), t(t) {}
3157  RealDFComparator(const RealDFComparator & other) :m(other.m), t(other.t){}
3158  RealDFComparator & operator = (RealDFComparator const & other) { m = other.m; t = other.t; return *this;}
3159  bool operator() (HandleType a, HandleType b) const {if( a == InvalidHandle() || b == InvalidHandle() ) return a > b; return m->RealDF(a,t) < m->RealDF(b,t);}
3160  bool operator() (HandleType a, real b) const {if( a == InvalidHandle() ) return true; return m->RealDF(a,t) < b;}
3161  };
3162 
3164  {
3165  Mesh * m; Tag t;
3166  public:
3167  IntegerDFComparator(Mesh * m, Tag t) :m(m), t(t) {}
3168  IntegerDFComparator(const IntegerDFComparator & other) :m(other.m), t(other.t){}
3169  IntegerDFComparator & operator = (IntegerDFComparator const & other) { m = other.m; t = other.t; return *this;}
3170  bool operator() (HandleType a, HandleType b) const {if( a == InvalidHandle() || b == InvalidHandle() ) return a > b; return m->IntegerDF(a,t) < m->IntegerDF(b,t);}
3171  bool operator() (HandleType a, integer b) const {if( a == InvalidHandle() ) return true; return m->IntegerDF(a,t) < b;}
3172  };
3173 
3175  {
3176  Mesh * m; Tag t;
3177  public:
3178  BulkDFComparator(Mesh * m, Tag t) :m(m), t(t) {}
3179  BulkDFComparator(const BulkDFComparator & other) :m(other.m), t(other.t){}
3180  BulkDFComparator & operator = (BulkDFComparator const & other) { m = other.m; t = other.t; return *this;}
3181  bool operator() (HandleType a, HandleType b) const {if( a == InvalidHandle() || b == InvalidHandle() ) return a > b; return m->BulkDF(a,t) < m->BulkDF(b,t);}
3182  bool operator() (HandleType a, bulk b) const {if( a == InvalidHandle() ) return true; return m->BulkDF(a,t) < b;}
3183  };
3184 
3185  void SortHandles(HandleType * h, enumerator num);
3188  void SortByGlobalID(HandleType * h, enumerator num);
3189 
3191  std::string GetMeshName();
3193  void SetMeshName(std::string new_name);
3195  static Mesh * GetMesh(std::string name);
3196  };
3197 
3198 
3202  __INLINE bool Storage::operator <(const Storage & other) const
3203  {
3204  return handle < other.handle;
3205  }
3206  __INLINE bool Storage::operator >(const Storage & other) const
3207  {
3208  return handle > other.handle;
3209  }
3210  __INLINE bool Storage::operator <=(const Storage & other) const
3211  {
3212  return handle <= other.handle;
3213  }
3214  __INLINE bool Storage::operator >=(const Storage & other) const
3215  {
3216  return handle >= other.handle;
3217  }
3218  __INLINE bool Storage::operator ==(const Storage & other) const
3219  {
3220  return handle == other.handle;
3221  }
3222  __INLINE bool Storage::operator !=(const Storage & other) const
3223  {
3224  return handle != other.handle;
3225  }
3227  {
3228  return this;
3229  }
3231  {
3232  return this;
3233  }
3235  {
3236  return *this;
3237  }
3238  __INLINE const Storage & Storage::self() const
3239  {
3240  return *this;
3241  }
3243  {
3244  return GetMeshLink()->Real(GetHandle(),tag);
3245  }
3247  {
3248  return GetMeshLink()->Integer(GetHandle(),tag);
3249  }
3251  {
3252  return GetMeshLink()->Bulk(GetHandle(),tag);
3253  }
3255  {
3256  return GetMeshLink()->Reference(GetHandle(),tag);
3257  }
3259  {
3260  return GetMeshLink()->RemoteReference(GetHandle(),tag);
3261  }
3263  {
3264  return GetMeshLink()->RealArray(GetHandle(),tag);
3265  }
3267  {
3268  return GetMeshLink()->IntegerArray(GetHandle(),tag);
3269  }
3271  {
3272  return GetMeshLink()->BulkArray(GetHandle(),tag);
3273  }
3275  {
3276  return GetMeshLink()->ReferenceArray(GetHandle(),tag);
3277  }
3279  {
3280  return GetMeshLink()->RemoteReferenceArray(GetHandle(),tag);
3281  }
3283  {
3284  return GetMeshLink()->RealArrayDF(GetHandle(),tag);
3285  }
3287  {
3288  return GetMeshLink()->IntegerArrayDF(GetHandle(),tag);
3289  }
3291  {
3292  return GetMeshLink()->BulkArrayDF(GetHandle(),tag);
3293  }
3295  {
3296  return GetMeshLink()->ReferenceArrayDF(GetHandle(),tag);
3297  }
3299  {
3300  return GetMeshLink()->RemoteReferenceArrayDF(GetHandle(),tag);
3301  }
3303  {
3304  return GetMeshLink()->RealDF(GetHandle(),tag);
3305  }
3307  {
3308  return GetMeshLink()->IntegerDF(GetHandle(),tag);
3309  }
3311  {
3312  return GetMeshLink()->BulkDF(GetHandle(),tag);
3313  }
3315  {
3316  return GetMeshLink()->ReferenceDF(GetHandle(),tag);
3317  }
3319  {
3320  return GetMeshLink()->RemoteReferenceDF(GetHandle(),tag);
3321  }
3323  {
3324  return GetMeshLink()->RealArrayDV(GetHandle(),tag);
3325  }
3327  {
3328  return GetMeshLink()->IntegerArrayDV(GetHandle(),tag);
3329  }
3331  {
3332  return GetMeshLink()->BulkArrayDV(GetHandle(),tag);
3333  }
3335  {
3336  return GetMeshLink()->ReferenceArrayDV(GetHandle(),tag);
3337  }
3339  {
3340  return GetMeshLink()->RemoteReferenceArrayDV(GetHandle(),tag);
3341  }
3343  {
3344  return GetMeshLink()->RealDV(GetHandle(),tag);
3345  }
3347  {
3348  return GetMeshLink()->IntegerDV(GetHandle(),tag);
3349  }
3351  {
3352  return GetMeshLink()->BulkDV(GetHandle(),tag);
3353  }
3355  {
3356  return GetMeshLink()->ReferenceDV(GetHandle(),tag);
3357  }
3359  {
3360  return GetMeshLink()->RemoteReferenceDV(GetHandle(),tag);
3361  }
3362 #if defined(USE_AUTODIFF)
3364  {
3365  return GetMeshLink()->Variable(GetHandle(),tag);
3366  }
3368  {
3369  return GetMeshLink()->VariableDF(GetHandle(),tag);
3370  }
3372  {
3373  return GetMeshLink()->VariableDV(GetHandle(),tag);
3374  }
3376  {
3377  return GetMeshLink()->VariableArray(GetHandle(),tag);
3378  }
3380  {
3381  return GetMeshLink()->VariableArrayDF(GetHandle(),tag);
3382  }
3384  {
3385  return GetMeshLink()->VariableArrayDV(GetHandle(),tag);
3386  }
3387 #endif
3388  __INLINE bool Storage::HaveData(const Tag & tag) const
3389  {
3390  assert(isValid());
3391  return GetMeshLink()->HaveData(GetHandle(),tag);
3392  }
3394  {
3395  return GetMeshLink()->GetDataSize(GetHandle(),tag);
3396  }
3398  {
3399  return GetMeshLink()->GetDataCapacity(GetHandle(),tag);
3400  }
3401  __INLINE void Storage::SetDataSize(const Tag & tag,INMOST_DATA_ENUM_TYPE new_size) const
3402  {
3403  GetMeshLink()->SetDataSize(GetHandle(),tag,new_size);
3404  }
3406  {
3407  return GetHandleElementType(handle);
3408  }
3410  {
3411  return GetHandleElementNum(handle);
3412  }
3413  __INLINE void Storage::GetData(const Tag & tag,INMOST_DATA_ENUM_TYPE shift, INMOST_DATA_ENUM_TYPE size, void * data_out) const
3414  {
3415  GetMeshLink()->GetData(GetHandle(),tag,shift,size,data_out);
3416  }
3417  __INLINE void Storage::SetData(const Tag & tag,INMOST_DATA_ENUM_TYPE shift, INMOST_DATA_ENUM_TYPE size, const void * data_in) const
3418  {
3419  GetMeshLink()->SetData(GetHandle(),tag,shift,size,data_in);
3420  }
3421  __INLINE void Storage::DelData(const Tag & tag) const
3422  {
3423  GetMeshLink()->DelData(GetHandle(),tag);
3424  }
3425  __INLINE void Storage::DelDenseData(const Tag & tag) const
3426  {
3428  }
3429  __INLINE void Storage::DelSparseData(const Tag & tag) const
3430  {
3432  }
3434  {
3435  assert( isValid() );
3437  }
3439  {
3440  assert( isValid() );
3441  return GetMeshLink()->GetMarker(GetHandle(),n);
3442  }
3444  {
3445  assert( isValid() );
3447  }
3449  {
3450  assert( isValid() );
3452  }
3454  {
3455  assert( isValid() );
3456  return GetMeshLink()->GetPrivateMarker(GetHandle(),n);
3457  }
3459  {
3460  assert( isValid() );
3462  }
3464  {
3466  }
3467  __INLINE void Storage::GetMarkerSpace(Storage::bulk copy[MarkerFields]) const
3468  {
3470  }
3471  __INLINE void Storage::SetMarkerSpace(Storage::bulk source[MarkerFields]) const
3472  {
3473  GetMeshLink()->SetMarkerSpace(GetHandle(),source);
3474  }
3476  {
3477  return handle != InvalidHandle() && GetMeshLink() != NULL && GetMeshLink()->isValidElement(handle);
3478  }
3480  {
3481  return GetHandleID(handle);
3482  }
3484  {
3485  return GetMeshLink()->DataLocalID(GetHandle());
3486  }
3488  {
3489  assert(GetElementType() & (NODE | EDGE | FACE | CELL | ESET) );
3490  return Element(GetMeshLink(), GetHandle());
3491  }
3493  {
3494  assert(GetElementType() == NODE);
3495  return Node(GetMeshLink(),GetHandle());
3496  }
3498  {
3499  assert(GetElementType() == EDGE);
3500  return Edge(GetMeshLink(),GetHandle());
3501  }
3503  {
3504  assert(GetElementType() == FACE);
3505  return Face(GetMeshLink(),GetHandle());
3506  }
3508  {
3509  assert(GetElementType() == CELL);
3510  return Cell(GetMeshLink(),GetHandle());
3511  }
3513  {
3514  assert(GetElementType() == ESET);
3515  return ElementSet(GetMeshLink(),GetHandle());
3516  }
3518  {
3519  return m_link;
3520  }
3522  {
3523  return handle;
3524  }
3525 
3526 }
3527 
3528  //Implementation of inlined functions
3529 //#include "Source/Data/storage_inline.hpp"
3530 
3531 #endif
3532 
3533 #endif // INMOST_MESH_H_INCLUDED
void RemoveGhost()
Delete all the ghost cells.
const_reverse_iterator & operator++()
Definition: inmost_mesh.h:213
bool isValidHandleRange(HandleType h) const
ElementArray< Cell > NeighbouringCells() const
Get all cells that share the face with the current cell.
void Destroy(HandleType h)
const_iterator(Mesh *m, const cont_t::const_iterator &other)
Definition: inmost_mesh.h:197
void SortSet(ComparatorType comp) const
void PutElements(const ElementArray< EType > &elems) const
Put multiple handles without checking.
Definition: inmost_mesh.h:1006
ElementSet GetSibling() const
Retrieve sibling set of the set, this will be next child for the parent.
__INLINE iterator begin()
Definition: container.hpp:1854
iteratorSet EndSet()
__INLINE bool operator>=(const base_iterator &other) const
Definition: inmost_mesh.h:2901
__INLINE integer NumberOfNodes() const
Definition: inmost_mesh.h:2840
void ReorderApply(Tag index, ElementType mask)
var_array VariableArray(HandleType h, const Tag &tag)
void ReleasePrivateMarker(MarkerType n)
const HandleType & operator*() const
Definition: inmost_mesh.h:1164
BulkDFComparator & operator=(BulkDFComparator const &other)
Definition: inmost_mesh.h:3180
__INLINE integer & IntegerDF(const Tag &tag) const
Definition: inmost_mesh.h:3306
#define INMOST_DATA_BIG_ENUM_TYPE
void SavePMF(std::string File)
HandleType LastHandle(ElementType etype) const
Definition: inmost_mesh.h:2804
enumerator CountSiblings() const
How many there are siblings to the right of me including me.
__INLINE const Tag & SharedTag() const
Definition: inmost_mesh.h:1328
__INLINE bool operator!=(const Storage &other) const
Definition: inmost_mesh.h:3222
iteratorEdge BeginEdge()
__INLINE const Tag & LayersTag() const
Definition: inmost_mesh.h:1330
void SetDataSize(HandleType h, const Tag &tag, enumerator new_size)
Cell(Mesh *m, HandleType h)
Basic constructor with fixed handle.
Definition: inmost_mesh.h:648
static const GeometricType Line
Definition: inmost_mesh.h:286
reference & ReferenceDF(HandleType h, const Tag &tag)
Definition: inmost_mesh.h:1630
__INLINE void reserve(size_type n)
Definition: inmost_mesh.h:255
__INLINE integer NumberOfAll() const
Definition: inmost_mesh.h:2842
const_iterator & operator=(const_iterator const &other)
Definition: inmost_mesh.h:203
static bool TestSplitEdge(Edge e, const ElementArray< Node > &nodes, MarkerType del_protect)
__INLINE INMOST_DATA_ENUM_TYPE GetDataCapacity(const Tag &tag) const
Definition: inmost_mesh.h:3397
__INLINE remote_reference_array RemoteReferenceArrayDV(const Tag &tag) const
Definition: inmost_mesh.h:3338
void SetStatus(Status status) const
__INLINE const Tag & CoordsTag() const
Definition: inmost_mesh.h:1322
virtual ElementArray< Node > getNodes() const
Face(const Face &other)
Definition: inmost_mesh.h:554
__INLINE Node getAsNode() const
Definition: inmost_mesh.h:3492
ElementSet EsetByLocalID(integer lid)
Definition: inmost_mesh.h:2810
shell< real > real_array
Storage type for representing arrays of real values.
Definition: inmost_data.h:290
ElementArray< Edge > getEdges() const
real Integrate(real input)
bool operator()(HandleType a, HandleType b) const
Definition: inmost_mesh.h:3126
void(* ReduceOperation)(const Tag &tag, const Element &element, const INMOST_DATA_BULK_TYPE *recv_data, INMOST_DATA_ENUM_TYPE recv_size)
Definition: inmost_mesh.h:2145
void RemoveGhostElements(const ElementArray< EType > &ghost)
Definition: inmost_mesh.h:2380
BulkComparator & operator=(BulkComparator const &other)
Definition: inmost_mesh.h:3147
bool CheckElementConnectivity() const
void RemPrivateMarkerArray(const HandleType *h, enumerator n, MarkerType m)
Definition: inmost_mesh.h:1924
__INLINE var_array VariableArrayDV(const Tag &tag) const
Definition: inmost_mesh.h:3383
ElementArray< Face > getFaces() const
bulk & Bulk(HandleType h, const Tag &tag)
bulk_array BulkArray(HandleType h, const Tag &tag)
__INLINE const Tag & OwnerTag() const
Definition: inmost_mesh.h:1329
MarkerType CreateMarker()
iterator End() const
remote_reference & RemoteReference(HandleType h, const Tag &tag)
void SwapCells()
bool Planarity() const
integer_array IntegerArrayDV(HandleType h, const Tag &tag)
Definition: inmost_mesh.h:1827
void SetParallelFileStrategy(int strategy)
Definition: inmost_mesh.h:2345
ElementArray< Element > Intersection(const ElementSet &other) const
INMOST_DATA_BULK_TYPE GeometricType
Definition: inmost_mesh.h:283
void Intersect(const ElementArray< EType > &other)
Definition: inmost_mesh.h:270
std::pair< Face, bool > CreateFace(const ElementArray< Edge > &edges)
BulkDFComparator(const BulkDFComparator &other)
Definition: inmost_mesh.h:3179
__INLINE real_array RealArrayDF(const Tag &tag) const
Definition: inmost_mesh.h:3282
Element::adj_type const & LowConn(HandleType h) const
Access directly lower order adjacencies of current element without right of modification.
Definition: inmost_mesh.h:1982
__INLINE Face getAsFace() const
Definition: inmost_mesh.h:3502
int GetParallelFileStrategy()
Definition: inmost_mesh.h:2348
void LoadMKF(std::string File)
__INLINE reference & ReferenceDF(const Tag &tag) const
Definition: inmost_mesh.h:3314
ElementArray(Mesh *m_link)
Definition: inmost_mesh.h:151
void ComputeGeometricType(HandleType h)
__INLINE void push_back(HandleType x)
Definition: inmost_mesh.h:250
BulkDFComparator(Mesh *m, Tag t)
Definition: inmost_mesh.h:3178
__INLINE bool operator<(const Storage &other) const
Inline functions for class Storage //.
Definition: inmost_mesh.h:3202
__INLINE const_iterator begin() const
Definition: inmost_mesh.h:230
bool FaceOrientedOutside(Cell c) const
__INLINE element & front()
Definition: container.hpp:1768
void ExchangeDataEnd(const Tag &tag, ElementType mask, MarkerType select, exchange_data &storage)
__INLINE reverse_iterator rbegin()
Definition: container.hpp:1858
void ApplyModification()
__INLINE integer & Integer(const Tag &tag) const
Definition: inmost_mesh.h:3246
void RecomputeGeometricData(HandleType e)
__INLINE void SetEpsilon(real e)
Definition: inmost_mesh.h:1304
__INLINE integer_array IntegerArray(const Tag &tag) const
Definition: inmost_mesh.h:3266
static const GeometricType Set
Definition: inmost_mesh.h:297
void RemMarkerElements(MarkerType m, ElementType etype=ESET|CELL|FACE|EDGE|NODE) const
Remove markers from all the elements of given type.
bool operator()(HandleType a, HandleType b) const
Definition: inmost_mesh.h:3103
chunk_array< integer, chunk_bits_elems > links_container
Definition: inmost_mesh.h:1212
bool Hidden() const
_reverse_iterator< HandleType > reverse_iterator
Definition: container.hpp:1608
void SetParallelStrategy(int strategy)
Definition: inmost_mesh.h:2301
static const GeometricType Polygon
Definition: inmost_mesh.h:290
bool DeleteSet()
Remove the set and resolve it&#39;s ierarchical structure.
iteratorFace BeginFace()
ElementArray & operator=(ElementArray const &other)
Definition: inmost_mesh.h:157
ptrdiff_t operator-(const iterator &other) const
Definition: inmost_mesh.h:165
RealDFComparator(const RealDFComparator &other)
Definition: inmost_mesh.h:3157
__INLINE iterator begin()
Definition: inmost_mesh.h:226
static __INLINE HandleType & hSorted(Element::adj_type &arr)
Definition: inmost_mesh.h:919
bool CheckNormalOrientation() const
RealComparator(Mesh *m, Tag t)
Definition: inmost_mesh.h:3123
Edge & operator=(Edge const &other)
Definition: inmost_mesh.h:501
reverse_iterator operator+(size_t n)
Definition: inmost_mesh.h:183
std::map< int, element_set > proc_elements
Definition: inmost_mesh.h:2149
std::pair< Cell, bool > CreateCell(const ElementArray< Face > &faces, const ElementArray< Node > &suggest_nodes_order=ElementArray< Node >(NULL))
bool operator()(HandleType a, HandleType b) const
Definition: inmost_mesh.h:3181
__INLINE StorageType back() const
Definition: inmost_mesh.h:240
static const GeometricType MultiLine
Definition: inmost_mesh.h:287
ElementArray< Edge > BridgeAdjacencies2Edge(ElementType Bridge, MarkerType mask=0, bool invert_mask=false) const
bool isValidElement(integer etypenum, integer lid) const
Definition: inmost_mesh.h:1404
Storage::real_array Coords() const
INMOST_DATA_BULK_TYPE GeometricData
Definition: inmost_mesh.h:24
Cell(const Cell &other)
Copy constructor.
Definition: inmost_mesh.h:665
__INLINE bulk & BulkDV(const Tag &tag) const
Definition: inmost_mesh.h:3350
reference & ReferenceDV(HandleType h, const Tag &tag)
Definition: inmost_mesh.h:1793
void OrientedUnitNormal(Cell c, real *nrm) const
__INLINE const HandleType * data() const
Definition: inmost_mesh.h:258
bool FindHandle(HandleType h, bool use_comparator) const
__INLINE bulk_array BulkArrayDV(const Tag &tag) const
Definition: inmost_mesh.h:3330
__INLINE iterator end()
Definition: container.hpp:1855
__INLINE HandleType & atfront()
Definition: inmost_mesh.h:243
void EndSequentialCode()
INMOST_DATA_ENUM_TYPE TopologyCheck
to accomodate more topological errors or events.
Definition: inmost_mesh.h:44
Node * operator->()
Definition: inmost_mesh.h:476
__INLINE integer_array IntegerArrayDV(const Tag &tag) const
Definition: inmost_mesh.h:3326
std::vector< proc_buffer_type > exch_buffer_type
Definition: inmost_mesh.h:2151
static void Finalize()
Finalizes operation with MPI, recomended to call, otherwise MPI may produce warnings.
__INLINE remote_reference_array RemoteReferenceArray(const Tag &tag) const
Definition: inmost_mesh.h:3278
Edge * operator->()
Definition: inmost_mesh.h:502
integer Enumerate(ElementType mask, Tag num_tag, integer start=0, bool define_sparse=false)
std::pair< int, buffer_type > proc_buffer_type
Definition: inmost_mesh.h:2150
enumerator MemoryUsage(HandleType h)
bool HaveGeometricData(GeometricData type, ElementType mask) const
Definition: inmost_mesh.h:3000
void SortByGlobalID(HandleType *h, enumerator num)
HandleType NextHandle(HandleType h) const
void RemTopologyCheck(TopologyCheck mask)
Remove topology checks.
__INLINE StorageType front()
Definition: inmost_mesh.h:237
__INLINE integer GetDimensions() const
Definition: inmost_mesh.h:1317
var & VariableDV(HandleType h, const Tag &tag)
Definition: inmost_mesh.h:1891
bool GetPrivateMarker(HandleType h, MarkerType n) const
void PutElement(const Storage &e) const
Definition: inmost_mesh.h:999
ElementArray< Element > Union(const ElementArray< EType > &elems) const
Compute and return union with elements.
Definition: inmost_mesh.h:1042
__INLINE dense_sub_type const & GetDenseData(int pos) const
Definition: inmost_data.h:254
virtual ~Element()
Definition: inmost_mesh.h:330
Element FindElementByCentroid(real *centroid) const
void GetData(HandleType h, const Tag &tag, enumerator shift, enumerator size, void *data) const
integer_array IntegerArrayDF(HandleType h, const Tag &tag)
Definition: inmost_mesh.h:1669
Element FindElementByGlobalID(integer global_id) const
static const GeometricType Pyramid
Definition: inmost_mesh.h:295
__INLINE bool OneType(ElementType t)
Definition: inmost_data.h:38
base_iterator(const base_iterator &other)
Definition: inmost_mesh.h:2887
HandleType reference
Storage type for representing references to Element.
Definition: inmost_data.h:286
void RemoveGeometricData(GeomParam table)
__INLINE bool operator<=(const Storage &other) const
Definition: inmost_mesh.h:3210
__INLINE var & Variable(const Tag &tag) const
Retrieve variable reference associated with Tag.
Definition: inmost_mesh.h:3363
remote_reference_array RemoteReferenceArrayDV(HandleType h, const Tag &tag)
Definition: inmost_mesh.h:1886
tiny_map< GeometricData, ElementType, 5 > GeomParam
Definition: inmost_mesh.h:2992
static const GeometricType MeshPart
Definition: inmost_mesh.h:298
__INLINE Storage & self()
Definition: inmost_mesh.h:3234
void SetMeshName(std::string new_name)
Be careful changing mesh name if you have already established remote links.
ElementArray< Element > Intersection(const ElementArray< EType > &elems) const
Compute and return intersection with elements.
Definition: inmost_mesh.h:1060
__INLINE INMOST_DATA_INTEGER_TYPE ElementNum(ElementType t)
Definition: inmost_data.h:45
bool operator()(HandleType a, HandleType b) const
real_array RealArrayDF(HandleType h, const Tag &tag)
Definition: inmost_mesh.h:1656
__INLINE StorageType back()
Definition: inmost_mesh.h:239
bool Delete(HandleType h)
integer GlobalID(HandleType h) const
Definition: inmost_mesh.h:2055
Node getBeg() const
integer LastLocalID(ElementType etype) const
Definition: inmost_mesh.h:2833
iterator insert(iterator pos, const element &x)
Definition: container.hpp:1881
integer TotalNumberOf(ElementType mask)
An interface for elements of type FACE.
Definition: inmost_mesh.h:550
size_type size() const
Definition: container.hpp:2294
void SetDimensions(integer dim)
INMOST_DATA_INTEGER_TYPE integer
Storage type for representing integer values.
Definition: inmost_data.h:280
void RemMarker(HandleType h, MarkerType n)
Definition: inmost_mesh.h:1916
adj_type::const_iterator const_adj_iterator
Definition: inmost_mesh.h:312
Tag DeleteTag(Tag tag, ElementType mask=NODE|EDGE|FACE|CELL|ESET|MESH)
integer & Integer(HandleType h, const Tag &tag)
ElementSet(Mesh *m, HandleType *h)
Definition: inmost_mesh.h:928
__INLINE bool operator<=(const base_iterator &other) const
Definition: inmost_mesh.h:2900
Node & operator=(Node const &other)
Definition: inmost_mesh.h:475
__INLINE HandleType & atback()
Definition: inmost_mesh.h:244
static bool TestUniteEdges(const ElementArray< Edge > &edges, MarkerType del_protect)
bool isParallelFileFormat(std::string File)
void LoadPVTK(std::string File)
integer FaceNextLocalID(integer lid) const
Definition: inmost_mesh.h:2814
RealComparator & operator=(RealComparator const &other)
Definition: inmost_mesh.h:3125
int GetParallelStrategy()
Definition: inmost_mesh.h:2304
__INLINE const Node & InvalidNode()
Definition: inmost_mesh.h:492
ElementArray< Element > BridgeAdjacencies(ElementType Bridge, ElementType Dest, MarkerType mask=0, bool invert_mask=false) const
bool operator()(HandleType a, HandleType b) const
Definition: inmost_mesh.h:3170
sparse_type::size_type senum
Definition: inmost_mesh.h:1220
INMOST_MPI_Comm GetCommunicator()
Retrieve MPI communicator.
bool Hide() const
integer DataLocalID(HandleType h) const
Definition: inmost_mesh.h:2060
iteratorEdge EndEdge()
int CompareElements(HandleType a, HandleType b) const
Edge(Mesh *m, HandleType h)
Definition: inmost_mesh.h:499
void RecomputeParallelStorage(ElementType mask)
enumerator nbAdjElements(ElementType etype) const
Retrieve all elements by type.
bool isValidEdge(integer lid) const
Definition: inmost_mesh.h:1408
bool Hidden(HandleType h) const
bool operator()(HandleType a, HandleType b) const
Definition: inmost_mesh.h:3148
__INLINE base_iterator operator--(int)
Definition: inmost_mesh.h:2892
bool Show() const
static const GeometricType Unset
Definition: inmost_mesh.h:284
__INLINE var & VariableDV(const Tag &tag) const
Definition: inmost_mesh.h:3371
void SetMarker(MarkerType n) const
static const GeometricType Prism
Definition: inmost_mesh.h:294
__INLINE const Tag & SendtoTag() const
Definition: inmost_mesh.h:1327
void EndModification()
__INLINE iteratorTag BeginTag()
Definition: inmost_mesh.h:1368
Element operator->() const
Definition: inmost_mesh.h:1165
BulkComparator(Mesh *m, Tag t)
Definition: inmost_mesh.h:3145
iterator(const iterator &other)
Definition: inmost_mesh.h:1153
ElementSet GetParent() const
Retrieve parent of the set.
__INLINE void swap(ElementArray< StorageType > &other)
Definition: inmost_mesh.h:247
void LoadECL(std::string File)
__INLINE real_array RealArray(const Tag &tag) const
Definition: inmost_mesh.h:3262
void AddSibling(const ElementSet &sibling) const
This will create new child for the parent.
__INLINE void RemPrivateMarker(MarkerType n) const
Definition: inmost_mesh.h:3458
static const GeometricType Tet
Definition: inmost_mesh.h:292
integer & IntegerDF(HandleType h, const Tag &tag)
Definition: inmost_mesh.h:1608
Cell BackCell() const
Retrieve the cell for which the normal points outwards.
CentroidComparator & operator=(CentroidComparator const &other)
Definition: inmost_mesh.h:3089
__INLINE ElementType GetHandleElementType(HandleType h)
Definition: inmost_data.h:93
static const ComparatorType HANDLE_COMPARATOR
Definition: inmost_mesh.h:925
Storage::real Area() const
static const ComparatorType GLOBALID_COMPARATOR
Definition: inmost_mesh.h:922
#define INMOST_MPI_Comm
void resize(size_type n, element c=element())
Definition: container.hpp:1772
integer & IntegerDV(HandleType h, const Tag &tag)
Definition: inmost_mesh.h:1764
Edge(Mesh *m, HandleType *h)
Definition: inmost_mesh.h:500
bool Show(HandleType h)
RealComparator(const RealComparator &other)
Definition: inmost_mesh.h:3124
ElementArray< Element > Difference(const ElementArray< EType > &elems) const
Compute and return difference with elements.
Definition: inmost_mesh.h:1051
bool HaveData(HandleType h, const Tag &tag) const
bool isValidElementSet(integer lid) const
Definition: inmost_mesh.h:1410
Edge EdgeByLocalID(integer lid)
Definition: inmost_mesh.h:2807
integer NextLocalID(ElementType etype, integer lid) const
Definition: inmost_mesh.h:2829
void DelSparseData(HandleType h, const Tag &tag)
cont_t::size_type size_type
Definition: inmost_mesh.h:143
__INLINE const Tag & SetComparatorTag() const
Definition: inmost_mesh.h:1334
void AddChild(const ElementSet &child) const
Add child to current set.
Status GetStatus() const
GlobalIDComparator & operator=(GlobalIDComparator const &other)
Definition: inmost_mesh.h:3102
Face(Mesh *m, HandleType h)
Definition: inmost_mesh.h:555
__INLINE void SetMarkerSpace(bulk source[MarkerFields]) const
Definition: inmost_mesh.h:3471
integer PrevLocalID(ElementType etype, integer lid) const
Definition: inmost_mesh.h:2830
virtual enumerator nbAdjElements(ElementType etype) const
Cell Neighbour(Face face) const
Get a cell that share a face with the current cell.
__INLINE bool operator==(const base_iterator &other) const
Definition: inmost_mesh.h:2896
void RestoreCellNodes(HandleType hc, ElementArray< Node > &ret)
void SetPrivateMarkerElements(MarkerType m, ElementType etype=ESET|CELL|FACE|EDGE|NODE) const
void UpdateGeometricData() const
Update geometric data for element, calls RecomputeGeometricData from Mesh.
#define INMOST_DATA_BULK_TYPE
virtual ElementArray< Face > getFaces() const
base_iterator< Element > iteratorElement
Definition: inmost_mesh.h:2847
std::vector< INMOST_DATA_BULK_TYPE > buffer_type
Definition: inmost_mesh.h:2148
IntegerDFComparator & operator=(IntegerDFComparator const &other)
Definition: inmost_mesh.h:3169
reverse_iterator & operator=(reverse_iterator const &other)
Definition: inmost_mesh.h:189
integer EnumerateSet(const ElementSet &set, const Tag &num_tag, integer start=0, bool define_sparse=true)
ComparatorType GetComparator() const
Retrieve current set comparator.
__INLINE reference & ReferenceDV(const Tag &tag) const
Definition: inmost_mesh.h:3354
bulk_array BulkArrayDV(HandleType h, const Tag &tag)
Definition: inmost_mesh.h:1836
IntegerComparator & operator=(IntegerComparator const &other)
Definition: inmost_mesh.h:3136
bool isValidFace(integer lid) const
Definition: inmost_mesh.h:1407
void SaveGMV(std::string File)
__INLINE const Edge & InvalidEdge()
Definition: inmost_mesh.h:527
iterator Begin() const
__INLINE HandleType * data()
Definition: inmost_mesh.h:257
void SetTopologyError(TopologyCheck mask)
This will turn mesh into the state indicating that some topology error occured.
Definition: inmost_mesh.h:3076
void ReleaseMarker(MarkerType n)
__INLINE Mesh * GetMeshLink() const
Definition: inmost_mesh.h:3517
__INLINE real & RealDV(const Tag &tag) const
Definition: inmost_mesh.h:3342
_iterator< HandleType > iterator
Definition: container.hpp:1570
__INLINE HandleType GetHandle() const
Definition: inmost_mesh.h:3521
integer NumberOf(ElementType t) const
bool operator!=(const iterator &other) const
Definition: inmost_mesh.h:1159
__INLINE integer GetElementNum() const
Definition: inmost_mesh.h:3409
real_array RealArrayDV(HandleType h, const Tag &tag)
Definition: inmost_mesh.h:1818
void SynchronizeMarker(MarkerType marker, ElementType mask, SyncBitOp op)
static const Status Any
Definition: inmost_mesh.h:307
static __INLINE HandleType & hChild(Element::adj_type &arr)
Definition: inmost_mesh.h:918
void SetPrivateMarker(MarkerType n) const
__INLINE void SetPrivateMarker(MarkerType n) const
Definition: inmost_mesh.h:3448
iterator EndSorted() const
__INLINE Mesh * GetMeshLink() const
Definition: inmost_mesh.h:259
var_array VariableArrayDV(HandleType h, const Tag &tag)
Definition: inmost_mesh.h:1894
void Subtract(const HandleType *h, INMOST_DATA_ENUM_TYPE num)
virtual ElementArray< Edge > getEdges() const
__INLINE remote_reference & RemoteReference(const Tag &tag) const
Definition: inmost_mesh.h:3258
_reverse_iterator< const HandleType > const_reverse_iterator
Definition: container.hpp:1609
__INLINE ElementType GetElementType() const
Definition: inmost_mesh.h:3405
iterator erase(iterator pos)
Definition: container.hpp:1862
ElementArray< Element > Difference(const ElementSet &other) const
static const Status Owned
Definition: inmost_mesh.h:304
void ClearMarkerSpace(HandleType h)
Remove all the markers from the element.
void UnitNormal(real *nrm) const
integer NodeNextLocalID(integer lid) const
Definition: inmost_mesh.h:2812
static bool TestSplitFace(Face face, const ElementArray< Edge > &edges, MarkerType del_protect)
Cell * operator->()
Operator of dereference to pointer.
Definition: inmost_mesh.h:680
Node getEnd() const
__INLINE bool operator!=(const base_iterator &other) const
Definition: inmost_mesh.h:2897
bool operator<(const iterator &other) const
Definition: inmost_mesh.h:1160
const_reverse_iterator & operator=(const_reverse_iterator const &other)
Definition: inmost_mesh.h:217
std::forward_iterator_tag iterator_category
Definition: inmost_mesh.h:1151
adj_type::const_reverse_iterator const_adj_reverse_iterator
Definition: inmost_mesh.h:314
adj_type::reverse_iterator adj_reverse_iterator
Definition: inmost_mesh.h:313
__INLINE ElementSet getAsSet() const
Definition: inmost_mesh.h:3512
bool Empty() const
Is there any elements in the set.
iterator & operator=(iterator const &other)
Definition: inmost_mesh.h:1155
__INLINE StorageType front() const
Definition: inmost_mesh.h:238
__INLINE void SetMeshLink(Mesh *m)
Definition: inmost_mesh.h:260
static Cell UniteCells(ElementArray< Cell > &cells, MarkerType del_protect)
Unite a set of given cells into one cell.
Node CreateNode(const real *coords)
__INLINE Tag RedistributeTag()
Definition: inmost_mesh.h:1337
Node(Mesh *m, HandleType *h)
Definition: inmost_mesh.h:474
void ResolveShared()
Element::adj_type const & HighConn(HandleType h) const
Access directly higher order adjacencies of current element without right of modification.
Definition: inmost_mesh.h:1968
void ReorderEmpty() const
Compact holes in inner representation.
__INLINE void SetData(const Tag &tag, INMOST_DATA_ENUM_TYPE shift, INMOST_DATA_ENUM_TYPE size, const void *data) const
Definition: inmost_mesh.h:3417
bool operator>(const iterator &other) const
Definition: inmost_mesh.h:1161
Face * operator->()
Definition: inmost_mesh.h:558
__INLINE const Tag & GeomTypeTag() const
Definition: inmost_mesh.h:1326
iteratorCell BeginCell()
Cell()
Basic constructor.
Definition: inmost_mesh.h:641
IntegerDFComparator(const IntegerDFComparator &other)
Definition: inmost_mesh.h:3168
HandleType FirstHandle(ElementType etype) const
Definition: inmost_mesh.h:2803
__INLINE remote_reference & RemoteReferenceDV(const Tag &tag) const
Definition: inmost_mesh.h:3358
reference_array ReferenceArrayDF(HandleType h, const Tag &tag)
Definition: inmost_mesh.h:1711
real & RealDF(HandleType h, const Tag &tag)
Definition: inmost_mesh.h:1599
ElementArray< Face > getFaces() const
Cell & operator=(Cell const &other)
Assignment operator.
Definition: inmost_mesh.h:674
integer LastLocalID(integer n) const
Definition: inmost_mesh.h:2832
ElementArray< Cell > getCells() const
static const GeometricType Quad
Definition: inmost_mesh.h:289
void Save(std::string File)
void Unite(const ElementArray< EType > &elems) const
Compute and store union with elements.
Definition: inmost_mesh.h:1068
INMOST_DATA_BULK_TYPE ElementType
Definition: inmost_data.h:23
remote_reference & RemoteReferenceDV(HandleType h, const Tag &tag)
Definition: inmost_mesh.h:1809
void SetGeometricType(HandleType h, Element::GeometricType type)
Definition: inmost_mesh.h:2041
real AggregateMin(real input)
void RemPrivateMarkerElements(MarkerType m, ElementType etype=ESET|CELL|FACE|EDGE|NODE) const
std::string GetFileOption(std::string key)
__INLINE Cell getAsCell() const
Definition: inmost_mesh.h:3507
iteratorFace EndFace()
__INLINE const Tag & BridgeTag() const
Definition: inmost_mesh.h:1331
static bool TestUniteCells(const ElementArray< Cell > &cells, MarkerType del_protect)
Test that no marked element will be deleted during union of given cells.
GlobalIDComparator(const GlobalIDComparator &other)
Definition: inmost_mesh.h:3101
ElementArray< Edge > getEdges() const
int GetProcessorsNumber()
Get number of processors.
reverse_iterator(const reverse_iterator &other)
Definition: inmost_mesh.h:181
integer HandleDataPos(HandleType h)
For debug purposes.
Definition: inmost_mesh.h:1272
HandleType * getHandles() const
__INLINE integer & IntegerDV(const Tag &tag) const
Definition: inmost_mesh.h:3346
static const char * StatusName(Status s)
static void Initialize(int *argc, char ***argv)
void Connect(const HandleType *adjacent, INMOST_DATA_ENUM_TYPE num) const
Connects lower adjacencies to current element. Geometric data and cell nodes are updated automaticall...
ElementSet(Mesh *m, HandleType h)
Definition: inmost_mesh.h:927
ptrdiff_t operator-(const reverse_iterator &other) const
Definition: inmost_mesh.h:182
bool operator()(HandleType a, HandleType b) const
Definition: inmost_mesh.h:3137
__INLINE const ElementSet & InvalidElementSet()
Definition: inmost_mesh.h:1203
std::pair< ElementSet, bool > CreateSet(std::string name)
INMOST_DATA_BULK_TYPE SyncBitOp
Definition: inmost_mesh.h:35
Cell FrontCell() const
Retrieve the cell for which the normal points inwards.
HierarchyComparator(const HierarchyComparator &other)
Definition: inmost_mesh.h:3112
bulk & BulkDF(HandleType h, const Tag &tag)
Definition: inmost_mesh.h:1617
iterator(Mesh *m, Element::adj_type const *ptr, Element::adj_type::size_type pos)
Definition: inmost_mesh.h:1154
void GetGeometricData(HandleType e, GeometricData type, real *ret)
std::string GetMeshName()
Retrive the name of the current mesh.
__INLINE var_array VariableArrayDF(const Tag &tag) const
Definition: inmost_mesh.h:3379
__INLINE INMOST_DATA_ENUM_TYPE GetDataSize(const Tag &tag) const
Definition: inmost_mesh.h:3393
Element::adj_type & HighConn(HandleType h)
Definition: inmost_mesh.h:1966
__INLINE integer FaceLastLocalID() const
Definition: inmost_mesh.h:2826
bool FixNormalOrientation() const
INMOST_DATA_BULK_TYPE Status
Definition: inmost_mesh.h:303
Element * operator->()
Definition: inmost_mesh.h:326
Face(Mesh *m, HandleType *h)
Definition: inmost_mesh.h:556
var_array VariableArrayDF(HandleType h, const Tag &tag)
Definition: inmost_mesh.h:1893
reverse_iterator(Mesh *m, const cont_t::reverse_iterator &other)
Definition: inmost_mesh.h:180
void SetPrivateMarker(HandleType h, MarkerType n)
__INLINE reverse_iterator rend()
Definition: inmost_mesh.h:229
tag_array_type tags
Definition: inmost_data.h:262
__INLINE integer_array IntegerArrayDF(const Tag &tag) const
Definition: inmost_mesh.h:3286
HandleType FirstHandle() const
Definition: inmost_mesh.h:2801
bool HaveSibling() const
__INLINE integer NumberOfFaces() const
Definition: inmost_mesh.h:2838
Face FaceByLocalID(integer lid)
Definition: inmost_mesh.h:2808
bool isValidCell(integer lid) const
Definition: inmost_mesh.h:1406
ElementArray< Edge > getEdges() const
Get all the edges of the current cell.
MarkerType CreatePrivateMarker()
void LoadPMF(std::string File)
bool Hide(HandleType h)
bool HaveChild() const
void ReorderEmpty(ElementType reordertypes)
bulk & BulkDV(HandleType h, const Tag &tag)
Definition: inmost_mesh.h:1777
__INLINE void GetData(const Tag &tag, INMOST_DATA_ENUM_TYPE shift, INMOST_DATA_ENUM_TYPE size, void *data) const
Definition: inmost_mesh.h:3413
void PrintElementConnectivity() const
integer CellPrevLocalID(integer lid) const
Definition: inmost_mesh.h:2821
unsigned int GetElementDimension() const
Definition: inmost_mesh.h:426
__INLINE size_type size() const
Definition: inmost_mesh.h:256
__INLINE bool isValidHandle(HandleType h)
Definition: inmost_data.h:101
Node(const Node &other)
Definition: inmost_mesh.h:472
__INLINE bool GetPrivateMarker(MarkerType n) const
Definition: inmost_mesh.h:3453
__INLINE HandleType ComposeHandleNum(INMOST_DATA_INTEGER_TYPE etypenum, INMOST_DATA_INTEGER_TYPE ID)
Definition: inmost_data.h:100
var & Variable(HandleType h, const Tag &tag)
__INLINE remote_reference & RemoteReferenceDF(const Tag &tag) const
Definition: inmost_mesh.h:3318
std::bidirectional_iterator_tag iterator_category
Definition: inmost_mesh.h:2885
void AddElement(const Storage &e) const
Definition: inmost_mesh.h:1012
Element::GeometricType GetGeometricType(HandleType h) const
Definition: inmost_mesh.h:2040
void RemPrivateMarker(MarkerType n) const
void RemoveElements(const HandleType *handles, enumerator num) const
integer & GlobalID(HandleType h)
Definition: inmost_mesh.h:2048
Edge(const Edge &other)
Definition: inmost_mesh.h:498
__INLINE iteratorTag EndTag()
Definition: inmost_mesh.h:1374
exch_buffer_type send_buffers
Definition: inmost_mesh.h:2156
void ComputeGeometricType() const
static ElementArray< Edge > SplitEdge(Edge e, const ElementArray< Node > &nodes, MarkerType del_protect)
__INLINE HandleType at(size_type n) const
Definition: inmost_mesh.h:246
bool isValidElement(HandleType h) const
Definition: inmost_mesh.h:1411
base_iterator< Face > iteratorFace
Definition: inmost_mesh.h:2850
void BeginSequentialCode()
shell< variable > var_array
Storage type for representing array of values with vectors of variations.
Definition: inmost_data.h:299
void PrepareGeometricData(GeomParam table)
__INLINE bool operator>(const Storage &other) const
Definition: inmost_mesh.h:3206
INMOST_DATA_BULK_TYPE ComparatorType
Definition: inmost_mesh.h:920
integer NodePrevLocalID(integer lid) const
Definition: inmost_mesh.h:2818
int Compare(const real *a, const real *b) const
bool New() const
void swap(dynarray< element, stacked > &other)
Definition: container.hpp:1808
bool operator<=(const iterator &other) const
Definition: inmost_mesh.h:1162
__INLINE Edge getAsEdge() const
Definition: inmost_mesh.h:3497
void SetFileOption(std::string, std::string)
__INLINE var & VariableDF(const Tag &tag) const
Definition: inmost_mesh.h:3367
__INLINE bool HaveData(const Tag &tag) const
Check if any data is associated with Tag.
Definition: inmost_mesh.h:3388
void RemoveGhostElements(const HandleType *ghost, enumerator num)
enumerator Count(const HandleType *arr, enumerator size, MarkerType marker) const
static const GeometricType Polyhedron
Definition: inmost_mesh.h:296
integer FirstLocalID(ElementType etype) const
INMOST_DATA_ENUM_TYPE GetArrayCapacity(integer etypenum)
void CastRay(real *pos, real *dir, dynarray< std::pair< Element, real >, 16 > &hits) const
bool CheckEdgeOrder() const
Check that sequence of edges form a closed loop and each edge have a node that matches one of the nod...
void SetTopologyCheck(TopologyCheck mask)
Set topology checks.
Node(Mesh *m, HandleType h)
Definition: inmost_mesh.h:473
std::vector< HandleType > element_set
Definition: inmost_mesh.h:2147
void RemMarker(MarkerType n) const
__INLINE const Tag & ProcessorsTag() const
Definition: inmost_mesh.h:1332
ElementSet GetSet(std::string name)
void RemPrivateMarker(HandleType h, MarkerType n)
void Centroid(real *cnt) const
__INLINE INMOST_DATA_ENUM_TYPE GetSize() const
Definition: inmost_data.h:664
static integer GetGeometricDimension(GeometricType m_type)
ElementSet(const ElementSet &other)
Definition: inmost_mesh.h:929
#define INMOST_MPI_Win
__INLINE void DelDenseData(const Tag &tag) const
Frees variable array or fills field with zeroes.
Definition: inmost_mesh.h:3425
iteratorStorage Begin(ElementType Types)
These iterators skip invalid elements but don&#39;t skip modified elements.
__INLINE real GetEpsilon() const
Definition: inmost_mesh.h:1307
const char * TopologyCheckNotifyString(TopologyCheck c)
void Load(std::string File)
__INLINE HandleType & at(size_type n)
Definition: inmost_mesh.h:245
bool Closure() const
Test that faces of the cell form the closed set.
ElementArray< Node > getNodes() const
Get all the nodes of the current cell.
void PutElements(const HandleType *handles, enumerator num) const
Put multiple handles without checking of the existance of duplicate.
void ClearTopologyError(TopologyCheck mask=ENUMUNDEF)
Revert mesh to clean topology error state.
Definition: inmost_mesh.h:3080
__INLINE bulk & Bulk(const Tag &tag) const
Definition: inmost_mesh.h:3250
const_iterator(const const_iterator &other)
Definition: inmost_mesh.h:198
Element ElementByLocalID(ElementType etype, integer lid)
Definition: inmost_mesh.h:2794
__INLINE void ClearMarkerSpace() const
Definition: inmost_mesh.h:3463
INMOST_DATA_BULK_TYPE bulk
Storage type for representing one byte of abstact data.
Definition: inmost_data.h:282
static Edge UniteEdges(ElementArray< Edge > &edges, MarkerType del_protect)
ElementArray< Face > GatherBoundaryFaces()
void SaveVTK(std::string File)
real_array RealArray(HandleType h, const Tag &tag)
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...
integer CellNextLocalID(integer lid) const
Definition: inmost_mesh.h:2815
Element::Status GetStatus(HandleType h) const
Definition: inmost_mesh.h:2069
__INLINE element & back()
Definition: container.hpp:1766
ElementArray< ElementSet > GetSetsByPrefix(std::string prefix)
Retrieve all the sets whose names start with given prefix.
__INLINE EType operator->()
Definition: inmost_mesh.h:2894
integer_array IntegerArray(HandleType h, const Tag &tag)
iteratorCell EndCell()
Cell CellByLocalID(integer lid)
Definition: inmost_mesh.h:2809
__INLINE ElementSet * operator->()
Definition: inmost_mesh.h:931
ElementArray< Cell > getCells() const
void RemSibling(const ElementSet &sibling) const
This will erase sibling or parent&#39;s child.
static bool CheckConnectivity(Mesh *m)
__INLINE integer NumberOfElements() const
Definition: inmost_mesh.h:2841
const cont_t & GetContainer()
Definition: inmost_mesh.h:148
bool FixEdgeOrder() const
Repair the sequence of edges so that each edge have node that matches one of the nodes at the next ed...
ElementSet GetChild() const
iteratorStorage End()
static const ComparatorType CENTROID_COMPARATOR
Definition: inmost_mesh.h:923
ElementArray< Cell > BridgeAdjacencies2Cell(ElementType Bridge, MarkerType mask=0, bool invert_mask=false) const
chunk_array< integer, chunk_bits_empty > empty_container
Definition: inmost_mesh.h:1210
__INLINE bool operator<(const base_iterator &other) const
Definition: inmost_mesh.h:2898
__INLINE HandleType ComposeHandle(ElementType etype, INMOST_DATA_INTEGER_TYPE ID)
Definition: inmost_data.h:94
void SetCommunicator(INMOST_MPI_Comm _comm)
Set MPI communicator.
base_iterator & operator--()
__INLINE integer NodeLastLocalID() const
Definition: inmost_mesh.h:2824
integer EdgeNextLocalID(integer lid) const
Definition: inmost_mesh.h:2813
void Barycenter(real *cnt) const
bool Closure() const
Element ElementByHandle(HandleType h)
Definition: inmost_mesh.h:2795
Storage::real Length() const
bool operator>=(const iterator &other) const
Definition: inmost_mesh.h:1163
__INLINE bulk & BulkDF(const Tag &tag) const
Definition: inmost_mesh.h:3310
__INLINE void SetMarker(MarkerType n) const
Definition: inmost_mesh.h:3433
HandleType handle
Definition: inmost_data.h:423
__INLINE void pop_back()
Definition: inmost_mesh.h:251
void LoadXML(std::string File)
void Destroy(const Storage &e)
Shortcut for typed elements.
Definition: inmost_mesh.h:2092
__INLINE integer NumberOfSets() const
Definition: inmost_mesh.h:2836
bool isMeshModified() const
Definition: inmost_mesh.h:3018
bulk_array BulkArrayDF(HandleType h, const Tag &tag)
Definition: inmost_mesh.h:1682
std::vector< INMOST_MPI_Request > send_reqs
Definition: inmost_mesh.h:2155
ElementArray< Element > getAdjElements(ElementType etype) const
Retrieve all elements by type.
__INLINE size_type size() const
Definition: container.hpp:1780
int CompareNodes(HandleType a, HandleType b) const
__INLINE real_array RealArrayDV(const Tag &tag) const
Definition: inmost_mesh.h:3322
ElementArray< Element > Union(const ElementSet &other) const
Storage type for representing arrays of Element references on another Mesh.
Definition: inmost_data.h:381
INMOST_DATA_ENUM_TYPE GetDataSize(HandleType h, const Tag &tag) const
void ExchangeDataBegin(const Tag &tag, ElementType mask, MarkerType select, exchange_data &storage)
RealDFComparator(Mesh *m, Tag t)
Definition: inmost_mesh.h:3156
base_iterator< ElementSet > iteratorSet
Definition: inmost_mesh.h:2848
std::string GetName() const
Get name of the set.
#define __INLINE
Definition: inmost_common.h:75
const_reverse_iterator(Mesh *m, const cont_t::const_reverse_iterator &other)
Definition: inmost_mesh.h:211
ElementArray< Face > getFaces() const
Retrieve only faces.
__INLINE Storage * operator->()
Definition: inmost_mesh.h:3226
iterator(Mesh *m, const cont_t::iterator &other)
Definition: inmost_mesh.h:163
void ReorderEdges() const
integer CountInteriorFaces()
base_iterator< Node > iteratorNode
Definition: inmost_mesh.h:2852
static const GeometricType MaxType
Definition: inmost_mesh.h:299
remote_reference & RemoteReferenceDF(HandleType h, const Tag &tag)
Definition: inmost_mesh.h:1643
real Volume() const
Return volume of the cell.
__INLINE bool GetMarker(MarkerType n) const
Definition: inmost_mesh.h:3438
static const char * GeometricTypeName(GeometricType t)
void ExchangeGhost(integer layers, ElementType bridge)
dynarray< HandleType, 64 > cont_t
Definition: inmost_mesh.h:142
void SetPrivateMarkerArray(const HandleType *h, enumerator n, MarkerType m)
Definition: inmost_mesh.h:1907
__INLINE integer NumberOfCells() const
Definition: inmost_mesh.h:2837
__INLINE const Tag & GlobalIDTag() const
Definition: inmost_mesh.h:1321
An interface for elements of type CELL.
Definition: inmost_mesh.h:635
__INLINE element * data()
Definition: container.hpp:1632
void Normal(real *nrm) const
__INLINE void RemMarker(MarkerType n) const
Definition: inmost_mesh.h:3443
HandleType LastHandle() const
Definition: inmost_mesh.h:2802
__INLINE reference_array ReferenceArray(const Tag &tag) const
Definition: inmost_mesh.h:3274
__INLINE const Tag & LowConnTag() const
Definition: inmost_mesh.h:1323
TopologyCheck GetTopologyCheck(TopologyCheck mask=ENUMUNDEF) const
Retrieve currently set topology checks.
Definition: inmost_mesh.h:3070
void ExchangeMarked(enum Action action=AGhost)
__INLINE bool operator>=(const Storage &other) const
Definition: inmost_mesh.h:3214
void SetData(HandleType h, const Tag &tag, enumerator shift, enumerator size, const void *data)
tag_array_type::iterator iteratorTag
Definition: inmost_data.h:240
ElementArray< Node > BridgeAdjacencies2Node(ElementType Bridge, MarkerType mask=0, bool invert_mask=false) const
RemoteHandleType remote_reference
Storage type for representing references to Element in another Mesh.
Definition: inmost_data.h:288
__INLINE HandleType atfront() const
Definition: inmost_mesh.h:241
_iterator< const HandleType > const_iterator
Definition: container.hpp:1571
void OrientedNormal(Cell c, real *nrm) const
void Unite(const ElementSet &other) const
Compute and store union with raw handles.
bool operator()(HandleType a, HandleType b) const
Definition: inmost_mesh.h:3159
virtual ElementArray< Element > getAdjElements(ElementType etype) const
std::vector< INMOST_MPI_Request > recv_reqs
Definition: inmost_mesh.h:2155
const_reverse_iterator(const const_reverse_iterator &other)
Definition: inmost_mesh.h:212
bool New(HandleType h) const
bool HaveParent() const
Storage::real Mean(real(*func)(real *x, real t), real time) const
void Intersect(const ElementSet &other) const
Compute and store intersection with raw handles.
std::pair< ElementSet, bool > CreateSetUnique(std::string name)
Same as Mesh::CreateSet without checking existance of the set.
iterator operator+(size_t n)
Definition: inmost_mesh.h:166
real & RealDV(HandleType h, const Tag &tag)
Definition: inmost_mesh.h:1752
base_iterator< Cell > iteratorCell
Definition: inmost_mesh.h:2849
ElementArray(Mesh *m_link, const cont_t &c)
Definition: inmost_mesh.h:153
__INLINE reference & Reference(const Tag &tag) const
Definition: inmost_mesh.h:3254
static const GeometricType MultiPolygon
Definition: inmost_mesh.h:291
void SetMarker(HandleType h, MarkerType n)
Definition: inmost_mesh.h:1899
#define ENUMUNDEF
remote_reference_array RemoteReferenceArray(HandleType h, const Tag &tag)
var & VariableDF(HandleType h, const Tag &tag)
Definition: inmost_mesh.h:1890
void LoadMSH(std::string File)
__INLINE enumerator NumberOfTags() const
Definition: inmost_mesh.h:1371
void Disconnect(bool delete_upper_adjacent) const
bool FixEdgeOrder() const
__INLINE base_iterator operator++(int)
Definition: inmost_mesh.h:2890
void AddElement(HandleType e) const
adj_type::iterator adj_iterator
Definition: inmost_mesh.h:311
__INLINE const_reverse_iterator rend() const
Definition: inmost_mesh.h:233
static __INLINE HandleType & hSibling(Element::adj_type &arr)
Definition: inmost_mesh.h:917
const_reverse_iterator & operator--()
Definition: inmost_mesh.h:215
ElementArray< Node > getNodes() const
Retrieve only nodes.
__INLINE ElementSet & operator=(ElementSet const &other)
Definition: inmost_mesh.h:930
reference_array ReferenceArray(HandleType h, const Tag &tag)
static Face UniteFaces(ElementArray< Face > &faces, MarkerType del_protect)
void reserve(size_type n)
Definition: container.hpp:1643
__INLINE void DelData(const Tag &tag) const
Definition: inmost_mesh.h:3421
void ReduceData(const Tag &tag, ElementType mask, MarkerType select, ReduceOperation op)
Accumulation of data from ghost elements to shared elements.
void PutElements(const ElementSet &other) const
Put multiple handles of the other set without checking of the existance of duplicate.
Definition: inmost_mesh.h:1003
__INLINE MeshState GetMeshState() const
Definition: inmost_mesh.h:1320
#define INMOST_DATA_ENUM_TYPE
__INLINE const_reverse_iterator rbegin() const
Definition: inmost_mesh.h:232
INMOST_DATA_REAL_TYPE real
Storage type for representing real values.
Definition: inmost_data.h:278
void SetMarkerElements(MarkerType m, ElementType etype=ESET|CELL|FACE|EDGE|NODE) const
Set markers on all the elements of given type.
static ElementArray< Face > SplitFace(Face face, const ElementArray< Edge > &edges, MarkerType del_protect)
static const Status Shared
Definition: inmost_mesh.h:305
ElementArray< Node > getNodes() const
ElementArray< Etype > Convert()
Definition: inmost_mesh.h:276
Element::adj_type & LowConn(HandleType h)
Definition: inmost_mesh.h:1980
Element(const Element &other)
Definition: inmost_mesh.h:324
remote_reference_array RemoteReferenceArrayDF(HandleType h, const Tag &tag)
Definition: inmost_mesh.h:1740
void AssignGlobalID(ElementType mask)
virtual ElementArray< Cell > getCells() const
__INLINE const Element & InvalidElement()
Definition: inmost_mesh.h:466
void GetMarkerSpace(HandleType h, bulk copy[MarkerFields]) const
__INLINE void clear()
Definition: inmost_mesh.h:254
MarkerType NewMarker() const
Definition: inmost_mesh.h:3020
reference_array ReferenceArrayDV(HandleType h, const Tag &tag)
Definition: inmost_mesh.h:1861
CentroidComparator(const CentroidComparator &other)
Definition: inmost_mesh.h:3088
void Intersect(const ElementArray< EType > &elems) const
Compute and store intersection with elements.
Definition: inmost_mesh.h:1089
bool Boundary() const
__INLINE const element & at(size_type n) const
Definition: container.hpp:1746
int GetProcessorRank()
Get rank of current processor.
__INLINE bulk_array BulkArray(const Tag &tag) const
Definition: inmost_mesh.h:3270
__INLINE INMOST::expr operator*(const INMOST_DATA_REAL_TYPE &left, const INMOST::expr &right)
void ReduceDataEnd(const Tag &tag, ElementType mask, MarkerType select, ReduceOperation op, exchange_data &storage)
const Tag & GetGeometricTag(GeometricData type) const
bool Inside(const real *point) const
Determine, if point lies inside element.
shell< bulk > bulk_array
Storage type for representing abstact data as a series of bytes.
Definition: inmost_data.h:294
TopologyCheck GetTopologyError(TopologyCheck mask=ENUMUNDEF) const
Retrieve topology error state, this indicates that some error have occured.
Definition: inmost_mesh.h:3078
__INLINE bool empty() const
Definition: inmost_mesh.h:253
Face & operator=(Face const &other)
Definition: inmost_mesh.h:557
Element(Mesh *m, HandleType *h)
Definition: inmost_mesh.h:323
void Subtract(const ElementArray< EType > &other)
Definition: inmost_mesh.h:268
ElementType SynchronizeElementType(ElementType etype)
ElementArray(Mesh *m_link, size_type n, HandleType h=InvalidHandle())
Definition: inmost_mesh.h:152
bool isValidElement(ElementType etype, integer lid) const
Definition: inmost_mesh.h:1405
integer EsetPrevLocalID(integer lid) const
Definition: inmost_mesh.h:2822
static const ComparatorType HIERARCHY_COMPARATOR
Definition: inmost_mesh.h:924
__INLINE reference_array ReferenceArrayDV(const Tag &tag) const
Definition: inmost_mesh.h:3334
__INLINE const_iterator end() const
Definition: inmost_mesh.h:231
void Clear() const
Remove all elements, clear all data, removes sorted marker.
__INLINE bool operator==(const Storage &other) const
Definition: inmost_mesh.h:3218
void ReduceDataBegin(const Tag &tag, ElementType mask, MarkerType select, exchange_data &storage)
__INLINE INMOST_DATA_INTEGER_TYPE GetHandleElementNum(HandleType h)
Definition: inmost_data.h:92
void SaveXML(std::string File)
HandleType LastCreated() const
Definition: inmost_mesh.h:1401
bool CheckEdgeOrder() const
Tag TopologyErrorTag() const
Definition: inmost_mesh.h:3068
void push_back(const element &e)
Definition: container.hpp:1757
void RemoveElement(const Storage &e) const
enumerator Size() const
Get total number of elements.
ElementArray< Edge > getEdges() const
Retrieve only edges.
__INLINE const Cell & InvalidCell()
Definition: inmost_mesh.h:904
Node getBeg() const
iterator & operator=(iterator const &other)
Definition: inmost_mesh.h:172
base_iterator< Storage > iteratorStorage
Definition: inmost_mesh.h:2845
__INLINE real & RealDF(const Tag &tag) const
Definition: inmost_mesh.h:3302
void BeginModification()
Node getEnd() const
__INLINE Element getAsElement() const
Definition: inmost_mesh.h:3487
Element & operator=(Element const &other)
Definition: inmost_mesh.h:325
__INLINE bool isValid() const
Definition: inmost_mesh.h:3475
__INLINE const element & at(size_type n) const
Definition: container.hpp:210
void PutElement(HandleType e) const
iteratorNode BeginNode()
IntegerComparator(const IntegerComparator &other)
Definition: inmost_mesh.h:3135
void SwapModification()
__INLINE iterator erase(iterator pos)
Definition: inmost_mesh.h:224
std::pair< Edge, bool > CreateEdge(const ElementArray< Node > &nodes)
Element(Mesh *m, HandleType h)
Definition: inmost_mesh.h:322
iteratorNode EndNode()
iterator(const iterator &other)
Definition: inmost_mesh.h:164
__INLINE integer LocalID() const
Definition: inmost_mesh.h:3479
Cell(Mesh *m, HandleType *h)
Basic constructor with an assignable handle.
Definition: inmost_mesh.h:659
static Mesh * GetMesh(std::string name)
Find mesh by name.
__INLINE integer EdgeLastLocalID() const
Definition: inmost_mesh.h:2825
ElementArray< Face > GatherInteriorFaces()
INMOST_DATA_ENUM_TYPE enumerator
type for representing unsigned integer values.
Definition: inmost_data.h:284
reference & Reference(HandleType h, const Tag &tag)
__INLINE const Tag & MarkersTag() const
Definition: inmost_mesh.h:1325
exch_buffer_type recv_buffers
Definition: inmost_mesh.h:2156
__INLINE integer CellLastLocalID() const
Definition: inmost_mesh.h:2827
TopologyCheck EndTopologyCheck(HandleType e)
__INLINE reverse_iterator rbegin()
Definition: inmost_mesh.h:228
__INLINE void push_back(const Storage &x)
Definition: inmost_mesh.h:248
GeometricType GetGeometricType() const
real & Real(HandleType h, const Tag &tag)
ElementArray(Mesh *m_link, InputIterator first, InputIterator last)
Definition: inmost_mesh.h:156
base_iterator< Edge > iteratorEdge
Definition: inmost_mesh.h:2851
static const GeometricType Hex
Definition: inmost_mesh.h:293
__INLINE reverse_iterator rend()
Definition: container.hpp:1859
static const ComparatorType UNSORTED_COMPARATOR
Definition: inmost_mesh.h:921
__INLINE const Face & InvalidFace()
Definition: inmost_mesh.h:612
HierarchyComparator & operator=(HierarchyComparator const &other)
Definition: inmost_mesh.h:3113
void SetMarkerArray(const HandleType *h, enumerator n, MarkerType m)
Definition: inmost_mesh.h:1906
__INLINE void DelSparseData(const Tag &tag) const
Deallocates space allocated for sparse data, frees variable array if necessary.
Definition: inmost_mesh.h:3429
__INLINE base_iterator & operator=(base_iterator const &other)
Definition: inmost_mesh.h:2895
void SortHandles(HandleType *h, enumerator num)
__INLINE HandleType atback() const
Definition: inmost_mesh.h:242
TagManager::sparse_sub_type sparse_type
Definition: inmost_mesh.h:1216
ElementArray(const ElementArray &other)
Definition: inmost_mesh.h:154
void DelData(HandleType h, const Tag &tag)
Storage type for representing arrays of Element references.
Definition: inmost_data.h:302
integer FacePrevLocalID(integer lid) const
Definition: inmost_mesh.h:2820
enumerator nbSorted() const
HandleType FindSharedAdjacency(const HandleType *arr, enumerator num) const
void Subtract(const ElementArray< EType > &elems) const
Compute and store difference with elements.
Definition: inmost_mesh.h:1080
static const GeometricType Tri
Definition: inmost_mesh.h:288
Storage & operator=(Storage const &other)
static const enumerator high_conn_reserved
Definition: inmost_mesh.h:915
ElementArray< Cell > getCells() const
Retrieve only cells.
__INLINE void insert(iterator pos, InputIterator pbeg, InputIterator pend)
Definition: inmost_mesh.h:223
integer EdgePrevLocalID(integer lid) const
Definition: inmost_mesh.h:2819
bool GetMarker(HandleType h, MarkerType n) const
Definition: inmost_mesh.h:1911
__INLINE integer DataLocalID() const
Definition: inmost_mesh.h:3483
shell< integer > integer_array
Storage type for representing arrays of integer values.
Definition: inmost_data.h:292
RealDFComparator & operator=(RealDFComparator const &other)
Definition: inmost_mesh.h:3158
void Unite(const HandleType *h, INMOST_DATA_ENUM_TYPE num)
__INLINE bool operator>(const base_iterator &other) const
Definition: inmost_mesh.h:2899
integer ExclusiveSum(integer input)
void Intersect(const HandleType *h, INMOST_DATA_ENUM_TYPE num)
__INLINE integer EsetLastLocalID() const
Definition: inmost_mesh.h:2828
real AggregateMax(real input)
__INLINE bool empty() const
Definition: container.hpp:1771
enumerator nbHandles() const
Node NodeByLocalID(integer lid)
Definition: inmost_mesh.h:2806
static __INLINE HandleType & hParent(Element::adj_type &arr)
Definition: inmost_mesh.h:916
bool operator==(const iterator &other) const
Definition: inmost_mesh.h:1158
INMOST_DATA_ENUM_TYPE GetDataCapacity(HandleType h, const Tag &tag) const
__INLINE StorageType operator[](size_type n)
Definition: inmost_mesh.h:235
BulkComparator(const BulkComparator &other)
Definition: inmost_mesh.h:3146
void ExchangeData(const Tag &tag, ElementType mask, MarkerType select)
void RemChild(const ElementSet &child) const
This will erase my child.
void Subtract(const ElementSet &other) const
__INLINE void SetDataSize(const Tag &tag, INMOST_DATA_ENUM_TYPE new_size) const
Definition: inmost_mesh.h:3401
static const GeometricType Vertex
Definition: inmost_mesh.h:285
__INLINE bulk_array BulkArrayDF(const Tag &tag) const
Definition: inmost_mesh.h:3290
bool TestClosure(const HandleType *elements, integer num) const
__INLINE HandleType InvalidHandle()
Definition: inmost_data.h:90
iteratorSet BeginSet()
This class provides the access to the individual mesh datum and general information about it...
Definition: inmost_data.h:185
bool isValidNode(integer lid) const
Definition: inmost_mesh.h:1409
integer EsetNextLocalID(integer lid) const
Definition: inmost_mesh.h:2816
void LoadVTK(std::string File)
inner_reference_array adj_type
Definition: inmost_mesh.h:310
iterator Erase(iterator pos) const
Erase one element pointed by iterator and return next valid element.
TagManager::sparse_sub_record sparse_rec
Definition: inmost_mesh.h:1218
__INLINE remote_reference_array RemoteReferenceArrayDF(const Tag &tag) const
Definition: inmost_mesh.h:3298
__INLINE const Tag & SetNameTag() const
Definition: inmost_mesh.h:1333
TopologyCheck BeginTopologyCheck(ElementType etype, const HandleType *adj, enumerator num)
void SetMarkerSpace(HandleType h, bulk source[MarkerFields])
__INLINE integer NumberOfEdges() const
Definition: inmost_mesh.h:2839
__INLINE void GetMarkerSpace(bulk copy[MarkerFields]) const
Definition: inmost_mesh.h:3467
static ElementArray< Cell > SplitCell(Cell cell, const ElementArray< Face > &faces, MarkerType del_protect)
Separate a cell according to the set of provided faces.
iteratorElement BeginElement(ElementType Types)
void RemMarkerArray(const HandleType *h, enumerator n, MarkerType m)
Definition: inmost_mesh.h:1923
__INLINE iterator end()
Definition: inmost_mesh.h:227
void Redistribute()
Tag CreateTag(std::string name, DataType dtype, ElementType etype, ElementType sparse, INMOST_DATA_ENUM_TYPE size=ENUMUNDEF)
HandleType PrevHandle(HandleType h) const
bool operator()(HandleType a, HandleType b) const
Definition: inmost_mesh.h:3116
void SetStatus(HandleType h, Element::Status s)
Definition: inmost_mesh.h:2081
ElementArray< Face > getFaces() const
Get all the faces of the current cell.
__INLINE value_type operator*()
Definition: inmost_mesh.h:2893
void Unite(const ElementArray< EType > &other)
Definition: inmost_mesh.h:266
__INLINE real & Real(const Tag &tag) const
Definition: inmost_mesh.h:3242
ElementArray< Cell > getCells() const
INMOST_DATA_ENUM_TYPE MarkerType
Low 8 bits - marker mask, rest high bits - position of marker.
Definition: inmost_data.h:62
__INLINE void resize(size_type n)
Definition: inmost_mesh.h:252
INMOST_DATA_ENUM_TYPE HandleType
Definition: inmost_data.h:80
Mesh & operator=(Mesh const &other)
void DelDenseData(HandleType h, const Tag &tag)
Storage::integer & GlobalID() const
void ResolveModification()
ElementArray< Node > getNodes() const
MarkerType HideMarker() const
Definition: inmost_mesh.h:3019
enumerator getNext(const HandleType *arr, enumerator size, enumerator k, MarkerType marker) const
Element ElementByLocalID(integer etypenum, integer lid)
Definition: inmost_mesh.h:2793
void AddElements(const ElementArray< EType > &elems) const
Add multiple elements with checking of the existance of duplicate.
Definition: inmost_mesh.h:1024
void AddElements(const ElementSet &other)
Add elements of other set.
Definition: inmost_mesh.h:1021
iteratorElement EndElement()
integer Enumerate(const ElementArray< EType > &elements, const Tag &num_tag, integer start=0, bool define_sparse=true)
Definition: inmost_mesh.h:2679
base_iterator & operator++()
void SetGeometricType(GeometricType t)
__INLINE reference_array ReferenceArrayDF(const Tag &tag) const
Definition: inmost_mesh.h:3294
__INLINE var_array VariableArray(const Tag &tag) const
Retrieve array of variables associated with Tag.
Definition: inmost_mesh.h:3375
enumerator CountChildren() const
How many children I have.
__INLINE sparse_sub_type const & GetSparseData(int etypenum, int local_id) const
Definition: inmost_data.h:252
ElementArray< Face > BridgeAdjacencies2Face(ElementType Bridge, MarkerType mask=0, bool invert_mask=false) const
void RemoveElements(const ElementArray< EType > &elems) const
Remove multiple elements from the set.
Definition: inmost_mesh.h:1030
void AddElements(const HandleType *handles, enumerator num) const
void SavePVTK(std::string File)
static bool TestUniteFaces(const ElementArray< Face > &faces, MarkerType del_protect)
integer CountBoundaryFaces()
__INLINE const Tag & HighConnTag() const
Definition: inmost_mesh.h:1324
static const Status Ghost
Definition: inmost_mesh.h:306
void RemoveGhostElements(const ElementSet &ghost)
Definition: inmost_mesh.h:2381
variable var
Storage type for representing real value with vector of variations.
Definition: inmost_data.h:297
__INLINE INMOST_DATA_INTEGER_TYPE GetHandleID(HandleType h)
Definition: inmost_data.h:91
std::vector< Tag > tag_set
Definition: inmost_mesh.h:2146