mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-13 09:51:57 -06:00
Merge pull request #1433 from totto82/fix_reportStep
Add reportStep method in SimulatorReport and use it
This commit is contained in:
commit
ce308455ab
@ -259,16 +259,9 @@ public:
|
||||
|
||||
if( terminal_output_ )
|
||||
{
|
||||
//stepReport.briefReport();
|
||||
std::ostringstream iter_msg;
|
||||
iter_msg << "Stepsize " << (double)unit::convert::to(timer.currentStepLength(), unit::day);
|
||||
if (solver->wellIterations() != 0) {
|
||||
iter_msg << " days well iterations = " << solver->wellIterations() << ", ";
|
||||
}
|
||||
iter_msg << "non-linear iterations = " << solver->nonlinearIterations()
|
||||
<< ", total linear iterations = " << solver->linearIterations()
|
||||
<< "\n";
|
||||
OpmLog::info(iter_msg.str());
|
||||
std::ostringstream ss;
|
||||
stepReport.reportStep(ss);
|
||||
OpmLog::info(ss.str());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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_ )
|
||||
|
@ -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);
|
||||
|
@ -309,15 +309,7 @@ namespace Opm {
|
||||
if( timestep_verbose_ )
|
||||
{
|
||||
std::ostringstream ss;
|
||||
ss << "Time step summary: ";
|
||||
if (substepReport.total_well_iterations != 0) {
|
||||
ss << "well its = " << std::setw(2) << substepReport.total_well_iterations << ", ";
|
||||
}
|
||||
ss << "newton its = " << std::setw(2) << substepReport.total_newton_iterations << ", "
|
||||
<< "linearizations = " << std::setw(2) << substepReport.total_linearizations
|
||||
<< " (" << std::fixed << std::setprecision(3) << std::setw(6) << substepReport.assemble_time << " sec), "
|
||||
<< "linear its = " << std::setw(3) << substepReport.total_linear_iterations
|
||||
<< " (" << std::fixed << std::setprecision(3) << std::setw(6) << substepReport.linear_solve_time << " sec)";
|
||||
substepReport.reportStep(ss);
|
||||
OpmLog::info(ss.str());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user