diff --git a/dumux/boxmodels/2p2c/2p2cnewtoncontroller.hh b/dumux/boxmodels/2p2c/2p2cnewtoncontroller.hh index b2c265ef35e3930faa7caa2e767b12f640322581..0e218dc7b4d1c0632183fc48f026a94d7feba84c 100644 --- a/dumux/boxmodels/2p2c/2p2cnewtoncontroller.hh +++ b/dumux/boxmodels/2p2c/2p2cnewtoncontroller.hh @@ -66,9 +66,28 @@ public: void newtonEndStep(SolutionVector &uCurrentIter, const SolutionVector &uLastIter) { - // call the method of the base class - this->method().model().updateStaticData(uCurrentIter, uLastIter); - ParentType::newtonEndStep(uCurrentIter, uLastIter); + int succeeded; + try { + // call the method of the base class + this->method().model().updateStaticData(uCurrentIter, uLastIter); + ParentType::newtonEndStep(uCurrentIter, uLastIter); + + succeeded = 1; + succeeded = this->problem_().gridView().comm().min(succeeded); + } + catch (Dumux::NumericalProblem &e) + { + std::cout << "rank " << this->problem_().gridView().comm().rank() + << " caught an exception while assembling:" << e.what() + << "\n"; + succeeded = 0; + succeeded = this->problem_().gridView().comm().min(succeeded); + } + + if (!succeeded) { + DUNE_THROW(NumericalProblem, + "A process did not succeed in linearizing the system"); + }; } /*!