MFEM v4.8.0
Finite element discretization library
Loading...
Searching...
No Matches
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 Array< real_t > * GetPointsArray (const int p, const int btype)
 Get the coordinates of the points of the given BasisType, btype.
 
const real_tGetPoints (const int p, const int btype, bool on_device=false)
 Get the coordinates of the points of the given BasisType, btype.
 
const real_tOpenPoints (const int p, const int btype=BasisType::GaussLegendre, bool on_device=false)
 Get coordinates of an open (GaussLegendre) set of points if degree p.
 
const real_tClosedPoints (const int p, const int btype=BasisType::GaussLobatto, bool on_device=false)
 Get coordinates of a closed (GaussLegendre) set of points if degree p.
 
BasisGetBasis (const int p, const int btype)
 Get a Poly_1D::Basis object of the given degree and BasisType, btype.
 
 ~Poly_1D ()=default
 

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.
 
static void CalcBasis (const int p, const real_t x, real_t *u)
 Evaluate the values of a hierarchical 1D basis at point x hierarchical = k-th basis function is degree k polynomial.
 
static void CalcBasis (const int p, const real_t x, Vector &u)
 Evaluate the values of a hierarchical 1D basis at point x hierarchical = k-th basis function is degree k polynomial.
 
static void CalcBasis (const int p, const real_t x, real_t *u, real_t *d)
 Evaluate the values and derivatives of a hierarchical 1D basis at point x.
 
static void CalcBasis (const int p, const real_t x, Vector &u, Vector &d)
 Evaluate the values and derivatives of a hierarchical 1D basis at point x.
 
static void CalcBasis (const int p, const real_t x, real_t *u, real_t *d, real_t *dd)
 Evaluate the values, derivatives and second derivatives of a hierarchical 1D basis at point x.
 
static void CalcBasis (const int p, const real_t x, Vector &u, Vector &d, Vector &dd)
 Evaluate the values, derivatives and second derivatives of a hierarchical 1D basis at point x.
 
static real_t CalcDelta (const int p, const real_t x)
 Evaluate a representation of a Delta function at point x.
 
static void ChebyshevPoints (const int p, real_t *x)
 Compute the points for the Chebyshev polynomials of order p and place them in the already allocated x array.
 
static void CalcBinomTerms (const int p, const real_t x, const real_t y, real_t *u)
 Compute the p terms in the expansion of the binomial (x + y)^p and store them in the already allocated u array.
 
static void CalcBinomTerms (const int p, const real_t x, const real_t y, real_t *u, real_t *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.
 
static void CalcDBinomTerms (const int p, const real_t x, const real_t y, real_t *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.
 
static void CalcDxBinomTerms (const int p, const real_t x, const real_t y, real_t *d)
 Compute the derivatives (w.r.t. x) of the terms in the expansion of the binomial (x + y)^p. Store the results in the already allocated d array.
 
static void CalcDyBinomTerms (const int p, const real_t x, const real_t y, real_t *d)
 Compute the derivatives (w.r.t. y) of the terms in the expansion of the binomial (x + y)^p. Store the results in the already allocated d array.
 
static void CalcBernstein (const int p, const real_t x, real_t *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.
 
static void CalcBernstein (const int p, const real_t x, Vector &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.
 
static void CalcBernstein (const int p, const real_t x, real_t *u, real_t *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.
 
static void CalcBernstein (const int p, const real_t x, Vector &u, Vector &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.
 
static void CalcLegendre (const int p, const real_t x, real_t *u)
 
static void CalcLegendre (const int p, const real_t x, real_t *u, real_t *d)
 

Detailed Description

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

Definition at line 987 of file fe_base.hpp.

Member Enumeration Documentation

◆ EvalType

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 991 of file fe_base.hpp.

Constructor & Destructor Documentation

◆ Poly_1D()

mfem::Poly_1D::Poly_1D ( )
inline

Definition at line 1078 of file fe_base.hpp.

◆ ~Poly_1D()

mfem::Poly_1D::~Poly_1D ( )
default

Member Function Documentation

◆ Binom()

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 2044 of file fe_base.cpp.

◆ CalcBasis() [1/6]

static void mfem::Poly_1D::CalcBasis ( const int p,
const real_t x,
real_t * 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 1140 of file fe_base.hpp.

◆ CalcBasis() [2/6]

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

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

Definition at line 1154 of file fe_base.hpp.

◆ CalcBasis() [3/6]

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

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

Definition at line 1166 of file fe_base.hpp.

◆ CalcBasis() [4/6]

static void mfem::Poly_1D::CalcBasis ( const int p,
const real_t x,
Vector & 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 1150 of file fe_base.hpp.

◆ CalcBasis() [5/6]

static void mfem::Poly_1D::CalcBasis ( const int p,
const real_t x,
Vector & u,
Vector & d )
inlinestatic

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

Definition at line 1162 of file fe_base.hpp.

◆ CalcBasis() [6/6]

static void mfem::Poly_1D::CalcBasis ( const int p,
const real_t x,
Vector & u,
Vector & d,
Vector & dd )
inlinestatic

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

Definition at line 1175 of file fe_base.hpp.

◆ CalcBernstein() [1/4]

static void mfem::Poly_1D::CalcBernstein ( const int p,
const real_t x,
real_t * 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 1215 of file fe_base.hpp.

◆ CalcBernstein() [2/4]

static void mfem::Poly_1D::CalcBernstein ( const int p,
const real_t x,
real_t * u,
real_t * 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 1227 of file fe_base.hpp.

◆ CalcBernstein() [3/4]

static void mfem::Poly_1D::CalcBernstein ( const int p,
const real_t x,
Vector & 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 1221 of file fe_base.hpp.

◆ CalcBernstein() [4/4]

static void mfem::Poly_1D::CalcBernstein ( const int p,
const real_t x,
Vector & u,
Vector & 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 1233 of file fe_base.hpp.

◆ CalcBinomTerms() [1/2]

void mfem::Poly_1D::CalcBinomTerms ( const int p,
const real_t x,
const real_t y,
real_t * 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 2093 of file fe_base.cpp.

◆ CalcBinomTerms() [2/2]

void mfem::Poly_1D::CalcBinomTerms ( const int p,
const real_t x,
const real_t y,
real_t * u,
real_t * 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 2122 of file fe_base.cpp.

◆ CalcDBinomTerms()

void mfem::Poly_1D::CalcDBinomTerms ( const int p,
const real_t x,
const real_t y,
real_t * 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 2157 of file fe_base.cpp.

◆ CalcDelta()

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

Evaluate a representation of a Delta function at point x.

Definition at line 1180 of file fe_base.hpp.

◆ CalcDxBinomTerms()

void mfem::Poly_1D::CalcDxBinomTerms ( const int p,
const real_t x,
const real_t y,
real_t * d )
static

Compute the derivatives (w.r.t. x) of the terms in the expansion of the binomial (x + y)^p. Store the results in the already allocated d array.

Definition at line 2187 of file fe_base.cpp.

◆ CalcDyBinomTerms()

void mfem::Poly_1D::CalcDyBinomTerms ( const int p,
const real_t x,
const real_t y,
real_t * d )
static

Compute the derivatives (w.r.t. y) of the terms in the expansion of the binomial (x + y)^p. Store the results in the already allocated d array.

Definition at line 2216 of file fe_base.cpp.

◆ CalcLegendre() [1/2]

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

Definition at line 2245 of file fe_base.cpp.

◆ CalcLegendre() [2/2]

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

Definition at line 2259 of file fe_base.cpp.

◆ ChebyshevPoints()

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

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

Definition at line 2061 of file fe_base.cpp.

◆ ClosedPoints()

const real_t * mfem::Poly_1D::ClosedPoints ( const int p,
const int btype = BasisType::GaussLobatto,
bool on_device = false )
inline

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

Definition at line 1121 of file fe_base.hpp.

◆ GetBasis()

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 2372 of file fe_base.cpp.

◆ GetPoints()

const real_t * mfem::Poly_1D::GetPoints ( const int p,
const int btype,
bool on_device = false )
inline

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.
[in]on_devicetrue if the requested pointer should be accessible from the device.
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 1106 of file fe_base.hpp.

◆ GetPointsArray()

const Array< real_t > * mfem::Poly_1D::GetPointsArray ( 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 2344 of file fe_base.cpp.

◆ OpenPoints()

const real_t * mfem::Poly_1D::OpenPoints ( const int p,
const int btype = BasisType::GaussLegendre,
bool on_device = false )
inline

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

Definition at line 1113 of file fe_base.hpp.


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