Add reportStep method in SimulatorReport and use it

This commit is contained in:
Tor Harald Sandve
2018-03-12 14:48:34 +01:00
parent d4ca28ec61
commit 7c9dab1a64
4 changed files with 23 additions and 19 deletions

View File

@@ -20,6 +20,8 @@
#include "config.h"
#include <opm/core/simulator/SimulatorReport.hpp>
#include <ostream>
#include <iomanip>
namespace Opm
{
@@ -70,6 +72,22 @@ namespace Opm
}
}
void SimulatorReport::reportStep(std::ostringstream& ss)
{
if ( verbose_ )
{
ss << "Time step summary: ";
if (total_well_iterations != 0) {
ss << "well its = " << std::setw(2) << total_well_iterations << ", ";
}
ss << "newton its = " << std::setw(2) << total_newton_iterations << ", "
<< "linearizations = " << std::setw(2) << total_linearizations
<< " (" << std::fixed << std::setprecision(3) << std::setw(6) << assemble_time << " sec), "
<< "linear its = " << std::setw(3) << total_linear_iterations
<< " (" << std::fixed << std::setprecision(3) << std::setw(6) << linear_solve_time << " sec)";
}
}
void SimulatorReport::reportFullyImplicit(std::ostream& os, const SimulatorReport* failureReport)
{
if ( verbose_ )

View File

@@ -52,6 +52,7 @@ namespace Opm
void operator+=(const SimulatorReport& sr);
/// Print a report to the given stream.
void report(std::ostream& os);
void reportStep(std::ostringstream& os);
/// Print a report, leaving out the transport time.
void reportFullyImplicit(std::ostream& os, const SimulatorReport* failedReport = nullptr);
void reportParam(std::ostream& os);