v0.15.0
Loading...
Searching...
No Matches
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
 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].getNSharedPtr(base) =
42 data.dataOnEntities[MBVERTEX][0].getNSharedPtr(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 nme:nme847.
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 double diff_s = 2.; // s = s(xi), ds/dxi = 2., because change of basis
220 for (int gg = 0; gg != nb_gauss_pts; gg++) {
221
222 double s = 2 * pts(0, gg) - 1; // makes form -1..1
223 if (!sense) {
224 s *= -1;
225 diff_s *= -1;
226 }
227
228 // calculate Legendre polynomials at integration points
229 CHKERR base_polynomials(NBEDGE_H1(order) - 1, s, &diff_s,
230 &*L.data().begin(), &*diffL.data().begin(), 1);
231
232 for (unsigned int pp = 0;
233 pp < data.dataOnEntities[MBEDGE][side_number].getN(base).size2();
234 pp++) {
235
236 // Calculate edge shape functions N0*N1*L(p), where N0 and N1 are nodal
237 // shape functions
238 double v = data.dataOnEntities[MBVERTEX][0].getN(base)(gg, 0) *
239 data.dataOnEntities[MBVERTEX][0].getN(base)(gg, 1);
240 data.dataOnEntities[MBEDGE][side_number].getN(base)(gg, pp) = v * L(pp);
241
242 // Calculate derivative edge shape functions
243 // dN/dksi = dN0/dxi*N1*L + N0*dN1/ksi*L + N0*N1*dL/dxi
244 data.dataOnEntities[MBEDGE][side_number].getDiffN(base)(gg, pp) =
245 ((+1.) * data.dataOnEntities[MBVERTEX][0].getN(base)(gg, 1) +
246 data.dataOnEntities[MBVERTEX][0].getN(base)(gg, 0) * (-1.)) *
247 L(pp) +
248 v * diffL(pp);
249 }
250 }
251 }
252
254}
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< int > MatrixInt
Definition Types.hpp:76
UBlasMatrix< double > MatrixDouble
Definition Types.hpp:77
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 256 of file EdgePolynomialBase.cpp.

256 {
258
259 EntitiesFieldData &data = cTx->dAta;
260 const FieldApproximationBase base = cTx->bAse;
261
262 int nb_gauss_pts = pts.size2();
263
264 const int side_number = 0;
265 int order = data.dataOnEntities[MBEDGE][side_number].getOrder();
266
267 data.dataOnEntities[MBEDGE][side_number].getN(base).resize(
268 nb_gauss_pts, NBEDGE_H1(order), false);
269 data.dataOnEntities[MBEDGE][side_number].getDiffN(base).resize(
270 nb_gauss_pts, NBEDGE_H1(order), false);
271
272 data.dataOnEntities[MBEDGE][side_number].getN(base).clear();
273 data.dataOnEntities[MBEDGE][side_number].getDiffN(base).clear();
274
275 double diff_shape[] = {-1, 1};
276 MatrixDouble shape(nb_gauss_pts, 2);
277
278 if (NBEDGE_L2(order)) {
279 for (int gg = 0; gg != nb_gauss_pts; gg++) {
280 const double mu0 = 1.0 - pts(0, gg); // pts ranges over [0, 1]
281 const double mu1 = pts(0, gg);
282 shape(gg, 0) = mu0;
283 shape(gg, 1) = mu1;
284 }
285
287 order, &*shape.data().begin(), diff_shape,
288 &*data.dataOnEntities[MBEDGE][side_number].getN(base).data().begin(),
289 &*data.dataOnEntities[MBEDGE][side_number]
290 .getDiffN(base)
291 .data()
292 .begin(),
293 nb_gauss_pts);
294 }
295
297}
#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 452 of file EdgePolynomialBase.cpp.

452 {
454
455 switch (cTx->bAse) {
461 default:
462 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "Not implemented");
463 }
464
466}
MoFEMErrorCode getValueHcurlDemkowiczBase(MatrixDouble &pts)
MoFEMErrorCode getValueHcurlAinsworthBase(MatrixDouble &pts)

◆ getValueHcurlAinsworthBase()

MoFEMErrorCode EdgePolynomialBase::getValueHcurlAinsworthBase ( MatrixDouble & pts)
private

Definition at line 373 of file EdgePolynomialBase.cpp.

373 {
375
376 EntitiesFieldData &data = cTx->dAta;
377 const FieldApproximationBase base = cTx->bAse;
378
379 PetscErrorCode (*base_polynomials)(int p, double s, double *diff_s, double *L,
380 double *diffL, const int dim) =
382
383 int nb_gauss_pts = pts.size2();
384 if (data.spacesOnEntities[MBEDGE].test(HCURL)) {
385
386 if (data.dataOnEntities[MBEDGE].size() != 1)
387 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
388
389 int sense = data.dataOnEntities[MBEDGE][0].getSense();
390 int order = data.dataOnEntities[MBEDGE][0].getOrder();
391 int nb_dofs =
392 NBEDGE_AINSWORTH_HCURL(data.dataOnEntities[MBEDGE][0].getOrder());
393 data.dataOnEntities[MBEDGE][0].getN(base).resize(nb_gauss_pts, 3 * nb_dofs,
394 false);
395 data.dataOnEntities[MBEDGE][0].getDiffN(base).resize(nb_gauss_pts, 0,
396 false);
397
399 sense, order, &data.dataOnEntities[MBVERTEX][0].getN(base)(0, 0),
400 &*data.dataOnEntities[MBVERTEX][0].getDiffN(base).data().begin(),
401 &*data.dataOnEntities[MBEDGE][0].getN(base).data().begin(), nullptr,
402 nb_gauss_pts, base_polynomials);
403
404 } else {
405 data.dataOnEntities[MBEDGE][0].getN(base).resize(nb_gauss_pts, 0, false);
406 data.dataOnEntities[MBEDGE][0].getDiffN(base).resize(nb_gauss_pts, 0,
407 false);
408 }
409
411}
#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 414 of file EdgePolynomialBase.cpp.

414 {
416
417 EntitiesFieldData &data = cTx->dAta;
418 const FieldApproximationBase base = cTx->bAse;
419
420 int nb_gauss_pts = pts.size2();
421 if (data.spacesOnEntities[MBEDGE].test(HCURL)) {
422
423 if (data.dataOnEntities[MBEDGE].size() != 1)
424 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
425 "No data structure to store base functions");
426
427 int sense = data.dataOnEntities[MBEDGE][0].getSense();
428 int order = data.dataOnEntities[MBEDGE][0].getOrder();
429 int nb_dofs =
430 NBEDGE_DEMKOWICZ_HCURL(data.dataOnEntities[MBEDGE][0].getOrder());
431 data.dataOnEntities[MBEDGE][0].getN(base).resize(nb_gauss_pts, 3 * nb_dofs,
432 false);
433 data.dataOnEntities[MBEDGE][0].getDiffN(base).resize(nb_gauss_pts, 0,
434 false);
435 if (nb_dofs) {
437 sense, order, &data.dataOnEntities[MBVERTEX][0].getN(base)(0, 0),
438 &*data.dataOnEntities[MBVERTEX][0].getDiffN(base).data().begin(),
439 &*data.dataOnEntities[MBEDGE][0].getN(base).data().begin(), NULL,
440 nb_gauss_pts);
441 }
442 } else {
443
444 data.dataOnEntities[MBEDGE][0].getN(base).resize(nb_gauss_pts, 0, false);
445 data.dataOnEntities[MBEDGE][0].getDiffN(base).resize(nb_gauss_pts, 0,
446 false);
447 }
448
450}
#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:2144

◆ getValueHdiv()

MoFEMErrorCode EdgePolynomialBase::getValueHdiv ( MatrixDouble & pts)
private

Definition at line 367 of file EdgePolynomialBase.cpp.

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

◆ getValueL2()

MoFEMErrorCode EdgePolynomialBase::getValueL2 ( MatrixDouble & pts)
private

Definition at line 299 of file EdgePolynomialBase.cpp.

299 {
301
302 switch (cTx->bAse) {
308 default:
309 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "Not implemented");
310 }
311
313}
MoFEMErrorCode getValueL2AinsworthBase(MatrixDouble &pts)
MoFEMErrorCode getValueL2DemkowiczBase(MatrixDouble &pts)

◆ getValueL2AinsworthBase()

MoFEMErrorCode EdgePolynomialBase::getValueL2AinsworthBase ( MatrixDouble & pts)
private

Definition at line 315 of file EdgePolynomialBase.cpp.

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

◆ getValueL2DemkowiczBase()

MoFEMErrorCode EdgePolynomialBase::getValueL2DemkowiczBase ( MatrixDouble & pts)
private

Definition at line 363 of file EdgePolynomialBase.cpp.

363 {
364 return getValueL2AinsworthBase(pts);
365}

◆ 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: