![]() |
Reference documentation for deal.II version 8.1.0
|
#include <function_derivative.h>
Public Member Functions | |
FunctionDerivative (const Function< dim > &f, const Point< dim > &direction, const double h=1.e-6) | |
FunctionDerivative (const Function< dim > &f, const std::vector< Point< dim > > &direction, const double h=1.e-6) | |
void | set_formula (typename AutoDerivativeFunction< dim >::DifferenceFormula formula=AutoDerivativeFunction< dim >::Euler) |
void | set_h (const double h) |
virtual double | value (const Point< dim > &p, const unsigned int component=0) const |
virtual void | vector_value (const Point< dim > &p, Vector< double > &value) const |
virtual void | value_list (const std::vector< Point< dim > > &points, std::vector< double > &values, const unsigned int component=0) const |
std::size_t | memory_consumption () const |
DeclException0 (ExcInvalidFormula) | |
![]() | |
AutoDerivativeFunction (const double h, const unsigned int n_components=1, const double initial_time=0.0) | |
virtual | ~AutoDerivativeFunction () |
void | set_formula (const DifferenceFormula formula=Euler) |
void | set_h (const double h) |
virtual Tensor< 1, dim > | gradient (const Point< dim > &p, const unsigned int component=0) const |
virtual void | vector_gradient (const Point< dim > &p, std::vector< Tensor< 1, dim > > &gradients) const |
virtual void | gradient_list (const std::vector< Point< dim > > &points, std::vector< Tensor< 1, dim > > &gradients, const unsigned int component=0) const |
virtual void | vector_gradient_list (const std::vector< Point< dim > > &points, std::vector< std::vector< Tensor< 1, dim > > > &gradients) const |
DeclException0 (ExcInvalidFormula) | |
![]() | |
Function (const unsigned int n_components=1, const double initial_time=0.0) | |
virtual | ~Function ()=0 |
Function & | operator= (const Function &f) |
virtual void | vector_value_list (const std::vector< Point< dim > > &points, std::vector< Vector< double > > &values) const |
virtual void | vector_values (const std::vector< Point< dim > > &points, std::vector< std::vector< double > > &values) const |
virtual void | vector_gradients (const std::vector< Point< dim > > &points, std::vector< std::vector< Tensor< 1, dim > > > &gradients) const |
virtual double | laplacian (const Point< dim > &p, const unsigned int component=0) const |
virtual void | vector_laplacian (const Point< dim > &p, Vector< double > &values) const |
virtual void | laplacian_list (const std::vector< Point< dim > > &points, std::vector< double > &values, const unsigned int component=0) const |
virtual void | vector_laplacian_list (const std::vector< Point< dim > > &points, std::vector< Vector< double > > &values) const |
std::size_t | memory_consumption () const |
![]() | |
FunctionTime (const double initial_time=0.0) | |
virtual | ~FunctionTime () |
double | get_time () const |
virtual void | set_time (const double new_time) |
virtual void | advance_time (const double delta_t) |
![]() | |
Subscriptor () | |
Subscriptor (const Subscriptor &) | |
virtual | ~Subscriptor () |
Subscriptor & | operator= (const Subscriptor &) |
void | subscribe (const char *identifier=0) const |
void | unsubscribe (const char *identifier=0) const |
unsigned int | n_subscriptions () const |
void | list_subscribers () const |
DeclException3 (ExcInUse, int, char *, std::string &,<< "Object of class "<< arg2<< " is still used by "<< arg1<< " other objects.\n"<< "(Additional information: "<< arg3<< ")\n"<< "Note the entry in the Frequently Asked Questions of "<< "deal.II (linked to from http://www.dealii.org/) for "<< "more information on what this error means.") | |
DeclException2 (ExcNoSubscriber, char *, char *,<< "No subscriber with identifier \""<< arg2<< "\" did subscribe to this object of class "<< arg1) | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Private Attributes | |
const Function< dim > & | f |
double | h |
AutoDerivativeFunction< dim > ::DifferenceFormula | formula |
std::vector< Point< dim > > | incr |
Additional Inherited Members | |
![]() | |
enum | DifferenceFormula { Euler, UpwindEuler, FourthOrder } |
![]() | |
static DifferenceFormula | get_formula_of_order (const unsigned int ord) |
![]() | |
const unsigned int | n_components |
![]() | |
static const unsigned int | dimension = dim |
Derivative of a function object. The value access functions of this class return the directional derivative of a function with respect to a direction provided on construction. If b
is the vector, the derivative b . grad f
is computed. This derivative is evaluated directly, not by computing the gradient of f
and its scalar product with b
.
The derivative is computed numerically, using one of the provided difference formulas (see set_formula
for available schemes). Experimenting with h
and the difference scheme may be necessary to obtain sufficient results.
Definition at line 45 of file function_derivative.h.
FunctionDerivative< dim >::FunctionDerivative | ( | const Function< dim > & | f, |
const Point< dim > & | direction, | ||
const double | h = 1.e-6 |
||
) |
Constructor. Provided are the functions to compute derivatives of, the direction vector of the differentiation and the step size h
of the difference formula.
FunctionDerivative< dim >::FunctionDerivative | ( | const Function< dim > & | f, |
const std::vector< Point< dim > > & | direction, | ||
const double | h = 1.e-6 |
||
) |
Constructor. Provided are the functions to compute derivatives of and the direction vector of the differentiation in each quadrature point and the difference step size.
This is the constructor for a variable velocity field. Most probably, a new object of FunctionDerivative
has to be constructed for each set of quadrature points.
The number of quadrature point must still be the same, when values are accessed.
void FunctionDerivative< dim >::set_formula | ( | typename AutoDerivativeFunction< dim >::DifferenceFormula | formula = AutoDerivativeFunction< dim >::Euler | ) |
Choose the difference formula. This is set to the default in the constructor.
Formulas implemented right now are first order backward Euler (UpwindEuler
), second order symmetric Euler (Euler
) and a symmetric fourth order formula (FourthOrder
).
void FunctionDerivative< dim >::set_h | ( | const double | h | ) |
Change the base step size of the difference formula
|
virtual |
Return the value of the function at the given point. Unless there is only one component (i.e. the function is scalar), you should state the component you want to have evaluated; it defaults to zero, i.e. the first component.
Reimplemented from Function< dim >.
|
virtual |
Return all components of a vector-valued function at a given point.
values
shall have the right size beforehand, i.e. n_components.
Reimplemented from Function< dim >.
|
virtual |
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.
Be default, this function repeatedly calls value() for each point separately, to fill the output array.
Reimplemented from Function< dim >.
std::size_t FunctionDerivative< dim >::memory_consumption | ( | ) | const |
Determine an estimate for the memory consumption (in bytes) of this object. Since sometimes the size of objects can not be determined exactly (for example: what is the memory consumption of an STL std::map
type with a certain number of elements?), this is only an estimate. however often quite close to the true value.
|
private |
Function for differentiation.
Definition at line 145 of file function_derivative.h.
|
private |
Step size of the difference formula.
Definition at line 151 of file function_derivative.h.
|
private |
Difference formula.
Definition at line 156 of file function_derivative.h.
|
private |
Helper object. Contains the increment vector for the formula.
Definition at line 163 of file function_derivative.h.