From c6ddecea93d213e3fb5894ba57084a3c5b58c3ee Mon Sep 17 00:00:00 2001
From: Robert K <rokl@iris.no>
Date: Thu, 6 Nov 2014 15:30:17 +0100
Subject: [PATCH] remove DiscreteFunction and DiscreteSpace from AlgorithmBase.

---
 dune/fem-dg/stepper/baseevolution.hh | 16 +++++-----------
 dune/fem-dg/stepper/stepperbase.hh   |  4 +++-
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/dune/fem-dg/stepper/baseevolution.hh b/dune/fem-dg/stepper/baseevolution.hh
index 7b4c7512..68286d3c 100644
--- a/dune/fem-dg/stepper/baseevolution.hh
+++ b/dune/fem-dg/stepper/baseevolution.hh
@@ -135,12 +135,6 @@ public:
   // choose a suitable GridView
   typedef typename Traits :: GridPartType              GridPartType;
 
-  // the space type
-  typedef typename Traits :: DiscreteSpaceType         DiscreteSpaceType;
-
-  // the discrete function type
-  typedef typename Traits :: DiscreteFunctionType      DiscreteFunctionType;
-
   // the indicator function type (for limiting only)
   typedef typename Traits :: IndicatorType             IndicatorType;
 
@@ -175,12 +169,12 @@ public:
   //! return default data tuple for data output
   virtual IOTupleType dataTuple() = 0 ;
 
-  //! return reference to space 
-  virtual const DiscreteSpaceType& space() const = 0 ;
-
   //! return reference to hierarchical grid 
   GridType& grid() { return grid_ ; }
 
+  // return grid width of grid (overload in derived classes)
+  virtual double gridWidth() const { return 0.0; }
+
   // return size of grid 
   virtual UInt64Type gridSize() const 
   { 
@@ -418,8 +412,8 @@ public:
     fixedTimeStep_ /= fixedTimeStepEocLoopFactor_; 
 
     // adjust average time step size 
-    monitor.finalize( Dune::Fem::GridWidth::calcGridWidth( space().gridPart() ), // h
-                      gridSize() );                                   // elements
+    monitor.finalize( gridWidth(),  // h 
+                      gridSize() ); // elements
 
     return monitor;
   }
diff --git a/dune/fem-dg/stepper/stepperbase.hh b/dune/fem-dg/stepper/stepperbase.hh
index cc990882..651c2dc1 100644
--- a/dune/fem-dg/stepper/stepperbase.hh
+++ b/dune/fem-dg/stepper/stepperbase.hh
@@ -157,7 +157,9 @@ struct StepperBase
     additionalVariables_ = 0;
   }
 
-  const DiscreteSpaceType& space() const { return space_ ; }
+  virtual const DiscreteSpaceType& space() const { return space_ ; }
+
+  double gridWidth () const { return Dune::Fem::GridWidth::calcGridWidth( gridPart_ ); }
 
   // return reference to discrete function holding solution
   DiscreteFunctionType& solution() { return solution_; }
-- 
GitLab