"So I can't reproduce what you are saying -- though I can see that what you are saying is right in principle. Would you be willing to modify this testcase in such a way that it actually shows the issue you mention?"
The only change I made to your new testcase was commenting out the check on count in line 61: if ((u[0] < -10) || (u[0] > 20) /* || (count > 0) */) After this modification, I get the following output: ------------------------------------------------------------------------------------------ Computing residual for the 1th time, at u=10 Setting up Jacobian system at u=10 Computing residual for the 2th time, at u=10 Computing residual for the 3th time, at u=-88.0839 Reporting recoverable failure. Computing residual for the 3th time, at u=-39.0419 Reporting recoverable failure. Computing residual for the 3th time, at u=-14.521 Reporting recoverable failure. Computing residual for the 3th time, at u=-2.26049 Setting up Jacobian system at u=-2.26049 Computing residual for the 4th time, at u=-2.26049 Computing residual for the 5th time, at u=7.84693 Computing residual for the 6th time, at u=7.84693 Computing residual for the 7th time, at u=2.07902 Setting up Jacobian system at u=2.07902 Computing residual for the 8th time, at u=2.07902 Computing residual for the 9th time, at u=-1.23396 Computing residual for the 10th time, at u=-1.23396 Computing residual for the 11th time, at u=6.16274 [KINSOL ERROR] KINSol The maximum number of iterations was reached before convergence. ------------------------------------------------------------------------------------------ That said, if there is no pending exception from the callbacks, the status returned by KINSOL is ignored in release mode. One solution would be to define the AssertKINSOL macro as "AssertThrow(...)", rather than "Assert(...)". Best, Simon On Wednesday, April 30, 2025 at 10:03:22 PM UTC+2 Wolfgang Bangerth wrote: On 4/30/25 00:40, Simon wrote: > > Attached is the test case for the deal.II 9.6.0 release. > I was also able to install version 9.6.0 and run the program myself. > Currently, the program throws a > 'StandardExceptions::RecoverableUserCallbackError', > which can be caught and handled as a recoverable error. However, I > believe this is not sufficient. > For example, if we limit the number of nonlinear iterations to two via > the AdditionalData argument, > we can easily trigger a 'KIN_MAXITER_REACHED' error -- still being > ignored in release mode. I tried that, but I still get the following with a slightly modified testcase: 21: DEAL::Computing residual for the 1st time, at 10.0000 21: DEAL::Setting up Jacobian system at u=10.0000 21: DEAL::Computing residual for the 2nd time, at 10.0000 21: DEAL::Reporting recoverable failure. 21: 21: sundials/kinsol_06_v2.debug: RUN failed. ------ Additional output on stdout/stderr: 21: 21: 21: [KINSOL ERROR] KINSol 21: The linear solver's solve function failed recoverably, but the Jacobian data is already current. 21: 21: terminate called after throwing an instance of 'dealii::StandardExceptions::RecoverableUserCallbackError' 21: what(): 21: -------------------------------------------------------- 21: An error occurred in line <0> of file <> in function 21: 21: The violated condition was: 21: 21: Additional information: 21: A user call-back function encountered a recoverable error, but the 21: underlying library that called the call-back did not manage to recover 21: from the error and aborted its operation. 21: 21: See the glossary entry on user call-back functions for more 21: information. 21: -------------------------------------------------------- That actually sounds like a reasonable error message to me, and it's an exception I can catch. I posted this testcase here: https://github.com/dealii/dealii/pull/18404 So I can't reproduce what you are saying -- though I can see that what you are saying is right in principle. Would you be willing to modify this testcase in such a way that it actually shows the issue you mention? Best W. -- 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/45fc1a5f-1100-4460-948a-2507495af4c7n%40googlegroups.com.
