25 boost::shared_ptr<BaseFunctionCtx> ctx_ptr) {
30 ctx->
baseFunPtr->resize(pts.size2(), ctx->P + 1,
false);
31 ctx->baseDiffFunPtr->resize(pts.size2(), ctx->dIm * (ctx->P + 1),
false);
33 double *diff_l = NULL;
34 for (
unsigned int gg = 0; gg < pts.size2(); gg++) {
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,
60 boost::shared_ptr<BaseFunctionCtx> ctx_ptr) {
64 ctx->
baseFunPtr->resize(pts.size2(), ctx->P + 1,
false);
65 ctx->baseDiffFunPtr->resize(pts.size2(), ctx->dIm * (ctx->P + 1),
false);
67 double *diff_l = NULL;
68 for (
unsigned int gg = 0; gg < pts.size2(); gg++) {
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,
81 double *diffL,
const int dim) {
98 for (
int d = 0; d != dim; ++d) {
99 diffL[d * (p + 1) + 0] = 0;
105 if (diff_s == NULL) {
109 for (
int d = 0; d != dim; ++d) {
110 diffL[d * (p + 1) + 1] = diff_s[d];
115 for (
int k = 2;
k <= p;
k++) {
116 const double factor = 2 * (2 *
k - 1);
117 L[
k] = 1.0 / factor * (
l[
k] -
l[
k - 2]);
121 for (
int k = 2;
k <= p;
k++) {
122 double a =
l[
k - 1] / 2.;
123 for (
int d = 0; d != dim; ++d) {
124 diffL[d * (p + 1) +
k] =
a * diff_s[d];
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
PetscErrorCode Lobatto_polynomials(int p, double s, double *diff_s, double *L, double *diffL, const int dim)
Calculate Lobatto basis functions .
PetscErrorCode Legendre_polynomials(int p, double s, double *diff_s, double *L, double *diffL, int dim)
Calculate Legendre approximation basis.
FTensor::Index< 'l', 3 > l
FTensor::Index< 'k', 3 > k
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
Context class for Kernel Lobatto basis function arguments.
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Class for calculating Kernel Lobatto basis functions.
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
MoFEMErrorCode getValue(MatrixDouble &pts, boost::shared_ptr< BaseFunctionCtx > ctx_ptr)
Evaluate Kernel Lobatto basis functions at given points.
boost::shared_ptr< MatrixDouble > baseFunPtr
Pointer to base function matrix.
Context class for Lobatto basis function arguments.
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Class for calculating Lobatto basis functions.
MoFEMErrorCode getValue(MatrixDouble &pts, boost::shared_ptr< BaseFunctionCtx > ctx_ptr)
Evaluate Lobatto basis functions at given points.
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
base class for all interface classes
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.