Merge pull request #1168 from nairr/term_output_mod

Logging of multiple problems/warnings
This commit is contained in:
Atgeirr Flø Rasmussen 2017-06-07 15:47:34 +02:00 committed by GitHub
commit 60985fdbeb
2 changed files with 9 additions and 9 deletions

View File

@ -162,11 +162,8 @@ namespace Opm
if (!converged) {
failureReport_ += report;
std::string msg = "Failed to complete a time step within " + std::to_string(maxIter()) + " iterations.";
if (model_->terminalOutputEnabled()) {
OpmLog::problem(msg);
}
OPM_THROW_NOLOG(Opm::NumericalProblem, msg);
std::string msg = "Solver convergence failure - Failed to complete a time step within " + std::to_string(maxIter()) + " iterations.";
OPM_THROW_NOLOG(Opm::TooManyIterations, msg);
}
// Do model-specific post-step actions.

View File

@ -64,9 +64,10 @@ namespace Opm {
{
if( verbose )
{
std::ostringstream message;
message << "Caught Exception: " << exception.what();
OpmLog::debug(message.str());
std::string message;
message = "Caught Exception: ";
message += exception.what();
OpmLog::debug(message);
}
}
}
@ -231,6 +232,7 @@ namespace Opm {
}
SimulatorReport substepReport;
std::string cause_of_failure = "";
try {
substepReport = solver.step( substepTimer, state, well_state);
report += substepReport;
@ -242,6 +244,7 @@ namespace Opm {
}
catch (const Opm::NumericalProblem& e) {
substepReport += solver.failureReport();
cause_of_failure = e.what();
detail::logException(e, solver_verbose_);
// since linearIterations is < 0 this will restart the solver
@ -353,7 +356,7 @@ namespace Opm {
substepTimer.provideTimeStepEstimate( newTimeStep );
if( solver_verbose_ ) {
std::string msg;
msg = "Solver convergence failed, cutting timestep to "
msg = cause_of_failure + "\n Timestep chopped to "
+ std::to_string(unit::convert::to( substepTimer.currentStepLength(), unit::day )) + " days.\n";
OpmLog::problem(msg);
}