1#ifndef DUNE_FEM_ERRORDISPLAY_HH
2#define DUNE_FEM_ERRORDISPLAY_HH
4#include <dune/common/exceptions.hh>
12 template<
class DiscreteFunction,
class SolutionType,
bool withTime = true >
16 template<
class DiscreteFunction,
class SolutionType >
26 typedef typename DiscreteFunctionType :: DiscreteFunctionSpaceType
29 typedef typename DiscreteFunctionSpaceType :: GridPartType
GridPartType;
37 template<
class GrapeDispType >
40 const SolutionType &solution,
41 const double time = 0 )
42 : gridPart_( Uh.space().gridPart() ),
43 error_( Uh, solution, time ),
44 errorFunction_(
"error", error_, gridPart_ )
46 disp.addData( errorFunction_,
"error", time );
51 ThisType &operator= (
const ThisType & );
61 template<
class DiscreteFunction,
class SolutionType >
64 typedef typename DiscreteFunctionSpaceType :: GridPartType GridPartType;
66 typedef typename DiscreteFunctionSpaceType :: FunctionSpaceType
68 typedef typename FunctionSpaceType :: DomainType DomainType;
69 typedef typename FunctionSpaceType :: RangeType RangeType;
70 typedef typename FunctionSpaceType :: JacobianRangeType JacobianRangeType;
72 static const int dimDomain = DiscreteFunctionSpaceType :: dimDomain;
73 static const int dimRange = DiscreteFunctionSpaceType :: dimRange;
76 typedef typename GridPartType::template Codim< 0 >::EntityType EntityType;
77 typedef typename GridPartType::template Codim< 0 >::GeometryType GeometryType;
80 Error (
const DiscreteFunctionType &Uh,
81 const SolutionType &solution,
89 template<
class Po
intType >
90 void evaluate (
const PointType &x, RangeType& ret)
const
92 assert( initialized() );
93 lUh_.evaluate( x, ret );
94 DomainType global = entity().geometry().global( coordinate( x ) );
96 initU0_.evaluate( time_, global, phi );
100 template<
class Po
intType >
101 void jacobian (
const PointType &x, JacobianRangeType &ret )
const
103 DUNE_THROW( NotImplemented,
"DisplayErrorFunction::jacobian is not implemented." );
106 void init (
const EntityType &entity )
113 const EntityType &entity ()
const
119 bool initialized ()
const {
return entity_; }
121 LocalFunctionType lUh_;
122 const SolutionType &initU0_;
123 const EntityType *entity_;
130 template<
class DiscreteFunction,
class SolutionType >
140 typedef typename DiscreteFunctionType :: DiscreteFunctionSpaceType
143 typedef typename DiscreteFunctionSpaceType :: GridPartType
GridPartType;
149 typedef typename DiscreteFunctionSpaceType :: GridPartType
GridPartType;
151 typedef typename DiscreteFunctionSpaceType :: FunctionSpaceType
153 typedef typename FunctionSpaceType :: DomainType DomainType;
154 typedef typename FunctionSpaceType :: RangeType RangeType;
155 typedef typename FunctionSpaceType :: JacobianRangeType JacobianRangeType;
157 static const int dimDomain = DiscreteFunctionSpaceType :: dimDomain;
158 static const int dimRange = DiscreteFunctionSpaceType :: dimRange;
161 typedef typename GridPartType::template Codim< 0 >::EntityType EntityType;
162 typedef typename GridPartType::template Codim< 0 >::GeometryType GeometryType;
166 const SolutionType &solution )
172 template<
class Po
intType >
173 void evaluate (
const PointType &x, RangeType& ret)
const
175 assert( initialized() );
176 lUh_.evaluate( x, ret );
177 DomainType global = entity().geometry().global( coordinate( x ) );
179 initU0_.evaluate( global, phi );
183 template<
class Po
intType >
184 void jacobian (
const PointType &x, JacobianRangeType &ret )
const
186 DUNE_THROW( NotImplemented,
"DisplayErrorFunction::jacobian is not implemented." );
189 void init (
const EntityType &entity )
196 const EntityType &entity ()
const
202 bool initialized ()
const {
return entity_; }
205 const SolutionType &initU0_;
206 const EntityType *entity_;
221 template<
class GrapeDispType >
224 const SolutionType &solution )
225 : gridPart_( Uh.space().gridPart() ),
226 gridSolution_(
"exact solution", solution, gridPart_ ),
227 error_( Uh, solution ),
228 errorFunction_(
"error", error_, gridPart_ )
230 disp.addData( errorFunction_ );
231 disp.addData( gridSolution_ );
236 ThisType &operator= (
const ThisType & );
GrapeDataDisplay< GR_GridType > GrapeDispType
type of GrapeDisplay
Definition: readiotupledata.cc:22
Definition: bindguard.hh:11
BasicGridFunctionAdapter provides local functions for a Function.
Definition: gridfunctionadapter.hh:79
Definition: errordisplay.hh:13
Fem::LocalFunctionAdapter< Error > ErrorFunctionType
Definition: errordisplay.hh:34
DiscreteFunction DiscreteFunctionType
Definition: errordisplay.hh:22
DiscreteFunctionSpaceType::GridPartType GridPartType
Definition: errordisplay.hh:29
ErrorFunctionType errorFunction_
Definition: errordisplay.hh:56
Error error_
Definition: errordisplay.hh:55
DisplayErrorFunction(GrapeDispType &disp, const DiscreteFunctionType &Uh, const SolutionType &solution, const double time=0)
Definition: errordisplay.hh:38
DiscreteFunctionType::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
Definition: errordisplay.hh:27
DiscreteFunctionType::LocalFunctionType LocalFunctionType
Definition: errordisplay.hh:24
const GridPartType & gridPart_
Definition: errordisplay.hh:54
DiscreteFunctionType::LocalFunctionType LocalFunctionType
Definition: errordisplay.hh:138
Fem::GridFunctionAdapter< SolutionType, GridPartType > GridSolutionType
Definition: errordisplay.hh:212
ErrorFunctionType errorFunction_
Definition: errordisplay.hh:218
const GridPartType & gridPart_
Definition: errordisplay.hh:215
DiscreteFunctionSpaceType::GridPartType GridPartType
Definition: errordisplay.hh:143
DiscreteFunctionType::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
Definition: errordisplay.hh:141
GridSolutionType gridSolution_
Definition: errordisplay.hh:216
DiscreteFunction DiscreteFunctionType
Definition: errordisplay.hh:136
Error error_
Definition: errordisplay.hh:217
Fem::LocalFunctionAdapter< Error > ErrorFunctionType
Definition: errordisplay.hh:210
DisplayErrorFunction(GrapeDispType &disp, const DiscreteFunctionType &Uh, const SolutionType &solution)
Definition: errordisplay.hh:222