#1340 Introduce a catch mechanism in the three Petsc Snes internal function I...
#1340 Introduce a catch mechanism in the three Petsc Snes internal function I have to define when using Petsc Newton. The issue is that if an exception is thrown in any of these, I got a message regarding uncaught exception due to C++ abi problem. This message was printed at the very end of the program, but still hindered dramatically the readability of the output. I have in fact here introduced a macro MOREFEM_NO_TRAP_SNES_EXCEPTION: if it is not defined in each of these three functions exceptions are caught systematically and 'converted' into an arbitrary Petsc error code; if not the old behaviour is kept. The latter might be the right choice for release as try/catch in an oft called function might be expensive in runtime.
Showing with 107 additions and 58 deletions