Repository navigation
Add weak_form and classify (strong-to-weak stage e) - #1
Merged
Merged
Conversation
Galerkin projection of a strong-form analysis into mass, volume and facet terms, with each additive term classified as source, bilinear or nonlinear over the declared state slots (spec 5.1 stage e, 5.2). The analysis is read by field so PDEBase.StrongForm can replace the test-only seam in test/strongform_seam.jl without changes to src. Agent-Harness: Claude Code 2.1.310 Agent-Model: claude-opus-5-5 Agent-Session: d6252e53-ed42-4149-9811-233262edb2ef Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Follow the SciMLTesting folder layout used by MethodOfLines: one test/<Group>/ folder per group declared in test_groups.toml, with helpers in test/shared/, which run_tests never executes because it is not a declared group. Agent-Harness: Claude Code 2.1.310 Agent-Model: claude-opus-5-5 Agent-Session: d6252e53-ed42-4149-9811-233262edb2ef Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Symbolics.variables is not public, which fails ExplicitImports' all_qualified_accesses_are_public check in the QA group. Symbolics.variable(:W, i) builds the same symbols. Agent-Harness: Claude Code 2.1.310 Agent-Model: claude-opus-5-5 Agent-Session: d6252e53-ed42-4149-9811-233262edb2ef Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
This was referenced Oct 24, 2026
The Typos spell check flags dorder; a descriptive name is clearer than a whitelist entry. Agent-Harness: Claude Code 2.1.310 Agent-Model: claude-opus-5-5 Agent-Session: d6252e53-ed42-4149-9811-233262edb2ef Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
makedocs checks that every docstring in the module is included in the manual; an @autodocs block over FiniteElementMethod covers these and later docstrings. The module docstring stays on the home page, so the block lists types, functions, constants and macros only. Agent-Harness: Claude Code 2.1.310 Agent-Model: claude-opus-5-5 Agent-Session: d6252e53-ed42-4149-9811-233262edb2ef Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
This was referenced Oct 26, 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.
PR 1 of 4 for milestone M1 (spec §11.1): the Galerkin projection and term classification, stage e of the strong-to-weak transform. This PR is symbolic only and does not touch Ferrite.
What
src/weakform.jladds the FEM data types of spec §5.2 and two functions.TestSlots(V, W, hK),VolumeTerm,FacetTerm{P},WeakForm{A}andKernelSpec{F,T}.classify(integrand, slots, test)expands the integrand and puts each additive term into one bucket. A term with no state slot is:source. A term whose first derivative with respect to every state slot is state-free is:bilinear. Anything else is:nonlinear. Each bucket also carries atimedepflag (it containsT) and aparamdepflag (it containsP).weak_form(analysis; test)is the Galerkin projection. Each equationecontributes a mass termmass[e]·Vand the classified volume integrand−G·W + R·V. Each natural condition contributes the classified facet termΦ·V, keyed by its boundary piece. The residual convention isΣ∫vol + Σ∮facet = 0. Essential conditions stay inanalysis.essential.classifyranges over the declared state slots (U,G, andHwhen present), not over a hard-coded list. This prevents the regression in report 5 §1e, where Hessian terms were misfiled as sources.src/reads the analysis object by field name only and never names aPDEBase.StrongFormtype.Why
This implements spec §5.1 stage e and §5.2. Stages 0 to d belong to
PDEBase.StrongForm.analyse(§4.4), which is not released yet. Until it is,test/strongform_seam.jl(moduleStrongFormSeam) is a test-only stand-in. It implements the §5.2 types andanalyse, ported from the verified dauntless prototype. Replacing it with PDEBase's version will be a test-only change.Tests
test/weakform.jl(Core group) checks the output term for term against the prototype's outputs (test_linear.out,test_nonlinear.out,test_multifield.out,test_testspace.out).k, the Robin condition split into a facet bilinear term plus a facet source, and the Dirichlet data.k = 1 + u², with nonlinear volume and facet terms.timedepandparamdepflags.∂ₙu = hon an anisotropic flux.GROUP=Core Pkg.test()passes. The new file has 30 tests. Runic is clean. Codex review approved it with no findings.Reviewer notes
mass[e]as the whole time-derivative part,Σ_f m_ef·Ud_f, andnatural[i].eqas a 1-based index. These readings have been sent to PDEBase so itsanalysematches.SymbolicUtils.operation(ex) === (+), which relies on Symbolics 7 internals.Follow-up commits
0654711moves the tests to the SciMLTesting per-group layout:test/WeakForm/weakform.jl(groupWeakForm) and the stand-in for PDEBase'sanalyseattest/shared/strongform_seam.jl.a8ceef9builds the test-function gradient slots with the publicSymbolics.variable, becauseSymbolics.variablesis not public and failed the ExplicitImports QA check. QA now passes 20/20.a168de3renamesdordertoderivative_orderin the test stand-in, because the Typos spell check flagged it. A localtyposrun exits 0.14c21edaddsdocs/src/api.mdwith an@autodocsblock, so Documenter's missing-docs check covers every docstring, including those of the stacked PRs. A localmakedocsrun passes.All four follow-up commits were approved by Codex review with no findings.
🤖 Posted by an AI agent · harness: Claude Code 2.1.310 · model: claude-opus-5-5
Review: unreviewed
Session: d6252e53-ed42-4149-9811-233262edb2ef