v0.9.0
Public Member Functions | List of all members
MoFEM::LegendrePolynomial Struct Reference

Calculating Legendre base functions. More...

#include <src/approximation/LegendrePolynomial.hpp>

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

Public Member Functions

MoFEMErrorCode query_interface (const MOFEMuuid &uuid, BaseFunctionUnknownInterface **iface) const
 
 LegendrePolynomial ()
 
 ~LegendrePolynomial ()
 
MoFEMErrorCode getValue (MatrixDouble &pts, boost::shared_ptr< BaseFunctionCtx > ctx_ptr)
 
- Public Member Functions inherited from MoFEM::BaseFunction
 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
 

Detailed Description

Calculating Legendre base functions.

Definition at line 60 of file LegendrePolynomial.hpp.

Constructor & Destructor Documentation

◆ LegendrePolynomial()

MoFEM::LegendrePolynomial::LegendrePolynomial ( )

Definition at line 65 of file LegendrePolynomial.hpp.

65 {}

◆ ~LegendrePolynomial()

MoFEM::LegendrePolynomial::~LegendrePolynomial ( )

Definition at line 66 of file LegendrePolynomial.hpp.

66 {}

Member Function Documentation

◆ getValue()

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

Reimplemented from MoFEM::BaseFunction.

Reimplemented in MoFEM::KernelLobattoPolynomial, and MoFEM::LobattoPolynomial.

Definition at line 55 of file LegendrePolynomial.cpp.

56  {
57 
59  BaseFunctionUnknownInterface *iface;
60  ierr = ctx_ptr->query_interface(IDD_LEGENDRE_BASE_FUNCTION, &iface);
61  CHKERRG(ierr);
62  LegendrePolynomialCtx *ctx = reinterpret_cast<LegendrePolynomialCtx *>(iface);
63  ctx->baseFunPtr->resize(pts.size2(), ctx->P + 1, false);
64  ctx->baseDiffFunPtr->resize(pts.size2(), ctx->dIm * (ctx->P + 1), false);
65  double *l = NULL;
66  double *diff_l = NULL;
67  for (unsigned int gg = 0; gg < pts.size2(); gg++) {
68  if (ctx->baseFunPtr)
69  l = &((*ctx->baseFunPtr)(gg, 0));
70  if (ctx->baseDiffFunPtr)
71  diff_l = &((*ctx->baseDiffFunPtr)(gg, 0));
72  ierr = (ctx->basePolynomialsType0)(ctx->P, pts(0, gg), ctx->diffS, l,
73  diff_l, ctx->dIm);
74  CHKERRG(ierr);
75  }
77 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:544
static const MOFEMuuid IDD_LEGENDRE_BASE_FUNCTION
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508

◆ query_interface()

MoFEMErrorCode MoFEM::LegendrePolynomial::query_interface ( const MOFEMuuid uuid,
BaseFunctionUnknownInterface **  iface 
) const
virtual

Reimplemented from MoFEM::BaseFunction.

Reimplemented in MoFEM::KernelLobattoPolynomial, and MoFEM::LobattoPolynomial.

Definition at line 38 of file LegendrePolynomial.cpp.

39  {
40 
42  *iface = NULL;
43  if (uuid == IDD_LEGENDRE_BASE_FUNCTION) {
44  *iface = const_cast<LegendrePolynomial *>(this);
46  } else {
47  SETERRQ(PETSC_COMM_WORLD, MOFEM_DATA_INCONSISTENCY, "wrong interference");
48  }
49  ierr = BaseFunction::query_interface(uuid, iface);
50  CHKERRG(ierr);
52 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
MoFEMErrorCode query_interface(const MOFEMuuid &uuid, MoFEM::BaseFunctionUnknownInterface **iface) const
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:544
static const MOFEMuuid IDD_LEGENDRE_BASE_FUNCTION
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508

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