v0.14.0
Loading...
Searching...
No Matches
LobattoPolynomial.cpp
Go to the documentation of this file.
1/** \file LobattoPolynomial.cpp
2 * \brief implementation of multi-grid solver for p- adaptivity
3 */
4
5
6
7namespace MoFEM {
8
10LobattoPolynomialCtx::query_interface(boost::typeindex::type_index type_index,
11 UnknownInterface **iface) const {
12 *iface = const_cast<LobattoPolynomialCtx *>(this);
13 return 0;
14}
15
17LobattoPolynomial::query_interface(boost::typeindex::type_index type_index,
18 UnknownInterface **iface) const {
19 *iface = const_cast<LobattoPolynomial *>(this);
20 return 0;
21}
22
25 boost::shared_ptr<BaseFunctionCtx> ctx_ptr) {
26
28 auto ctx = ctx_ptr->getInterface<LobattoPolynomialCtx>();
29 // Polynomial order start from 2nd order
30 ctx->baseFunPtr->resize(pts.size2(), ctx->P + 1, false);
31 ctx->baseDiffFunPtr->resize(pts.size2(), ctx->dIm * (ctx->P + 1), false);
32 double *l = NULL;
33 double *diff_l = NULL;
34 for (unsigned int gg = 0; gg < pts.size2(); gg++) {
35 if (ctx->baseFunPtr)
36 l = &((*ctx->baseFunPtr)(gg, 0));
37 if (ctx->baseDiffFunPtr)
38 diff_l = &((*ctx->baseDiffFunPtr)(gg, 0));
39 ierr = (ctx->basePolynomialsType0)(ctx->P, pts(0, gg), ctx->diffS, l,
40 diff_l, ctx->dIm);
42 }
44}
45
47 boost::typeindex::type_index type_index, UnknownInterface **iface) const {
48 *iface = const_cast<KernelLobattoPolynomialCtx *>(this);
49 return 0;
50}
51
53 boost::typeindex::type_index type_index, UnknownInterface **iface) const {
54 *iface = const_cast<KernelLobattoPolynomial *>(this);
55 return 0;
56}
57
60 boost::shared_ptr<BaseFunctionCtx> ctx_ptr) {
61
63 auto ctx = ctx_ptr->getInterface<KernelLobattoPolynomialCtx>();
64 ctx->baseFunPtr->resize(pts.size2(), ctx->P + 1, false);
65 ctx->baseDiffFunPtr->resize(pts.size2(), ctx->dIm * (ctx->P + 1), false);
66 double *l = NULL;
67 double *diff_l = NULL;
68 for (unsigned int gg = 0; gg < pts.size2(); gg++) {
69 if (ctx->baseFunPtr)
70 l = &((*ctx->baseFunPtr)(gg, 0));
71 if (ctx->baseDiffFunPtr)
72 diff_l = &((*ctx->baseDiffFunPtr)(gg, 0));
73 ierr = (ctx->basePolynomialsType0)(ctx->P, pts(0, gg), ctx->diffS, l,
74 diff_l, ctx->dIm);
76 }
78}
79
80} // namespace MoFEM
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:483
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440
FTensor::Index< 'l', 3 > l
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
Class used to give arguments to Kernel Lobatto base functions.
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Calculating Lobatto base functions.
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
MoFEMErrorCode getValue(MatrixDouble &pts, boost::shared_ptr< BaseFunctionCtx > ctx_ptr)
boost::shared_ptr< MatrixDouble > baseFunPtr
Class used to give arguments to Lobatto base functions.
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Calculating Lobatto base functions.
MoFEMErrorCode getValue(MatrixDouble &pts, boost::shared_ptr< BaseFunctionCtx > ctx_ptr)
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
base class for all interface classes