1#ifndef __DUNE_ACFEM_ZERO_FUNCTIONAL_HH__
2#define __DUNE_ACFEM_ZERO_FUNCTIONAL_HH__
4#include "functionalexpressionbase.hh"
20 template<
class DiscreteFunctionSpace>
23 template<
class DiscreteFunctionSpace>
24 class LocalZeroFunctional;
26 template<
class DiscreteFunctionSpace>
27 struct ZeroFunctionalTraits
28 :
public LinearFunctionalTraitsDefault<ZeroFunctional<DiscreteFunctionSpace>,
29 LocalZeroFunctional<DiscreteFunctionSpace> >
38 template<
class DiscreteFunctionSpace>
40 :
public ZeroFunctionalExpression<DiscreteFunctionSpace,
41 ZeroFunctionalTraits<DiscreteFunctionSpace> >
44 typedef ZeroFunctionalTraits<DiscreteFunctionSpace> TraitsType;
47 typedef ZeroFunctionalExpression<DiscreteFunctionSpace, TraitsType>
BaseType;
49 typedef typename TraitsType::LocalFunctionalType LocalFunctionalType;
50 typedef DiscreteFunctionSpace DiscreteFunctionSpaceType;
51 typedef typename DiscreteFunctionSpaceType::GridPartType GridPartType;
52 typedef typename DiscreteFunctionSpaceType::EntityType EntityType;
53 typedef typename DiscreteFunctionSpace::FunctionSpaceType FunctionSpaceType;
54 typedef typename FunctionSpaceType::RangeFieldType FieldType;
55 typedef FieldType RangeType;
61#if !FUNCTIONAL_TESTING
62 template<
class DFTraits>
63 RangeType operator()(
const Fem::DiscreteFunctionInterface<DFTraits>& arg)
const
65 static_assert(std::is_same<DiscreteFunctionSpaceType, typename DFTraits::DiscreteFunctionSpaceType>::value,
70 template<
class DFTraits>
71 void coefficients(Fem::DiscreteFunctionInterface<DFTraits>& coeffs)
73 static_assert(std::is_same<DiscreteFunctionSpaceType, typename DFTraits::DiscreteFunctionSpaceType>::value,
78 using BaseType::operator();
79 using BaseType::coefficients;
81 using BaseType::localFunctional;
83 std::string name()
const
89 template<
class DiscreteFunctionSpace>
90 class LocalZeroFunctional
92 ZeroFunctionalTraits<DiscreteFunctionSpace> >
94 typedef LocalZeroFunctional ThisType;
98 ZeroFunctionalTraits<DiscreteFunctionSpace> >
100 friend FunctionalType;
102 typedef DiscreteFunctionSpace DiscreteFunctionSpaceType;
104 typedef typename DiscreteFunctionSpaceType::EntityType EntityType;
106 typedef typename DiscreteFunctionSpaceType::RangeFieldType FieldType;
107 typedef FieldType RangeType;
110 LocalZeroFunctional(
const FunctionalType& zero)
114 LocalZeroFunctional(
const EntityType& entity,
const FunctionalType& zero)
115 : BaseType(entity, zero)
118 template<
class LocalFunction>
119 RangeType operator()(
const LocalFunction& arg)
const
124 template<
class LocalFunction>
125 void coefficients(
const RangeType& c, LocalFunction& coeffs)
const
130 template<
class LocalFunction>
136 using BaseType::functional;
137 using BaseType::entity;
140 using BaseType::entity_;
Default implementation for linear functionals.
Definition: linearfunctional.hh:132
Interface class for a discrete linear functional.
Definition: linearfunctional.hh:52
Default implementation for LocalLinearFunctional.
Definition: linearfunctional.hh:362
void coefficients(LocalFunction &coeffs) const
Definition: linearfunctional.hh:436
This is the famous "do-nothing" functional.
Definition: zerofunctional.hh:42