Open j-fu opened 3 weeks ago
good catch. I added the reinit before the set property so I forgot about the interaction. fix incoming
a reuse_precs
kwarg seems reasonable for this function.
Why would it actually make the new prec instead of just setting a flag to make a prec and then make at the next solve step?
oh, we could possibly used cache.isfresh for this... that's interesting
Yes because you only have to update the precs when A changes, which is when isfresh
Describe the bug đ
In
reinit!
. preconditioner construction via precs is called several times: once in the method itself, and then bycache.A=A
andcache.p=p
(triggered bysetproperty
).Expected behavior
I would expect that the preconditioner is updated only once.
Minimal Reproducible Example đ
Output
Discussion
I think that the
setproperty
overload forcache.A
andcache.p
is not necessary. In any case I find it a bit dangerous.As a feature request, I would like to see a kwarg
keep_precs
, allowing toreinit!
without updating Pl, Pr in a transparent manner. I could try a corresponding PR once this is fixed.