Skip to content

Fix preconditioner precs interface for v7 (#1601)#1606

Open
jitendravjh wants to merge 1 commit into
SciML:masterfrom
jitendravjh:fix-precs-interface-1601
Open

Fix preconditioner precs interface for v7 (#1601)#1606
jitendravjh wants to merge 1 commit into
SciML:masterfrom
jitendravjh:fix-precs-interface-1601

Conversation

@jitendravjh

Copy link
Copy Markdown

Fixes #1601. The precs interface changed in v7 from the 9-argument (W, du, u, p, t, newW, Plprev, Prprev, solverdata) to the 2-argument (newW, p), so the hand-written preconditioner builders in the benchmarks were failing with a MethodError on the old signature.

This migrates all of them to (newW, p) and returns I instead of nothing for the right preconditioner, since the solver now applies it via ldiv! and nothing has no method. convert(AbstractMatrix, newW) materializes the passed WOperator to its sparse matrix, so concrete_jac = true keeps working.

Updated 12 builders across SimpleHandwrittenPDE/burgers_fdm_wpd.jmd, SimpleHandwrittenPDE/allen_cahn_fdm_wpd.jmd, StiffODE/Bruss.jmd, Bio/BCR.jmd, and Bio/fceri_gamma2.jmd.

Checked locally by running the affected builders on the real problems: the four SimpleHandwrittenPDE preconditioners solve the burgers problem with KenCarp4, and KenCarp47 solves with the ILU builder. The Bio problems use a sparse Jacobian, so the ilu(convert(...)) path is unchanged from before.

The precs interface changed in v7 from the 9-argument
(W, du, u, p, t, newW, Plprev, Prprev, solverdata) to the 2-argument
(newW, p) form, which broke every hand-written preconditioner builder in
the benchmarks with a MethodError on the old signature.

Migrate all builders to the new (newW, p) signature and return I (identity)
instead of nothing for the right preconditioner, since the solver now
applies it via ldiv! and nothing has no method. convert(AbstractMatrix,
newW) materializes the passed WOperator to its underlying sparse matrix, so
concrete_jac = true keeps working.

Updated 12 builders across:
- SimpleHandwrittenPDE/burgers_fdm_wpd.jmd (4)
- SimpleHandwrittenPDE/allen_cahn_fdm_wpd.jmd (4)
- StiffODE/Bruss.jmd (2)
- Bio/BCR.jmd (1)
- Bio/fceri_gamma2.jmd (1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preconditioner setup only partially upgraded

1 participant