Skip to content
Snippets Groups Projects
Commit f2b684c6 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Adding counter of all iterations.

parent e1ad4cb0
No related branches found
No related tags found
No related merge requests found
......@@ -86,6 +86,8 @@ class tnlExplicitTimeStepper
MeshDependentDataType* meshDependentData;
tnlTimerRT explicitUpdaterTimer, mainTimer;
long long int allIterations;
};
#include <solvers/pde/tnlExplicitTimeStepper_impl.h>
......
......@@ -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;
......
......@@ -83,6 +83,8 @@ class tnlSemiImplicitTimeStepper
tnlTimerRT preIterateTimer, linearSystemAssemblerTimer, linearSystemSolverTimer, postIterateTimer;
bool verbose;
long long int allIterations;
};
#include <solvers/pde/tnlSemiImplicitTimeStepper_impl.h>
......
......@@ -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,10 +219,11 @@ 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() );
logger.writeParameter< double >( "Post-iterate time:", this->postIterateTimer.getTime() );
logger.writeParameter< double >( "Post-iterate time:", this->postIterateTimer.getTime() );
return true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment