diff --git a/opm/autodiff/CPRPreconditioner.hpp b/opm/autodiff/CPRPreconditioner.hpp index 1dbd627db..c30b6e1b1 100644 --- a/opm/autodiff/CPRPreconditioner.hpp +++ b/opm/autodiff/CPRPreconditioner.hpp @@ -178,7 +178,31 @@ createILU0Ptr(const M& A, double relax, Dune::OwnerOverlapCopyCommunication, Dune::SeqILU0 > PointerType; - Dune::SeqILU0* ilu = new Dune::SeqILU0(A, relax); + Dune::SeqILU0* ilu = nullptr; + int ilu_setup_successful = 1; + std::string message; + try { + ilu = new Dune::SeqILU0(A, relax); + } + catch ( Dune::MatrixBlockError error ) + { + message = error.what(); + std::cerr<<"Exception occured on process " << + comm.communicator().rank() << " during " << + "setup of ILU0 preconditioner with message: " << + message<, I1, I2> ::type ( new PointerType(*ilu, comm), createParallelDeleter(*ilu, comm)); } diff --git a/opm/autodiff/NewtonIterationBlackoilInterleaved.hpp b/opm/autodiff/NewtonIterationBlackoilInterleaved.hpp index 4eef1944e..2a8553c64 100644 --- a/opm/autodiff/NewtonIterationBlackoilInterleaved.hpp +++ b/opm/autodiff/NewtonIterationBlackoilInterleaved.hpp @@ -132,14 +132,37 @@ namespace Opm AdditionalObjectDeleter > constructPrecond(Operator& opA, const Comm& comm) const { - const double relax = 1.0; - SeqPreconditioner* seq_precond= new SeqPreconditioner(opA.getmat(), - relax); typedef AdditionalObjectDeleter Deleter; - std::unique_ptr - precond(new ParPreconditioner(*seq_precond, comm), - Deleter(*seq_precond)); - return precond; + typedef std::unique_ptr Pointer; + int ilu_setup_successful = 1; + std::string message; + const double relax = 1.0; + SeqPreconditioner* seq_precond = nullptr; + try { + seq_precond = new SeqPreconditioner(opA.getmat(), + relax); + } + catch ( Dune::MatrixBlockError error ) + { + message = error.what(); + std::cerr<<"Exception occured on process " << + comm.communicator().rank() << " during " << + "setup of ILU0 preconditioner with message: " << + message<