1 #ifndef DUNE_FEM_L1NORM_HH 2 #define DUNE_FEM_L1NORM_HH 17 template<
class Gr
idPart >
30 template<
class Function >
33 template<
class UFunction,
class VFunction >
41 explicit L1Norm (
const GridPartType &
gridPart,
const unsigned int order = 0 );
43 template<
class DiscreteFunctionType >
44 typename Dune::FieldTraits< typename DiscreteFunctionType::RangeFieldType >::real_type
45 norm (
const DiscreteFunctionType &u )
const;
47 template<
class UDiscreteFunctionType,
class VDiscreteFunctionType >
48 typename Dune::FieldTraits< typename UDiscreteFunctionType::RangeFieldType >::real_type
49 distance (
const UDiscreteFunctionType &u,
const VDiscreteFunctionType &v )
const;
51 template<
class LocalFunctionType,
class ReturnType >
52 void normLocal (
const EntityType &entity,
unsigned int order,
const LocalFunctionType &uLocal, ReturnType &
sum )
const;
54 template<
class ULocalFunctionType,
class VLocalFunctionType,
class ReturnType >
55 void distanceLocal (
const EntityType &entity,
unsigned int order,
const ULocalFunctionType &uLocal,
const VLocalFunctionType &vLocal, ReturnType &
sum )
const;
63 template<
class Gr
idPart >
70 template<
class Gr
idPart >
71 template<
class DiscreteFunctionType >
72 inline typename Dune::FieldTraits< typename DiscreteFunctionType::RangeFieldType >::real_type
75 typedef typename DiscreteFunctionType::RangeFieldType RangeFieldType;
76 typedef typename Dune::FieldTraits< RangeFieldType >::real_type RealType;
77 typedef FieldVector< RealType, 1 > ReturnType ;
83 return comm().sum( sum[ 0 ] );
87 template<
class Gr
idPart >
88 template<
class UDiscreteFunctionType,
class VDiscreteFunctionType >
89 inline typename Dune::FieldTraits< typename UDiscreteFunctionType::RangeFieldType >::real_type
91 ::distance (
const UDiscreteFunctionType &u,
const VDiscreteFunctionType &v )
const 93 typedef typename UDiscreteFunctionType::RangeFieldType RangeFieldType;
94 typedef typename Dune::FieldTraits< RangeFieldType >::real_type RealType;
95 typedef FieldVector< RealType, 1 > ReturnType ;
101 return comm().sum( sum[ 0 ] );
104 template<
class Gr
idPart >
105 template<
class LocalFunctionType,
class ReturnType >
116 template<
class Gr
idPart >
117 template<
class ULocalFunctionType,
class VLocalFunctionType,
class ReturnType >
125 LocalDistanceType dist( uLocal, vLocal );
132 template<
class Gr
idPart >
133 template<
class Function >
139 typedef typename Dune::FieldTraits< RangeFieldType >::real_type
RealType;
143 : function_( function )
146 template<
class Po
int >
147 void evaluate (
const Point &x, RangeType &ret )
const 150 function_.evaluate( x, phi );
151 ret = phi.one_norm();
155 const FunctionType &function_;
159 template<
class Gr
idPart >
160 template<
class UFunction,
class VFunction >
174 template<
class Po
int >
175 void evaluate (
const Point &x, RangeType &ret )
const 178 u_.evaluate( x, ret );
179 v_.evaluate( x, phi );
183 template<
class Po
int >
184 void jacobian (
const Point &x, JacobianRangeType &ret )
const 186 JacobianRangeType phi;
187 u_.jacobian( x, ret );
188 v_.jacobian( x, phi );
193 const UFunctionType &u_;
194 const VFunctionType &v_;
201 #endif // #ifndef DUNE_FEM_L1NORM_HH
Dune::FieldTraits< typename UDiscreteFunctionType::RangeFieldType >::real_type distance(const UDiscreteFunctionType &u, const VDiscreteFunctionType &v) const
Definition: l1norm.hh:91
const unsigned int order_
Definition: l1norm.hh:39
Dune::FieldTraits< RangeFieldType >::real_type RealType
Definition: l1norm.hh:139
FieldVector< RealType, 1 > RangeType
Definition: l1norm.hh:140
void jacobian(const Point &x, JacobianRangeType &ret) const
Definition: l1norm.hh:184
static constexpr T sum(T a)
Definition: utility.hh:33
CachingQuadrature< GridPartType, 0 > QuadratureType
Definition: l1norm.hh:37
void evaluate(const Point &x, RangeType &ret) const
Definition: l1norm.hh:147
FunctionSpaceType::RangeType RangeType
range type
Definition: function.hh:68
GridPart GridPartType
Definition: l1norm.hh:24
void integrateAdd(const EntityType &entity, const Function &function, typename Function::RangeType &ret) const
add the integral over an entity to a variable
Definition: integrator.hh:71
FunctionType::RangeFieldType RangeFieldType
Definition: l1norm.hh:138
ReturnType forEach(const DiscreteFunctionType &u, const ReturnType &initialValue, unsigned int order=0) const
Definition: lpnorm.hh:106
void distanceLocal(const EntityType &entity, unsigned int order, const ULocalFunctionType &uLocal, const VLocalFunctionType &vLocal, ReturnType &sum) const
Definition: l1norm.hh:119
BaseType::EntityType EntityType
Definition: l1norm.hh:34
UFunction UFunctionType
Definition: l1norm.hh:163
GridPartType::template Codim< 0 >::EntityType EntityType
Definition: lpnorm.hh:40
Definition: coordinate.hh:4
integrator for arbitrary functions providing evaluate
Definition: integrator.hh:28
Function FunctionType
Definition: l1norm.hh:136
GridPartType::CollectiveCommunicationType comm() const
Definition: lpnorm.hh:157
FunctionSpaceType::RangeFieldType RangeFieldType
field type of range
Definition: function.hh:64
Dune::FieldTraits< typename DiscreteFunctionType::RangeFieldType >::real_type norm(const DiscreteFunctionType &u) const
Definition: l1norm.hh:73
FunctionAbs(const FunctionType &function)
Definition: l1norm.hh:142
Abstract class representing a function.
Definition: function.hh:43
L1Norm(const GridPartType &gridPart, const unsigned int order=0)
Definition: l1norm.hh:64
FunctionDistance(const UFunctionType &u, const VFunctionType &v)
Definition: l1norm.hh:170
UFunctionType::RangeFieldType RangeFieldType
Definition: l1norm.hh:166
UFunctionType::JacobianRangeType JacobianRangeType
Definition: l1norm.hh:168
void normLocal(const EntityType &entity, unsigned int order, const LocalFunctionType &uLocal, ReturnType &sum) const
Definition: l1norm.hh:107
void evaluate(const Point &x, RangeType &ret) const
Definition: l1norm.hh:175
VFunction VFunctionType
Definition: l1norm.hh:164
const GridPartType & gridPart() const
Definition: lpnorm.hh:155
UFunctionType::RangeType RangeType
Definition: l1norm.hh:167