INMOST
Mathematical Modelling Toolkit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
inmost_data.h
Go to the documentation of this file.
1 #ifndef INMOST_DATA_H_INCLUDED
2 #define INMOST_DATA_H_INCLUDED
3 
4 #include "inmost_common.h"
5 #if defined(USE_AUTODIFF)
6 #include "inmost_expression.h"
7 #endif
8 
9 
10 #if defined(USE_MESH)
11 
12 
13 namespace INMOST
14 {
15  class Mesh;
16  class Storage;
17  class Element;
18  class TagManager;
19  class Node;
20  class Edge;
21  class Face;
22  class Cell;
23  class ElementSet;
24 
26  // ElementType
27 
29  static const ElementType NONE = 0x00;
30  static const ElementType NODE = 0x01;
31  static const ElementType EDGE = 0x02;
32  static const ElementType FACE = 0x04;
33  static const ElementType CELL = 0x08;
34  static const ElementType ESET = 0x10;
35  static const ElementType MESH = 0x20;
36  #define NUM_ELEMENT_TYPS 6
37 
38  __INLINE bool OneType (ElementType t) {return t > 0 && (t & (t-1)) == 0;}
40  __INLINE ElementType LastElementType () {return MESH << 1;}
41  __INLINE ElementType NextElementType (ElementType etype) {return etype << 1;}
42  __INLINE ElementType PrevElementType (ElementType etype) {return etype >> 1;}
44  const char * ElementTypeName (ElementType t); //mesh.cpp
46  {
47  unsigned int v = static_cast<unsigned int>(t); // 32-bit value to find the log2 of
48  //static const unsigned int b[] = {0xAAAAAAAA, 0xCCCCCCCC, 0xF0F0F0F0, 0xFF00FF00, 0xFFFF0000};
49  static const unsigned int b[] = {0xAAAAAAAA, 0xCCCCCCCC, 0xF0F0F0F0};
50  register unsigned int r = (v & b[0]) != 0;
51  //r |= ((v & b[4]) != 0) << 4;
52  //r |= ((v & b[3]) != 0) << 3;
53  r |= ((v & b[2]) != 0) << 2;
54  r |= ((v & b[1]) != 0) << 1;
55  return static_cast<INMOST_DATA_INTEGER_TYPE>(r);
56  }
57 
59  // MarkerType
60 
64  static const INMOST_DATA_ENUM_TYPE MarkerFields = 16;
66  static const INMOST_DATA_ENUM_TYPE MarkerFieldsPrivate = 4;
68  static const INMOST_DATA_ENUM_TYPE MarkerPrivateBit = 1 << (sizeof(INMOST_DATA_ENUM_TYPE)*8-1);
70  static const INMOST_DATA_ENUM_TYPE MarkerMask = static_cast<INMOST_DATA_BULK_TYPE>(-1);
72  static const INMOST_DATA_ENUM_TYPE MarkerShift = sizeof(INMOST_DATA_BULK_TYPE)*8;
73  __INLINE static bool isPrivate (MarkerType n) {return (n & MarkerPrivateBit) == MarkerPrivateBit;}
74  __INLINE static MarkerType InvalidMarker (){return ENUMUNDEF;}
75 
76 
78  // HandleType
79 
81  static const INMOST_DATA_ENUM_TYPE handle_etype_bits = 3;
82  static const INMOST_DATA_ENUM_TYPE handle_etype_shift = sizeof(HandleType)*8-handle_etype_bits;
83  static const INMOST_DATA_ENUM_TYPE handle_id_mask = (1 << handle_etype_shift)-1;
84 
85  static const INMOST_DATA_ENUM_TYPE chunk_bits_elems = 13;
86  static const INMOST_DATA_ENUM_TYPE chunk_bits_empty = 8;
87  static const INMOST_DATA_ENUM_TYPE chunk_bits_tags = 6;
88  static const INMOST_DATA_ENUM_TYPE chunk_bits_dense = 6;
89 
91  __INLINE INMOST_DATA_INTEGER_TYPE GetHandleID (HandleType h) {return (h & handle_id_mask)-1;}
92  __INLINE INMOST_DATA_INTEGER_TYPE GetHandleElementNum (HandleType h) {return h >> handle_etype_shift;}
94  __INLINE HandleType ComposeHandle (ElementType etype, INMOST_DATA_INTEGER_TYPE ID) {return ID == -1 ? InvalidHandle() : ((ElementNum(etype) << handle_etype_shift) + (1+ID));}
95  __INLINE HandleType ComposeCellHandle (INMOST_DATA_INTEGER_TYPE ID) {return ID == -1 ? InvalidHandle() : ((ElementNum(CELL) << handle_etype_shift) + (1+ID));}
96  __INLINE HandleType ComposeFaceHandle (INMOST_DATA_INTEGER_TYPE ID) {return ID == -1 ? InvalidHandle() : ((ElementNum(FACE) << handle_etype_shift) + (1+ID));}
97  __INLINE HandleType ComposeEdgeHandle (INMOST_DATA_INTEGER_TYPE ID) {return ID == -1 ? InvalidHandle() : ((ElementNum(EDGE) << handle_etype_shift) + (1+ID));}
98  __INLINE HandleType ComposeNodeHandle (INMOST_DATA_INTEGER_TYPE ID) {return ID == -1 ? InvalidHandle() : ((ElementNum(NODE) << handle_etype_shift) + (1+ID));}
99  __INLINE HandleType ComposeSetHandle (INMOST_DATA_INTEGER_TYPE ID) {return ID == -1 ? InvalidHandle() : ((ElementNum(ESET) << handle_etype_shift) + (1+ID));}
100  __INLINE HandleType ComposeHandleNum (INMOST_DATA_INTEGER_TYPE etypenum, INMOST_DATA_INTEGER_TYPE ID) {return ID == -1 ? InvalidHandle() : ((etypenum << handle_etype_shift) + (1+ID));}
101  __INLINE bool isValidHandle (HandleType h) {return h != 0;}
102 
104  // RemoteElementType
105 
106  typedef std::pair<Mesh*,HandleType> RemoteHandleType;
108  Element MakeElement (const RemoteHandleType & rh); //storage.cpp
110  Element MakeElementRef (RemoteHandleType & rh); //storage.cpp
111 
112 
113 
114 #if defined(USE_AUTODIFF)
116 #endif
123 
124  enum DataType
125  {
126  DATA_REAL = 0,
131 #if defined(USE_AUTODIFF)
133 #endif
134  };
135 
137  const char * DataTypeName (DataType t);
138 
139 
143  class TagMemory
144  {
145  public:
150  TagMemory(Mesh * m, const TagMemory & other);
152  TagMemory & operator =(TagMemory const & other);
153  private:
155  TagMemory();
159  DataType dtype;
161  std::string tagname;
163  INMOST_MPI_Type bulk_data_type;
168  INMOST_DATA_ENUM_TYPE bytes_size;
171  bool sparse[NUM_ELEMENT_TYPS];
173  // fixed size or number of bytes for the structure used to represent data of variable size.
174  INMOST_DATA_ENUM_TYPE record_size;
176  Mesh * m_link;
178  friend class Tag;
180  friend class Storage;
181  };
182 
183 
185  class Tag //implemented in tag.cpp
186  {
187  private:
189  TagMemory * mem;
191  Tag (Mesh * m,std::string name, DataType _dtype, INMOST_DATA_ENUM_TYPE size);
192  __INLINE INMOST_DATA_ENUM_TYPE GetRecordSize() const;
193  __INLINE void SetSize(INMOST_DATA_ENUM_TYPE size);
194  __INLINE void SetPosition(INMOST_DATA_ENUM_TYPE pos, ElementType type);
195  __INLINE INMOST_DATA_ENUM_TYPE GetPosition(ElementType type) const;
196  __INLINE void SetSparse(ElementType type);
197  __INLINE INMOST_DATA_ENUM_TYPE GetPositionByDim(INMOST_DATA_ENUM_TYPE typenum) const;
198  public:
199  ~Tag();
200  Tag();
201  Tag(const Tag & other);
202  __INLINE bool operator <(const Tag & other) const;
203  __INLINE bool operator >(const Tag & other) const;
204  __INLINE bool operator ==(const Tag & other) const;
205  __INLINE bool operator !=(const Tag & other) const;
206  __INLINE Tag & operator =(Tag const & other);
207  __INLINE DataType GetDataType() const;
211  __INLINE std::string GetTagName() const;
212  __INLINE bool isDefined(ElementType type) const;
213  __INLINE bool isSparse(ElementType type) const;
214  __INLINE bool isValid() const;
215  __INLINE Mesh * GetMeshLink() const;
219  friend class TagManager;
220  friend class Storage;
221  friend class Mesh;
222  };
223 
224  class TagManager //implemented in tag.cpp
225  {
226  protected:
227  TagManager();
228  TagManager(const TagManager & other);
229  TagManager & operator = (TagManager const & other);
234  typedef struct{void * tag, * rec;} sparse_sub_record;
238  //typedef std::vector<INMOST_DATA_INTEGER_TYPE> back_links_type;
239  public:
240  typedef tag_array_type::iterator iteratorTag;
241  public:
242  virtual ~TagManager();
243  bool HaveTag(std::string name) const;
244  Tag GetTag(std::string name) const;
245  void ListTagNames(std::vector<std::string> & list) const;
246  Tag CreateTag(Mesh * m, std::string name, DataType dtype, ElementType etype, ElementType sparse, INMOST_DATA_ENUM_TYPE size = ENUMUNDEF);
247  virtual Tag DeleteTag(Tag tag, ElementType mask);
248  bool ElementDefined(Tag const & tag, ElementType etype) const;
249  protected:
250  void ReallocateData(const Tag & t, INMOST_DATA_INTEGER_TYPE etypenum,INMOST_DATA_ENUM_TYPE new_size);
252  __INLINE sparse_sub_type const & GetSparseData(int etypenum, int local_id) const {return sparse_data[etypenum][local_id];}
253  __INLINE sparse_sub_type & GetSparseData(int etypenum, int local_id) {return sparse_data[etypenum][local_id];}
254  __INLINE dense_sub_type const & GetDenseData(int pos) const {return dense_data[pos];}
255  __INLINE dense_sub_type & GetDenseData(int pos) {return dense_data[pos];}
256  static void CopyData(const Tag & t, void * adata, const void * bdata);
257  static void DestroyVariableData(const Tag & t, void * adata);
258  protected:
259  typedef tag_array_type::iterator tag_iterator;
260  typedef tag_array_type::const_iterator tag_const_iterator;
261  protected:
267  };
268 
274  class Storage //implemented in storage.cpp
275  {
276  public:
295 #if defined(USE_AUTODIFF)
296  typedef variable var;
300 #endif
301  class reference_array : public shell<reference>
303  {
304  Mesh * m;
305  public:
306  reference_array() : m(NULL) {}
308  reference_array(Mesh * m, reference * arr, size_type size) : shell<reference>(arr,size), m(m) {}
310  void push_back(const Storage & elem);
311  void push_back(HandleType h) {shell<reference>::push_back(h);} //is it needed?
313  Element operator[] (size_type n) const;
314  class iterator : public shell<HandleType>::iterator
315  {
316  Mesh * m;
317  public:
319  iterator(Mesh * m, const shell<HandleType>::iterator & other) : shell<HandleType>::iterator(other), m(m) {}
320  iterator(const iterator & other) : shell<HandleType>::iterator(other), m(other.m) {}
321  iterator & operator =(iterator const & other) {m = other.m; shell<HandleType>::iterator::operator=(other); return *this;}
327  };
328  class const_iterator : public shell<HandleType>::const_iterator
329  {
330  Mesh * m;
331  public:
334  const_iterator(const const_iterator & other) : shell<HandleType>::const_iterator(other), m(other.m) {}
335  const_iterator & operator =(const_iterator const & other) {m = other.m; shell<HandleType>::const_iterator::operator=(other); return *this;}
341  };
342  class reverse_iterator : public shell<HandleType>::reverse_iterator
343  {
344  Mesh * m;
345  public:
348  reverse_iterator(const reverse_iterator & other) : shell<HandleType>::reverse_iterator(other), m(other.m) {}
355  };
357  {
358  Mesh * m;
359  public:
369  };
378  void SetMeshLink(Mesh * new_m) {m = new_m;}
379  };
381  class remote_reference_array : public shell<remote_reference>
382  {
383  public:
388  void push_back(const Storage & elem);
391  Element operator[] (size_type n) const;
392  class iterator : public shell<remote_reference>::iterator
393  {
396  iterator(const iterator & other) : shell<remote_reference>::iterator(other) {}
397  Element operator->();
398  };
399  class const_iterator : public shell<remote_reference>::const_iterator
400  {
404  Element operator->();
405  };
406  class reverse_iterator : public shell<remote_reference>::reverse_iterator
407  {
411  Element operator->();
412  };
413  class const_reverse_iterator : public shell<remote_reference>::const_reverse_iterator
414  {
418  Element operator->();
419  };
420  };
421  //typedef shell<reference> reference_array;
422  protected:
425  private:
426  Mesh * m_link;
427  public:
428  Storage(const Storage & other) : handle(other.handle), handle_link(other.handle_link), m_link(other.m_link) {}
429  Storage(Mesh * mesh, HandleType handle) : handle(handle), handle_link(NULL), m_link(mesh) {}
431  Storage(Mesh * mesh, HandleType * handle) : handle(*handle), handle_link(handle), m_link(mesh) {}
434  Storage & operator = (Storage const & other);
435  __INLINE bool operator < (const Storage & other) const;
436  __INLINE bool operator > (const Storage & other) const;
437  __INLINE bool operator <= (const Storage & other) const;
438  __INLINE bool operator >= (const Storage & other) const;
439  __INLINE bool operator == (const Storage & other) const;
440  __INLINE bool operator != (const Storage & other) const;
442  __INLINE const Storage * operator-> () const;
443  __INLINE Storage & self ();
444  __INLINE const Storage & self () const;
445  virtual ~Storage() {}
446  public:
449  __INLINE real & Real (const Tag & tag) const;
452  __INLINE integer & Integer (const Tag & tag) const;
455  __INLINE bulk & Bulk (const Tag & tag) const;
458  __INLINE reference & Reference (const Tag & tag) const;
461  __INLINE remote_reference & RemoteReference (const Tag & tag) const;
464  __INLINE real_array RealArray (const Tag & tag) const;
467  __INLINE integer_array IntegerArray (const Tag & tag) const;
471  __INLINE bulk_array BulkArray (const Tag & tag) const;
475  __INLINE reference_array ReferenceArray (const Tag & tag) const;
479  __INLINE remote_reference_array RemoteReferenceArray(const Tag & tag) const;
480 
481  //optimized data requests for dense data with fixed size
482  __INLINE real_array RealArrayDF (const Tag & tag) const;
483  __INLINE integer_array IntegerArrayDF (const Tag & tag) const;
484  __INLINE bulk_array BulkArrayDF (const Tag & tag) const;
485  __INLINE reference_array ReferenceArrayDF (const Tag & tag) const;
486  __INLINE remote_reference_array RemoteReferenceArrayDF(const Tag & tag) const;
487  __INLINE real & RealDF (const Tag & tag) const;
488  __INLINE integer & IntegerDF (const Tag & tag) const;
489  __INLINE bulk & BulkDF (const Tag & tag) const;
490  __INLINE reference & ReferenceDF (const Tag & tag) const;
491  __INLINE remote_reference & RemoteReferenceDF (const Tag & tag) const;
492 
493  //optimized data requests for dense data with variable size
494  __INLINE real_array RealArrayDV (const Tag & tag) const;
495  __INLINE integer_array IntegerArrayDV (const Tag & tag) const;
496  __INLINE bulk_array BulkArrayDV (const Tag & tag) const;
497  __INLINE reference_array ReferenceArrayDV (const Tag & tag) const;
498  __INLINE remote_reference_array RemoteReferenceArrayDV(const Tag & tag) const;
499  __INLINE real & RealDV (const Tag & tag) const;
500  __INLINE integer & IntegerDV (const Tag & tag) const;
501  __INLINE bulk & BulkDV (const Tag & tag) const;
502  __INLINE reference & ReferenceDV (const Tag & tag) const;
503  __INLINE remote_reference & RemoteReferenceDV (const Tag & tag) const;
504 #if defined(USE_AUTODIFF)
505  __INLINE var & Variable (const Tag & tag) const;
507  __INLINE var & VariableDF (const Tag & tag) const;
508  __INLINE var & VariableDV (const Tag & tag) const;
510  __INLINE var_array VariableArray (const Tag & tag) const;
511  __INLINE var_array VariableArrayDF (const Tag & tag) const;
512  __INLINE var_array VariableArrayDV (const Tag & tag) const;
513 #endif
514 
520  __INLINE INMOST_DATA_ENUM_TYPE GetDataSize (const Tag & tag) const;
532  __INLINE void SetDataSize (const Tag & tag,
533  INMOST_DATA_ENUM_TYPE new_size) const;
543  __INLINE void GetData (const Tag & tag,
544  INMOST_DATA_ENUM_TYPE shift,
545  INMOST_DATA_ENUM_TYPE size,
546  void * data) const;
547  __INLINE void SetData (const Tag & tag,
548  INMOST_DATA_ENUM_TYPE shift,
549  INMOST_DATA_ENUM_TYPE size,
550  const void * data) const;
551  __INLINE void DelData (const Tag & tag) const;
553  __INLINE void DelSparseData (const Tag & tag) const;
555  __INLINE void DelDenseData (const Tag & tag) const;
557  __INLINE bool HaveData (const Tag & tag) const;
559  __INLINE integer GetElementNum () const;
560  __INLINE void SetMarker (MarkerType n) const;
561  __INLINE bool GetMarker (MarkerType n) const;
562  __INLINE void RemMarker (MarkerType n) const;
563  __INLINE void SetPrivateMarker (MarkerType n) const;
564  __INLINE bool GetPrivateMarker (MarkerType n) const;
565  __INLINE void RemPrivateMarker (MarkerType n) const;
566  __INLINE void ClearMarkerSpace () const;
567  __INLINE void GetMarkerSpace (bulk copy[MarkerFields]) const;
568  __INLINE void SetMarkerSpace (bulk source[MarkerFields]) const;
569  __INLINE integer LocalID () const;
572  __INLINE integer DataLocalID () const;
573  __INLINE bool isValid () const;
574  __INLINE Mesh * GetMeshLink () const;
575  __INLINE HandleType GetHandle () const;
576  __INLINE Element getAsElement () const;
577  __INLINE Node getAsNode () const;
578  __INLINE Edge getAsEdge () const;
579  __INLINE Face getAsFace () const;
580  __INLINE Cell getAsCell () const;
581  __INLINE ElementSet getAsSet () const;
582  friend class Mesh;
583  };
584 
588 
589  __INLINE INMOST_DATA_ENUM_TYPE Tag::GetRecordSize() const
590  {
591  return mem->record_size;
592  }
593 
594  __INLINE void Tag::SetSize(INMOST_DATA_ENUM_TYPE size)
595  {
596  mem->size = size;
597  }
598 
599  __INLINE void Tag::SetPosition(INMOST_DATA_ENUM_TYPE pos,
600  ElementType type)
601  {
602  mem->pos[ElementNum(type)] = pos;
603  }
604 
605  __INLINE INMOST_DATA_ENUM_TYPE Tag::GetPosition(ElementType type) const
606  {
607  assert(mem != NULL);
608  return mem->pos[ElementNum(type)];
609  }
610 
611  __INLINE void Tag::SetSparse(ElementType type)
612  {
613  mem->sparse[ElementNum(type)] = true;
614  }
615 
616  __INLINE INMOST_DATA_ENUM_TYPE Tag::GetPositionByDim(INMOST_DATA_ENUM_TYPE typenum) const
617  {
618  return mem->pos[typenum];
619  }
620 
621  __INLINE bool Tag::operator <(const Tag & other) const
622  {
623  return mem < other.mem;
624  }
625 
626  __INLINE bool Tag::operator >(const Tag & other) const
627  {
628  return mem > other.mem;
629  }
630 
631  __INLINE bool Tag::operator ==(const Tag & other) const
632  {
633  return mem == other.mem;
634  }
635 
636  __INLINE bool Tag::operator !=(const Tag & other) const
637  {
638  return mem != other.mem;
639  }
640 
641  __INLINE Tag & Tag::operator =(Tag const & other)
642  {
643  mem = other.mem;
644  return *this;
645  }
646 
648  {
649  assert(mem!=NULL);
650  return mem->dtype;
651  }
652 
654  {
655  assert(mem!=NULL);
656  return mem->bulk_data_type;
657  }
658 
660  {
661  assert(mem!=NULL);
662  return mem->bytes_size;
663  }
665  {
666  assert(mem!=NULL);
667  return mem->size;
668  }
669  __INLINE std::string Tag::GetTagName() const
670  {
671  assert(mem!=NULL);
672  return mem->tagname;
673  }
675  {
676  assert(mem!=NULL);
677  assert(OneType(type));
678  return GetPosition(type) != ENUMUNDEF;
679  }
681  {
682  assert(mem!=NULL);
683  assert(OneType(type));
684  return mem->sparse[ElementNum(type)];
685  }
686  __INLINE bool Tag::isValid() const
687  {
688  return mem != NULL;
689  }
691  {
692  assert(mem!=NULL);
693  return mem->m_link;
694  }
696  {
697  assert(mem!=NULL);
698  return mem->sparse[typenum];
699  }
701  {
702  assert(mem!=NULL);
703  return GetPositionByDim(typenum) != ENUMUNDEF;
704  }
706  {
707  assert(mem!=NULL);
708  assert(mem->dtype == DATA_BULK );
709  mem->bulk_data_type = type;
710  }
711 
712 }
713 
714  //Implementation of inlined functions
715 //#include "Source/Data/tag_inline.hpp"
716 
717 
718 #endif
719 
720 
721 
722 #endif //INMOST_DATA_H_INCLUDED
__INLINE HandleType ComposeFaceHandle(INMOST_DATA_INTEGER_TYPE ID)
Definition: inmost_data.h:96
__INLINE integer & IntegerDF(const Tag &tag) const
Definition: inmost_mesh.h:3306
__INLINE bool operator!=(const Storage &other) const
Definition: inmost_mesh.h:3222
const_reverse_iterator & operator=(const_reverse_iterator const &other)
Definition: inmost_data.h:363
__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
__INLINE Node getAsNode() const
Definition: inmost_mesh.h:3492
shell< real > real_array
Storage type for representing arrays of real values.
Definition: inmost_data.h:290
void push_back(const Storage &elem)
__INLINE var_array VariableArrayDV(const Tag &tag) const
Definition: inmost_mesh.h:3383
iterator & operator=(iterator const &other)
Definition: inmost_data.h:321
__INLINE ElementType FirstElementType()
Definition: inmost_data.h:39
const_reverse_iterator(Mesh *m, const shell< HandleType >::const_reverse_iterator &other)
Definition: inmost_data.h:361
__INLINE real_array RealArrayDF(const Tag &tag) const
Definition: inmost_mesh.h:3282
__INLINE Face getAsFace() const
Definition: inmost_mesh.h:3502
__INLINE reference & ReferenceDF(const Tag &tag) const
Definition: inmost_mesh.h:3314
__INLINE bool operator<(const Storage &other) const
Inline functions for class Storage //.
Definition: inmost_mesh.h:3202
__INLINE integer & Integer(const Tag &tag) const
Definition: inmost_mesh.h:3246
_iterator & operator++()
Definition: container.hpp:542
__INLINE integer_array IntegerArray(const Tag &tag) const
Definition: inmost_mesh.h:3266
#define NUM_ELEMENT_TYPS
Definition: inmost_data.h:36
reference_array(Mesh *m, reference *arr, size_type size)
Definition: inmost_data.h:308
__INLINE bool isSparseByDim(INMOST_DATA_INTEGER_TYPE typenum) const
Definition: inmost_data.h:695
array< HandleType > inner_reference_array
Definition: inmost_data.h:121
__INLINE ElementType NextElementType(ElementType etype)
Definition: inmost_data.h:41
_iterator & operator--()
Definition: container.hpp:544
const_iterator begin() const
Definition: inmost_data.h:371
Storage(const Storage &other)
Definition: inmost_data.h:428
__INLINE bulk & BulkDV(const Tag &tag) const
Definition: inmost_mesh.h:3350
__INLINE INMOST_MPI_Type GetBulkDataType() const
Definition: inmost_data.h:653
__INLINE bulk_array BulkArrayDV(const Tag &tag) const
Definition: inmost_mesh.h:3330
__INLINE Tag & operator=(Tag const &other)
Definition: inmost_data.h:641
__INLINE bool isValid() const
Definition: inmost_data.h:686
__INLINE integer_array IntegerArrayDV(const Tag &tag) const
Definition: inmost_mesh.h:3326
__INLINE remote_reference_array RemoteReferenceArray(const Tag &tag) const
Definition: inmost_mesh.h:3278
__INLINE dense_sub_type const & GetDenseData(int pos) const
Definition: inmost_data.h:254
_reverse_iterator & operator=(_reverse_iterator const &other)
Definition: container.hpp:586
__INLINE bool OneType(ElementType t)
Definition: inmost_data.h:38
chunk_array< Tag, chunk_bits_tags > tag_array_type
Definition: inmost_data.h:231
HandleType reference
Storage type for representing references to Element.
Definition: inmost_data.h:286
__INLINE bool operator<=(const Storage &other) const
Definition: inmost_mesh.h:3210
chunk_bulk_array< chunk_bits_elems > dense_sub_type
Definition: inmost_data.h:232
dense_data_array_type dense_data
Definition: inmost_data.h:264
__INLINE var & Variable(const Tag &tag) const
Retrieve variable reference associated with Tag.
Definition: inmost_mesh.h:3363
__INLINE INMOST_DATA_INTEGER_TYPE ElementNum(ElementType t)
Definition: inmost_data.h:45
bool HaveTag(std::string name) const
tag_array_type::const_iterator tag_const_iterator
Definition: inmost_data.h:260
An interface for elements of type FACE.
Definition: inmost_mesh.h:550
INMOST_DATA_INTEGER_TYPE integer
Storage type for representing integer values.
Definition: inmost_data.h:280
void push_back(HandleType h)
Definition: inmost_data.h:311
array< variable > inner_variable_array
Definition: inmost_data.h:115
__INLINE var & VariableDV(const Tag &tag) const
Definition: inmost_mesh.h:3371
const_iterator(const const_iterator &other)
Definition: inmost_data.h:334
__INLINE bool operator>(const Tag &other) const
Definition: inmost_data.h:626
__INLINE Mesh * GetMeshLink() const
Definition: inmost_data.h:690
__INLINE real_array RealArray(const Tag &tag) const
Definition: inmost_mesh.h:3262
__INLINE void RemPrivateMarker(MarkerType n) const
Definition: inmost_mesh.h:3458
_reverse_iterator< reference > reverse_iterator
Definition: container.hpp:595
~TagMemory()
Destructor should not do anything.
Definition: inmost_data.h:147
__INLINE ElementType GetHandleElementType(HandleType h)
Definition: inmost_data.h:93
back_links_type back_links[NUM_ELEMENT_TYPS]
Definition: inmost_data.h:266
array< INMOST_DATA_REAL_TYPE > inner_real_array
Definition: inmost_data.h:117
#define INMOST_DATA_REAL_TYPE
__INLINE void SetMarkerSpace(bulk source[MarkerFields]) const
Definition: inmost_mesh.h:3471
#define INMOST_DATA_BULK_TYPE
_iterator< reference > iterator
Definition: container.hpp:558
const char * DataTypeName(DataType t)
Returns a name of the data type as a string.
__INLINE reference & ReferenceDV(const Tag &tag) const
Definition: inmost_mesh.h:3354
static void CopyData(const Tag &t, void *adata, const void *bdata)
__INLINE Mesh * GetMeshLink() const
Definition: inmost_mesh.h:3517
__INLINE real & RealDV(const Tag &tag) const
Definition: inmost_mesh.h:3342
__INLINE HandleType GetHandle() const
Definition: inmost_mesh.h:3521
__INLINE integer GetElementNum() const
Definition: inmost_mesh.h:3409
__INLINE void SetPrivateMarker(MarkerType n) const
Definition: inmost_mesh.h:3448
void ReallocateData(const Tag &t, INMOST_DATA_INTEGER_TYPE etypenum, INMOST_DATA_ENUM_TYPE new_size)
reverse_iterator(Mesh *m, const shell< HandleType >::reverse_iterator &other)
Definition: inmost_data.h:347
__INLINE remote_reference & RemoteReference(const Tag &tag) const
Definition: inmost_mesh.h:3258
__INLINE ElementType GetElementType() const
Definition: inmost_mesh.h:3405
_reverse_iterator & operator--()
Definition: container.hpp:581
__INLINE ElementSet getAsSet() const
Definition: inmost_mesh.h:3512
__INLINE ElementType ElementTypeFromDim(INMOST_DATA_INTEGER_TYPE dim)
Definition: inmost_data.h:43
_reverse_iterator & operator++()
Definition: container.hpp:579
#define INMOST_DATA_INTEGER_TYPE
__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
__INLINE remote_reference & RemoteReferenceDV(const Tag &tag) const
Definition: inmost_mesh.h:3358
Element operator[](size_type n)
INMOST_DATA_BULK_TYPE ElementType
Definition: inmost_data.h:23
__INLINE bool operator!=(const Tag &other) const
Definition: inmost_data.h:636
__INLINE Cell getAsCell() const
Definition: inmost_mesh.h:3507
__INLINE bool isDefinedByDim(INMOST_DATA_INTEGER_TYPE typenum) const
Definition: inmost_data.h:700
__INLINE HandleType ComposeEdgeHandle(INMOST_DATA_INTEGER_TYPE ID)
Definition: inmost_data.h:97
reverse_iterator & operator=(reverse_iterator const &other)
Definition: inmost_data.h:349
__INLINE integer & IntegerDV(const Tag &tag) const
Definition: inmost_mesh.h:3346
__INLINE ElementType LastElementType()
Definition: inmost_data.h:40
__INLINE dense_sub_type & GetDenseData(int pos)
Definition: inmost_data.h:255
__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
remote_reference_array(const shell< remote_reference > &other)
Definition: inmost_data.h:385
__INLINE HandleType ComposeSetHandle(INMOST_DATA_INTEGER_TYPE ID)
Definition: inmost_data.h:99
tag_array_type tags
Definition: inmost_data.h:262
__INLINE integer_array IntegerArrayDF(const Tag &tag) const
Definition: inmost_mesh.h:3286
#define INMOST_MPI_Type
Tag GetTag(std::string name) const
void push_back(Mesh *m, HandleType h)
Definition: inmost_data.h:389
__INLINE HandleType ComposeCellHandle(INMOST_DATA_INTEGER_TYPE ID)
Definition: inmost_data.h:95
void push_back(const Storage &elem)
__INLINE void GetData(const Tag &tag, INMOST_DATA_ENUM_TYPE shift, INMOST_DATA_ENUM_TYPE size, void *data) const
Definition: inmost_mesh.h:3413
__INLINE bool isValidHandle(HandleType h)
Definition: inmost_data.h:101
__INLINE bool GetPrivateMarker(MarkerType n) const
Definition: inmost_mesh.h:3453
void push_back(const element &e)
Definition: container.hpp:677
__INLINE HandleType ComposeHandleNum(INMOST_DATA_INTEGER_TYPE etypenum, INMOST_DATA_INTEGER_TYPE ID)
Definition: inmost_data.h:100
__INLINE remote_reference & RemoteReferenceDF(const Tag &tag) const
Definition: inmost_mesh.h:3318
__INLINE HandleType ComposeNodeHandle(INMOST_DATA_INTEGER_TYPE ID)
Definition: inmost_data.h:98
array< INMOST_DATA_BULK_TYPE > inner_bulk_array
Definition: inmost_data.h:120
reverse_iterator(const reverse_iterator &other)
Definition: inmost_data.h:348
shell< variable > var_array
Storage type for representing array of values with vectors of variations.
Definition: inmost_data.h:299
__INLINE bool operator>(const Storage &other) const
Definition: inmost_mesh.h:3206
__INLINE Edge getAsEdge() const
Definition: inmost_mesh.h:3497
__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
const_reverse_iterator rbegin() const
Definition: inmost_data.h:373
__INLINE sparse_sub_type & GetSparseData(int etypenum, int local_id)
Definition: inmost_data.h:253
chunk_array< INMOST_DATA_INTEGER_TYPE, chunk_bits_elems > back_links_type
Definition: inmost_data.h:237
__INLINE INMOST_DATA_ENUM_TYPE GetSize() const
Definition: inmost_data.h:664
__INLINE void DelDenseData(const Tag &tag) const
Frees variable array or fills field with zeroes.
Definition: inmost_mesh.h:3425
iterator(Mesh *m, const shell< HandleType >::iterator &other)
Definition: inmost_data.h:319
__INLINE bulk & Bulk(const Tag &tag) const
Definition: inmost_mesh.h:3250
__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
__INLINE size_type size() const
Definition: container.hpp:765
virtual ~TagManager()
_iterator< const reference > const_iterator
Definition: container.hpp:559
__INLINE HandleType ComposeHandle(ElementType etype, INMOST_DATA_INTEGER_TYPE ID)
Definition: inmost_data.h:94
__INLINE bool operator==(const Tag &other) const
Definition: inmost_data.h:631
const_iterator & operator=(const_iterator const &other)
Definition: inmost_data.h:335
array< reference >::size_type size_type
Definition: container.hpp:522
__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 real_array RealArrayDV(const Tag &tag) const
Definition: inmost_mesh.h:3322
Storage type for representing arrays of Element references on another Mesh.
Definition: inmost_data.h:381
#define __INLINE
Definition: inmost_common.h:75
__INLINE Storage * operator->()
Definition: inmost_mesh.h:3226
__INLINE bool isDefined(ElementType type) const
Definition: inmost_data.h:674
__INLINE bool GetMarker(MarkerType n) const
Definition: inmost_mesh.h:3438
bool ElementDefined(Tag const &tag, ElementType etype) const
const char * ElementTypeName(ElementType t)
void ListTagNames(std::vector< std::string > &list) const
An interface for elements of type CELL.
Definition: inmost_mesh.h:635
Element MakeElementRef(RemoteHandleType &rh)
Construct an object of type Element, hande can be modified.
__INLINE void RemMarker(MarkerType n) const
Definition: inmost_mesh.h:3443
__INLINE reference_array ReferenceArray(const Tag &tag) const
Definition: inmost_mesh.h:3274
__INLINE bool operator>=(const Storage &other) const
Definition: inmost_mesh.h:3214
__INLINE void SetBulkDataType(INMOST_MPI_Type type)
Definition: inmost_data.h:705
tag_array_type::iterator iteratorTag
Definition: inmost_data.h:240
const_reverse_iterator(const const_reverse_iterator &other)
Definition: inmost_data.h:362
RemoteHandleType remote_reference
Storage type for representing references to Element in another Mesh.
Definition: inmost_data.h:288
__INLINE reference & Reference(const Tag &tag) const
Definition: inmost_mesh.h:3254
tag_array_type::iterator tag_iterator
Definition: inmost_data.h:259
#define ENUMUNDEF
virtual ~Storage()
Definition: inmost_data.h:445
HandleType * handle_link
Definition: inmost_data.h:424
__INLINE void DelData(const Tag &tag) const
Definition: inmost_mesh.h:3421
#define INMOST_DATA_ENUM_TYPE
INMOST_DATA_REAL_TYPE real
Storage type for representing real values.
Definition: inmost_data.h:278
__INLINE bool operator<(const Tag &other) const
Definition: inmost_data.h:621
const_iterator end() const
Definition: inmost_data.h:375
_iterator & operator=(_iterator const &other)
Definition: container.hpp:549
array< sparse_sub_record > sparse_sub_type
Definition: inmost_data.h:235
_reverse_iterator< const reference > const_reverse_iterator
Definition: container.hpp:596
__INLINE bulk_array BulkArray(const Tag &tag) const
Definition: inmost_mesh.h:3270
shell< bulk > bulk_array
Storage type for representing abstact data as a series of bytes.
Definition: inmost_data.h:294
const_reverse_iterator rend() const
Definition: inmost_data.h:377
__INLINE reference_array ReferenceArrayDV(const Tag &tag) const
Definition: inmost_mesh.h:3334
__INLINE bool operator==(const Storage &other) const
Definition: inmost_mesh.h:3218
Storage(Mesh *mesh, HandleType handle)
Definition: inmost_data.h:429
__INLINE INMOST_DATA_INTEGER_TYPE GetHandleElementNum(HandleType h)
Definition: inmost_data.h:92
remote_reference_array(remote_reference *pntr, shell< remote_reference >::size_type psize)
Definition: inmost_data.h:387
remote_reference_array(const remote_reference_array &other)
Definition: inmost_data.h:386
__INLINE ElementType PrevElementType(ElementType etype)
Definition: inmost_data.h:42
__INLINE real & RealDF(const Tag &tag) const
Definition: inmost_mesh.h:3302
__INLINE Element getAsElement() const
Definition: inmost_mesh.h:3487
__INLINE bool isValid() const
Definition: inmost_mesh.h:3475
static void DestroyVariableData(const Tag &t, void *adata)
virtual Tag DeleteTag(Tag tag, ElementType mask)
__INLINE integer LocalID() const
Definition: inmost_mesh.h:3479
INMOST_DATA_ENUM_TYPE enumerator
type for representing unsigned integer values.
Definition: inmost_data.h:284
array< RemoteHandleType > inner_remote_reference_array
Definition: inmost_data.h:122
__INLINE std::string GetTagName() const
Definition: inmost_data.h:669
chunk_array< dense_sub_type, chunk_bits_dense > dense_data_array_type
Definition: inmost_data.h:233
__INLINE DataType GetDataType() const
Definition: inmost_data.h:647
__INLINE void DelSparseData(const Tag &tag) const
Deallocates space allocated for sparse data, frees variable array if necessary.
Definition: inmost_mesh.h:3429
Storage type for representing arrays of Element references.
Definition: inmost_data.h:302
TagMemory & operator=(TagMemory const &other)
Assignment operator should not be ever used, but is here for convinience.
array< INMOST_DATA_INTEGER_TYPE > inner_integer_array
Definition: inmost_data.h:119
Storage & operator=(Storage const &other)
__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
Tag CreateTag(Mesh *m, std::string name, DataType dtype, ElementType etype, ElementType sparse, INMOST_DATA_ENUM_TYPE size=ENUMUNDEF)
__INLINE void SetDataSize(const Tag &tag, INMOST_DATA_ENUM_TYPE new_size) const
Definition: inmost_mesh.h:3401
chunk_array< sparse_sub_type, chunk_bits_elems > sparse_data_array_type
Definition: inmost_data.h:236
__INLINE bulk_array BulkArrayDF(const Tag &tag) const
Definition: inmost_mesh.h:3290
__INLINE HandleType InvalidHandle()
Definition: inmost_data.h:90
Element MakeElement(const RemoteHandleType &rh)
Construct an object of type Element, hande cannot be modified.
This class provides the access to the individual mesh datum and general information about it...
Definition: inmost_data.h:185
__INLINE remote_reference_array RemoteReferenceArrayDF(const Tag &tag) const
Definition: inmost_mesh.h:3298
std::pair< Mesh *, HandleType > RemoteHandleType
Definition: inmost_data.h:106
__INLINE INMOST_DATA_ENUM_TYPE GetBytesSize() const
Definition: inmost_data.h:659
__INLINE void GetMarkerSpace(bulk copy[MarkerFields]) const
Definition: inmost_mesh.h:3467
const_iterator(Mesh *m, const shell< HandleType >::const_iterator &other)
Definition: inmost_data.h:333
__INLINE real & Real(const Tag &tag) const
Definition: inmost_mesh.h:3242
INMOST_DATA_ENUM_TYPE MarkerType
Low 8 bits - marker mask, rest high bits - position of marker.
Definition: inmost_data.h:62
INMOST_DATA_ENUM_TYPE HandleType
Definition: inmost_data.h:80
Storage(Mesh *mesh, HandleType *handle)
This constructor allows for remote handle modification.
Definition: inmost_data.h:431
empty_data empty_dense_data
Definition: inmost_data.h:263
__INLINE bool isSparse(ElementType type) const
Definition: inmost_data.h:680
__INLINE reference_array ReferenceArrayDF(const Tag &tag) const
Definition: inmost_mesh.h:3294
chunk_array< INMOST_DATA_ENUM_TYPE, chunk_bits_empty > empty_data
Definition: inmost_data.h:230
__INLINE var_array VariableArray(const Tag &tag) const
Retrieve array of variables associated with Tag.
Definition: inmost_mesh.h:3375
__INLINE sparse_sub_type const & GetSparseData(int etypenum, int local_id) const
Definition: inmost_data.h:252
TagManager & operator=(TagManager const &other)
reference_array(Mesh *m, inner_reference_array &arr)
Definition: inmost_data.h:307
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