v0.16.0
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MoFEM::EdgePolynomialBase Struct Reference

Calculate base functions on tetrahedral. More...

#include "src/approximation/EdgePolynomialBase.hpp"

Inheritance diagram for MoFEM::EdgePolynomialBase:
[legend]
Collaboration diagram for MoFEM::EdgePolynomialBase:
[legend]

Public Member Functions

MoFEMErrorCode query_interface (boost::typeindex::type_index type_index, UnknownInterface **iface) const
 
 EdgePolynomialBase ()=default
 
virtual ~EdgePolynomialBase ()=default
 
MoFEMErrorCode getValue (MatrixDouble &pts, boost::shared_ptr< BaseFunctionCtx > ctx_ptr)
 
- Public Member Functions inherited from MoFEM::BaseFunction
virtual MoFEMErrorCode getValue (MatrixDouble &pts_x, MatrixDouble &pts_t, boost::shared_ptr< BaseFunctionCtx > ctx_ptr)
 
- Public Member Functions inherited from MoFEM::BaseFunctionUnknownInterface
virtual ~BaseFunctionUnknownInterface ()=default
 
- Public Member Functions inherited from MoFEM::UnknownInterface
template<class IFACE >
MoFEMErrorCode registerInterface (bool error_if_registration_failed=true)
 Register interface.
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE *&iface) const
 Get interface reference to pointer of interface.
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE **const iface) const
 Get interface pointer to pointer of interface.
 
template<class IFACE , typename boost::enable_if< boost::is_pointer< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get interface pointer to pointer of interface.
 
template<class IFACE , typename boost::enable_if< boost::is_reference< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get reference to interface.
 
template<class IFACE >
IFACE * getInterface () const
 Function returning pointer to interface.
 
virtual ~UnknownInterface ()=default
 

Private Member Functions

MoFEMErrorCode getValueH1 (MatrixDouble &pts)
 
MoFEMErrorCode getValueH1AinsworthBase (MatrixDouble &pts)
 
MoFEMErrorCode getValueH1DemkowiczBase (MatrixDouble &pts)
 
MoFEMErrorCode getValueH1BernsteinBezierBase (MatrixDouble &pts)
 
MoFEMErrorCode getValueL2 (MatrixDouble &pts)
 
MoFEMErrorCode getValueL2AinsworthBase (MatrixDouble &pts)
 
MoFEMErrorCode getValueL2DemkowiczBase (MatrixDouble &pts)
 
MoFEMErrorCode getValueHdiv (MatrixDouble &pts)
 
MoFEMErrorCode getValueHcurl (MatrixDouble &pts)
 
MoFEMErrorCode getValueHcurlAinsworthBase (MatrixDouble &pts)
 
MoFEMErrorCode getValueHcurlDemkowiczBase (MatrixDouble &pts)
 

Private Attributes

EntPolynomialBaseCtxcTx
 
VectorDouble L
 
VectorDouble diffL
 

Additional Inherited Members

- Public Types inherited from MoFEM::BaseFunction
using DofsSideMap = 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 > > > >
 Map entity stype and side to element/entity dof index.
 
- Static Public Member Functions inherited from MoFEM::UnknownInterface
static MoFEMErrorCode getLibVersion (Version &version)
 Get library version.
 
static MoFEMErrorCode getFileVersion (moab::Interface &moab, Version &version)
 Get database major version.
 
static MoFEMErrorCode setFileVersion (moab::Interface &moab, Version version=Version(MoFEM_VERSION_MAJOR, MoFEM_VERSION_MINOR, MoFEM_VERSION_BUILD))
 Get database major version.
 
static MoFEMErrorCode getInterfaceVersion (Version &version)
 Get database major version.
 

Detailed Description

Calculate base functions on tetrahedral.

Definition at line 19 of file EdgePolynomialBase.hpp.

Constructor & Destructor Documentation

◆ EdgePolynomialBase()

MoFEM::EdgePolynomialBase::EdgePolynomialBase ( )
default

◆ ~EdgePolynomialBase()

virtual MoFEM::EdgePolynomialBase::~EdgePolynomialBase ( )
virtualdefault

Member Function Documentation

◆ getValue()

MoFEMErrorCode EdgePolynomialBase::getValue ( MatrixDouble pts,
boost::shared_ptr< BaseFunctionCtx ctx_ptr 
)
virtual

Reimplemented from MoFEM::BaseFunction.

Definition at line 15 of file EdgePolynomialBase.cpp.

16 {
18
20
21 int nb_gauss_pts = pts.size2();
22 if (!nb_gauss_pts)
24
25 if (pts.size1() < 1)
26 SETERRQ(
27 PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
28 "Wrong dimension of pts, should be at least 3 rows with coordinates");
29
30 const FieldApproximationBase base = cTx->bAse;
31 EntitiesFieldData &data = cTx->dAta;
32
34 if (cTx->copyNodeBase == LASTBASE) {
35 data.dataOnEntities[MBVERTEX][0].getN(base).resize(nb_gauss_pts, 2,
36 false);
38 &*data.dataOnEntities[MBVERTEX][0].getN(base).data().begin(),
39 &pts(0, 0), nb_gauss_pts);
40 } else
41 data.dataOnEntities[MBVERTEX][0].getN(base) =
42 data.dataOnEntities[MBVERTEX][0].getN(cTx->copyNodeBase);
43
44 if (data.dataOnEntities[MBVERTEX][0].getN(base).size1() !=
45 (unsigned int)nb_gauss_pts)
46 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
47 "Base functions or nodes has wrong number of integration points "
48 "for base %s",
50
51 data.dataOnEntities[MBVERTEX][0].getDiffN(base).resize(nb_gauss_pts, 2 * 1,
52 false);
53 for (auto gg = 0; gg != nb_gauss_pts; ++gg)
54 std::copy(Tools::diffShapeFunMBEDGE.begin(),
56 &data.dataOnEntities[MBVERTEX][0].getDiffN(base)(gg, 0));
57 }
58
59 switch (cTx->sPace) {
60 case H1:
62 case HDIV:
64 case HCURL:
66 case L2:
68 default:
69 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "Not yet implemented");
70 }
71
73}
FieldApproximationBase
approximation base
Definition definitions.h:58
@ LASTBASE
Definition definitions.h:69
@ AINSWORTH_BERNSTEIN_BEZIER_BASE
Definition definitions.h:64
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ L2
field with C-1 continuity
Definition definitions.h:88
@ H1
continuous field
Definition definitions.h:85
@ HCURL
field with continuous tangents
Definition definitions.h:86
@ HDIV
field with continuous normal traction
Definition definitions.h:87
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
@ MOFEM_NOT_IMPLEMENTED
Definition definitions.h:32
static const char *const ApproximationBaseNames[]
Definition definitions.h:72
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
PetscErrorCode ShapeMBEDGE(double *N, const double *G_X, int DIM)
Definition fem_tools.c:761
MoFEMErrorCode getValueHdiv(MatrixDouble &pts)
MoFEMErrorCode getValueHcurl(MatrixDouble &pts)
MoFEMErrorCode getValueL2(MatrixDouble &pts)
EntPolynomialBaseCtx * cTx
MoFEMErrorCode getValueH1(MatrixDouble &pts)
Class used to pass element data to calculate base functions on tet,triangle,edge.
const FieldApproximationBase copyNodeBase
const FieldApproximationBase bAse
data structure for finite element entity
std::array< boost::ptr_vector< EntData >, MBMAXTYPE > dataOnEntities
static constexpr std::array< double, 2 > diffShapeFunMBEDGE
Definition Tools.hpp:68
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.

◆ getValueH1()

MoFEMErrorCode EdgePolynomialBase::getValueH1 ( MatrixDouble pts)
private

Definition at line 75 of file EdgePolynomialBase.cpp.

75 {
77
78 switch (cTx->bAse) {
82 break;
85 break;
88 break;
89 default:
90 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "Not implemented");
91 }
92
94}
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
Definition definitions.h:60
@ AINSWORTH_LOBATTO_BASE
Definition definitions.h:62
@ DEMKOWICZ_JACOBI_BASE
Definition definitions.h:66
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
MoFEMErrorCode getValueH1AinsworthBase(MatrixDouble &pts)
MoFEMErrorCode getValueH1DemkowiczBase(MatrixDouble &pts)
MoFEMErrorCode getValueH1BernsteinBezierBase(MatrixDouble &pts)

◆ getValueH1AinsworthBase()

MoFEMErrorCode EdgePolynomialBase::getValueH1AinsworthBase ( MatrixDouble pts)
private

Definition at line 192 of file EdgePolynomialBase.cpp.

192 {
194
195 EntitiesFieldData &data = cTx->dAta;
196 const FieldApproximationBase base = cTx->bAse;
197 PetscErrorCode (*base_polynomials)(int p, double s, double *diff_s, double *L,
198 double *diffL, const int dim) =
200
201 int nb_gauss_pts = pts.size2();
202
203 const int side_number = 0;
204 int sense = data.dataOnEntities[MBEDGE][side_number].getSense();
205 int order = data.dataOnEntities[MBEDGE][side_number].getOrder();
206 data.dataOnEntities[MBEDGE][side_number].getN(base).resize(
207 nb_gauss_pts, NBEDGE_H1(order), false);
208 data.dataOnEntities[MBEDGE][side_number].getDiffN(base).resize(
209 nb_gauss_pts, NBEDGE_H1(order), false);
210
211 data.dataOnEntities[MBEDGE][side_number].getN(base).clear();
212 data.dataOnEntities[MBEDGE][side_number].getDiffN(base).clear();
213
214 L.resize(NBEDGE_H1(order), false);
215 diffL.resize(NBEDGE_H1(order), false);
216
217 if (data.dataOnEntities[MBEDGE][side_number].getOrder() > 1) {
218
219#ifndef NDEBUG
220 if (sense != 1 && sense != -1)
221 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
222 "Wrong sense of edge, should be 1 or -1");
223#endif
224
225 for (int gg = 0; gg != nb_gauss_pts; gg++) {
226
227 double s = (2. * pts(0, gg) - 1) * sense; // from [-1..1] * sense
228 double diff_s = 2. * sense; // oriented s = s(xi), ds/dxi = 2 * sense
229
230 // calculate Legendre polynomials at integration points
231 CHKERR base_polynomials(NBEDGE_H1(order) - 1, s, &diff_s,
232 &*L.data().begin(), &*diffL.data().begin(), 1);
233
234 for (unsigned int pp = 0;
235 pp < data.dataOnEntities[MBEDGE][side_number].getN(base).size2();
236 pp++) {
237
238 // Calculate edge shape functions N0*N1*L(p), where N0 and N1 are nodal
239 // shape functions
240 double v = data.dataOnEntities[MBVERTEX][0].getN(base)(gg, 0) *
241 data.dataOnEntities[MBVERTEX][0].getN(base)(gg, 1);
242 data.dataOnEntities[MBEDGE][side_number].getN(base)(gg, pp) = v * L(pp);
243
244 // Calculate derivative edge shape functions
245 // dN/dksi = dN0/dxi*N1*L + N0*dN1/ksi*L + N0*N1*dL/dxi
246 data.dataOnEntities[MBEDGE][side_number].getDiffN(base)(gg, pp) =
247 ((-1.) * data.dataOnEntities[MBVERTEX][0].getN(base)(gg, 1) +
248 data.dataOnEntities[MBVERTEX][0].getN(base)(gg, 0) * (+1.)) *
249 L(pp) +
250 v * diffL(pp);
251 }
252 }
253 }
254
256}
constexpr int order
#define NBEDGE_H1(P)
Number of base function on edge for H1 space.
const double v
phase velocity of light in medium (cm/ns)
PetscErrorCode(* basePolynomialsType0)(int p, double s, double *diff_s, double *L, double *diffL, const int dim)

◆ getValueH1BernsteinBezierBase()

MoFEMErrorCode EdgePolynomialBase::getValueH1BernsteinBezierBase ( MatrixDouble pts)
private

Definition at line 97 of file EdgePolynomialBase.cpp.

97 {
99
100 EntitiesFieldData &data = cTx->dAta;
101 const std::string &field_name = cTx->fieldName;
102 const int nb_gauss_pts = pts.size2();
103
104 auto get_alpha = [field_name](auto &data) -> MatrixInt & {
105 auto &ptr = data.getBBAlphaIndicesSharedPtr(field_name);
106 if (!ptr)
107 ptr.reset(new MatrixInt());
108 return *ptr;
109 };
110
111 auto get_base = [field_name](auto &data) -> MatrixDouble & {
112 auto &ptr = data.getBBNSharedPtr(field_name);
113 if (!ptr)
114 ptr.reset(new MatrixDouble());
115 return *ptr;
116 };
117
118 auto get_diff_base = [field_name](auto &data) -> MatrixDouble & {
119 auto &ptr = data.getBBDiffNSharedPtr(field_name);
120 if (!ptr)
121 ptr.reset(new MatrixDouble());
122 return *ptr;
123 };
124
125 auto &get_n = get_base(data.dataOnEntities[MBVERTEX][0]);
126 auto &get_diff_n = get_diff_base(data.dataOnEntities[MBVERTEX][0]);
127 get_n.resize(nb_gauss_pts, 2, false);
128 get_diff_n.resize(nb_gauss_pts, 2, false);
129 get_n.clear();
130 get_diff_n.clear();
131
132 if (data.dataOnEntities[MBVERTEX][0].getN(NOBASE).size1() !=
133 (unsigned int)nb_gauss_pts)
134 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
135 "Base functions or nodes has wrong number of integration points "
136 "for base %s",
138 auto &lambda = data.dataOnEntities[MBVERTEX][0].getN(NOBASE);
139
140 auto &vertex_alpha = get_alpha(data.dataOnEntities[MBVERTEX][0]);
141 vertex_alpha.resize(2, 2, false);
142 vertex_alpha(0, 0) = data.dataOnEntities[MBVERTEX][0].getBBNodeOrder()[0];
143 vertex_alpha(0, 1) = 0;
144 vertex_alpha(1, 0) = 0;
145 vertex_alpha(1, 1) = data.dataOnEntities[MBVERTEX][0].getBBNodeOrder()[1];
146
148 1, nb_gauss_pts, vertex_alpha.size1(), &vertex_alpha(0, 0), &lambda(0, 0),
149 Tools::diffShapeFunMBEDGE.data(), &get_n(0, 0), &get_diff_n(0, 0));
150 std::array<double, 2> f = {
151 boost::math::factorial<double>(
152 data.dataOnEntities[MBVERTEX][0].getBBNodeOrder()[0]),
153 boost::math::factorial<double>(
154 data.dataOnEntities[MBVERTEX][0].getBBNodeOrder()[1])};
155
156 for (int g = 0; g != nb_gauss_pts; ++g)
157 for (int n = 0; n != 2; ++n) {
158 get_n(g, n) *= f[n];
159 get_diff_n(g, n) *= f[n];
160 }
161
162 if (data.spacesOnEntities[MBEDGE].test(H1)) {
163 if (data.dataOnEntities[MBEDGE].size() != 1)
164 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
165 "Wrong size ent of ent data");
166
167 int order = data.dataOnEntities[MBEDGE][0].getOrder();
168 const int nb_dofs = NBEDGE_H1(order);
169
170 auto &get_n = get_base(data.dataOnEntities[MBEDGE][0]);
171 auto &get_diff_n = get_diff_base(data.dataOnEntities[MBEDGE][0]);
172 get_n.resize(nb_gauss_pts, nb_dofs, false);
173 get_diff_n.resize(nb_gauss_pts, nb_dofs, false);
174
175 if (nb_dofs) {
176 auto &edge_alpha = get_alpha(data.dataOnEntities[MBEDGE][0]);
177 edge_alpha.resize(nb_dofs, 2);
180 order, nb_gauss_pts, edge_alpha.size1(), &edge_alpha(0, 0),
181 &lambda(0, 0), Tools::diffShapeFunMBEDGE.data(), &get_n(0, 0),
182 &get_diff_n(0, 0));
183 }
184 } else {
185 get_n.resize(nb_gauss_pts, 0, false);
186 get_diff_n.resize(nb_gauss_pts, 0, false);
187 }
188
190}
@ NOBASE
Definition definitions.h:59
static double lambda
const double n
refractive index of diffusive medium
UBlasMatrix< double > MatrixDouble
Definition Types.hpp:77
UBlasMatrix< int > MatrixInt
Definition Types.hpp:76
constexpr auto field_name
constexpr double g
static MoFEMErrorCode baseFunctionsEdge(const int N, const int gdim, const int n_alpha, const int *alpha, const double *lambda, const double *grad_lambda, double *base, double *grad_base)
static MoFEMErrorCode generateIndicesEdgeEdge(const int N, int *alpha)
std::array< std::bitset< LASTSPACE >, MBMAXTYPE > spacesOnEntities
spaces on entity types

◆ getValueH1DemkowiczBase()

MoFEMErrorCode EdgePolynomialBase::getValueH1DemkowiczBase ( MatrixDouble pts)
private

Definition at line 258 of file EdgePolynomialBase.cpp.

258 {
260
261 EntitiesFieldData &data = cTx->dAta;
262 const FieldApproximationBase base = cTx->bAse;
263
264 int nb_gauss_pts = pts.size2();
265
266 const int side_number = 0;
267 int order = data.dataOnEntities[MBEDGE][side_number].getOrder();
268
269 data.dataOnEntities[MBEDGE][side_number].getN(base).resize(
270 nb_gauss_pts, NBEDGE_H1(order), false);
271 data.dataOnEntities[MBEDGE][side_number].getDiffN(base).resize(
272 nb_gauss_pts, NBEDGE_H1(order), false);
273
274 data.dataOnEntities[MBEDGE][side_number].getN(base).clear();
275 data.dataOnEntities[MBEDGE][side_number].getDiffN(base).clear();
276
277 double diff_shape[] = {-1, 1};
278 MatrixDouble shape(nb_gauss_pts, 2);
279
280 if (NBEDGE_L2(order)) {
281 for (int gg = 0; gg != nb_gauss_pts; gg++) {
282 const double mu0 = 1.0 - pts(0, gg); // pts ranges over [0, 1]
283 const double mu1 = pts(0, gg);
284 shape(gg, 0) = mu0;
285 shape(gg, 1) = mu1;
286 }
287
289 order, &*shape.data().begin(), diff_shape,
290 &*data.dataOnEntities[MBEDGE][side_number].getN(base).data().begin(),
291 &*data.dataOnEntities[MBEDGE][side_number]
292 .getDiffN(base)
293 .data()
294 .begin(),
295 nb_gauss_pts);
296 }
297
299}
#define NBEDGE_L2(P)
Number of base functions on edge from L2 space.
MoFEMErrorCode H1_BubbleShapeFunctions_ONSEGMENT(int p, double *N, double *diffN, double *bubbleN, double *diff_bubbleN, int nb_integration_pts)

◆ getValueHcurl()

MoFEMErrorCode EdgePolynomialBase::getValueHcurl ( MatrixDouble pts)
private

Definition at line 454 of file EdgePolynomialBase.cpp.

454 {
456
457 switch (cTx->bAse) {
463 default:
464 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "Not implemented");
465 }
466
468}
MoFEMErrorCode getValueHcurlDemkowiczBase(MatrixDouble &pts)
MoFEMErrorCode getValueHcurlAinsworthBase(MatrixDouble &pts)

◆ getValueHcurlAinsworthBase()

MoFEMErrorCode EdgePolynomialBase::getValueHcurlAinsworthBase ( MatrixDouble pts)
private

Definition at line 375 of file EdgePolynomialBase.cpp.

375 {
377
378 EntitiesFieldData &data = cTx->dAta;
379 const FieldApproximationBase base = cTx->bAse;
380
381 PetscErrorCode (*base_polynomials)(int p, double s, double *diff_s, double *L,
382 double *diffL, const int dim) =
384
385 int nb_gauss_pts = pts.size2();
386 if (data.spacesOnEntities[MBEDGE].test(HCURL)) {
387
388 if (data.dataOnEntities[MBEDGE].size() != 1)
389 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
390
391 int sense = data.dataOnEntities[MBEDGE][0].getSense();
392 int order = data.dataOnEntities[MBEDGE][0].getOrder();
393 int nb_dofs =
394 NBEDGE_AINSWORTH_HCURL(data.dataOnEntities[MBEDGE][0].getOrder());
395 data.dataOnEntities[MBEDGE][0].getN(base).resize(nb_gauss_pts, 3 * nb_dofs,
396 false);
397 data.dataOnEntities[MBEDGE][0].getDiffN(base).resize(nb_gauss_pts, 0,
398 false);
399
401 sense, order, &data.dataOnEntities[MBVERTEX][0].getN(base)(0, 0),
402 &*data.dataOnEntities[MBVERTEX][0].getDiffN(base).data().begin(),
403 &*data.dataOnEntities[MBEDGE][0].getN(base).data().begin(), nullptr,
404 nb_gauss_pts, base_polynomials);
405
406 } else {
407 data.dataOnEntities[MBEDGE][0].getN(base).resize(nb_gauss_pts, 0, false);
408 data.dataOnEntities[MBEDGE][0].getDiffN(base).resize(nb_gauss_pts, 0,
409 false);
410 }
411
413}
#define NBEDGE_AINSWORTH_HCURL(P)
MoFEMErrorCode Hcurl_Ainsworth_EdgeBaseFunctions_MBTET_ON_EDGE(int sense, int p, double *N, double *diffN, double *edgeN, double *diff_edgeN, int nb_integration_pts, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
Edge based H-curl base functions on edge.
Definition Hcurl.cpp:175

◆ getValueHcurlDemkowiczBase()

MoFEMErrorCode EdgePolynomialBase::getValueHcurlDemkowiczBase ( MatrixDouble pts)
private

Definition at line 416 of file EdgePolynomialBase.cpp.

416 {
418
419 EntitiesFieldData &data = cTx->dAta;
420 const FieldApproximationBase base = cTx->bAse;
421
422 int nb_gauss_pts = pts.size2();
423 if (data.spacesOnEntities[MBEDGE].test(HCURL)) {
424
425 if (data.dataOnEntities[MBEDGE].size() != 1)
426 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
427 "No data structure to store base functions");
428
429 int sense = data.dataOnEntities[MBEDGE][0].getSense();
430 int order = data.dataOnEntities[MBEDGE][0].getOrder();
431 int nb_dofs =
432 NBEDGE_DEMKOWICZ_HCURL(data.dataOnEntities[MBEDGE][0].getOrder());
433 data.dataOnEntities[MBEDGE][0].getN(base).resize(nb_gauss_pts, 3 * nb_dofs,
434 false);
435 data.dataOnEntities[MBEDGE][0].getDiffN(base).resize(nb_gauss_pts, 0,
436 false);
437 if (nb_dofs) {
439 sense, order, &data.dataOnEntities[MBVERTEX][0].getN(base)(0, 0),
440 &*data.dataOnEntities[MBVERTEX][0].getDiffN(base).data().begin(),
441 &*data.dataOnEntities[MBEDGE][0].getN(base).data().begin(), NULL,
442 nb_gauss_pts);
443 }
444 } else {
445
446 data.dataOnEntities[MBEDGE][0].getN(base).resize(nb_gauss_pts, 0, false);
447 data.dataOnEntities[MBEDGE][0].getDiffN(base).resize(nb_gauss_pts, 0,
448 false);
449 }
450
452}
#define NBEDGE_DEMKOWICZ_HCURL(P)
MoFEMErrorCode Hcurl_Demkowicz_EdgeBaseFunctions_MBEDGE(int sense, int p, double *n, double *diff_n, double *phi, double *diff_phi, int nb_integration_pts)
Edge based H-curl base functions on edge.
Definition Hcurl.cpp:2155

◆ getValueHdiv()

MoFEMErrorCode EdgePolynomialBase::getValueHdiv ( MatrixDouble pts)
private

Definition at line 369 of file EdgePolynomialBase.cpp.

369 {
370 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
371 "Make no sense, unless problem is 2d (2d not implemented yet)");
372}

◆ getValueL2()

MoFEMErrorCode EdgePolynomialBase::getValueL2 ( MatrixDouble pts)
private

Definition at line 301 of file EdgePolynomialBase.cpp.

301 {
303
304 switch (cTx->bAse) {
310 default:
311 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "Not implemented");
312 }
313
315}
MoFEMErrorCode getValueL2AinsworthBase(MatrixDouble &pts)
MoFEMErrorCode getValueL2DemkowiczBase(MatrixDouble &pts)

◆ getValueL2AinsworthBase()

MoFEMErrorCode EdgePolynomialBase::getValueL2AinsworthBase ( MatrixDouble pts)
private

Definition at line 317 of file EdgePolynomialBase.cpp.

317 {
319
320 EntitiesFieldData &data = cTx->dAta;
322
323 PetscErrorCode (*base_polynomials)(int p, double s, double *diff_s, double *L,
324 double *diffL, const int dim) =
326
327 if(base == AINSWORTH_LOBATTO_BASE)
328 base_polynomials = Lobatto_polynomials;
329
330 int nb_gauss_pts = pts.size2();
331
332 constexpr int side_number = 0;
333 int order = data.dataOnEntities[MBEDGE][side_number].getOrder();
334
335 data.dataOnEntities[MBEDGE][side_number].getN(base).resize(
336 nb_gauss_pts, NBEDGE_L2(order), false);
337 data.dataOnEntities[MBEDGE][side_number].getDiffN(base).resize(
338 nb_gauss_pts, NBEDGE_L2(order), false);
339
340 auto *fun_n =
341 &*data.dataOnEntities[MBEDGE][side_number].getN(base).data().begin();
342 auto *diff_fun_n =
343 &*data.dataOnEntities[MBEDGE][side_number].getDiffN(base).data().begin();
344
345 if (NBEDGE_L2(order)) {
346
347 double diff_mu = 2;
348 double l[NBEDGE_L2(order)];
349 double diff_l[NBEDGE_L2(order)];
350 for (int gg = 0; gg != nb_gauss_pts; gg++) {
351 double mu = 2 * pts(0, gg) - 1;
352 CHKERR base_polynomials(order, mu, &diff_mu, l, diff_l, 1);
353 int qd_shift = NBEDGE_L2(order) * gg;
354 for (int n = 0; n != NBEDGE_L2(order); n++) {
355 fun_n[qd_shift + n] = l[n];
356 diff_fun_n[qd_shift + n] = diff_l[n];
357 }
358 }
359
360 }
361
363}
PetscErrorCode Lobatto_polynomials(int p, double s, double *diff_s, double *L, double *diffL, const int dim)
Calculate Lobatto basis functions .
FTensor::Index< 'l', 3 > l

◆ getValueL2DemkowiczBase()

MoFEMErrorCode EdgePolynomialBase::getValueL2DemkowiczBase ( MatrixDouble pts)
private

Definition at line 365 of file EdgePolynomialBase.cpp.

365 {
366 return getValueL2AinsworthBase(pts);
367}

◆ query_interface()

MoFEMErrorCode EdgePolynomialBase::query_interface ( boost::typeindex::type_index  type_index,
UnknownInterface **  iface 
) const
virtual

Reimplemented from MoFEM::BaseFunction.

Definition at line 8 of file EdgePolynomialBase.cpp.

9 {
10 *iface = const_cast<EdgePolynomialBase *>(this);
11 return 0;
12}
Calculate base functions on tetrahedral.

Member Data Documentation

◆ cTx

EntPolynomialBaseCtx* MoFEM::EdgePolynomialBase::cTx
private

Definition at line 31 of file EdgePolynomialBase.hpp.

◆ diffL

VectorDouble MoFEM::EdgePolynomialBase::diffL
private

Definition at line 33 of file EdgePolynomialBase.hpp.

◆ L

VectorDouble MoFEM::EdgePolynomialBase::L
private

Definition at line 33 of file EdgePolynomialBase.hpp.


The documentation for this struct was generated from the following files: