Class template Dune::XT::Functions::GenericGridFunction<E, r, rC, R>

Inherits from Dune::XT::Functions::GridFunctionInterface.

template<class E, size_t r = 1, size_t rC = 1, class R = double>
class Dune::XT::Functions::GenericGridFunction<E, r, rC, R> : public GridFunctionInterface<E, r, rC, R>

A function given by a lambda expression or std::function which is evaluated locally on each element.

To model the function f(x) = x^p (where x is the local coordinate on the reference element) with a variable exponent p, use as

GenericGridFunction<...> f([](const typename F::DomainType& point_in_local_coordinates,
                              const XT::Common::Parameter&  param) {
                             typename F::RangeType ret(std::pow(point_in_local_coordinates[0],
                                     param.get("power").at(0)));
                             return ret;
                           },
                           integration_order,
                           XT::Common::ParameterType("power", 1),
                           "x_power_p");

The XT::Common::ParameterType provided on construction ensures that the XT::Common::Parameter param which is passed on to the generic function is of correct type. If you want the function to have Jacobians, you have to provide an additional generic function to the constructor. Note that this generic jacobian function should describe the local jacobian on the reference element (for the x^p function in one dimension, this would be p x^{p-1}). The jacobian(…) method of the LocalGenericGridFunction will do the transformation for you and return the jacobian on the actual grid element.

Class Dune::XT::Functions::GenericGridFunction::LocalGenericGridFunction

Inherits from Dune::XT::Functions::ElementFunctionInterface.

template<class E, size_t r = 1, size_t rC = 1, class R = double>
class Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::LocalGenericGridFunction : public ElementFunctionInterface<E, r, rC, R>

No documentation provided.

Method Dune::XT::Functions::GenericGridFunction::LocalGenericGridFunction::post_bind

template<class E, size_t r = 1, size_t rC = 1, class R = double>
void Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::LocalGenericGridFunction::post_bind(const ElementType &element) final

No documentation provided.

Method Dune::XT::Functions::GenericGridFunction::LocalGenericGridFunction::order

template<class E, size_t r = 1, size_t rC = 1, class R = double>
int Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::LocalGenericGridFunction::order(const XT::Common::Parameter &param = {}) const final

No documentation provided.

Method Dune::XT::Functions::GenericGridFunction::LocalGenericGridFunction::evaluate

template<class E, size_t r = 1, size_t rC = 1, class R = double>
RangeReturnType Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::LocalGenericGridFunction::evaluate(const DomainType &point_in_local_coordinates, const Common::Parameter &param = {}) const final

No documentation provided.

Method Dune::XT::Functions::GenericGridFunction::LocalGenericGridFunction::jacobian

template<class E, size_t r = 1, size_t rC = 1, class R = double>
DerivativeRangeReturnType Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::LocalGenericGridFunction::jacobian(const DomainType &point_in_local_coordinates, const Common::Parameter &param = {}) const final

No documentation provided.

Method Dune::XT::Functions::GenericGridFunction::LocalGenericGridFunction::derivative

template<class E, size_t r = 1, size_t rC = 1, class R = double>
DerivativeRangeReturnType Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::LocalGenericGridFunction::derivative(const std::array<size_t, d> &alpha, const DomainType &point_in_local_coordinates, const Common::Parameter &param = {}) const final

No documentation provided.

Constructor Dune::XT::Functions::GenericGridFunction::LocalGenericGridFunction::LocalGenericGridFunction

template<class E, size_t r = 1, size_t rC = 1, class R = double>
Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::LocalGenericGridFunction::LocalGenericGridFunction(GenericOrderFunctionType order_func, GenericPostBindFunctionType post_bind_func, GenericEvaluateFunctionType evaluate_func, const Common::ParameterType &param_type, GenericJacobianFunctionType jacobian_func, GenericDerivativeFunctionType derivative_func)

No documentation provided.

Field Dune::XT::Functions::GenericGridFunction::LocalGenericGridFunction::order_

template<class E, size_t r = 1, size_t rC = 1, class R = double>
const GenericOrderFunctionType Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::LocalGenericGridFunction::order_

No documentation provided.

Field Dune::XT::Functions::GenericGridFunction::LocalGenericGridFunction::post_bind_

template<class E, size_t r = 1, size_t rC = 1, class R = double>
const GenericPostBindFunctionType Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::LocalGenericGridFunction::post_bind_

No documentation provided.

Field Dune::XT::Functions::GenericGridFunction::LocalGenericGridFunction::evaluate_

template<class E, size_t r = 1, size_t rC = 1, class R = double>
const GenericEvaluateFunctionType Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::LocalGenericGridFunction::evaluate_

No documentation provided.

Field Dune::XT::Functions::GenericGridFunction::LocalGenericGridFunction::jacobian_

template<class E, size_t r = 1, size_t rC = 1, class R = double>
const GenericJacobianFunctionType Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::LocalGenericGridFunction::jacobian_

No documentation provided.

Field Dune::XT::Functions::GenericGridFunction::LocalGenericGridFunction::derivative_

template<class E, size_t r = 1, size_t rC = 1, class R = double>
const GenericDerivativeFunctionType Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::LocalGenericGridFunction::derivative_

No documentation provided.

Type alias Dune::XT::Functions::GenericGridFunction::LocalGenericGridFunction::BaseType

template<class E, size_t r = 1, size_t rC = 1, class R = double>
using Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::LocalGenericGridFunction::BaseType = ElementFunctionInterface<E, r, rC, R>

No documentation provided.

Type alias Dune::XT::Functions::GenericGridFunction::LocalGenericGridFunction::GenericEvaluateFunctionType

template<class E, size_t r = 1, size_t rC = 1, class R = double>
using Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::LocalGenericGridFunction::GenericEvaluateFunctionType = std::function<RangeReturnType(const DomainType&, const Common::Parameter&)>

No documentation provided.

Type alias Dune::XT::Functions::GenericGridFunction::LocalGenericGridFunction::GenericPostBindFunctionType

template<class E, size_t r = 1, size_t rC = 1, class R = double>
using Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::LocalGenericGridFunction::GenericPostBindFunctionType = std::function<void(const ElementType&)>

No documentation provided.

Type alias Dune::XT::Functions::GenericGridFunction::LocalGenericGridFunction::GenericOrderFunctionType

template<class E, size_t r = 1, size_t rC = 1, class R = double>
using Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::LocalGenericGridFunction::GenericOrderFunctionType = std::function<int(const Common::Parameter&)>

No documentation provided.

Type alias Dune::XT::Functions::GenericGridFunction::LocalGenericGridFunction::GenericJacobianFunctionType

template<class E, size_t r = 1, size_t rC = 1, class R = double>
using Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::LocalGenericGridFunction::GenericJacobianFunctionType = std::function<DerivativeRangeReturnType(const DomainType&, const XT::Common::Parameter&)>

No documentation provided.

Type alias Dune::XT::Functions::GenericGridFunction::LocalGenericGridFunction::GenericDerivativeFunctionType

template<class E, size_t r = 1, size_t rC = 1, class R = double>
using Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::LocalGenericGridFunction::GenericDerivativeFunctionType = std::function<DerivativeRangeReturnType(const std::array<size_t, d>&, const DomainType&, const XT::Common::Parameter&)>

No documentation provided.

Method Dune::XT::Functions::GenericGridFunction::copy_as_grid_function_impl

template<class E, size_t r = 1, size_t rC = 1, class R = double>
ThisType *Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::copy_as_grid_function_impl() const override

No documentation provided.

Method Dune::XT::Functions::GenericGridFunction::copy_as_grid_function

template<class E, size_t r = 1, size_t rC = 1, class R = double>
std::unique_ptr<ThisType> Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::copy_as_grid_function() const

No documentation provided.

Method Dune::XT::Functions::GenericGridFunction::name

template<class E, size_t r = 1, size_t rC = 1, class R = double>
std::string Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::name() const final

No documentation provided.

Method Dune::XT::Functions::GenericGridFunction::local_function

template<class E, size_t r = 1, size_t rC = 1, class R = double>
std::unique_ptr<LocalFunctionType> Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::local_function() const final

No documentation provided.

Method Dune::XT::Functions::GenericGridFunction::default_order_lambda

template<class E, size_t r = 1, size_t rC = 1, class R = double>
static GenericOrderFunctionType Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::default_order_lambda(const int ord)

\ }

´´These methods may be used to provide defaults on construction.‘’

\ {

Method Dune::XT::Functions::GenericGridFunction::default_post_bind_function

template<class E, size_t r = 1, size_t rC = 1, class R = double>
static GenericPostBindFunctionType Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::default_post_bind_function()

No documentation provided.

Method Dune::XT::Functions::GenericGridFunction::default_evaluate_function

template<class E, size_t r = 1, size_t rC = 1, class R = double>
static GenericEvaluateFunctionType Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::default_evaluate_function()

No documentation provided.

Method Dune::XT::Functions::GenericGridFunction::default_jacobian_function

template<class E, size_t r = 1, size_t rC = 1, class R = double>
static GenericJacobianFunctionType Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::default_jacobian_function()

No documentation provided.

Method Dune::XT::Functions::GenericGridFunction::default_derivative_function

template<class E, size_t r = 1, size_t rC = 1, class R = double>
static GenericDerivativeFunctionType Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::default_derivative_function()

No documentation provided.

Constructor Dune::XT::Functions::GenericGridFunction::GenericGridFunction

template<class E, size_t r = 1, size_t rC = 1, class R = double>
explicit Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::GenericGridFunction(const int ord, GenericPostBindFunctionType post_bind_func = default_post_bind_function(), GenericEvaluateFunctionType evaluate_func = default_evaluate_function(), const Common::ParameterType &param_type = Common::ParameterType(), std::string nm = "GenericGridFunction", GenericJacobianFunctionType jacobian_func = default_jacobian_function(), GenericDerivativeFunctionType derivative_func = default_derivative_function())

No documentation provided.

Constructor Dune::XT::Functions::GenericGridFunction::GenericGridFunction

template<class E, size_t r = 1, size_t rC = 1, class R = double>
explicit Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::GenericGridFunction(GenericOrderFunctionType order_func, GenericPostBindFunctionType post_bind_func = default_post_bind_function(), GenericEvaluateFunctionType evaluate_func = default_evaluate_function(), const Common::ParameterType &param_type = Common::ParameterType(), std::string nm = "GenericGridFunction", GenericJacobianFunctionType jacobian_func = default_jacobian_function(), GenericDerivativeFunctionType derivative_func = default_derivative_function())

No documentation provided.

Constructor Dune::XT::Functions::GenericGridFunction::GenericGridFunction

template<class E, size_t r = 1, size_t rC = 1, class R = double>
Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::GenericGridFunction(const ThisType&) = default

No documentation provided.

Constructor Dune::XT::Functions::GenericGridFunction::GenericGridFunction

template<class E, size_t r = 1, size_t rC = 1, class R = double>
Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::GenericGridFunction(ThisType&&) noexcept = default

No documentation provided.

Field Dune::XT::Functions::GenericGridFunction::order_

template<class E, size_t r = 1, size_t rC = 1, class R = double>
const GenericOrderFunctionType Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::order_

\ }

Field Dune::XT::Functions::GenericGridFunction::post_bind_

template<class E, size_t r = 1, size_t rC = 1, class R = double>
const GenericPostBindFunctionType Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::post_bind_

No documentation provided.

Field Dune::XT::Functions::GenericGridFunction::evaluate_

template<class E, size_t r = 1, size_t rC = 1, class R = double>
const GenericEvaluateFunctionType Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::evaluate_

No documentation provided.

Field Dune::XT::Functions::GenericGridFunction::name_

template<class E, size_t r = 1, size_t rC = 1, class R = double>
const std::string Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::name_

No documentation provided.

Field Dune::XT::Functions::GenericGridFunction::jacobian_

template<class E, size_t r = 1, size_t rC = 1, class R = double>
const GenericJacobianFunctionType Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::jacobian_

No documentation provided.

Field Dune::XT::Functions::GenericGridFunction::derivative_

template<class E, size_t r = 1, size_t rC = 1, class R = double>
const GenericDerivativeFunctionType Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::derivative_

No documentation provided.

Type alias Dune::XT::Functions::GenericGridFunction::ThisType

template<class E, size_t r = 1, size_t rC = 1, class R = double>
using Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::ThisType = GenericGridFunction<E, r, rC, R>

No documentation provided.

Type alias Dune::XT::Functions::GenericGridFunction::BaseType

template<class E, size_t r = 1, size_t rC = 1, class R = double>
using Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::BaseType = GridFunctionInterface<E, r, rC, R>

No documentation provided.

Type alias Dune::XT::Functions::GenericGridFunction::DomainType

template<class E, size_t r = 1, size_t rC = 1, class R = double>
using Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::DomainType = typename LocalGenericGridFunction::DomainType

No documentation provided.

Type alias Dune::XT::Functions::GenericGridFunction::RangeType

template<class E, size_t r = 1, size_t rC = 1, class R = double>
using Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::RangeType = typename LocalGenericGridFunction::RangeType

No documentation provided.

Type alias Dune::XT::Functions::GenericGridFunction::DerivativeRangeType

template<class E, size_t r = 1, size_t rC = 1, class R = double>
using Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::DerivativeRangeType = typename LocalGenericGridFunction::DerivativeRangeType

No documentation provided.

Type alias Dune::XT::Functions::GenericGridFunction::RangeReturnType

template<class E, size_t r = 1, size_t rC = 1, class R = double>
using Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::RangeReturnType = typename LocalGenericGridFunction::RangeReturnType

No documentation provided.

Type alias Dune::XT::Functions::GenericGridFunction::DerivativeRangeReturnType

template<class E, size_t r = 1, size_t rC = 1, class R = double>
using Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::DerivativeRangeReturnType = typename LocalGenericGridFunction::DerivativeRangeReturnType

No documentation provided.

Type alias Dune::XT::Functions::GenericGridFunction::GenericOrderFunctionType

template<class E, size_t r = 1, size_t rC = 1, class R = double>
using Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::GenericOrderFunctionType = std::function<int(const Common::Parameter&)>

No documentation provided.

Type alias Dune::XT::Functions::GenericGridFunction::GenericPostBindFunctionType

template<class E, size_t r = 1, size_t rC = 1, class R = double>
using Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::GenericPostBindFunctionType = std::function<void(const ElementType&)>

No documentation provided.

Type alias Dune::XT::Functions::GenericGridFunction::GenericEvaluateFunctionType

template<class E, size_t r = 1, size_t rC = 1, class R = double>
using Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::GenericEvaluateFunctionType = std::function<RangeReturnType(const DomainType&, const Common::Parameter&)>

No documentation provided.

Type alias Dune::XT::Functions::GenericGridFunction::GenericJacobianFunctionType

template<class E, size_t r = 1, size_t rC = 1, class R = double>
using Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::GenericJacobianFunctionType = std::function<DerivativeRangeReturnType(const DomainType&, const XT::Common::Parameter&)>

No documentation provided.

Type alias Dune::XT::Functions::GenericGridFunction::GenericDerivativeFunctionType

template<class E, size_t r = 1, size_t rC = 1, class R = double>
using Dune::XT::Functions::GenericGridFunction<E, r, rC, R>::GenericDerivativeFunctionType = std::function<DerivativeRangeReturnType(const std::array<size_t, d>&, const DomainType&, const XT::Common::Parameter&)>

No documentation provided.