Skip to main content

panel-bie

Panel-based boundary integral equation (BIE) solvers for 2D Laplace and Stokes problems.

PyPI version Python versions License CI Documentation codecov

Overview

This package provides Nyström discretization methods for solving boundary integral equations on smooth 2D curves. It includes:

  • Double-layer potential for Laplace (Dirichlet problems)
  • Single-layer potential for Laplace (Neumann problems)
  • Combined-field formulations for robust exterior problems
  • Curvature-corrected diagonal for improved conditioning
  • Near-field evaluation with Helsing-Ojala quadrature corrections

Installation

pip install panel-bie

# With plotting support
pip install panel-bie[plot]

Quick Start

from panel_bie import DoubleLayerLaplace, solve_dirichlet
from superellipse import Superellipse

# Create geometry
curve = Superellipse(a=1, b=1, p=8)
disc = curve.panel_discretization(panels_per_quadrant=4, nodes_per_panel=16)

# Set up boundary data
g = lambda pt: pt[0]**2 - pt[1]**2  # harmonic function

# Solve
solver = DoubleLayerLaplace(disc)
mu = solver.solve(g)

# Evaluate at interior point
u_0 = solver.evaluate(mu, point=[0.0, 0.0])

Command-Line Interface

The package includes a CLI for quick experiments and diagnostics.

Commands

solve - Solve a Dirichlet problem on a superellipse geometry:

# Create a geometry file
echo '{"a": 1.0, "b": 1.0, "p": 4.0}' > curve.json

# Solve with harmonic boundary data u = x² - y²
panel-bie solve -g curve.json --bc "x**2 - y**2" --eval 0,0

# With custom discretization
panel-bie solve -g curve.json --bc "x" --eval 0.5,0 --panels 8 --nodes 16

condition - Compute the condition number of the discretized operator:

# Default squircle (p=4)
panel-bie condition

# Higher-order Lamé curve
panel-bie condition --p 8 --panels 8

# Custom geometry
panel-bie condition --a 2.0 --b 1.0 --p 4 --panels 4 --nodes 16

convergence - Test convergence with increasing panel count:

# Default p=4 superellipse
panel-bie convergence

# Higher exponent
panel-bie convergence --p 8

CLI Options

Command Option Description
solve --geometry, -g JSON file with geometry (a, b, p, q)
solve --bc Boundary condition as Python expression
solve --eval Evaluation point as x,y
solve --panels Panels per quadrant (default: 4)
solve --nodes Nodes per panel (default: 16)
solve --beta Panel grading parameter (default: auto)
condition --a, --b, --p Superellipse parameters
condition --panels, --nodes Discretization parameters
condition --beta Panel grading parameter (default: auto)
convergence --a, --b, --p Superellipse parameters

The --beta parameter controls panel grading near corners and is automatically computed to ensure numerical stability (beta must be less than p/2).

Theory

Double-Layer Potential

For Laplace's equation, the double-layer potential representation:

$$u(x) = \int_\Gamma \mu(y) \frac{\partial G(x,y)}{\partial n_y} , ds_y$$

where $G(x,y) = \frac{1}{2\pi} \log|x-y|$ is the fundamental solution.

The density $\mu$ satisfies the second-kind integral equation:

$$\left(-\frac{1}{2}I + K\right)\mu = g$$

where $K$ is the double-layer operator.

Diagonal Correction

For smooth boundaries, the kernel $K(x,y)$ has a finite limit as $y \to x$:

$$K(x,x) = \frac{\kappa(x)}{4\pi}$$

where $\kappa(x)$ is the signed curvature. This package uses this analytic limit rather than numerical regularization.

Near-Field Evaluation

For target points close to the boundary, standard quadrature loses accuracy. This package implements the Helsing-Ojala method for accurate near-boundary evaluation.

API Reference

DoubleLayerLaplace(discretization)

Double-layer potential solver for interior Dirichlet problems.

Method Description
assemble() Build the discretized operator matrix
solve(g) Solve for density given boundary data g
evaluate(mu, point) Evaluate solution at interior point
evaluate_grid(mu, grid) Evaluate on a grid of points

SingleLayerLaplace(discretization)

Single-layer potential solver for Neumann problems.

Geometry protocol

Any geometry object providing:

  • points: (N, 2) boundary nodes
  • normals: (N, 2) outward unit normals
  • weights: (N,) quadrature weights
  • curvature: (N,) signed curvature

Compatible with superellipse.PanelDiscretization.

References

  • Kress, R. (2014). Linear Integral Equations, 3rd ed. Springer.
  • Helsing, J. & Ojala, R. (2008). On the evaluation of layer potentials close to their sources. J. Comput. Phys. 227:2899–2921.

License

MIT License. See LICENSE for details.

Metadata

Release files for panel-bie 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for panel-bie 0.8.0
File Size Uploaded Provenance Actions
panel_bie-0.8.0.tar.gz 17.1 kB With provenance Details for panel_bie-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for panel-bie 0.8.0
File Interpreter ABI Platform Actions
panel_bie-0.8.0-py3-none-any.whl Python 3 none any Details for panel_bie-0.8.0-py3-none-any.whl

Total release size: 28.2 kB

Release files / panel_bie-0.8.0.tar.gz

Download URL panel_bie-0.8.0.tar.gz
Size 17.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f32bf8182d49ae61f8db0f491c0213e61871cc668b4061e4f59964049dec7f3e
BLAKE2b-256 checksum
How to use checksums
27ecfc4f2eab0d8cfb56e26f80af04d7a14c00fad0bdbe0244287ef4c1e0d025
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 26, 2026.

Transparency log

Release files / panel_bie-0.8.0-py3-none-any.whl

Download URL panel_bie-0.8.0-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
856c71e110f9c23f2453a82cd758139b7319bbbc76debea3c1494438d6d6211a
BLAKE2b-256 checksum
How to use checksums
13faec644da9805b563a1f8552ed7e63bdb308f00c00976a96e398726a22af97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 26, 2026.

Transparency log

Security for panel-bie 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for panel_bie-0.8.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page