Reference documentation for deal.II version 9.3.3
|
#include <deal.II/base/function_lib.h>
Public Types | |
using | time_type = typename FunctionTime< typename numbers::NumberTraits< RangeNumberType >::real_type >::time_type |
Public Member Functions | |
Polynomial (const Table< 2, double > &exponents, const std::vector< double > &coefficients) | |
virtual double | value (const Point< dim > &p, const unsigned int component=0) const override |
virtual void | value_list (const std::vector< Point< dim > > &points, std::vector< double > &values, const unsigned int component=0) const override |
virtual Tensor< 1, dim > | gradient (const Point< dim > &p, const unsigned int component=0) const override |
virtual std::size_t | memory_consumption () const override |
virtual void | vector_value (const Point< dim > &p, Vector< RangeNumberType > &values) const |
virtual void | value_list (const std::vector< Point< dim > > &points, std::vector< RangeNumberType > &values, const unsigned int component=0) const |
virtual void | vector_value_list (const std::vector< Point< dim > > &points, std::vector< Vector< RangeNumberType > > &values) const |
virtual void | vector_values (const std::vector< Point< dim > > &points, std::vector< std::vector< RangeNumberType > > &values) const |
virtual void | vector_gradient (const Point< dim > &p, std::vector< Tensor< 1, dim, RangeNumberType > > &gradients) const |
virtual void | gradient_list (const std::vector< Point< dim > > &points, std::vector< Tensor< 1, dim, RangeNumberType > > &gradients, const unsigned int component=0) const |
virtual void | vector_gradients (const std::vector< Point< dim > > &points, std::vector< std::vector< Tensor< 1, dim, RangeNumberType > > > &gradients) const |
virtual void | vector_gradient_list (const std::vector< Point< dim > > &points, std::vector< std::vector< Tensor< 1, dim, RangeNumberType > > > &gradients) const |
virtual RangeNumberType | laplacian (const Point< dim > &p, const unsigned int component=0) const |
virtual void | vector_laplacian (const Point< dim > &p, Vector< RangeNumberType > &values) const |
virtual void | laplacian_list (const std::vector< Point< dim > > &points, std::vector< RangeNumberType > &values, const unsigned int component=0) const |
virtual void | vector_laplacian_list (const std::vector< Point< dim > > &points, std::vector< Vector< RangeNumberType > > &values) const |
virtual SymmetricTensor< 2, dim, RangeNumberType > | hessian (const Point< dim > &p, const unsigned int component=0) const |
virtual void | vector_hessian (const Point< dim > &p, std::vector< SymmetricTensor< 2, dim, RangeNumberType > > &values) const |
virtual void | hessian_list (const std::vector< Point< dim > > &points, std::vector< SymmetricTensor< 2, dim, RangeNumberType > > &values, const unsigned int component=0) const |
virtual void | vector_hessian_list (const std::vector< Point< dim > > &points, std::vector< std::vector< SymmetricTensor< 2, dim, RangeNumberType > > > &values) const |
numbers::NumberTraits< double >::real_type | get_time () const |
virtual void | set_time (const numbers::NumberTraits< double >::real_type new_time) |
virtual void | advance_time (const numbers::NumberTraits< double >::real_type delta_t) |
Public Attributes | |
const unsigned int | n_components |
Static Public Attributes | |
static const unsigned int | dimension = dim |
Private Attributes | |
const Table< 2, double > | exponents |
const std::vector< double > | coefficients |
numbers::NumberTraits< double >::real_type | time |
Subscriptor functionality | |
Classes derived from Subscriptor provide a facility to subscribe to this object. This is mostly used by the SmartPointer class. | |
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 |
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 |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
using | map_value_type = decltype(counter_map)::value_type |
using | map_iterator = decltype(counter_map)::iterator |
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 |
A class that represents a function object for a polynomial. A polynomial is composed by the summation of multiple monomials. If the polynomial has n monomials and the dimension is equal to dim, the polynomial can be written as \(\sum_{i=1}^{n} a_{i}(\prod_{d=1}^{dim} x_{d}^{\alpha_{i,d}})\), where \(a_{i}\) are the coefficients of the monomials and \(\alpha_{i,d}\) are their exponents. The class's constructor takes a Table<2,double> to describe the set of exponents and a Vector<double> to describe the set of coefficients.
Definition at line 1700 of file function_lib.h.
|
inherited |
The scalar-valued real type used for representing time.
Definition at line 169 of file function.h.
Functions::Polynomial< dim >::Polynomial | ( | const Table< 2, double > & | exponents, |
const std::vector< double > & | coefficients | ||
) |
Constructor. The coefficients and the exponents of the polynomial are passed as arguments. The Table<2, double> exponents has a number of rows equal to the number of monomials of the polynomial and a number of columns equal to dim. The i-th row of the exponents table contains the \({\alpha_{i,d}}\) exponents of the i-th monomial \(a_{i}\prod_{d=1}^{dim} x_{d}^{\alpha_{i,d}}\). The i-th element of the coefficients vector contains the coefficient \(a_{i}\) for the i-th monomial.
Definition at line 2838 of file function_lib.cc.
|
overridevirtual |
Function value at one point.
Reimplemented from Function< dim, RangeNumberType >.
Definition at line 2854 of file function_lib.cc.
|
overridevirtual |
Function values at multiple points.
Definition at line 2881 of file function_lib.cc.
|
overridevirtual |
Function gradient at one point.
Reimplemented from Function< dim, RangeNumberType >.
Definition at line 2896 of file function_lib.cc.
|
overridevirtual |
Return an estimate for the memory consumption, in bytes, of this object.
Reimplemented from Function< dim, RangeNumberType >.
Definition at line 2943 of file function_lib.cc.
|
virtualinherited |
Return all components of a vector-valued function at a given point.
values
shall have the right size beforehand, i.e. n_components.
The default implementation will call value() for each component.
Reimplemented in Functions::ConstantFunction< dim, double >, and Functions::FEFieldFunction< dim, DoFHandlerType, VectorType >.
|
virtualinherited |
Set values
to the point values of the specified component of the function at the points
. It is assumed that values
already has the right size, i.e. the same size as the points
array.
By default, this function repeatedly calls value() for each point separately, to fill the output array.
Reimplemented in Functions::ConstantFunction< dim, double >, and Functions::FEFieldFunction< dim, DoFHandlerType, VectorType >.
|
virtualinherited |
Set values
to the point values of the function at the points
. It is assumed that values
already has the right size, i.e. the same size as the points
array, and that all elements be vectors with the same number of components as this function has.
By default, this function repeatedly calls vector_value() for each point separately, to fill the output array.
Reimplemented in Functions::ConstantFunction< dim, double >, and Functions::FEFieldFunction< dim, DoFHandlerType, VectorType >.
|
virtualinherited |
For each component of the function, fill a vector of values, one for each point.
The default implementation of this function in Function calls value_list() for each component. In order to improve performance, this can be reimplemented in derived classes to speed up performance.
|
virtualinherited |
Return the gradient of all components of the function at the given point.
Reimplemented in Functions::ConstantFunction< dim, double >, and Functions::FEFieldFunction< dim, DoFHandlerType, VectorType >.
|
virtualinherited |
Set gradients
to the gradients of the specified component of the function at the points
. It is assumed that gradients
already has the right size, i.e. the same size as the points
array.
Reimplemented in Functions::FEFieldFunction< dim, DoFHandlerType, VectorType >, and Functions::ConstantFunction< dim, double >.
|
virtualinherited |
For each component of the function, fill a vector of gradient values, one for each point.
The default implementation of this function in Function calls value_list() for each component. In order to improve performance, this can be reimplemented in derived classes to speed up performance.
|
virtualinherited |
Set gradients
to the gradients of the function at the points
, for all components. It is assumed that gradients
already has the right size, i.e. the same size as the points
array.
The outer loop over gradients
is over the points in the list, the inner loop over the different components of the function.
Reimplemented in Functions::FEFieldFunction< dim, DoFHandlerType, VectorType >, and Functions::ConstantFunction< dim, double >.
|
virtualinherited |
Compute the Laplacian of a given component at point p
.
Reimplemented in Functions::CosineGradFunction< dim >, Functions::IdentityFunction< dim, RangeNumberType >, Functions::CSpline< dim >, Functions::SquareFunction< dim >, Functions::Q1WedgeFunction< dim >, Functions::PillowFunction< dim >, Functions::CosineFunction< dim >, Functions::ExpFunction< dim >, Functions::SlitSingularityFunction< dim >, Functions::JumpFunction< dim >, Functions::FourierCosineFunction< dim >, Functions::FourierSineFunction< dim >, Functions::FourierSineSum< dim >, Functions::FourierCosineSum< dim >, Functions::SymbolicFunction< dim, RangeNumberType >, Functions::FEFieldFunction< dim, DoFHandlerType, VectorType >, Functions::ConstantFunction< dim, RangeNumberType >, and Functions::ConstantFunction< dim, double >.
|
virtualinherited |
Compute the Laplacian of all components at point p
and store them in values
.
Reimplemented in Functions::FEFieldFunction< dim, DoFHandlerType, VectorType >.
|
virtualinherited |
Compute the Laplacian of one component at a set of points.
Reimplemented in Functions::FEFieldFunction< dim, DoFHandlerType, VectorType >.
|
virtualinherited |
Compute the Laplacians of all components at a set of points.
Reimplemented in Functions::FEFieldFunction< dim, DoFHandlerType, VectorType >.
|
virtualinherited |
Compute the Hessian of a given component at point p
, that is the gradient of the gradient of the function.
Reimplemented in Functions::LevelSet::Plane< dim >, Functions::IdentityFunction< dim, RangeNumberType >, Functions::CSpline< dim >, Functions::CosineFunction< dim >, Functions::Spherical< dim >, Functions::SymbolicFunction< dim, RangeNumberType >, Functions::CoordinateRestriction< dim >, Functions::ConstantFunction< dim, RangeNumberType >, Functions::ConstantFunction< dim, double >, and Functions::LevelSet::Sphere< dim >.
|
virtualinherited |
Compute the Hessian of all components at point p
and store them in values
.
|
virtualinherited |
Compute the Hessian of one component at a set of points.
|
virtualinherited |
Compute the Hessians of all components at a set of points.
|
inherited |
Return the value of the time variable.
|
virtualinherited |
Set the time to new_time
, overwriting the old value.
|
virtualinherited |
Advance the time by the given time step delta_t
.
|
private |
The set of exponents.
Definition at line 1747 of file function_lib.h.
|
private |
The set of coefficients.
Definition at line 1752 of file function_lib.h.
|
staticinherited |
Export the value of the template parameter as a static member constant. Sometimes useful for some expression template programming.
Definition at line 159 of file function.h.
|
inherited |
Number of vector components.
Definition at line 164 of file function.h.
|
privateinherited |
Store the present time.
Definition at line 113 of file function_time.h.