Repository navigation
Add StrongForm divergence split, slot form and analyse - #148
Merged
xtalax merged 17 commits intoOct 28, 2026
Merged
Conversation
split_divergence writes each equation's spatial part as a divergence plus remainder by the product rule, with the IBP policies, the coefficient smoothness check and order-naming rejections; slot_volume and SlotContext put mass, flux, remainder and the strong residual into slots; analyse ties the stages together and computes the conormal coefficients. split_time now distributes derivatives over sums so stage b sees one second-order factor per term. Boundary conditions are refused until the next PR. Agent-Harness: Claude Code 2.1.310 Agent-Model: claude-opus-5-5 Agent-Session: 70c8f395-69e3-4537-a58e-403f04ff7912 Agent-Review: unreviewed Co-authored-by: Claude Code <[email protected]>
…ng, skip vanishing corrections Review findings: an array parameter became one scalar P slot, so a[1] could not be rebuilt; each element now has its own slot (column-major, in parameter order) and indexed parameters are matched before descending. Equation-keyed ibp policies stopped matching once cardinalize_eqs! rewrote the equation; keys now match by residual up to sign, and a key matching no equation is an error. Product-rule corrections that cancel, as for (sin² + cos²)Δu split apart by expand, no longer warn or trip Reject(). Agent-Harness: Claude Code 2.1.310 Agent-Model: claude-opus-5-5 Agent-Session: 70c8f395-69e3-4537-a58e-403f04ff7912 Agent-Review: unreviewed Co-authored-by: Claude Code <[email protected]>
Review findings: mod, rem, clamp and other discontinuous functions passed the smoothness check, leaving a NaN-valued correction; they are now listed, and a coefficient whose derivative is piecewise in the variable or NaN is rejected too. Terms of order three or more inside a nonlinearity now get the ordinal message. Conflicting ibp keys for one equation are an error, keys written with array-variable fields are flattened like the system before matching, the correction warning names the policy, and distribute_derivatives drops derivatives of numeric constants. Agent-Harness: Claude Code 2.1.310 Agent-Model: claude-opus-5-5 Agent-Session: 70c8f395-69e3-4537-a58e-403f04ff7912 Agent-Review: unreviewed Co-authored-by: Claude Code <[email protected]>
Interpolating the policy printed it module-qualified under SciMLTesting (PDEBase.StrongForm.ProductRule()), so the warning text depended on the caller's imports; the type name is stable. Agent-Harness: Claude Code 2.1.310 Agent-Model: claude-opus-5-5 Agent-Session: 70c8f395-69e3-4537-a58e-403f04ff7912 Agent-Review: unreviewed Co-authored-by: Claude Code <[email protected]>
Review findings: a jump under a first-order derivative, such as Dx(ifelse(...)*u), or inside the inner w′ of a second-order term was accepted and lost its delta when slot_volume expanded the derivative. Every spatial derivative that will be expanded now needs a differentiable argument, raising the existing not-differentiable error; the divergence form Dx(ifelse(...)*Dx(u)) stays accepted because c⋅w′ enters the flux undifferentiated. ibp keys that are neither Equations nor integers now get a clear error, and the docstring says integer keys index the flattened equation list. Agent-Harness: Claude Code 2.1.310 Agent-Model: claude-opus-5-5 Agent-Session: 70c8f395-69e3-4537-a58e-403f04ff7912 Agent-Review: unreviewed Co-authored-by: Claude Code <[email protected]>
…check mass coefficients Review findings: the jump check also rejected continuous non-smooth fluxes such as Dx(abs(u)) that are differentiated correctly almost everywhere. Expanded derivatives now only reject DISCONTINUOUS_FUNCTIONS (NONSMOOTH_FUNCTIONS minus abs, max, min, clamp) and NaN derivatives, while the product-rule correction keeps the full M1 list. Mass coefficients such as Dx(jump)*Dt(u) skipped the check and now go through it. The message says expression rather than coefficient when the state is involved. Agent-Harness: Claude Code 2.1.310 Agent-Model: claude-opus-5-5 Agent-Session: 70c8f395-69e3-4537-a58e-403f04ff7912 Agent-Review: unreviewed Co-authored-by: Claude Code <[email protected]>
…eck_evaluable Dt(u) ~ Dx(a(x)*Dx(u)) with a registered without a derivative rule was rejected because the strong residual is derivative-expanded, although spec §8.2 accepts it: the flux a⋅∇u needs no derivative of a. The strong residual now keeps such derivatives in slot coordinates. check_evaluable names any unevaluated derivative, since build_function would compile it to zero; consumers call it on strong, and analyse asserts it on mass, flux, remainder and conormal. Agent-Harness: Claude Code 2.1.310 Agent-Model: claude-opus-5-5 Agent-Session: 70c8f395-69e3-4537-a58e-403f04ff7912 Agent-Review: unreviewed Co-authored-by: Claude Code <[email protected]>
FiniteElementMethod reaches PDEBase.StrongForm and runs make_pdesys_compatible in its own pipeline, so both are declared public. make_pdesys_compatible gets a docstring and a docs entry, and a Strong-Form Analysis page renders the StrongForm API. Agent-Harness: Claude Code 2.1.310 Agent-Model: claude-opus-5-5 Agent-Session: 70c8f395-69e3-4537-a58e-403f04ff7912 Agent-Review: unreviewed Co-authored-by: Claude Code <[email protected]>
…names names(PDEBase) lists public names too on Julia 1.11+, and StrongForm is now public. Agent-Harness: Claude Code 2.1.310 Agent-Model: claude-opus-5-5 Agent-Session: 70c8f395-69e3-4537-a58e-403f04ff7912 Agent-Review: unreviewed Co-authored-by: Claude Code <[email protected]>
This was referenced Oct 26, 2026
…bles Fields followed VariableMap's discovery order, so a system declared [u, w] whose equations mention w first got fields [w, u]. StrongForm now numbers fields by the declared order of pdesys's dependent variables (declared_fields), leaving VariableMap unchanged; SlotContext takes the system for this. Agent-Harness: Claude Code 2.1.310 Agent-Model: claude-opus-5-5 Agent-Session: 70c8f395-69e3-4537-a58e-403f04ff7912 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 26, 2026
Resolves the import and public-API lists, and moves the boundary tests to SlotContext(pdesys, v) now that fields follow the system's declared order. Agent-Harness: Claude Code 2.1.310 Agent-Model: claude-opus-5-5 Agent-Session: 70c8f395-69e3-4537-a58e-403f04ff7912 Agent-Review: unreviewed Co-authored-by: Claude Code <[email protected]>
Contributor
Author
|
Pushed 85a2102 (fast-forward): StrongForm now numbers fields in the declared order of 🤖 Posted by an AI agent · harness: Claude Code 2.1.310 · model: claude-sonnet-5-5 |
This was referenced Oct 26, 2026
Merged
…to forge/strongform-2-divergence Integration only. 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]>
…ry order At the lowest compat the derivative of mod is not the piecewise form is_piecewise looks for, and depvars comes out in a different order. is_smooth already rejects mod and rem by name, so the test now checks that; the field-order test runs both declared orders, one of which differs from discovery whichever it is. 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]>
…e/strongform-2-divergence Integration only. 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]>
split_divergence raised on the first term of order > 2 in the order the sum was given, so a system mixing third- and fourth-order terms (PDESystemLibrary gen1..gen3) was rejected with the third- or the fourth-order message depending on the Julia version's term ordering. Check all terms up front and name the highest order, so the rejection is identical on every Julia version. 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]> (cherry picked from commit 9b8862def4eee5073e0d1dc96285577483f5d8a3)
…trongform-2-divergence Integration only; docs/src/strongform.md conflict resolved by keeping the fuller page already on this branch. 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]>
Integration only: resolved src/PDEBase.jl by taking the union of the @public/include/export additions of both sides. 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: no conflicts; carries the resolved SciML#146/SciML#148/SciML#149 tips and upstream/master. 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: no conflicts; carries the resolved SciML#146/SciML#148/SciML#149/SciML#150 tips and upstream/master. 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
marked this pull request as ready for review
October 28, 2026 19:44
Integration only: src/PDEBase.jl (@public list) and test/public_api.jl (developer API names) conflicted; kept the union of both sides' entries. 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: clean merge of master (SciML#148); no conflicts. 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: clean merge of master (SciML#148); no conflicts. 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: clean merge of master (SciML#148); no conflicts. 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: clean merge of master (SciML#148); no conflicts. 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#148, SciML#149 and SciML#150. 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#148, SciML#149 and SciML#150. 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#148, SciML#149 and SciML#150. 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#148, SciML#149 and SciML#150. 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]>
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.
Depends on #146 (StrongForm skeleton, stages 0 and a). This PR is stacked on it; review the commits after #146's.
This PR adds stages b and c of the strong-form analysis that a finite-element discretizer builds its weak form from, plus the
analysedriver for volume equations. Every equation is written ase = m⋅u̇ + Σᵢ ∂ᵢGᵢ + Rin symbolic quadrature-point slots.What this adds
split_divergence(spatial, sivs, policy)(stage b) writes the spatial part of each equation asΣᵢ ∂ᵢGᵢ + R. It uses the single product rulec⋅Dᵢ(w′) = Dᵢ(c⋅w′) − (Dᵢc)⋅w′, which covers divergence form, cross terms, vector fluxes, non-divergencea(x)Δuandu⋅Δu. First-order terms stay inRin advective form. It rejects:Coefficient smoothness:
ifelse,abs,max,min,sign,floor,modand the like, or a function with no derivative rule, is rejected: "coefficient … is not differentiable; write the equation in divergence form or register the derivative". The full list isNONSMOOTH_FUNCTIONS.w′, mass coefficients), a discontinuous function of that variable is rejected so that a jump's delta term is never silently dropped. That list isDISCONTINUOUS_FUNCTIONS, and a NaN in the derivative is rejected as well. Continuous functions such asabs(u)remain allowed there.Integration-by-parts policies:
ProductRule()is the default. It warns when a nonzero correction is actually generated, because the stiffness matrix is then non-symmetric.Weighted(w)analysesw⋅e.Weighted(r²)recovers the symmetric spherical Laplacian.Reject()errors on any term that would need the product rule.SlotContextandslot_volume(stage c) write mass, flux, remainder and the strong residual inStateSlots. Array parameters are given onePslot per element. Leftover symbols raise "unresolved symbols … register the derivative".analyse(pdesys, v, boundarymap; ibp)is the only export ofStrongForm. It returns aStrongFormAnalysiswith:mass[e] = Σ_f m_ef⋅Ud_f;strong,fluxandremainder;∂(G⋅N)/∂G.Policies keyed by an
Equationare matched through PDEBase's preprocessing, including array-variable flattening. Keys that match no equation, or that conflict, raise an error. The input system is never mutated. Boundary conditions are refused with a clear error until the next PR in the series.An opaque registered coefficient with no derivative rule is accepted in divergence form, as in
Dx(a(x)*Dx(u)).strongmay then hold an unevaluated derivative of it. The new publiccheck_evaluable(ex)rejects such expressions, andanalyseguarantees that mass, flux, remainder and conormal never hold one.StrongFormandmake_pdesys_compatibleare declared public, with a new docs page, "Strong-Form Analysis".Tests (
test/strongform_analyse.jl, Core)strong = mass + Σᵢ ∂ᵢGᵢ + Rat random slot values, with a reusable helper intest/shared/strongform_identity.jl.ifelsein divergence form, continuous state fluxes, and an opaque coefficient in divergence form.sin(Δu);u_x⋅u_xx; non-smooth coefficients (ifelse,mod,rem,clamp,abs(x−½)) in non-divergence form; jumps under first-order derivatives and in mass coefficients; unregistered coefficients.Weighted(r²)versusProductRule, and integration-by-parts key matching and its errors.Local results: Core passes on all 13 files; QA passes 20/20; Runic is clean. The full Documenter build was not run locally.
Reviewed by Codex (forge codex-review, approve) after three rounds by an independent Claude Opus subagent while the Codex workspace was out of credits.
🤖 Posted by an AI agent · harness: Claude Code 2.1.310 · model: claude-opus-5-5
Review: unreviewed
Session: 70c8f395-69e3-4537-a58e-403f04ff7912