v0.15.0
Loading...
Searching...
No Matches
TetPolynomialBase.hpp
Go to the documentation of this file.
1/** \file TetPolynomialBase.hpp
2\brief Implementation of Ainsworth-Coyle / Demkowicz or any other H1, Hcurl,
3Hdiv and L2 base on tetrahedral
4
5*/
6
7#ifndef __TETPOLYNOMIALBASE_HPP__
8#define __TETPOLYNOMIALBASE_HPP__
9
10namespace MoFEM {
11
12/**
13 * \brief Calculate base functions on tetrahedral
14 *
15 * \ingroup mofem_base_functions
16 */
18
19 MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
20 UnknownInterface **iface) const;
21
22 TetPolynomialBase(const void *ptr = nullptr);
23 virtual ~TetPolynomialBase();
24
25 template <int SPACE>
26 static bool switchCacheBaseFace(FieldApproximationBase base, void *ptr);
27
28 template <int SPACE>
29 static bool switchCacheBaseInterior(FieldApproximationBase base, void *ptr);
30
31 template <int SPACE>
33 void *ptr);
34
35 template <int SPACE>
37 std::vector<void *> v);
38
39 template <int SPACE>
41 std::vector<void *> v);
42
43 template <int SPACE> static void switchCacheBaseOn(std::vector<void *> v);
44
45 template <int SPACE> static void switchCacheBaseOff(std::vector<void *> v);
46
48 boost::shared_ptr<BaseFunctionCtx> ctx_ptr);
49
50 /**
51 * @brief Set map of dof to side number
52 *
53 * That is used for broken space to establish connection between dofs in the
54 * interior of element/entity and side of element/entity to which that dof is
55 * associated. That depends on implementation of the base for given space, and
56 * has to be implemented while implementing base function for given space.
57 *
58 * @param space
59 * @param continuity
60 * @param base
61 * @param DofsSideMap
62 * @return MoFEMErrorCode
63 */
64 static MoFEMErrorCode
65 setDofsSideMap(const FieldSpace space, const FieldContinuity continuity,
66 const FieldApproximationBase base,
67 DofsSideMap &);
68
69protected:
70 const void *vPtr;
72
73 /**
74 * @brief Get base functions for H1 space
75 *
76 * @param pts matrix of integration pts
77 * @return MoFEMErrorCode
78 *
79 * \note matrix of integration points on rows has local coordinates of
80 * finite element on columns are integration pts.
81 */
83
84 /**
85 * @brief Get base functions for L2 space
86 *
87 * @param pts matrix of integration pts
88 * @return MoFEMErrorCode
89 *
90 * \note matrix of integration points on rows has local coordinates of finite
91 * element on columns are integration pts.
92 */
94
95 /**
96 * @brief Get base functions for Hdiv space
97 *
98 * @param pts matrix of integration pts
99 * @return MoFEMErrorCode
100 *
101 * \note matrix of integration points on rows has local coordinates of finite
102 * element on columns are integration pts.
103 */
105
106 /**
107 * @brief Get base functions for Hcurl space
108 *
109 * @param pts matrix of integration pts
110 * @return MoFEMErrorCode
111 *
112 * \note matrix of integration points on rows has local coordinates of finite
113 * element on columns are integration pts.
114 */
116
117 /**
118 * @brief Set the Dofs Side Map Hdiv object
119 *
120 * @param space
121 * @param continuity
122 * @param base
123 * @param dofs_side_map
124 * @return MoFEMErrorCode
125 */
126 static MoFEMErrorCode setDofsSideMapHdiv(const FieldContinuity continuity,
127 const FieldApproximationBase base,
128 DofsSideMap &dofs_side_map);
129
130protected:
133
136
138
139 MatrixDouble &pts,
140
141 MatrixDouble &shape_functions, MatrixDouble &diff_shape_functions,
142
143 int volume_order, std::array<int, 4> &faces_order,
144 std::array<int, 3 * 4> &faces_nodes,
145
146 boost::function<int(int)> broken_nbfacetri_edge_hdiv,
147 boost::function<int(int)> broken_nbfacetri_face_hdiv,
148 boost::function<int(int)> broken_nbvolumetet_edge_hdiv,
149 boost::function<int(int)> broken_nbvolumetet_face_hdiv,
150 boost::function<int(int)> broken_nbvolumetet_volume_hdiv
151
152 );
153
157
161
163
164 ublas::matrix<MatrixDouble> N_face_edge;
165 ublas::vector<MatrixDouble> N_face_bubble;
166 ublas::vector<MatrixDouble> N_volume_edge;
167 ublas::vector<MatrixDouble> N_volume_face;
169
170 ublas::matrix<MatrixDouble> diffN_face_edge;
171 ublas::vector<MatrixDouble> diffN_face_bubble;
172 ublas::vector<MatrixDouble> diffN_volume_edge;
173 ublas::vector<MatrixDouble> diffN_volume_face;
175};
176
177template <>
179 void *ptr);
180template <>
182 FieldApproximationBase base, void *ptr);
183
184template <>
186 FieldApproximationBase base, void *ptr);
187
188template <>
190 std::vector<void *> v);
191
192template <>
194 std::vector<void *> v);
195
196template <>
198
199template <>
201
202template <>
204 void *ptr);
205
206template <>
208 std::vector<void *> v);
209
210template <>
212 std::vector<void *> v);
213
214template <>
216
217template <>
219
220
221} // namespace MoFEM
222
223#endif //__TETPOLYNOMIALBASE_HPP__
FieldApproximationBase
approximation base
Definition definitions.h:58
FieldSpace
approximation spaces
Definition definitions.h:82
FieldContinuity
Field continuity.
Definition definitions.h:99
const double v
phase velocity of light in medium (cm/ns)
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
UBlasMatrix< int > MatrixInt
Definition Types.hpp:76
implementation of Data Operators for Forces and Sources
Definition Common.hpp:10
Base class if inherited used to calculate base functions.
multi_index_container< DofsSideMapData, indexed_by< ordered_non_unique< tag< TypeSide_mi_tag >, composite_key< DofsSideMapData, member< DofsSideMapData, EntityType, &DofsSideMapData::type >, member< DofsSideMapData, int, &DofsSideMapData::side > > >, ordered_unique< tag< EntDofIdx_mi_tag >, member< DofsSideMapData, int, &DofsSideMapData::dof > > > > DofsSideMap
Map entity stype and side to element/entity dof index.
Class used to pass element data to calculate base functions on tet,triangle,edge.
Calculate base functions on tetrahedral.
ublas::matrix< MatrixDouble > diffN_face_edge
EntPolynomialBaseCtx * cTx
MoFEMErrorCode getValueHdivAinsworthBaseImpl(MatrixDouble &pts, MatrixDouble &shape_functions, MatrixDouble &diff_shape_functions, int volume_order, std::array< int, 4 > &faces_order, std::array< int, 3 *4 > &faces_nodes, boost::function< int(int)> broken_nbfacetri_edge_hdiv, boost::function< int(int)> broken_nbfacetri_face_hdiv, boost::function< int(int)> broken_nbvolumetet_edge_hdiv, boost::function< int(int)> broken_nbvolumetet_face_hdiv, boost::function< int(int)> broken_nbvolumetet_volume_hdiv)
static void switchCacheBaseOff(FieldApproximationBase base, std::vector< void * > v)
MoFEMErrorCode getValueH1AinsworthBase(MatrixDouble &pts)
MoFEMErrorCode getValueHdivAinsworthBrokenBase(MatrixDouble &pts)
ublas::vector< MatrixDouble > diffN_volume_face
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
MoFEMErrorCode getValueL2BernsteinBezierBase(MatrixDouble &pts)
MoFEMErrorCode getValueHcurlDemkowiczBase(MatrixDouble &pts)
static bool switchCacheBaseFace(FieldApproximationBase base, void *ptr)
static void switchCacheBaseOff(std::vector< void * > v)
MoFEMErrorCode getValueHcurl(MatrixDouble &pts)
Get base functions for Hcurl space.
MoFEMErrorCode getValueH1BernsteinBezierBase(MatrixDouble &pts)
static void switchCacheBaseOn(std::vector< void * > v)
static MoFEMErrorCode setDofsSideMap(const FieldSpace space, const FieldContinuity continuity, const FieldApproximationBase base, DofsSideMap &)
Set map of dof to side number.
MoFEMErrorCode getValueH1(MatrixDouble &pts)
Get base functions for H1 space.
ublas::vector< MatrixDouble > diffN_face_bubble
ublas::vector< MatrixDouble > N_volume_edge
ublas::vector< MatrixDouble > N_volume_face
static void switchCacheBaseOn(FieldApproximationBase base, std::vector< void * > v)
MoFEMErrorCode getValueHdiv(MatrixDouble &pts)
Get base functions for Hdiv space.
MoFEMErrorCode getValueHdivAinsworthBase(MatrixDouble &pts)
static bool switchCacheBrokenBaseInterior(FieldApproximationBase base, void *ptr)
MoFEMErrorCode getValueL2AinsworthBase(MatrixDouble &pts)
ublas::vector< MatrixDouble > N_face_bubble
ublas::matrix< MatrixDouble > N_face_edge
MoFEMErrorCode getValueL2(MatrixDouble &pts)
Get base functions for L2 space.
MoFEMErrorCode getValueHdivDemkowiczBase(MatrixDouble &pts)
TetPolynomialBase(const void *ptr=nullptr)
MoFEMErrorCode getValue(MatrixDouble &pts, boost::shared_ptr< BaseFunctionCtx > ctx_ptr)
static bool switchCacheBaseInterior(FieldApproximationBase base, void *ptr)
MoFEMErrorCode getValueHdivDemkowiczBrokenBase(MatrixDouble &pts)
ublas::vector< MatrixDouble > diffN_volume_edge
MoFEMErrorCode getValueHcurlAinsworthBase(MatrixDouble &pts)
static MoFEMErrorCode setDofsSideMapHdiv(const FieldContinuity continuity, const FieldApproximationBase base, DofsSideMap &dofs_side_map)
Set the Dofs Side Map Hdiv object.
base class for all interface classes