diff --git a/dune/fem-dg/stepper/baseevolution.hh b/dune/fem-dg/stepper/baseevolution.hh index 7b4c7512edee3f19ef3ac270bc4069e28c69bc0e..68286d3cee7f689bc762c5944ddd14eea5758cd6 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 cc990882fb5685834961e652e599b7696213dba3..651c2dc16a6c6e7841c81d5bb61cf67f34ea4818 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_; }