v0.14.0
LegendrePolynomial.cpp
Go to the documentation of this file.
1 /** \file LegendrePolynomial.cpp
2  * \brief Implementation of base for Legendre polynomials
3  */
4 
5 namespace MoFEM {
6 
8  boost::typeindex::type_index type_index,
9  UnknownInterface **iface) const {
10  *iface = const_cast<LegendrePolynomialCtx *>(this);
11  return 0;
12 }
13 
15  boost::typeindex::type_index type_index,
16  UnknownInterface **iface) const {
17  *iface = const_cast<LegendrePolynomial *>(this);
18  return 9;
19 }
20 
23  boost::shared_ptr<BaseFunctionCtx> ctx_ptr) {
24 
26  auto ctx = ctx_ptr->getInterface<LegendrePolynomialCtx>();
27  ctx->baseFunPtr->resize(pts.size2(), ctx->P + 1, false);
28  ctx->baseDiffFunPtr->resize(pts.size2(), ctx->dIm * (ctx->P + 1), false);
29  double *l = NULL;
30  double *diff_l = NULL;
31  for (unsigned int gg = 0; gg < pts.size2(); gg++) {
32  if (ctx->baseFunPtr)
33  l = &((*ctx->baseFunPtr)(gg, 0));
34  if (ctx->baseDiffFunPtr)
35  diff_l = &((*ctx->baseDiffFunPtr)(gg, 0));
36  ierr = (ctx->basePolynomialsType0)(ctx->P, pts(0, gg), ctx->diffS, l,
37  diff_l, ctx->dIm);
38  CHKERRG(ierr);
39  }
41 }
42 
43 } // namespace MoFEM
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
MoFEM::LegendrePolynomial
Calculating Legendre base functions.
Definition: LegendrePolynomial.hpp:45
MoFEM::LegendrePolynomialCtx
Class used to give arguments to Legendre base functions.
Definition: LegendrePolynomial.hpp:17
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
MoFEM::Types::MatrixDouble
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
MoFEM::LegendrePolynomialCtx::baseFunPtr
boost::shared_ptr< MatrixDouble > baseFunPtr
Definition: LegendrePolynomial.hpp:25
MoFEM::LegendrePolynomial::query_interface
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Definition: LegendrePolynomial.cpp:14
MoFEM::LegendrePolynomial::getValue
MoFEMErrorCode getValue(MatrixDouble &pts, boost::shared_ptr< BaseFunctionCtx > ctx_ptr)
Definition: LegendrePolynomial.cpp:22
MoFEM
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
MoFEM::UnknownInterface
base class for all interface classes
Definition: UnknownInterface.hpp:34
MoFEM::Exceptions::ierr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440
MoFEM::LegendrePolynomialCtx::query_interface
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Definition: LegendrePolynomial.cpp:7
CHKERRG
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:483
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21