Dear all, I am solving an elasticity BVP where a nonlinear system must be solved at each time step. To speed up my assembly, I am currently testing the SUNDIALS::KINSOL wrapper in dealii version 9.4.0.
The main logic is happening during // call to KINSol 588 status = KINSol(kinsol_mem, solution, data.strategy, u_scale, f_scale); 589 AssertKINSOL <https://www.dealii.org/9.4.0/doxygen/deal.II/kinsol_8h.html#a0b815dfbfd8c5c49a64af965acdf5330> (status); where the AssertKINSOL translates into an Assert(code>=0, ExcKINSOLError), which is optimized away in release mode. Therefore, wrapping the solve() call in a try/catch block does not work in release mode. However, I believe that catching ExcKINSOLError would also be valuable in release mode, for example when: - The residual callback can not be evaluated (returns negative integer) in the first call. - The residual callback can not be evaluated five times in a row . In that cases, KINSol returns a negative error code, but the solve function currently returns the number of iterations taken as if the solve was successful. Robust error handling strategies (if an exception were thrown and caught) could include switching to a different nonlinear solver, or adjusting the outer time step size, ... I am aware that the SUNDIALS wrapper have been updated as of dealii 9.4.0, but I believe the above issue still exists. My questions are: 1. What are the reasons why the ExcKINSOLError is defined using Assert rather than AssertThrow? 2. What can be done instead to catch the above errors? (Of course, there is the option to compute the residual after the solve call, but I was hoping for a cheaper solution, ideally letting Kinsol itself decide if the nonlinear solve was successful.) Thank you. Best, Simon -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/dealii/385a758b-3469-4fa0-abe3-969628ca3a9en%40googlegroups.com.
