Repository navigation
Cardinalize equations on a copy in symbolic_discretize - #141
Merged
Merged
Conversation
cardinalize_eqs! rewrote the PDESystem's equation vector in place. Add a copying cardinalize_eqs that returns a new PDESystem and use it in both symbolic_discretize drivers; keep cardinalize_eqs! for downstream callers that rely on the mutation. Agent-Harness: Claude Code 2.1.310 Agent-Model: claude-sonnet-5-5 Agent-Session: a20a681b-e8cc-4c82-a40d-a5b8349014e2 Agent-Review: unreviewed Co-authored-by: Claude Code <[email protected]>
xtalax-droid
pushed a commit
to xtalax-droid/PDEBase.jl
that referenced
this pull request
Oct 28, 2026
Integration only: master now contains SciML#141 and SciML#160. Agent-Harness: Claude Code 2.1.312 Agent-Model: claude-sonnet-5-5 Agent-Session: a20a681b-e8cc-4c82-a40d-a5b8349014e2 Agent-Review: unreviewed Co-authored-by: Claude Code <[email protected]>
xtalax-droid
pushed a commit
to xtalax-droid/PDEBase.jl
that referenced
this pull request
Oct 28, 2026
Integration only: master now contains SciML#141 and SciML#160. Agent-Harness: Claude Code 2.1.312 Agent-Model: claude-sonnet-5-5 Agent-Session: a20a681b-e8cc-4c82-a40d-a5b8349014e2 Agent-Review: unreviewed Co-authored-by: Claude Code <[email protected]>
xtalax-droid
pushed a commit
to xtalax-droid/PDEBase.jl
that referenced
this pull request
Oct 28, 2026
Integration only: master now contains SciML#141 and SciML#160. Agent-Harness: Claude Code 2.1.312 Agent-Model: claude-sonnet-5-5 Agent-Session: a20a681b-e8cc-4c82-a40d-a5b8349014e2 Agent-Review: unreviewed Co-authored-by: Claude Code <[email protected]>
xtalax-droid
pushed a commit
to xtalax-droid/PDEBase.jl
that referenced
this pull request
Oct 28, 2026
Integration only: master now contains SciML#141 and SciML#160. Agent-Harness: Claude Code 2.1.312 Agent-Model: claude-sonnet-5-5 Agent-Session: a20a681b-e8cc-4c82-a40d-a5b8349014e2 Agent-Review: unreviewed Co-authored-by: Claude Code <[email protected]>
xtalax-droid
pushed a commit
to xtalax-droid/PDEBase.jl
that referenced
this pull request
Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem.
cardinalize_eqs!rewrites the equation vector of thePDESystemit is given. Thesymbolic_discretizedrivers called it on a system derived from the user's, so they depended onhandle_complexhappening to return a fresh vector to keep the caller'spdesys.eqsuntouched. A direct call on a user'spdesysdoes mutate it. (Part of the shared-layer work for the FiniteElementMethod.jl design, spec section 4.6.)Fix. Add
cardinalize_eqs(pdesys), which builds a newPDESystemwith equations inlhs - rhs ~ 0form and leaves its input alone. Bothsymbolic_discretizedrivers use it.cardinalize_eqs!is unchanged, because MethodOfLines'get_discretecalls it and keeps using the samepdesys.Tests. A new testset in
test/optimization_driver.jlchecks thatpdesys.eqsis unchanged aftersymbolic_discretizeand aftercardinalize_eqs, and that the returned equations are cardinalized. It errors on master becausecardinalize_eqsdoes not exist there; it was not otherwise run against master.GROUP=Corepasses (about 49 s); QA was not run.Review notes.
cardinalize_eqsrebuilds thePDESystemwith the same keyword arguments asmake_pdesys_compatible(src/make_pdesys_compatible.jl:104); please check no field is dropped. MethodOfLines is left on the mutating variant.🤖 Posted by an AI agent · harness: Claude Code 2.1.310 · model: claude-sonnet-5-5
Review: unreviewed
Session: a20a681b-e8cc-4c82-a40d-a5b8349014e2