v0.13.1
Loading...
Searching...
No Matches
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
10namespace MoFEM {
11
12/**
13 * \brief keeps data about abstract refined finite element
14 * \ingroup fe_multi_indices
15 */
16struct 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 */
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 */
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 */
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 */
99struct 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 */
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 */
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 */
135template <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> &
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 */
174typedef 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 **/
#define NOT_USED(x)
Definition: definitions.h:242
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.
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
const double T
std::bitset< BITREFEDGES_SIZE > BitRefEdges
Definition: Types.hpp:34
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
keeps data about abstract EDGE finite element
friend std::ostream & operator<<(std::ostream &os, const RefElement_EDGE &e)
virtual ~RefElement_EDGE()=default
keeps data about abstract MESHSET finite element
virtual ~RefElement_MESHSET()=default
keeps data about abstract PRISM finite element
const BitRefEdges & getBitRefEdges() const
virtual ~RefElement_PRISM()=default
keeps data about abstract VERTEX finite element
virtual ~RefElement_VERTEX()=default
friend std::ostream & operator<<(std::ostream &os, const RefElement_VERTEX &e)
keeps data about abstract TRI finite element
virtual ~RefElementFace()=default
friend std::ostream & operator<<(std::ostream &os, const RefElementFace &e)
keeps data about abstract refined finite element
friend std::ostream & operator<<(std::ostream &os, const RefElement &e)
virtual const BitRefEdges & getBitRefEdges() const
virtual const boost::shared_ptr< SideNumber > & getSideNumberPtr(const EntityHandle ent) const
static BitRefEdges DummyBitRefEdges
boost::shared_ptr< RefEntity > & getRefEntityPtr() const
Get pointer to RefEntity.
SideNumber_multiIndex side_number_table
static const boost::shared_ptr< SideNumber > nullSideNumber
interface_RefEntity< RefEntity > interface_type_RefEntity
SideNumber_multiIndex & getSideNumberTable() const
virtual ~RefElement()=default
virtual int getBitRefEdgesUlong() const
keeps data about abstract TET finite element
const BitRefEdges & getBitRefEdges() const
SideNumber_multiIndex & getSideNumberTable() const
virtual ~RefElementVolume()=default
interface_RefElement(const boost::shared_ptr< T > &sptr)
interface_RefEntity< T > interface_type_RefEntity
const boost::shared_ptr< SideNumber > & getSideNumberPtr(const EntityHandle ent) const
boost::shared_ptr< RefEntity > & getRefEntityPtr() const
SideNumber_multiIndex & getSideNumberTable() const
interface_RefElement< T > interface_type_RefElement
boost::shared_ptr< T > & getRefElement() const
virtual ~interface_RefElement()=default
boost::shared_ptr< SideNumber > getSideNumberPtr() const