1 #ifndef DUNE_FEM_H1NORM_HH 2 #define DUNE_FEM_H1NORM_HH 12 template<
class Gr
idPart >
14 :
public LPNormBase< GridPart, H1Norm< GridPart> >
22 template<
class Function >
37 explicit H1Norm (
const GridPartType &
gridPart,
const unsigned int order = 0 );
38 H1Norm (
const ThisType &other );
40 template<
class DiscreteFunctionType >
41 typename Dune::FieldTraits< typename DiscreteFunctionType::RangeFieldType >::real_type
42 norm (
const DiscreteFunctionType &u )
const;
44 template<
class UDiscreteFunctionType,
class VDiscreteFunctionType >
45 typename Dune::FieldTraits< typename UDiscreteFunctionType::RangeFieldType >::real_type
46 distance (
const UDiscreteFunctionType &u,
const VDiscreteFunctionType &v )
const;
48 template<
class LocalFunctionType,
class ReturnType >
49 void normLocal (
const EntityType &entity,
unsigned int order,
const LocalFunctionType &uLocal, ReturnType &
sum )
const;
51 template<
class ULocalFunctionType,
class VLocalFunctionType,
class ReturnType >
52 void distanceLocal (
const EntityType &entity,
unsigned int order,
const ULocalFunctionType &uLocal,
const VLocalFunctionType &vLocal, ReturnType &
sum )
const;
56 ThisType operator= (
const ThisType &other );
58 const unsigned int order_;
66 template<
class Gr
idPart >
67 template<
class Function >
73 typedef typename Dune::FieldTraits< typename FunctionType::RangeFieldType >::real_type
RealType;
78 : function_( function )
81 template<
class Po
int >
82 void evaluate (
const Point &x, RangeType &ret )
const 84 const int dimRange = FunctionType::RangeType::dimension;
87 function_.evaluate( x, phi );
88 ret[ 0 ] = phi.two_norm2();
91 function_.jacobian( x, grad );
92 for(
int i = 0; i < dimRange; ++i )
93 ret[ 0 ] += grad[ i ].two_norm2();
97 const FunctionType &function_;
105 template<
class Gr
idPart >
113 template<
class Gr
idPart >
116 order_( other.order_ )
120 template<
class Gr
idPart >
121 template<
class DiscreteFunctionType >
122 inline typename Dune::FieldTraits< typename DiscreteFunctionType::RangeFieldType >::real_type
125 typedef typename DiscreteFunctionType::RangeFieldType RangeFieldType;
126 typedef typename Dune::FieldTraits< RangeFieldType >::real_type RealType;
127 typedef FieldVector< RealType, 1 > ReturnType ;
135 template<
class Gr
idPart >
136 template<
class UDiscreteFunctionType,
class VDiscreteFunctionType >
137 inline typename Dune::FieldTraits< typename UDiscreteFunctionType::RangeFieldType >::real_type
139 const VDiscreteFunctionType &v )
const 141 typedef typename UDiscreteFunctionType::RangeFieldType RangeFieldType;
142 typedef typename Dune::FieldTraits< RangeFieldType >::real_type RealType;
143 typedef FieldVector< RealType, 1 > ReturnType ;
151 template<
class Gr
idPart >
152 template<
class ULocalFunctionType,
class VLocalFunctionType,
class ReturnType >
160 LocalDistanceType dist( uLocal, vLocal );
167 template<
class Gr
idPart >
168 template<
class LocalFunctionType,
class ReturnType >
184 #endif // #ifndef DUNE_FEM_H1NORM_HH BaseType::EntityType EntityType
Definition: h1norm.hh:23
static double sqrt(const Double &v)
Definition: double.hh:870
static constexpr T sum(T a)
Definition: utility.hh:33
FunctionSpaceType::RangeType RangeType
range type
Definition: function.hh:68
Dune::FieldTraits< typename DiscreteFunctionType::RangeFieldType >::real_type norm(const DiscreteFunctionType &u) const
Definition: h1norm.hh:123
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
void normLocal(const EntityType &entity, unsigned int order, const LocalFunctionType &uLocal, ReturnType &sum) const
Definition: h1norm.hh:170
ReturnType forEach(const DiscreteFunctionType &u, const ReturnType &initialValue, unsigned int order=0) const
Definition: lpnorm.hh:106
FunctionSpaceType::JacobianRangeType JacobianRangeType
jacobian type
Definition: function.hh:70
GridPartType::template Codim< 0 >::EntityType EntityType
Definition: lpnorm.hh:40
Definition: coordinate.hh:4
FunctionType::RangeFieldType RangeFieldType
Definition: h1norm.hh:72
integrator for arbitrary functions providing evaluate
Definition: integrator.hh:28
Dune::FieldTraits< typename UDiscreteFunctionType::RangeFieldType >::real_type distance(const UDiscreteFunctionType &u, const VDiscreteFunctionType &v) const
Definition: h1norm.hh:138
GridPart GridPartType
Definition: h1norm.hh:20
FunctionJacobianSquare(const FunctionType &function)
Definition: h1norm.hh:77
Integrator< QuadratureType > IntegratorType
Definition: h1norm.hh:30
CachingQuadrature< GridPartType, 0 > QuadratureType
Definition: h1norm.hh:28
H1Norm(const GridPartType &gridPart, const unsigned int order=0)
Definition: h1norm.hh:106
GridPartType::CollectiveCommunicationType comm() const
Definition: lpnorm.hh:157
Dune::FieldTraits< typename FunctionType::RangeFieldType >::real_type RealType
Definition: h1norm.hh:73
FunctionSpaceType::RangeFieldType RangeFieldType
field type of range
Definition: function.hh:64
Abstract class representing a function.
Definition: function.hh:43
void evaluate(const Point &x, RangeType &ret) const
Definition: h1norm.hh:82
FieldVector< RealType, 1 > RangeType
Definition: h1norm.hh:74
Function FunctionType
Definition: h1norm.hh:70
const GridPartType & gridPart() const
Definition: lpnorm.hh:155
void distanceLocal(const EntityType &entity, unsigned int order, const ULocalFunctionType &uLocal, const VLocalFunctionType &vLocal, ReturnType &sum) const
Definition: h1norm.hh:154