Repository navigation
Add get_system_unknowns so discretizers can keep array-valued unknowns - #124
Merged
ChrisRackauckas merged 1 commit intoSep 23, 2026
Conversation
`generate_system` built the unknown list by flattening `get_discvars` into its scalar entries, which forced one unknown per grid point. The new `get_system_unknowns(s)` hook returns the unknowns of the generated system; its default is the old flattening, and a discretizer that represents each dependent variable as one array variable can override it to return those arrays. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude <[email protected]> Agent-Harness: Claude Code 2.1.280 Agent-Model: claude-fable-5-1 Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/MethodOfLines.jl/jobs/695-claude/log.txt on amdci2.julia.csail.mit.edu
ChrisRackauckas
marked this pull request as ready for review
September 23, 2026 22:52
ChrisRackauckas
referenced
this pull request
Sep 24, 2026
* Support Complex-typed dependent variables in PDE splitting Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.156.1 Agent-Model: gpt-6-sol Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/PDEBase.jl/jobs/130-codex/log.txt on amdci2.julia.csail.mit.edu * Document Complex field declarations and bump patch version Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.156.1 Agent-Model: gpt-6-sol Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/PDEBase.jl/jobs/130-codex/log.txt on amdci2.julia.csail.mit.edu * Clarify mixed field limitation and test production split order Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.156.1 Agent-Model: gpt-6-sol Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/PDEBase.jl/jobs/130-codex/log.txt on amdci2.julia.csail.mit.edu --------- Co-authored-by: ChrisRackauckas-Claude <[email protected]> Co-authored-by: Codex <[email protected]>
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.
What changed and why
generate_systembuilt the unknown list of the generatedSystemby flatteningget_discvars(s)into its scalar entries, which forces one unknown per grid point. This adds the hookget_system_unknowns(s::AbstractDiscreteSpace), whose default is exactly that flattening, and makesgenerate_systemuse it. A discretizer that represents each dependent variable as one array variable (u(t)[1:n]) can override the hook to return those arrays, sounknowns(sys)no longer grows with the grid; the scalar entries ofget_discvarskeep indexing into them for stencils and boundary/initial conditions. MethodOfLines does this in SciML/MethodOfLines.jl#695 (companion PR linked below). Version0.1.36 → 0.1.37; theModelingToolkitBaselower bound moves1.69 → 1.72because the new test builds a problem from acompleted system with an array unknown, which needs SciML/ModelingToolkit.jl#5131.The name is public (
@public), documented indocs/src/interface.mdanddocs/src/api.md, and covered bytest/public_api.jland the newtest/system_unknowns.jl(default hook flattens; an overriding space yields one unknown;ODEProblemfrom bothcompleted systems gives the sameu0and RHS).Verification
Julia 1.11.9, ModelingToolkitBase 1.76.0, SciMLBase 3.55.0, Symbolics 7.40.1 (amdci2).
Docs (
julia +1.11 --project=docs -e 'using Pkg; Pkg.develop(path="."); Pkg.instantiate(); include("docs/make.jl")') build to completion withcheckdocs = :exportsanddoctest = true; the only warning is Documenter skipping deployment outside CI. Runic andtyposare clean on the changed files.Not verified
For the reviewer
get_system_unknownssits next toget_discvars; a different name is a one-line change in both PRs.Companion PR: MethodOfLines implements the hook in SciML/MethodOfLines.jl#701.
Part of SciML/MethodOfLines.jl#695.
🤖 Generated with Claude Code 2.1.280 (model: claude-fable-5-1); local session, transcript at /home/crackauc/sandbox/agent-jobs/MethodOfLines.jl/jobs/695-claude/log.txt on amdci2.julia.csail.mit.edu