-Added exception TooManyIterations

-Combined log messages from NonLinearSolver_impl.hpp and AdaptiveTimeStepping_impl.hpp
This commit is contained in:
Rohith Nair 2017-05-23 16:34:36 +02:00
parent e5732ea0a7
commit c12665e04f
2 changed files with 4 additions and 10 deletions

View File

@ -24,6 +24,7 @@
#define OPM_NONLINEARSOLVER_IMPL_HEADER_INCLUDED
#include <opm/autodiff/NonlinearSolver.hpp>
#include </data/DataExchange/Rohith/opm_dev/opm-common/opm/common/Exceptions.hpp>
#include <opm/common/Exceptions.hpp>
#include <opm/common/ErrorMacros.hpp>
@ -162,11 +163,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

@ -1,18 +1,14 @@
/*
Copyright 2014 IRIS AS
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
@ -383,4 +379,4 @@ namespace Opm {
}
}
#endif
#endif