Reference documentation for deal.II version 9.4.1
|
#include <deal.II/base/polynomials_piecewise.h>
Public Member Functions | |
PiecewisePolynomial (const Polynomial< number > &coefficients_on_interval, const unsigned int n_intervals, const unsigned int interval, const bool spans_next_interval) | |
PiecewisePolynomial (const std::vector< Point< 1, number > > &points, const unsigned int index) | |
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) |
virtual std::size_t | memory_consumption () const |
Protected Attributes | |
Polynomial< number > | polynomial |
unsigned int | n_intervals |
unsigned int | interval |
bool | spans_two_intervals |
std::vector< number > | points |
std::vector< number > | one_over_lengths |
unsigned int | index |
Subscriptor functionality | |
Classes derived from Subscriptor provide a facility to subscribe to this object. This is mostly used by the SmartPointer class. | |
void | subscribe (std::atomic< bool > *const validity, const std::string &identifier="") const |
void | unsubscribe (std::atomic< bool > *const validity, const std::string &identifier="") const |
unsigned int | n_subscriptions () const |
template<typename StreamType > | |
void | list_subscribers (StreamType &stream) const |
void | list_subscribers () const |
using | map_value_type = decltype(counter_map)::value_type |
using | map_iterator = decltype(counter_map)::iterator |
std::atomic< unsigned int > | counter |
std::map< std::string, unsigned int > | counter_map |
std::vector< std::atomic< bool > * > | validity_pointers |
const std::type_info * | object_info |
static std::mutex | mutex |
static ::ExceptionBase & | ExcInUse (int arg1, std::string arg2, std::string arg3) |
static ::ExceptionBase & | ExcNoSubscriber (std::string arg1, std::string arg2) |
void | check_no_subscribers () const noexcept |
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 subdivided elements. The primary purpose of this class is to allow constructing the shape functions of the FE_Q_iso_Q1 class that has a number of interpolation points in each coordinate direction, but instead of using them for higher-order polynomials just chooses piecewise linear shape functions – in effect, it is a \(Q_1\) element defined on a subdivision of the reference cell, and replicated on each of these sub-cells.
This class is not derived from the ScalarPolynomialsBase base class because it is not actually a polynomial – it is a piecewise polynomial. However, it is interface-compatible with the Polynomials::Polynomial class, and consequently can be used as template argument for TensorProductPolynomials.
Definition at line 64 of file polynomials_piecewise.h.
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.
Polynomials::PiecewisePolynomial< number >::PiecewisePolynomial | ( | const std::vector< Point< 1, number > > & | points, |
const unsigned int | index | ||
) |
Constructor for linear 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 subintervals are bounded by the adjacent points in points
.
Definition at line 45 of file polynomials_piecewise.cc.
|
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 246 of file polynomials_piecewise.h.
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 i
th 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 arithmetic) 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 70 of file polynomials_piecewise.cc.
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 i
th 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 arithmetic) 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 82 of file polynomials_piecewise.cc.
|
inline |
Degree of the polynomial. This is the degree of the underlying base polynomial.
Definition at line 235 of file polynomials_piecewise.h.
|
inline |
Write or read the data of this object to or from a stream for the purpose of serialization using the BOOST serialization library.
Definition at line 302 of file polynomials_piecewise.h.
|
virtual |
Return an estimate (in bytes) for the memory consumption of this object.
Definition at line 178 of file polynomials_piecewise.cc.
|
protected |
Underlying polynomial object that is scaled to a subinterval and concatenated accordingly.
Definition at line 165 of file polynomials_piecewise.h.
|
protected |
A variable storing the number of intervals that the unit interval is divided into.
Definition at line 171 of file polynomials_piecewise.h.
|
protected |
A variable storing the index of the current polynomial in the range of intervals.
Definition at line 177 of file polynomials_piecewise.h.
|
protected |
Store if the polynomial spans over two adjacent intervals, i.e., the one given in subinterval and the next one.
Definition at line 183 of file polynomials_piecewise.h.
|
protected |
Points bounding the subintervals in the case that piecewise linear polynomial on varying subintervals is requested.
Definition at line 189 of file polynomials_piecewise.h.
|
protected |
Precomputed inverses of the lengths of the subintervals, i.e., one_over_lengths[i] = 1.0 / (points[i + 1] - points[i]
.
Definition at line 195 of file polynomials_piecewise.h.
|
protected |
A variable storing the index of the current polynomial in the case that piecewise linear polynomial on varying subintervals is requested.
Definition at line 201 of file polynomials_piecewise.h.