Changes made as requested

This commit is contained in:
Rohith Nair
2017-06-07 14:40:18 +02:00
parent c12665e04f
commit 348cb5e5a4

View File

@@ -60,9 +60,10 @@ namespace Opm {
{ {
if( verbose ) if( verbose )
{ {
std::ostringstream message; std::string message;
message << "Caught Exception: " << exception.what(); message = "Caught Exception: ";
OpmLog::debug(message.str()); message += exception.what();
OpmLog::debug(message);
} }
} }
} }
@@ -227,6 +228,7 @@ namespace Opm {
} }
SimulatorReport substepReport; SimulatorReport substepReport;
std::string cause_of_failure = "";
try { try {
substepReport = solver.step( substepTimer, state, well_state); substepReport = solver.step( substepTimer, state, well_state);
report += substepReport; report += substepReport;
@@ -238,6 +240,7 @@ namespace Opm {
} }
catch (const Opm::NumericalProblem& e) { catch (const Opm::NumericalProblem& e) {
substepReport += solver.failureReport(); substepReport += solver.failureReport();
cause_of_failure = e.what();
detail::logException(e, solver_verbose_); detail::logException(e, solver_verbose_);
// since linearIterations is < 0 this will restart the solver // since linearIterations is < 0 this will restart the solver
@@ -349,7 +352,7 @@ namespace Opm {
substepTimer.provideTimeStepEstimate( newTimeStep ); substepTimer.provideTimeStepEstimate( newTimeStep );
if( solver_verbose_ ) { if( solver_verbose_ ) {
std::string msg; 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"; + std::to_string(unit::convert::to( substepTimer.currentStepLength(), unit::day )) + " days.\n";
OpmLog::problem(msg); OpmLog::problem(msg);
} }