Commit f2b684c6 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Adding counter of all iterations.

parent e1ad4cb0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -86,6 +86,8 @@ class tnlExplicitTimeStepper
   MeshDependentDataType* meshDependentData;
   
   tnlTimerRT explicitUpdaterTimer, mainTimer;
   
   long long int allIterations;
};

#include <solvers/pde/tnlExplicitTimeStepper_impl.h>
+7 −2
Original line number Diff line number Diff line
@@ -27,7 +27,8 @@ tnlExplicitTimeStepper< Problem, OdeSolver >::
tnlExplicitTimeStepper()
: odeSolver( 0 ),
  problem( 0 ),
  timeStep( 0 )
  timeStep( 0 ),
  allIterations( 0 )
{
};

@@ -123,8 +124,11 @@ solve( const RealType& time,
      this->odeSolver->setMaxTau( ( stopTime - time ) / ( typename OdeSolver< Problem >::RealType ) this->odeSolver->getMinIterations() );
   this->mesh = &mesh;
   this->meshDependentData = &meshDependentData;
   return this->odeSolver->solve( dofVector );
   if( ! this->odeSolver->solve( dofVector ) )
      return false;
   mainTimer.stop();
   this->allIterations += this->odeSolver->getIterations();
   return true;
}

template< typename Problem,
@@ -167,6 +171,7 @@ bool
tnlExplicitTimeStepper< Problem, OdeSolver >::
writeEpilog( tnlLogger& logger )
{
   logger.writeParameter< long long int >( "Ierations count:", this->allIterations );
   logger.writeParameter< double >( "Explicit update computation time:", this->explicitUpdaterTimer.getTime() );
   logger.writeParameter< double >( "Explicit time stepper time:", this->mainTimer.getTime() );
   return true;
+2 −0
Original line number Diff line number Diff line
@@ -83,6 +83,8 @@ class tnlSemiImplicitTimeStepper
   tnlTimerRT preIterateTimer, linearSystemAssemblerTimer, linearSystemSolverTimer, postIterateTimer;
   
   bool verbose;
   
   long long int allIterations;
};

#include <solvers/pde/tnlSemiImplicitTimeStepper_impl.h>
+8 −2
Original line number Diff line number Diff line
@@ -20,13 +20,16 @@

#include <core/mfuncs.h>

#include "tnlSemiImplicitTimeStepper.h"

template< typename Problem,
          typename LinearSystemSolver >
tnlSemiImplicitTimeStepper< Problem, LinearSystemSolver >::
tnlSemiImplicitTimeStepper()
: problem( 0 ),
  linearSystemSolver( 0 ),
  timeStep( 0 )
  timeStep( 0 ),
  allIterations( 0 )
{
};

@@ -75,6 +78,7 @@ init( const MeshType& mesh )
      return false;
   this->linearSystemAssemblerTimer.reset();
   this->linearSystemSolverTimer.reset();
   this->allIterations = 0;
   return true;
}

@@ -187,6 +191,7 @@ solve( const RealType& time,
         return false;
      }
      this->linearSystemSolverTimer.stop();
      this->allIterations += this->linearSystemSolver->getIterations();

      //if( verbose )
      //   cout << endl;
@@ -214,6 +219,7 @@ bool
tnlSemiImplicitTimeStepper< Problem, LinearSystemSolver >::
writeEpilog( tnlLogger& logger )
{
   logger.writeParameter< long long int >( "Ierations count:", this->allIterations );
   logger.writeParameter< double >( "Pre-iterate time:", this->preIterateTimer.getTime() );
   logger.writeParameter< double >( "Linear system assembler time:", this->linearSystemAssemblerTimer.getTime() );
   logger.writeParameter< double >( "Linear system solver time:", this->linearSystemSolverTimer.getTime() );