mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
added number of linear and newton iterations to output.
This commit is contained in:
parent
e5eec509d2
commit
05260e9582
@ -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_;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user