diff --git a/dune/fem-dg/stepper/baseevolution.hh b/dune/fem-dg/stepper/baseevolution.hh index f30ffdac073cd807857d874fa1c146ed1a96afee..7a99d77fccd25ccc66c1828a04eb8253c8c0cf21 100644 --- a/dune/fem-dg/stepper/baseevolution.hh +++ b/dune/fem-dg/stepper/baseevolution.hh @@ -41,6 +41,7 @@ struct EocDataOutputParameters : /*@LST1S@*/ class SolverMonitor { public: + //std::map< std::string, > double gridWidth; double avgTimeStep; double minTimeStep; @@ -215,7 +216,7 @@ public: estimateMarkAdapt( ); } - virtual void checkDofsValid( TimeProviderType& tp, const int loop ) const {} + virtual bool checkDofsValid( TimeProviderType& tp, const int loop ) const { return true; } virtual bool adaptive () const { return false ; } @@ -364,7 +365,11 @@ public: Dune::FemTimer::stop(timeStepTimer_,Dune::FemTimer::max); // Check that no NAN have been generated - checkDofsValid( tp, loop ); + if( !checkDofsValid( tp, loop ) ) + { + writeData( tp, true ); + std::abort(); + } if( (printCount > 0) && (((timeStep+1) % printCount) == 0)) { diff --git a/dune/fem-dg/stepper/stepperbase.hh b/dune/fem-dg/stepper/stepperbase.hh index e0ca36490cb40acceeaa8c22893264944f2759e9..b56e2a49c1f54086834d31a303bce94ea57ffd80 100644 --- a/dune/fem-dg/stepper/stepperbase.hh +++ b/dune/fem-dg/stepper/stepperbase.hh @@ -173,15 +173,9 @@ struct StepperBase return IOTupleType( &solution_, additionalVariables_, indicator() ); } - void checkDofsValid ( TimeProviderType& tp, const int loop ) const + bool checkDofsValid ( TimeProviderType& tp, const int loop ) const { - if( ! solution_.dofsValid() ) - { - std::cout << "Loop(" << loop << "): Invalid DOFs" << std::endl; - if( dataWriter_ ) - dataWriter_->write( tp ); - abort(); - } + return solution_.dofsValid(); } void writeData( TimeProviderType& tp, const bool writeAnyway = false ) @@ -194,6 +188,7 @@ struct StepperBase setupAdditionalVariables( tp, solution(), model(), *additionalVariables_ ); } + //todo: check it dataWriter_->write( tp ); }