Reference documentation for deal.II version 9.0.0
Public Member Functions | Protected Attributes | List of all members
Polynomials::PiecewisePolynomial< number > Class Template Reference

#include <deal.II/base/polynomials_piecewise.h>

Inheritance diagram for Polynomials::PiecewisePolynomial< number >:
[legend]

Public Member Functions

 PiecewisePolynomial (const Polynomial< number > &coefficients_on_interval, const unsigned int n_intervals, const unsigned int interval, const bool spans_next_interval)
 
number value (const number x) const
 
void value (const number x, std::vector< number > &values) const
 
void value (const number x, const unsigned int n_derivatives, number *values) const
 
unsigned int degree () const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 
- Public Member Functions inherited from Subscriptor
 Subscriptor ()
 
 Subscriptor (const Subscriptor &)
 
 Subscriptor (Subscriptor &&) noexcept
 
virtual ~Subscriptor ()
 
Subscriptoroperator= (const Subscriptor &)
 
Subscriptoroperator= (Subscriptor &&) noexcept
 
void subscribe (const char *identifier=nullptr) const
 
void unsubscribe (const char *identifier=nullptr) const
 
unsigned int n_subscriptions () const
 
void list_subscribers () const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Protected Attributes

Polynomial< number > polynomial
 
unsigned int n_intervals
 
unsigned int interval
 
bool spans_two_intervals
 

Additional Inherited Members

- Static Public Member Functions inherited from Subscriptor
static ::ExceptionBaseExcInUse (int arg1, std::string arg2, std::string arg3)
 
static ::ExceptionBaseExcNoSubscriber (std::string arg1, std::string arg2)
 

Detailed Description

template<typename number>
class Polynomials::PiecewisePolynomial< number >

Definition of piecewise 1D polynomials for the unit interval. This space allows the description of interpolating polynomials on parts of the unit interval, similarly to the definition of finite element basis functions on the subdivided elements. This primary purpose of this class is to allow constructing FE_Q_iso_Q1 elements that put additional degrees of freedom into an equivalent of a refined mesh instead of higher order polynomials, which is useful when using mixed finite elements.

Author
Martin Kronbichler, 2013

Definition at line 55 of file polynomials_piecewise.h.

Constructor & Destructor Documentation

◆ PiecewisePolynomial()

template<typename number>
Polynomials::PiecewisePolynomial< number >::PiecewisePolynomial ( const Polynomial< number > &  coefficients_on_interval,
const unsigned int  n_intervals,
const unsigned int  interval,
const bool  spans_next_interval 
)

Constructor for Lagrange polynomial on an interval that is a subset of the unit interval. It uses a polynomial description that is scaled to the size of the subinterval compared to the unit interval, the total number of intervals (subdivisions), the current index of the interval as well as if the polynomial spans onto the next interval (e.g., if it lives on two neighboring intervals).

If the number of intervals is one, the piecewise polynomial behaves exactly like a usual polynomial.

Definition at line 27 of file polynomials_piecewise.cc.

Member Function Documentation

◆ value() [1/3]

template<typename number>
number Polynomials::PiecewisePolynomial< number >::value ( const number  x) const
inline

Return the value of this polynomial at the given point, evaluating the underlying polynomial. The polynomial evaluates to zero when outside of the given interval (and possible the next one to the right when it spans over that range).

Definition at line 189 of file polynomials_piecewise.h.

◆ value() [2/3]

template<typename number>
void Polynomials::PiecewisePolynomial< number >::value ( const number  x,
std::vector< number > &  values 
) const

Return the values and the derivatives of the Polynomial at point x. values[i], i=0,...,values.size()-1 includes the ith derivative. The number of derivatives to be computed is thus determined by the size of the vector passed.

Note that all the derivatives evaluate to zero at the border between intervals (assuming exact arithmetics) in the interior of the unit interval, as there is no unique gradient value in that case for a piecewise polynomial. This is not always desired (e.g., when evaluating jumps of gradients on the element boundary), but it is the user's responsibility to avoid evaluation at these points when it does not make sense.

Definition at line 45 of file polynomials_piecewise.cc.

◆ value() [3/3]

template<typename number>
void Polynomials::PiecewisePolynomial< number >::value ( const number  x,
const unsigned int  n_derivatives,
number *  values 
) const

Return the values and the derivatives of the Polynomial at point x. values[i], i=0,...,n_derivatives includes the ith derivative.The number of derivatives to be computed is determined by n_derivatives and values has to provide sufficient space for n_derivatives + 1 values.

Note that all the derivatives evaluate to zero at the border between intervals (assuming exact arithmetics) in the interior of the unit interval, as there is no unique gradient value in that case for a piecewise polynomial. This is not always desired (e.g., when evaluating jumps of gradients on the element boundary), but it is the user's responsibility to avoid evaluation at these points when it does not make sense.

Definition at line 57 of file polynomials_piecewise.cc.

◆ degree()

template<typename number >
unsigned int Polynomials::PiecewisePolynomial< number >::degree ( ) const
inline

Degree of the polynomial. This is the degree of the underlying base polynomial.

Definition at line 179 of file polynomials_piecewise.h.

◆ serialize()

template<typename number >
template<class Archive >
void Polynomials::PiecewisePolynomial< number >::serialize ( Archive &  ar,
const unsigned int  version 
)
inline

Write or read the data of this object to or from a stream for the purpose of serialization.

Definition at line 232 of file polynomials_piecewise.h.

Member Data Documentation

◆ polynomial

template<typename number>
Polynomial<number> Polynomials::PiecewisePolynomial< number >::polynomial
protected

Underlying polynomial object that is scaled to a subinterval and concatenated accordingly.

Definition at line 137 of file polynomials_piecewise.h.

◆ n_intervals

template<typename number>
unsigned int Polynomials::PiecewisePolynomial< number >::n_intervals
protected

A variable storing the number of intervals that the unit interval is divided into.

Definition at line 142 of file polynomials_piecewise.h.

◆ interval

template<typename number>
unsigned int Polynomials::PiecewisePolynomial< number >::interval
protected

A variable storing the index of the current polynomial in the range of intervals.

Definition at line 147 of file polynomials_piecewise.h.

◆ spans_two_intervals

template<typename number>
bool Polynomials::PiecewisePolynomial< number >::spans_two_intervals
protected

Store if the polynomial spans over two adjacent intervals, i.e., the one given in subinterval and the next one.

Definition at line 153 of file polynomials_piecewise.h.


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