MFEM  v4.5.1
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
mfem::Poly_1D Class Reference

Class for computing 1D special polynomials and their associated basis functions. More...

#include <fe_base.hpp>

Classes

class  Basis
 Class for evaluating 1D nodal, positive (Bernstein), or integrated (Gerritsma) bases. More...
 

Public Types

enum  EvalType {
  ChangeOfBasis = 0, Barycentric = 1, Positive = 2, Integrated = 3,
  NumEvalTypes = 4
}
 One-dimensional basis evaluation type. More...
 

Public Member Functions

 Poly_1D ()
 
const double * GetPoints (const int p, const int btype)
 Get the coordinates of the points of the given BasisType, btype. More...
 
const double * OpenPoints (const int p, const int btype=BasisType::GaussLegendre)
 Get coordinates of an open (GaussLegendre) set of points if degree p. More...
 
const double * ClosedPoints (const int p, const int btype=BasisType::GaussLobatto)
 Get coordinates of a closed (GaussLegendre) set of points if degree p. More...
 
BasisGetBasis (const int p, const int btype)
 Get a Poly_1D::Basis object of the given degree and BasisType, btype. More...
 
 ~Poly_1D ()
 

Static Public Member Functions

static const int * Binom (const int p)
 Get a pointer to an array containing the binomial coefficients "p choose k" for k=0,...,p for the given p. More...
 
static void CalcBasis (const int p, const double x, double *u)
 Evaluate the values of a hierarchical 1D basis at point x hierarchical = k-th basis function is degree k polynomial. More...
 
static void CalcBasis (const int p, const double x, double *u, double *d)
 Evaluate the values and derivatives of a hierarchical 1D basis at point x. More...
 
static void CalcBasis (const int p, const double x, double *u, double *d, double *dd)
 Evaluate the values, derivatives and second derivatives of a hierarchical 1D basis at point x. More...
 
static double CalcDelta (const int p, const double x)
 Evaluate a representation of a Delta function at point x. More...
 
static void ChebyshevPoints (const int p, double *x)
 Compute the points for the Chebyshev polynomials of order p and place them in the already allocated x array. More...
 
static void CalcBinomTerms (const int p, const double x, const double y, double *u)
 Compute the p terms in the expansion of the binomial (x + y)^p and store them in the already allocated u array. More...
 
static void CalcBinomTerms (const int p, const double x, const double y, double *u, double *d)
 Compute the terms in the expansion of the binomial (x + y)^p and their derivatives with respect to x assuming that dy/dx = -1. Store the results in the already allocated u and d arrays. More...
 
static void CalcDBinomTerms (const int p, const double x, const double y, double *d)
 Compute the derivatives (w.r.t. x) of the terms in the expansion of the binomial (x + y)^p assuming that dy/dx = -1. Store the results in the already allocated d array. More...
 
static void CalcBernstein (const int p, const double x, double *u)
 Compute the values of the Bernstein basis functions of order p at coordinate x and store the results in the already allocated u array. More...
 
static void CalcBernstein (const int p, const double x, double *u, double *d)
 Compute the values and derivatives of the Bernstein basis functions of order p at coordinate x and store the results in the already allocated u and d arrays. More...
 
static void CalcLegendre (const int p, const double x, double *u)
 
static void CalcLegendre (const int p, const double x, double *u, double *d)
 

Detailed Description

Class for computing 1D special polynomials and their associated basis functions.

Definition at line 962 of file fe_base.hpp.

Member Enumeration Documentation

One-dimensional basis evaluation type.

Enumerator
ChangeOfBasis 

Use change of basis, O(p^2) Evals.

Barycentric 

Use barycentric Lagrangian interpolation, O(p) Evals.

Positive 

Fast evaluation of Bernstein polynomials.

Integrated 

Integrated indicator functions (cf. Gerritsma)

NumEvalTypes 

Keep count of the number of eval types.

Definition at line 966 of file fe_base.hpp.

Constructor & Destructor Documentation

mfem::Poly_1D::Poly_1D ( )
inline

Definition at line 1047 of file fe_base.hpp.

mfem::Poly_1D::~Poly_1D ( )

Definition at line 2180 of file fe_base.cpp.

Member Function Documentation

const int * mfem::Poly_1D::Binom ( const int  p)
static

Get a pointer to an array containing the binomial coefficients "p choose k" for k=0,...,p for the given p.

Definition at line 1889 of file fe_base.cpp.

static void mfem::Poly_1D::CalcBasis ( const int  p,
const double  x,
double *  u 
)
inlinestatic

Evaluate the values of a hierarchical 1D basis at point x hierarchical = k-th basis function is degree k polynomial.

Definition at line 1086 of file fe_base.hpp.

static void mfem::Poly_1D::CalcBasis ( const int  p,
const double  x,
double *  u,
double *  d 
)
inlinestatic

Evaluate the values and derivatives of a hierarchical 1D basis at point x.

Definition at line 1095 of file fe_base.hpp.

static void mfem::Poly_1D::CalcBasis ( const int  p,
const double  x,
double *  u,
double *  d,
double *  dd 
)
inlinestatic

Evaluate the values, derivatives and second derivatives of a hierarchical 1D basis at point x.

Definition at line 1102 of file fe_base.hpp.

static void mfem::Poly_1D::CalcBernstein ( const int  p,
const double  x,
double *  u 
)
inlinestatic

Compute the values of the Bernstein basis functions of order p at coordinate x and store the results in the already allocated u array.

Definition at line 1135 of file fe_base.hpp.

static void mfem::Poly_1D::CalcBernstein ( const int  p,
const double  x,
double *  u,
double *  d 
)
inlinestatic

Compute the values and derivatives of the Bernstein basis functions of order p at coordinate x and store the results in the already allocated u and d arrays.

Definition at line 1141 of file fe_base.hpp.

void mfem::Poly_1D::CalcBinomTerms ( const int  p,
const double  x,
const double  y,
double *  u 
)
static

Compute the p terms in the expansion of the binomial (x + y)^p and store them in the already allocated u array.

Definition at line 1938 of file fe_base.cpp.

void mfem::Poly_1D::CalcBinomTerms ( const int  p,
const double  x,
const double  y,
double *  u,
double *  d 
)
static

Compute the terms in the expansion of the binomial (x + y)^p and their derivatives with respect to x assuming that dy/dx = -1. Store the results in the already allocated u and d arrays.

Definition at line 1967 of file fe_base.cpp.

void mfem::Poly_1D::CalcDBinomTerms ( const int  p,
const double  x,
const double  y,
double *  d 
)
static

Compute the derivatives (w.r.t. x) of the terms in the expansion of the binomial (x + y)^p assuming that dy/dx = -1. Store the results in the already allocated d array.

Definition at line 2002 of file fe_base.cpp.

static double mfem::Poly_1D::CalcDelta ( const int  p,
const double  x 
)
inlinestatic

Evaluate a representation of a Delta function at point x.

Definition at line 1110 of file fe_base.hpp.

void mfem::Poly_1D::CalcLegendre ( const int  p,
const double  x,
double *  u 
)
static

Definition at line 2032 of file fe_base.cpp.

void mfem::Poly_1D::CalcLegendre ( const int  p,
const double  x,
double *  u,
double *  d 
)
static

Definition at line 2046 of file fe_base.cpp.

void mfem::Poly_1D::ChebyshevPoints ( const int  p,
double *  x 
)
static

Compute the points for the Chebyshev polynomials of order p and place them in the already allocated x array.

Definition at line 1906 of file fe_base.cpp.

const double* mfem::Poly_1D::ClosedPoints ( const int  p,
const int  btype = BasisType::GaussLobatto 
)
inline

Get coordinates of a closed (GaussLegendre) set of points if degree p.

Definition at line 1070 of file fe_base.hpp.

Poly_1D::Basis & mfem::Poly_1D::GetBasis ( const int  p,
const int  btype 
)

Get a Poly_1D::Basis object of the given degree and BasisType, btype.

Parameters
[in]pThe polynomial degree of the basis.
[in]btypeThe BasisType.
Returns
A reference to an object of type Poly_1D::Basis that represents the requested basis type.

Definition at line 2155 of file fe_base.cpp.

const double * mfem::Poly_1D::GetPoints ( const int  p,
const int  btype 
)

Get the coordinates of the points of the given BasisType, btype.

Parameters
[in]pThe polynomial degree; the number of points is p+1.
[in]btypeThe BasisType.
Returns
A pointer to an array containing the p+1 coordinates of the points. Returns NULL if the BasisType has no associated set of points.

Definition at line 2131 of file fe_base.cpp.

const double* mfem::Poly_1D::OpenPoints ( const int  p,
const int  btype = BasisType::GaussLegendre 
)
inline

Get coordinates of an open (GaussLegendre) set of points if degree p.

Definition at line 1065 of file fe_base.hpp.


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