1#ifndef __ESTIMATOR_INTERFACE_HH__
2#define __ESTIMATOR_INTERFACE_HH__
4#include <dune/fem/misc/bartonnackmaninterface.hh>
28 enum FunctionSpaceNorm
34 template<
class Estimator>
35 struct EstimatorTraits
37 typedef void DiscreteFunctionSpaceType;
38 typedef void IteratorType;
41 template<
class Estimator>
42 class EstimatorInterface
43 :
public Dune::Fem::BartonNackmanInterface<EstimatorInterface<Estimator>,
46 typedef EstimatorInterface ThisType;
47 typedef Estimator ImplementationType;
48 typedef EstimatorTraits<ImplementationType> TraitsType;
49 typedef Dune::Fem::BartonNackmanInterface<ThisType, ImplementationType> BaseType;
52 EstimatorInterface() {}
53 EstimatorInterface(
const EstimatorInterface& other) {}
54 EstimatorInterface& operator=(
const EstimatorInterface& other) {}
56 typedef typename TraitsType::DiscreteFunctionSpaceType DiscreteFunctionSpaceType;
57 typedef typename DiscreteFunctionSpaceType::RangeFieldType RangeFieldType;
58 typedef typename DiscreteFunctionSpaceType::GridPartType::GridType GridType;
59 typedef typename GridType::template Codim<0>::Entity ElementType;
60 typedef typename TraitsType::IteratorType IteratorType;
62 template<
class DiscreteFunctionType>
63 RangeFieldType estimate(
const DiscreteFunctionType& uh)
65 return asImp().estimate(uh);
69 return asImp().size();
72 IteratorType begin()
const {
73 return asImp().begin();
76 IteratorType end()
const {
80 const RangeFieldType& operator[](
const size_t& idx)
const
85 const RangeFieldType& operator[](
const ElementType& entity)
const
87 return asImp()[entity];
90 GridType& grid()
const {
91 return asImp().grid();
94 const DiscreteFunctionSpaceType& space()
const
96 return asImp().space();
101 template<
class Estimator>
102 class DefaultEstimator
103 :
public EstimatorInterface<Estimator>
105 typedef Estimator ImplementationType;
106 typedef EstimatorInterface<ImplementationType> BaseType;
107 typedef DefaultEstimator<ImplementationType> ThisType;
108 typedef EstimatorTraits<ImplementationType> TraitsType;
110 DefaultEstimator() {}
111 DefaultEstimator(
const DefaultEstimator& other) {}
112 DefaultEstimator& operator=(
const DefaultEstimator& other) {}
114 typedef typename TraitsType::DiscreteFunctionSpaceType DiscreteFunctionSpaceType;
115 typedef typename DiscreteFunctionSpaceType::FunctionSpaceType FunctionSpaceType;
116 typedef typename FunctionSpaceType::RangeFieldType RangeFieldType;
117 typedef typename DiscreteFunctionSpaceType::GridPartType GridPartType;
118 typedef typename GridPartType::GridType GridType;
119 typedef typename GridType::template Codim<0>::Entity ElementType;
121 template<
class DiscreteFunctionType>
122 RangeFieldType estimate(
const DiscreteFunctionType& uh)
127 size_t size()
const {
131 const RangeFieldType& operator[](
const size_t& idx)
const
136 const RangeFieldType& operator[](
const ElementType& entity)
const
const Implementation & asImp(const Fem::BartonNackmanInterface< Interface, Implementation > &arg)
Up-cast to the implementation for any Fem::BartonNackmanInterface.
Definition: expressionoperations.hh:71