added number of linear and newton iterations to output.

This commit is contained in:
Robert Kloefkorn 2015-03-04 15:02:00 +01:00
parent e5eec509d2
commit 05260e9582
3 changed files with 19 additions and 0 deletions

View File

@ -129,6 +129,9 @@ namespace Opm {
BlackoilState& state ,
WellStateFullyImplicitBlackoil& wstate);
unsigned int newtonIterations () const { return newtonIterations_; }
unsigned int linearIterations () const { return linearIterations_; }
private:
// Types and enums
typedef AutoDiffBlock<double> ADB;
@ -202,6 +205,8 @@ namespace Opm {
/// \brief Whether we print something to std::cout
bool terminal_output_;
unsigned int newtonIterations_;
unsigned int linearIterations_;
std::vector<int> primalVariable_;

View File

@ -221,6 +221,8 @@ namespace detail {
ADB::null(),
ADB::null() } )
, terminal_output_ (terminal_output)
, newtonIterations_( 0 )
, linearIterations_( 0 )
{
#if HAVE_MPI
if( terminal_output_ )
@ -336,6 +338,9 @@ namespace detail {
return -1;
}
linearIterations_ += linearIterations;
newtonIterations_ += it;
return linearIterations;
}

View File

@ -249,6 +249,9 @@ namespace Opm
output_writer_.restore( timer, state, prev_well_state, restorefilename, desiredRestoreStep );
}
unsigned int totalNewtonIterations = 0;
unsigned int totalLinearIterations = 0;
// Main simulation loop.
while (!timer.done()) {
// Report timestep.
@ -307,6 +310,10 @@ namespace Opm
// take time that was used to solve system for this reportStep
solver_timer.stop();
// accumulate the number of Newton and Linear Iterations
totalNewtonIterations += solver.newtonIterations();
totalLinearIterations += solver.linearIterations();
// Report timing.
const double st = solver_timer.secsSinceStart();
@ -339,6 +346,8 @@ namespace Opm
report.pressure_time = stime;
report.transport_time = 0.0;
report.total_time = total_timer.secsSinceStart();
report.total_newton_iterations = totalNewtonIterations;
report.total_linear_iterations = totalLinearIterations;
return report;
}