Skip to content

Add SIPG elliptic operator with inhomogeneous Dirichlet/Neumann BC support and convergence coverage#407

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/implement-interior-penalty-dg
Draft

Add SIPG elliptic operator with inhomogeneous Dirichlet/Neumann BC support and convergence coverage#407
Copilot wants to merge 2 commits intomainfrom
copilot/implement-interior-penalty-dg

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 17, 2026

This PR adds an interior-penalty DG elliptic model implementing the SIPG bilinear form shown in the issue (volume diffusion term plus symmetric consistency and penalty face terms). It also adds manufactured-solution convergence coverage on a square for both inhomogeneous Dirichlet and Neumann boundary data.

  • New elliptic model (grudge/models/elliptic.py)

    • Adds InteriorPenaltyEllipticOperator.
    • Supports configurable diffusion coefficient kappa and penalty scaling via penalty_factor.
    • Implements interior-face flux assembly with jump/average structure and ( \alpha_e / h_e ) penalty scaling.
    • Supports inhomogeneous boundary data:
      • dirichlet_tag, dirichlet_bc
      • neumann_tag, neumann_bc
    • Accepts scalar, field, or callable BC inputs.
  • Model export

    • Re-exports InteriorPenaltyEllipticOperator from grudge/models/__init__.py for direct import from grudge.models.
  • Convergence tests (test/test_elliptic.py)

    • Adds h-convergence test with a quadratic manufactured solution on a square mesh.
    • Covers both boundary-condition modes:
      • all-Dirichlet
      • all-Neumann
    • Uses the operator residual against the known source term to verify expected convergence behavior across mesh refinement.
from grudge.models.elliptic import InteriorPenaltyEllipticOperator
from meshmode.mesh import BTAG_ALL, BTAG_NONE

elliptic = InteriorPenaltyEllipticOperator(
    dcoll,
    kappa=1.0,
    penalty_factor=10.0,
    dirichlet_tag=BTAG_ALL,
    dirichlet_bc=u_boundary,   # scalar / DOFArray / callable
    neumann_tag=BTAG_NONE,
)

residual = elliptic.operator(u) - f

Copilot AI linked an issue Apr 17, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add interior penalty DG implementation in elliptic.py Add SIPG elliptic operator with inhomogeneous Dirichlet/Neumann BC support and convergence coverage Apr 17, 2026
Copilot AI requested a review from inducer April 17, 2026 15:21
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.

Implement interior penalty DG

2 participants