Reference documentation for deal.II version 8.5.1
|
#include <deal.II/base/function.h>
Public Member Functions | |
VectorFunctionFromScalarFunctionObject (const std_cxx11::function< Number(const Point< dim > &)> &function_object, const unsigned int selected_component, const unsigned int n_components) | |
virtual Number | value (const Point< dim > &p, const unsigned int component=0) const |
virtual void | vector_value (const Point< dim > &p, Vector< Number > &values) const |
Public Member Functions inherited from Function< dim, Number > | |
Function (const unsigned int n_components=1, const Number initial_time=0.0) | |
virtual | ~Function ()=0 |
Function & | operator= (const Function &f) |
virtual void | value_list (const std::vector< Point< dim > > &points, std::vector< Number > &values, const unsigned int component=0) const |
virtual void | vector_value_list (const std::vector< Point< dim > > &points, std::vector< Vector< Number > > &values) const |
virtual void | vector_values (const std::vector< Point< dim > > &points, std::vector< std::vector< Number > > &values) const |
virtual Tensor< 1, dim, Number > | gradient (const Point< dim > &p, const unsigned int component=0) const |
virtual void | vector_gradient (const Point< dim > &p, std::vector< Tensor< 1, dim, Number > > &gradients) const |
virtual void | gradient_list (const std::vector< Point< dim > > &points, std::vector< Tensor< 1, dim, Number > > &gradients, const unsigned int component=0) const |
virtual void | vector_gradients (const std::vector< Point< dim > > &points, std::vector< std::vector< Tensor< 1, dim, Number > > > &gradients) const |
virtual void | vector_gradient_list (const std::vector< Point< dim > > &points, std::vector< std::vector< Tensor< 1, dim, Number > > > &gradients) const |
virtual Number | laplacian (const Point< dim > &p, const unsigned int component=0) const |
virtual void | vector_laplacian (const Point< dim > &p, Vector< Number > &values) const |
virtual void | laplacian_list (const std::vector< Point< dim > > &points, std::vector< Number > &values, const unsigned int component=0) const |
virtual void | vector_laplacian_list (const std::vector< Point< dim > > &points, std::vector< Vector< Number > > &values) const |
virtual SymmetricTensor< 2, dim, Number > | hessian (const Point< dim > &p, const unsigned int component=0) const |
virtual void | vector_hessian (const Point< dim > &p, std::vector< SymmetricTensor< 2, dim, Number > > &values) const |
virtual void | hessian_list (const std::vector< Point< dim > > &points, std::vector< SymmetricTensor< 2, dim, Number > > &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, Number > > > &values) const |
std::size_t | memory_consumption () const |
Public Member Functions inherited from FunctionTime< Number > | |
FunctionTime (const Number initial_time=Number(0.0)) | |
virtual | ~FunctionTime () |
Number | get_time () const |
virtual void | set_time (const Number new_time) |
virtual void | advance_time (const Number delta_t) |
Public Member Functions inherited from Subscriptor | |
Subscriptor () | |
Subscriptor (const Subscriptor &) | |
Subscriptor (Subscriptor &&) | |
virtual | ~Subscriptor () |
Subscriptor & | operator= (const Subscriptor &) |
Subscriptor & | operator= (Subscriptor &&) |
void | subscribe (const char *identifier=0) const |
void | unsubscribe (const char *identifier=0) const |
unsigned int | n_subscriptions () const |
void | list_subscribers () const |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Private Attributes | |
const std_cxx11::function< Number(const Point< dim > &)> | function_object |
const unsigned int | selected_component |
Additional Inherited Members | |
Static Public Member Functions inherited from Subscriptor | |
static ::ExceptionBase & | ExcInUse (int arg1, char *arg2, std::string &arg3) |
static ::ExceptionBase & | ExcNoSubscriber (char *arg1, char *arg2) |
Public Attributes inherited from Function< dim, Number > | |
const unsigned int | n_components |
Static Public Attributes inherited from Function< dim, Number > | |
static const unsigned int | dimension = dim |
This class is similar to the ScalarFunctionFromFunctionObject class in that it allows for the easy conversion of a function object to something that satisfies the interface of the Function base class. The difference is that here, the given function object is still a scalar function (i.e. it has a single value at each space point) but that the Function object generated is vector valued. The number of vector components is specified in the constructor, where one also selects a single one of these vector components that should be filled by the passed object. The result is a vector Function object that returns zero in each component except the single selected one where it returns the value returned by the given as the first argument to the constructor.
x
that can be called as in x(p)
) and the capitalized (vector valued) "Function object" (i.e., an object of a class that is derived from the Function base class).To be more concrete, let us consider the following example:
Here, component_mask
then represents a Function object that for every point returns the vector \((0, 1, 0)^T\), i.e. a mask function that could, for example, be passed to VectorTools::integrate_difference(). This effect can also be achieved using the ComponentSelectFunction class but is obviously easily extended to functions that are non-constant in their one component.
Definition at line 711 of file function.h.
VectorFunctionFromScalarFunctionObject< dim, Number >::VectorFunctionFromScalarFunctionObject | ( | const std_cxx11::function< Number(const Point< dim > &)> & | function_object, |
const unsigned int | selected_component, | ||
const unsigned int | n_components | ||
) |
|
virtual |
Return the value of the function at the given point. Returns the value the function given to the constructor produces for this point.
Reimplemented from Function< dim, Number >.
|
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, Number >.
|
private |
The function object which we call when this class's value() or value_list() functions are called.
Definition at line 749 of file function.h.
|
private |
The vector component whose value is to be filled by the given scalar function.
Definition at line 755 of file function.h.