v0.14.0
RefElementMultiIndices.hpp
Go to the documentation of this file.
1 /** \file RefElementMultiIndices.hpp
2  * \brief Multi-index contains, data structures for mofem finite elements and
3  * other low-level functions
4  */
5 
6 
7 #ifndef __REF_ELEMENT_MULTIINDICES_HPP__
8 #define __REF_ELEMENT_MULTIINDICES_HPP__
9 
10 namespace MoFEM {
11 
12 /**
13  * \brief keeps data about abstract refined finite element
14  * \ingroup fe_multi_indices
15  */
16 struct RefElement : public interface_RefEntity<RefEntity> {
17 
19 
21 
23  RefElement(const boost::shared_ptr<RefEntity> &ref_ents_ptr);
24  virtual ~RefElement() = default;
25 
26  virtual const BitRefEdges &getBitRefEdges() const { return DummyBitRefEdges; }
27 
28  virtual int getBitRefEdgesUlong() const { return 0; }
29 
31  return const_cast<SideNumber_multiIndex &>(side_number_table);
32  }
33 
34  static const boost::shared_ptr<SideNumber> nullSideNumber;
35 
36  virtual const boost::shared_ptr<SideNumber> &
37  getSideNumberPtr(const EntityHandle ent) const {
38  NOT_USED(ent);
39  return nullSideNumber;
40  };
41 
42  /**
43  * \brief Get pointer to RefEntity
44  */
45  inline boost::shared_ptr<RefEntity> &getRefEntityPtr() const {
46  return this->sPtr;
47  }
48 
49  friend std::ostream &operator<<(std::ostream &os, const RefElement &e);
50 };
51 
52 /**
53  * \brief keeps data about abstract MESHSET finite element
54  * \ingroup fe_multi_indices
55  */
56 struct RefElement_MESHSET : public RefElement {
57  RefElement_MESHSET(const boost::shared_ptr<RefEntity> &ref_ents_ptr);
58  virtual ~RefElement_MESHSET() = default;
59  const boost::shared_ptr<SideNumber> &
60  getSideNumberPtr(const EntityHandle ent) const;
61 };
62 /**
63  * \brief keeps data about abstract PRISM finite element
64  * \ingroup fe_multi_indices
65  */
66 struct RefElement_PRISM : public RefElement {
68  RefElement_PRISM(const boost::shared_ptr<RefEntity> &ref_ents_ptr);
69  virtual ~RefElement_PRISM() = default;
70 
71  const boost::shared_ptr<SideNumber> &
72  getSideNumberPtr(const EntityHandle ent) const;
73  const BitRefEdges &getBitRefEdges() const { return *tag_BitRefEdges; }
74  int getBitRefEdgesUlong() const { return getBitRefEdges().to_ulong(); }
75 };
76 
77 /**
78  * \brief keeps data about abstract TET finite element
79  * \ingroup fe_multi_indices
80  */
81 struct RefElementVolume : public RefElement {
83  RefElementVolume(const boost::shared_ptr<RefEntity> &ref_ents_ptr);
84  virtual ~RefElementVolume() = default;
85 
86  const boost::shared_ptr<SideNumber> &
87  getSideNumberPtr(const EntityHandle ent) const;
89  return const_cast<SideNumber_multiIndex &>(side_number_table);
90  };
91  const BitRefEdges &getBitRefEdges() const { return *tag_BitRefEdges; }
92  int getBitRefEdgesUlong() const { return getBitRefEdges().to_ulong(); }
93 };
94 
95 /**
96  * \brief keeps data about abstract TRI finite element
97  * \ingroup fe_multi_indices
98  */
99 struct RefElementFace : public RefElement {
100  RefElementFace(const boost::shared_ptr<RefEntity> &ref_ents_ptr);
101  virtual ~RefElementFace() = default;
102  const boost::shared_ptr<SideNumber> &
103  getSideNumberPtr(const EntityHandle ent) const;
104  friend std::ostream &operator<<(std::ostream &os, const RefElementFace &e);
105 };
106 
107 /**
108  * \brief keeps data about abstract EDGE finite element
109  * \ingroup fe_multi_indices
110  */
111 struct RefElement_EDGE : public RefElement {
112  RefElement_EDGE(const boost::shared_ptr<RefEntity> &ref_ents_ptr);
113  virtual ~RefElement_EDGE() = default;
114  const boost::shared_ptr<SideNumber> &
115  getSideNumberPtr(const EntityHandle ent) const;
116  friend std::ostream &operator<<(std::ostream &os, const RefElement_EDGE &e);
117 };
118 
119 /**
120  * \brief keeps data about abstract VERTEX finite element
121  * \ingroup fe_multi_indices
122  */
123 struct RefElement_VERTEX : public RefElement {
124  RefElement_VERTEX(const boost::shared_ptr<RefEntity> &ref_ents_ptr);
125  virtual ~RefElement_VERTEX() = default;
126  const boost::shared_ptr<SideNumber> &
127  getSideNumberPtr(const EntityHandle ent) const;
128  friend std::ostream &operator<<(std::ostream &os, const RefElement_VERTEX &e);
129 };
130 
131 /**
132  * \brief intrface to RefElement
133  * \ingroup fe_multi_indices
134  */
135 template <typename T> struct interface_RefElement : interface_RefEntity<T> {
136 
139 
140  interface_RefElement(const boost::shared_ptr<T> &sptr)
141  : interface_RefEntity<T>(sptr) {}
142  virtual ~interface_RefElement() = default;
143 
144  inline int getBitRefEdgesUlong() const {
145  return this->sPtr->getBitRefEdgesUlong();
146  }
147 
149  return this->sPtr->getSideNumberTable();
150  }
151 
152  inline const boost::shared_ptr<SideNumber> &
153  getSideNumberPtr(const EntityHandle ent) const {
154  return this->sPtr->getSideNumberPtr(ent);
155  }
156 
157  inline boost::shared_ptr<RefEntity> &getRefEntityPtr() const {
158  return this->sPtr->getRefEntityPtr();
159  }
160 
161  inline boost::shared_ptr<T> &getRefElement() const { return this->sPtr; }
162 };
163 
164 /**
165  * \typedef RefElement_multiIndex
166  * type multiIndex container for RefElement
167  * \ingroup fe_multi_indices
168  *
169  * \param hashed_unique Ent_mi_tag
170  * \param ordered_non_unique Meshset_mi_tag
171  * \param ordered_non_unique Ent_Ent_mi_tag
172  * \param ordered_non_unique Composite_ParentEnt_And_BitsOfRefinedEdges_mi_tag
173  */
174 typedef multi_index_container<
175  boost::shared_ptr<RefElement>,
176  // ptrWrapperRefElement,
177  indexed_by<ordered_unique<
178  tag<Ent_mi_tag>, const_mem_fun<RefElement::interface_type_RefEntity,
181 
182 
183 
184 } // namespace MoFEM
185 
186 #endif // __REF_ELEMENT_MULTIINDICES_HPP__
187 
188 /**
189  * \defgroup fe_multi_indices Finite elements structures and multi-indices
190  * \ingroup mofem
191  **/
MoFEM::RefElement::RefElement
RefElement(const boost::shared_ptr< RefEntity > &ref_ents_ptr)
Definition: RefElementMultiIndices.cpp:15
MoFEM::interface_RefElement::interface_type_RefEntity
interface_RefEntity< T > interface_type_RefEntity
Definition: RefElementMultiIndices.hpp:137
MoFEM::interface_RefElement::getSideNumberPtr
const boost::shared_ptr< SideNumber > & getSideNumberPtr(const EntityHandle ent) const
Definition: RefElementMultiIndices.hpp:153
MoFEM::RefElementVolume::tag_BitRefEdges
BitRefEdges * tag_BitRefEdges
Definition: RefElementMultiIndices.hpp:82
MoFEM::RefElement::nullSideNumber
static const boost::shared_ptr< SideNumber > nullSideNumber
Definition: RefElementMultiIndices.hpp:34
EntityHandle
MoFEM::interface_RefElement::getRefEntityPtr
boost::shared_ptr< RefEntity > & getRefEntityPtr() const
Definition: RefElementMultiIndices.hpp:157
MoFEM::RefElement_multiIndex
multi_index_container< boost::shared_ptr< RefElement >, indexed_by< ordered_unique< tag< Ent_mi_tag >, const_mem_fun< RefElement::interface_type_RefEntity, EntityHandle, &RefElement::getEnt > > > > RefElement_multiIndex
Definition: RefElementMultiIndices.hpp:180
MoFEM::RefElement::~RefElement
virtual ~RefElement()=default
MoFEM::RefElementVolume::getBitRefEdgesUlong
int getBitRefEdgesUlong() const
Definition: RefElementMultiIndices.hpp:92
MoFEM::interface_RefEntity< RefEntity >::sPtr
boost::shared_ptr< RefEntity > sPtr
Definition: RefEntsMultiIndices.hpp:711
MoFEM::RefElement::getBitRefEdgesUlong
virtual int getBitRefEdgesUlong() const
Definition: RefElementMultiIndices.hpp:28
MoFEM::interface_RefEntity< RefEntity >::getEnt
EntityHandle getEnt() const
Get the entity handle.
Definition: RefEntsMultiIndices.hpp:603
NOT_USED
#define NOT_USED(x)
Definition: definitions.h:255
MoFEM::RefElementFace::~RefElementFace
virtual ~RefElementFace()=default
MoFEM::interface_RefEntity
interface to RefEntity
Definition: FieldMultiIndices.hpp:19
MoFEM::interface_RefElement::getSideNumberTable
SideNumber_multiIndex & getSideNumberTable() const
Definition: RefElementMultiIndices.hpp:148
MoFEM::RefElement::interface_type_RefEntity
interface_RefEntity< RefEntity > interface_type_RefEntity
Definition: RefElementMultiIndices.hpp:18
MoFEM::RefElement_PRISM::getBitRefEdgesUlong
int getBitRefEdgesUlong() const
Definition: RefElementMultiIndices.hpp:74
MoFEM::interface_RefElement
intrface to RefElement
Definition: RefElementMultiIndices.hpp:135
MoFEM::RefElementVolume::RefElementVolume
RefElementVolume(const boost::shared_ptr< RefEntity > &ref_ents_ptr)
Definition: RefElementMultiIndices.cpp:282
MoFEM::RefElementVolume::getBitRefEdges
const BitRefEdges & getBitRefEdges() const
Definition: RefElementMultiIndices.hpp:91
MoFEM::RefElementFace::operator<<
friend std::ostream & operator<<(std::ostream &os, const RefElementFace &e)
Definition: RefElementMultiIndices.cpp:408
MoFEM::RefElementVolume::getSideNumberTable
SideNumber_multiIndex & getSideNumberTable() const
Definition: RefElementMultiIndices.hpp:88
MoFEM::interface_RefElement::~interface_RefElement
virtual ~interface_RefElement()=default
MoFEM::RefElement_PRISM::~RefElement_PRISM
virtual ~RefElement_PRISM()=default
MoFEM::interface_RefElement::interface_type_RefElement
interface_RefElement< T > interface_type_RefElement
Definition: RefElementMultiIndices.hpp:138
MoFEM::RefElement_VERTEX::~RefElement_VERTEX
virtual ~RefElement_VERTEX()=default
MoFEM::RefElement_EDGE::~RefElement_EDGE
virtual ~RefElement_EDGE()=default
MoFEM
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
MoFEM::RefElement::getSideNumberPtr
virtual const boost::shared_ptr< SideNumber > & getSideNumberPtr(const EntityHandle ent) const
Definition: RefElementMultiIndices.hpp:37
MoFEM::RefElement_MESHSET::~RefElement_MESHSET
virtual ~RefElement_MESHSET()=default
MoFEM::RefElement::getBitRefEdges
virtual const BitRefEdges & getBitRefEdges() const
Definition: RefElementMultiIndices.hpp:26
MoFEM::RefElement_EDGE::RefElement_EDGE
RefElement_EDGE(const boost::shared_ptr< RefEntity > &ref_ents_ptr)
Definition: RefElementMultiIndices.cpp:412
MoFEM::RefElement_EDGE
keeps data about abstract EDGE finite element
Definition: RefElementMultiIndices.hpp:111
MoFEM::RefElement::getSideNumberTable
SideNumber_multiIndex & getSideNumberTable() const
Definition: RefElementMultiIndices.hpp:30
SideNumber_multiIndex
multi_index_container< boost::shared_ptr< SideNumber >, indexed_by< ordered_unique< member< SideNumber, EntityHandle, &SideNumber::ent > >, ordered_non_unique< composite_key< SideNumber, const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType >, member< SideNumber, signed char, &SideNumber::side_number > > > > > SideNumber_multiIndex
SideNumber_multiIndex for SideNumber.
Definition: RefEntsMultiIndices.hpp:101
MoFEM::RefElementFace::RefElementFace
RefElementFace(const boost::shared_ptr< RefEntity > &ref_ents_ptr)
Definition: RefElementMultiIndices.cpp:338
MoFEM::RefElement_MESHSET
keeps data about abstract MESHSET finite element
Definition: RefElementMultiIndices.hpp:56
MoFEM::RefElement::getRefEntityPtr
boost::shared_ptr< RefEntity > & getRefEntityPtr() const
Get pointer to RefEntity.
Definition: RefElementMultiIndices.hpp:45
MoFEM::RefElement_PRISM::RefElement_PRISM
RefElement_PRISM(const boost::shared_ptr< RefEntity > &ref_ents_ptr)
Definition: RefElementMultiIndices.cpp:44
MoFEM::RefElement
keeps data about abstract refined finite element
Definition: RefElementMultiIndices.hpp:16
MoFEM::RefElement_MESHSET::RefElement_MESHSET
RefElement_MESHSET(const boost::shared_ptr< RefEntity > &ref_ents_ptr)
Definition: RefElementMultiIndices.cpp:24
MoFEM::RefElement::operator<<
friend std::ostream & operator<<(std::ostream &os, const RefElement &e)
Definition: RefElementMultiIndices.cpp:18
MoFEM::RefElement_PRISM::tag_BitRefEdges
BitRefEdges * tag_BitRefEdges
Definition: RefElementMultiIndices.hpp:67
MoFEM::interface_RefEntity< RefEntity >::getSideNumberPtr
boost::shared_ptr< SideNumber > getSideNumberPtr() const
Get the Side number.
Definition: RefEntsMultiIndices.hpp:589
MoFEM::interface_RefElement::interface_RefElement
interface_RefElement(const boost::shared_ptr< T > &sptr)
Definition: RefElementMultiIndices.hpp:140
MoFEM::RefElement_PRISM::getBitRefEdges
const BitRefEdges & getBitRefEdges() const
Definition: RefElementMultiIndices.hpp:73
MoFEM::RefElement_VERTEX
keeps data about abstract VERTEX finite element
Definition: RefElementMultiIndices.hpp:123
MoFEM::RefElement_PRISM
keeps data about abstract PRISM finite element
Definition: RefElementMultiIndices.hpp:66
MoFEM::RefElement::side_number_table
SideNumber_multiIndex side_number_table
Definition: RefElementMultiIndices.hpp:22
MoFEM::Types::BitRefEdges
std::bitset< BITREFEDGES_SIZE > BitRefEdges
Definition: Types.hpp:34
MoFEM::RefElement_VERTEX::RefElement_VERTEX
RefElement_VERTEX(const boost::shared_ptr< RefEntity > &ref_ents_ptr)
Definition: RefElementMultiIndices.cpp:456
MoFEM::RefElementVolume
keeps data about abstract TET finite element
Definition: RefElementMultiIndices.hpp:81
MoFEM::interface_RefElement::getBitRefEdgesUlong
int getBitRefEdgesUlong() const
Definition: RefElementMultiIndices.hpp:144
MoFEM::interface_RefElement::getRefElement
boost::shared_ptr< T > & getRefElement() const
Definition: RefElementMultiIndices.hpp:161
MoFEM::RefElement::DummyBitRefEdges
static BitRefEdges DummyBitRefEdges
Definition: RefElementMultiIndices.hpp:20
MoFEM::RefElement_VERTEX::operator<<
friend std::ostream & operator<<(std::ostream &os, const RefElement_VERTEX &e)
Definition: RefElementMultiIndices.cpp:488
MoFEM::RefElementVolume::~RefElementVolume
virtual ~RefElementVolume()=default
MoFEM::RefElement_EDGE::operator<<
friend std::ostream & operator<<(std::ostream &os, const RefElement_EDGE &e)
Definition: RefElementMultiIndices.cpp:452
MoFEM::RefElementFace
keeps data about abstract TRI finite element
Definition: RefElementMultiIndices.hpp:99