v0.9.0
JacobiPolynomial.hpp
Go to the documentation of this file.
1 /** \file JacobiPolynomial.hpp
2 \brief Implementation of Legendre polynomial
3 
4 */
5 
6 /* This file is part of MoFEM.
7  * MoFEM is free software: you can redistribute it and/or modify it under
8  * the terms of the GNU Lesser General Public License as published by the
9  * Free Software Foundation, either version 3 of the License, or (at your
10  * option) any later version.
11  *
12  * MoFEM is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15  * License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>. */
19 
20 #ifndef __JACOBIPOLYNOMIALS_HPP__
21 #define __JACOBIPOLYNOMIALS_HPP__
22 
23 namespace MoFEM {
24 
27 
28 /**
29  * \brief Class used to give arguments to Legendre base functions
30  * \ingroup mofem_base_functions
31  */
33 
35  BaseFunctionUnknownInterface **iface) const;
36 
37  int P;
38  double *diffX;
39  double *diffT;
40  int dIm;
41 
42  double aLpha;
43 
44  boost::shared_ptr<MatrixDouble> baseFunPtr;
45  boost::shared_ptr<MatrixDouble> baseDiffFunPtr;
46 
47  PetscErrorCode (*basePolynomialsType1)(int p, double alpha, double x,
48  double t, double *diff_x,
49  double *diff_t, double *L,
50  double *diffL, const int dim);
51 
52  JacobiPolynomialCtx(int p, double *diff_x, double *diff_t, int dim,
53  double alpha,
54  boost::shared_ptr<MatrixDouble>& base_fun_ptr,
55  boost::shared_ptr<MatrixDouble>& base_diff_fun_ptr)
56  : P(p), diffX(diff_x), diffT(diff_t), dIm(dim), aLpha(alpha),
57  baseFunPtr(base_fun_ptr), baseDiffFunPtr(base_diff_fun_ptr),
60 };
61 
62 /**
63  * \brief Calculating Legendre base functions
64  * \ingroup mofem_base_functions
65  */
66 struct JacobiPolynomial : public BaseFunction {
67 
69  BaseFunctionUnknownInterface **iface) const;
70 
73 
75  boost::shared_ptr<BaseFunctionCtx> ctx_ptr);
76 };
77 
80 
82 
84  BaseFunctionUnknownInterface **iface) const;
85 
87  int p, double *diff_x, double *diff_t, int dim, double alpha,
88  boost::shared_ptr<MatrixDouble>& base_fun_ptr,
89  boost::shared_ptr<MatrixDouble>& base_diff_fun_ptr)
90  : JacobiPolynomialCtx(p, diff_x, diff_t, dim, alpha, base_fun_ptr,
91  base_diff_fun_ptr) {
93  }
95 };
96 
98 
100  BaseFunctionUnknownInterface **iface) const;
101 
104 
106  boost::shared_ptr<BaseFunctionCtx> ctx_ptr);
107 };
108 
109 } // namespace MoFEM
110 
111 #endif //__JACOBIPOLYNOMIALS_HPP__
static const MOFEMuuid IDD_INTEGRATED_JACOBI_BASE_FUNCTION
MoFEMErrorCode getValue(MatrixDouble &pts_x, MatrixDouble &pts_t, boost::shared_ptr< BaseFunctionCtx > ctx_ptr)
MoFEM interface unique ID.
PetscErrorCode Jacobi_polynomials(int p, double alpha, double x, double t, double *diff_x, double *diff_t, double *L, double *diffL, const int dim)
Calculate Jacobi approximation basis.
MoFEMErrorCode query_interface(const MOFEMuuid &uuid, BaseFunctionUnknownInterface **iface) const
MoFEMErrorCode query_interface(const MOFEMuuid &uuid, BaseFunctionUnknownInterface **iface) const
PetscErrorCode(* basePolynomialsType1)(int p, double alpha, double x, double t, double *diff_x, double *diff_t, double *L, double *diffL, const int dim)
JacobiPolynomialCtx(int p, double *diff_x, double *diff_t, int dim, double alpha, boost::shared_ptr< MatrixDouble > &base_fun_ptr, boost::shared_ptr< MatrixDouble > &base_diff_fun_ptr)
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
Definition: Types.hpp:74
Class used to give arguments to Legendre base functions.
std::bitset< BITINTERFACEUID_SIZE > BitIntefaceId
Definition: Types.hpp:56
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:21
MoFEMErrorCode query_interface(const MOFEMuuid &uuid, BaseFunctionUnknownInterface **iface) const
Base class if inherited used to calculate base functions.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:66
IntegratedJacobiPolynomialCtx(int p, double *diff_x, double *diff_t, int dim, double alpha, boost::shared_ptr< MatrixDouble > &base_fun_ptr, boost::shared_ptr< MatrixDouble > &base_diff_fun_ptr)
static const MOFEMuuid IDD_JACOBI_BASE_FUNCTION
boost::shared_ptr< MatrixDouble > baseDiffFunPtr
MoFEMErrorCode getValue(MatrixDouble &pts_x, MatrixDouble &pts_t, boost::shared_ptr< BaseFunctionCtx > ctx_ptr)
Base class used to exchange data between element data structures and class calculating base functions...
boost::shared_ptr< MatrixDouble > baseFunPtr
Calculating Legendre base functions.
PetscErrorCode IntegratedJacobi_polynomials(int p, double alpha, double x, double t, double *diff_x, double *diff_t, double *L, double *diffL, const int dim)
Calculate integrated Jacobi approximation basis.
MoFEMErrorCode query_interface(const MOFEMuuid &uuid, BaseFunctionUnknownInterface **iface) const