LLNL / sundials

Official development repository for SUNDIALS - a SUite of Nonlinear and DIfferential/ALgebraic equation Solvers. Pull requests are welcome for bug fixes and minor changes.
https://computing.llnl.gov/projects/sundials
BSD 3-Clause "New" or "Revised" License
517 stars 126 forks source link

The purpose of jcur in PrecSetupFn #106

Closed ChrisRackauckas closed 2 years ago

ChrisRackauckas commented 2 years ago

The jcur in the PrecSetupFn has always confused me https://sundials.readthedocs.io/en/latest/cvode/Usage/index.html#preconditioner-setup-iterative-linear-solvers

jcur – a pointer to a flag which should be set to SUNTRUE if Jacobian data was recomputed, or set to SUNFALSE if Jacobian data was not recomputed, but saved data was still reused.

What exactly is the use case for this, and how does it effect the solver algorithm after the user triggers it? It cannot be for matrix-free Newton-Krylov because there's no Jacobian to recompute. But even if there is a Jacobian, where would that information even be used? Usually jcur is for knowing whether to perform a new factorization, but this is in preconditioners so there is no factorization. Is this data even used or is it simply for updating the counters for number of Jacobians calculated?

ChrisRackauckas commented 2 years ago

Weird github dup.

gardner48 commented 2 years ago

See the discussion in issue https://github.com/LLNL/sundials/issues/107