Skip to content

Add PDEBase.StrongForm: operator whitelist and split_time - #146

Merged
xtalax merged 6 commits into
SciML:masterfrom
xtalax-droid:forge/strongform-1-skeleton
Oct 28, 2026
Merged

xtalax merged 6 commits into
SciML:masterfrom
xtalax-droid:forge/strongform-1-skeleton

Conversation

@xtalax-droid

Copy link
Copy Markdown
Contributor

This is the first PR of a stacked series that adds PDEBase.StrongForm, a Symbolics-only analysis of a PDE system's strong form, e = m⋅u̇ + Σᵢ ∂ᵢGᵢ + R. A finite-element discretizer (and later collocation or DG) builds its weak form from this data. This PR adds the module skeleton and the first two stages of the analysis: stage 0, the operator whitelist, and stage a, the time split.

What this adds

  • src/StrongForm/ is included from src/PDEBase.jl. Nothing is exported from PDEBase, and StrongForm exports nothing yet. Developer names are marked public with SciMLPublic.

  • Data types:

    • StateSlots(nfields, dim, nparams): symbolic quadrature-point slots U, G, Ud, H, X, T, N, P, with G field-major.
    • The integration-by-parts policies IBPPolicy, ProductRule, Weighted{W} and Reject, which the next PR uses.
    • EssentialBC{K}, NaturalBC{K} and PeriodicBC{K,S}, parametric in the boundary key (a box face or a mesh boundary piece).
    • StrongFormAnalysis{K}.
  • check_whitelist(ex, ivs, depvars) (stage 0) errors with "operator X is not supported by the strong-form analysis" on:

    • Integral, unknown operators, and a Differential in a variable that is not an independent variable;
    • functions without a derivative rule that the state reaches;
    • symbolic functions of the state that are not dependent variables, such as k(u).

    It accepts derivatives, dependent-variable calls, arithmetic, comparisons, logical operators, ifelse, abs/max and the like, indexed parameters, and state-free coefficients such as k(x, y).

  • split_time(eq, depvars, t) (stage a) splits the expanded residual into a mass coefficient per field and the spatial terms, distributing quotients over sums first. It rejects ∂ₜ², terms not of the form coefficient × ∂ₜu, and state-dependent mass. Steady problems work with t = nothing.

Tests (test/strongform.jl, Core group)

  • Slot construction.
  • Whitelist cases: the accepted classes (diffusion, nonlinear diffusion, advection, ifelse/abs coefficients, mixed partials, multi-field, indexed parameters) and the rejections, including Integral(x in 0..1)(u) and k(u).
  • split_time cases: heat, two-field with coefficients, wave written as a first-order system, an algebraic row, a steady equation, quotients such as (Dt(u) + u)/x, and flattened array variables. Rejections are checked for Dt(Dt(u)), Dt(u)^2, Dx(Dt(u)), Dt(u)*Dt(w) and (1+u^2)*Dt(u).
  • A check that every new name is documented and public.

Local results: Core 12 files pass (strongform.jl 74/74); QA 20/20; Runic clean.

Stacked series: stage b (divergence split, integration-by-parts policies, conormal) and analyse follow in the next PR, then boundary-condition matching, then a golden-outcome test over PDESystemLibrary.


🤖 Posted by an AI agent · harness: Claude Code 2.1.310 · model: claude-opus-5-5
Review: unreviewed
Session: 70c8f395-69e3-4537-a58e-403f04ff7912

xtalax and others added 3 commits October 24, 2026 20:56
First stages of the strong-form analysis a finite-element discretizer needs: StrongForm types and state slots, stage 0 (reject operators the analysis cannot represent, e.g. Integral) and stage a (split each residual into per-field mass coefficients and spatial terms, rejecting forms that need a residual-form DAE). Nothing is exported from PDEBase.

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]>
…nts in split_time

Review findings: replacing every argument with a fresh scalar broke indexed parameter arrays (getindex(::Num, ::Num) on a[1]*u), so only state-carrying arguments are probed, each checked for a Differential in its own symbol, and getindex is whitelisted. Symbolics.expand leaves (a + b)/d whole, so (Dt(u) + u)/x was rejected; addterms now splits quotients with additive numerators.

Agent-Harness: Claude Code 2.1.310
Agent-Model: unknown
Agent-Session: 70c8f395-69e3-4537-a58e-403f04ff7912
Agent-Review: unreviewed
Co-authored-by: Claude Code <[email protected]>
Review finding: a symbolic function such as k(..) that is not a dependent variable has no derivative rule, but its call skipped validation, so an opaque state-dependent law k(u) passed stage 0. It is now rejected when the state reaches it; coefficients of the coordinates such as k(x) stay accepted.

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 and others added 3 commits October 28, 2026 00:43
Older IntervalSets prints the interval as 0..1 rather than 0 .. 1, so the pinned message differed and the Downgrade job failed. Match the spacing with a regex and keep the rest of the message pinned.

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]>
The Documentation CI job failed with 1 docstring not included in the manual: PDEBase.StrongForm. Add a Strong-Form Analysis page listing the module and the names this branch provides, matching the page that the divergence PR extends.

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
xtalax merged commit e26daa6 into SciML:master Oct 28, 2026
27 checks passed
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.

2 participants