Skip to content

Add supported_conditions hook for discretizers to declare BC support - #147

Merged
xtalax merged 2 commits into
SciML:masterfrom
xtalax-droid:forge/boundary-7-supported-conditions
Oct 28, 2026
Merged

xtalax merged 2 commits into
SciML:masterfrom
xtalax-droid:forge/boundary-7-supported-conditions

Conversation

@xtalax-droid

Copy link
Copy Markdown
Contributor

Motivation

The SciMLBase PDE interface asks each discretizer package to document which geometries and boundary-condition classes it supports: Dirichlet, Neumann, Robin, periodic, interface and others. PDEBase is the shared layer under FiniteElementMethod, MethodOfLines and NeuralPDE, so it is the natural home for one machine-readable place where each discretizer declares that support.

What is added

  • PDEBase.SupportedConditions, an immutable record with a keyword constructor:

    • geometries: a tuple of symbols such as :interval, :box or :mesh, or of domain types;
    • dirichlet, neumann, robin, periodic, interface and time_dependent: each true, false, or nothing for not declared;
    • notes: free text.

    isempty(sc) is true when nothing is declared. show(io, MIME"text/markdown"(), sc) renders the record as a Markdown table for discretizer docs.

  • PDEBase.supported_conditions(disc::AbstractDiscretization) is a developer hook. Its default returns SupportedConditions(), which means unknown, not "supports nothing". A discretizer declares its support like this:

    PDEBase.supported_conditions(::MyDisc) = PDEBase.SupportedConditions(
        geometries = (:box,), dirichlet = true, neumann = true, robin = true,
        periodic = true, interface = true)
  • Both names are @public in the developer-API list and documented in a new "Supported Conditions" section of the Developer Extension API page.

The hook is for documentation and introspection only. PDEBase never calls it during discretization, so existing behaviour is unchanged.

Tests

The new test/supported_conditions.jl covers:

  • the empty default for a plain discretization;
  • an override and its fields;
  • isempty;
  • conversion of a vector of geometries to a tuple;
  • the Markdown rendering.

test/public_api.jl checks that both names are defined, documented and public. Core and QA pass locally.

Notes for review

These field names become public API once released, so they deserve the closest look, particularly time_dependent, and whether interface should be split, for example into conservation and continuity interfaces.


🤖 Posted by an AI agent · harness: Claude Code 2.1.310 · model: claude-opus-5-5
Review: unreviewed
Session: e5d08c60-db9f-4954-946c-272b70ca9edb

The SciMLBase PDE interface asks each discretizer to document its supported geometries and Dirichlet, Neumann, Robin, periodic and interface conditions. supported_conditions(disc) returns a SupportedConditions record so that this lives in one machine-readable place; the default declares nothing (unknown). It is documentation and introspection only and is not called by the pipeline.

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]>
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
xtalax merged commit 1583d15 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