v0.15.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
MoFEM::LegendrePolynomial Struct Reference

Class for calculating Legendre basis 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 (boost::typeindex::type_index type_index, UnknownInterface **iface) const
 
 LegendrePolynomial ()
 
 ~LegendrePolynomial ()
 
MoFEMErrorCode getValue (MatrixDouble &pts, boost::shared_ptr< BaseFunctionCtx > ctx_ptr)
 Evaluate Legendre basis functions at given points.
 
- 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
 

Additional Inherited Members

- Public Types inherited from MoFEM::BaseFunction
using DofsSideMap = multi_index_container< DofsSideMapData, indexed_by< ordered_non_unique< tag< TypeSide_mi_tag >, composite_key< DofsSideMapData, member< DofsSideMapData, EntityType, &DofsSideMapData::type >, member< DofsSideMapData, int, &DofsSideMapData::side > > >, ordered_unique< tag< EntDofIdx_mi_tag >, member< DofsSideMapData, int, &DofsSideMapData::dof > > > >
 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

Class for calculating Legendre basis functions.

This class implements the BaseFunction interface to provide Legendre polynomial evaluation capabilities for finite element approximations.

Definition at line 130 of file LegendrePolynomial.hpp.

Constructor & Destructor Documentation

◆ LegendrePolynomial()

MoFEM::LegendrePolynomial::LegendrePolynomial ( )
inline

Definition at line 135 of file LegendrePolynomial.hpp.

135{}

◆ ~LegendrePolynomial()

MoFEM::LegendrePolynomial::~LegendrePolynomial ( )
inline

Definition at line 136 of file LegendrePolynomial.hpp.

136{}

Member Function Documentation

◆ getValue()

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

Evaluate Legendre basis functions at given points.

Parameters
ptsmatrix of evaluation points
ctx_ptrcontext containing evaluation parameters
Returns
error code

Reimplemented from MoFEM::BaseFunction.

Reimplemented in MoFEM::LobattoPolynomial.

Definition at line 22 of file LegendrePolynomial.cpp.

23 {
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);
39 }
41}
#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 ...
FTensor::Index< 'l', 3 > l
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr

◆ query_interface()

MoFEMErrorCode MoFEM::LegendrePolynomial::query_interface ( boost::typeindex::type_index  type_index,
UnknownInterface **  iface 
) const
virtual

Reimplemented from MoFEM::BaseFunction.

Reimplemented in MoFEM::LobattoPolynomial.

Definition at line 15 of file LegendrePolynomial.cpp.

16 {
17 *iface = const_cast<LegendrePolynomial *>(this);
18 return 9;
19}

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