Repository navigation
Add box/mesh discretization supertypes and boundary hooks - #143
Merged
Merged
Conversation
Add AbstractBoxDiscretization and AbstractMeshDiscretization under AbstractEquationSystemDiscretization, and two developer hooks for the FiniteElementMethod boundary layer: lower_boundaries (identity by default, called first in symbolic_discretize) and split_ics_bcs (the existing ics/bcmap split, moved out of symbolic_discretize unchanged). Agent-Harness: Claude Code 2.1.310 Agent-Model: claude-opus-5-5 Agent-Session: e5d08c60-db9f-4954-946c-272b70ca9edb Agent-Review: unreviewed Co-authored-by: Claude Code <[email protected]>
List the new types and hooks in the API, developer-extension and workflow pages so checkdocs = :exports stays satisfied and the documented hook order matches symbolic_discretize. Agent-Harness: Claude Code 2.1.310 Agent-Model: claude-opus-5-5 Agent-Session: e5d08c60-db9f-4954-946c-272b70ca9edb Agent-Review: unreviewed Co-authored-by: Claude Code <[email protected]>
The example specialised only the discretization argument, so a method copied from it was ambiguous with the default, which specialises v::VariableMap. Test the documented override pattern on the lowering mock, which also exercises it through symbolic_discretize. Agent-Harness: Claude Code 2.1.310 Agent-Model: claude-opus-5-5 Agent-Session: e5d08c60-db9f-4954-946c-272b70ca9edb Agent-Review: unreviewed Co-authored-by: Claude Code <[email protected]>
This was referenced Oct 24, 2026
Merged
xtalax-droid
pushed a commit
to xtalax-droid/PDEBase.jl
that referenced
this pull request
Oct 28, 2026
xtalax
added a commit
to SciML/MethodOfLines.jl
that referenced
this pull request
Oct 29, 2026
…izations Both now subtype PDEBase.AbstractBoxDiscretization (FEM spec M0, section 4.2) so PDEBase can lower boundary conditions for box discretizers. Needs a PDEBase release containing the type (SciML/PDEBase.jl#143); compat is not bumped here. Agent-Harness: Claude Code 2.1.310 Agent-Model: claude-sonnet-5-5 Agent-Session: 6c520c71-764b-4a7e-a484-62d5a95bcfa1 Agent-Review: unreviewed Co-authored-by: Claude Code <[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.
Motivation
This is the first PR of the shared boundary layer that the FiniteElementMethod.jl design puts in PDEBase. Box discretizers (MethodOfLines finite differences and pseudospectral) and mesh discretizers (FEM) need two things from PDEBase:
symbolic_discretize: one that lowers boundary conditions into the form the discretizer consumes, and one that splits the parsed boundary map into initial and boundary conditions without assuming it is keyed byindvars(v).This PR adds those pieces with no change in behaviour. The box lowering (
to_box_bcs) and the mesh methods arrive in later PRs.What is added
AbstractBoxDiscretization <: AbstractEquationSystemDiscretizationandAbstractMeshDiscretization <: AbstractEquationSystemDiscretization, exported and documented. Every existing hook default is defined on a supertype or is untyped, so subtypes inherit everything. MethodOfLines' only change will be switching the declared supertype ofMOLFiniteDifferenceandPseudospectralDiscretization.PDEBase.lower_boundaries(pdesys, disc)is a public developer hook. Its default is the identity. It is called as the first step of the equation-systemsymbolic_discretize, beforehandle_complex,cardinalize_eqs!andmake_pdesys_compatible.PDEBase.split_ics_bcs(boundarymap, v, disc)is a public developer hook that returns(ics, bcmap). Its default is the inline code previously insymbolic_discretize, moved verbatim and usingt = get_time(disc).symbolic_discretizenow calls it.Tests
New testsets in
test/interface.jl:AbstractBoxDiscretizationgives the samesymbolic_discretizeresult as the existing mockAbstractEquationSystemDiscretization;lower_boundariesdefault returns its input (===);lower_boundariesis called with the original system, and its returned system is the one discretized;split_ics_bcsreproduces the old inline ics/bcmap on a heat-equation system, returns empty ics for a steady discretization, and the documented override pattern dispatches without ambiguity.test/public_api.jlcovers both new hooks (defined, documented, public). Core and QA groups pass locally.Notes for review
lower_boundariesruns beforehandle_complexandmake_pdesys_compatible, so an override sees the user's raw system. That is the ordering the box lowering in a later PR relies on.🤖 Posted by an AI agent · harness: Claude Code 2.1.310 · model: claude-opus-5-5
Review: unreviewed
Session: e5d08c60-db9f-4954-946c-272b70ca9edb