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 ...@@ -86,6 +86,8 @@ class tnlExplicitTimeStepper
MeshDependentDataType* meshDependentData; MeshDependentDataType* meshDependentData;
tnlTimerRT explicitUpdaterTimer, mainTimer; tnlTimerRT explicitUpdaterTimer, mainTimer;
long long int allIterations;
}; };
#include <solvers/pde/tnlExplicitTimeStepper_impl.h> #include <solvers/pde/tnlExplicitTimeStepper_impl.h>
......
...@@ -27,7 +27,8 @@ tnlExplicitTimeStepper< Problem, OdeSolver >:: ...@@ -27,7 +27,8 @@ tnlExplicitTimeStepper< Problem, OdeSolver >::
tnlExplicitTimeStepper() tnlExplicitTimeStepper()
: odeSolver( 0 ), : odeSolver( 0 ),
problem( 0 ), problem( 0 ),
timeStep( 0 ) timeStep( 0 ),
allIterations( 0 )
{ {
}; };
...@@ -123,8 +124,11 @@ solve( const RealType& time, ...@@ -123,8 +124,11 @@ solve( const RealType& time,
this->odeSolver->setMaxTau( ( stopTime - time ) / ( typename OdeSolver< Problem >::RealType ) this->odeSolver->getMinIterations() ); this->odeSolver->setMaxTau( ( stopTime - time ) / ( typename OdeSolver< Problem >::RealType ) this->odeSolver->getMinIterations() );
this->mesh = &mesh; this->mesh = &mesh;
this->meshDependentData = &meshDependentData; this->meshDependentData = &meshDependentData;
return this->odeSolver->solve( dofVector ); if( ! this->odeSolver->solve( dofVector ) )
return false;
mainTimer.stop(); mainTimer.stop();
this->allIterations += this->odeSolver->getIterations();
return true;
} }
template< typename Problem, template< typename Problem,
...@@ -167,6 +171,7 @@ bool ...@@ -167,6 +171,7 @@ bool
tnlExplicitTimeStepper< Problem, OdeSolver >:: tnlExplicitTimeStepper< Problem, OdeSolver >::
writeEpilog( tnlLogger& logger ) 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 update computation time:", this->explicitUpdaterTimer.getTime() );
logger.writeParameter< double >( "Explicit time stepper time:", this->mainTimer.getTime() ); logger.writeParameter< double >( "Explicit time stepper time:", this->mainTimer.getTime() );
return true; return true;
......
...@@ -83,6 +83,8 @@ class tnlSemiImplicitTimeStepper ...@@ -83,6 +83,8 @@ class tnlSemiImplicitTimeStepper
tnlTimerRT preIterateTimer, linearSystemAssemblerTimer, linearSystemSolverTimer, postIterateTimer; tnlTimerRT preIterateTimer, linearSystemAssemblerTimer, linearSystemSolverTimer, postIterateTimer;
bool verbose; bool verbose;
long long int allIterations;
}; };
#include <solvers/pde/tnlSemiImplicitTimeStepper_impl.h> #include <solvers/pde/tnlSemiImplicitTimeStepper_impl.h>
......
...@@ -20,13 +20,16 @@ ...@@ -20,13 +20,16 @@
#include <core/mfuncs.h> #include <core/mfuncs.h>
#include "tnlSemiImplicitTimeStepper.h"
template< typename Problem, template< typename Problem,
typename LinearSystemSolver > typename LinearSystemSolver >
tnlSemiImplicitTimeStepper< Problem, LinearSystemSolver >:: tnlSemiImplicitTimeStepper< Problem, LinearSystemSolver >::
tnlSemiImplicitTimeStepper() tnlSemiImplicitTimeStepper()
: problem( 0 ), : problem( 0 ),
linearSystemSolver( 0 ), linearSystemSolver( 0 ),
timeStep( 0 ) timeStep( 0 ),
allIterations( 0 )
{ {
}; };
...@@ -75,6 +78,7 @@ init( const MeshType& mesh ) ...@@ -75,6 +78,7 @@ init( const MeshType& mesh )
return false; return false;
this->linearSystemAssemblerTimer.reset(); this->linearSystemAssemblerTimer.reset();
this->linearSystemSolverTimer.reset(); this->linearSystemSolverTimer.reset();
this->allIterations = 0;
return true; return true;
} }
...@@ -187,6 +191,7 @@ solve( const RealType& time, ...@@ -187,6 +191,7 @@ solve( const RealType& time,
return false; return false;
} }
this->linearSystemSolverTimer.stop(); this->linearSystemSolverTimer.stop();
this->allIterations += this->linearSystemSolver->getIterations();
//if( verbose ) //if( verbose )
// cout << endl; // cout << endl;
...@@ -214,10 +219,11 @@ bool ...@@ -214,10 +219,11 @@ bool
tnlSemiImplicitTimeStepper< Problem, LinearSystemSolver >:: tnlSemiImplicitTimeStepper< Problem, LinearSystemSolver >::
writeEpilog( tnlLogger& logger ) writeEpilog( tnlLogger& logger )
{ {
logger.writeParameter< long long int >( "Ierations count:", this->allIterations );
logger.writeParameter< double >( "Pre-iterate time:", this->preIterateTimer.getTime() ); logger.writeParameter< double >( "Pre-iterate time:", this->preIterateTimer.getTime() );
logger.writeParameter< double >( "Linear system assembler time:", this->linearSystemAssemblerTimer.getTime() ); logger.writeParameter< double >( "Linear system assembler time:", this->linearSystemAssemblerTimer.getTime() );
logger.writeParameter< double >( "Linear system solver time:", this->linearSystemSolverTimer.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; return true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment