1#ifndef __DUNE_ACFEM_OPERATORS_FUNCTIONALS_MODULES_ZERO_HH__
2#define __DUNE_ACFEM_OPERATORS_FUNCTIONALS_MODULES_ZERO_HH__
4#include "../../../common/literals.hh"
5#include "../../../expressions/terminal.hh"
7#include "../linearfunctional.hh"
8#include "../functionaltraits.hh"
14 namespace LinearFunctional {
16 using namespace Literals;
19 template<
class DiscreteFunctionSpace>
21 :
public LinearFunctionalBase<DiscreteFunctionSpace>
25 using BaseType = LinearFunctionalBase<DiscreteFunctionSpace>;
27 using typename BaseType::DiscreteFunctionSpaceType;
28 using typename BaseType::RangeFieldType;
29 using BaseType::space;
35 template<
class FieldArg,
class DiscreteFunction,
36 std::enable_if_t<std::is_constructible<RangeFieldType, FieldArg>::value,
int> = 0>
37 void coefficients(FieldArg&& s, DiscreteFunction& values)
const
40 static_assert(std::is_same<DiscreteFunctionSpace, typename DiscreteFunction::DiscreteFunctionSpaceType>::value,
41 "DiscreteFunctionSpaceType of functional and discrete storage has to coincide");
44 template<
class DiscreteFunction>
45 void coefficients(DiscreteFunction& df)
const
47 coefficients(1_f, df);
50 template<
class DiscreteFunction>
51 auto operator()(
const DiscreteFunction& df)
const
56 std::string name()
const
63 template<
class DiscreteFunctionSpaceType>
64 auto zeroFunctional(
const DiscreteFunctionSpaceType& space)
72 using ZeroLinearFunctional = LinearFunctional::ZeroFunctional<Space>;
74 using LinearFunctional::zeroFunctional;
Light-weight base class for all linear functionals.
Definition: linearfunctional.hh:13
The zero functional.
Definition: zero.hh:24
Terminals may derive from this class to express that they are expressions.
Definition: terminal.hh:25
A tag structure which can be attached as base class to zero-expressions like the ZeroGridFunction,...
Definition: tags.hh:138