Skip to main content

Panel-based boundary integral equation solvers for 2D Laplace and Stokes problems

Project description

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])

CLI

# Solve Dirichlet problem from geometry file
panel-bie solve --geometry curve.json --bc "x**2 - y**2" --eval 0,0

# Compute condition number of discretized operator
panel-bie condition --geometry curve.json --panels 8 --nodes 16

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

panel_bie-0.5.0.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

panel_bie-0.5.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file panel_bie-0.5.0.tar.gz.

File metadata

  • Download URL: panel_bie-0.5.0.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for panel_bie-0.5.0.tar.gz
Algorithm Hash digest
SHA256 4ddfbba41033224033f336ba5ac77e622d815786bd2f409dce9dd2e7c54a1569
MD5 b40325f2fc70e86da38b22dd9b575e3d
BLAKE2b-256 1bb492b3fe7764825fadbaa1152d80e91371ff949ff86e2bec45d76b7b8c8cf7

See more details on using hashes here.

Provenance

The following attestation bundles were made for panel_bie-0.5.0.tar.gz:

Publisher: release.yml on egoughnour/panel-bie

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file panel_bie-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: panel_bie-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for panel_bie-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6d0d83f61b3abe108fb5d6fb85c0492e3b96089e0f0476f6c82f5702cdaa657f
MD5 689bc66b25ed9dc9ee0f07cf928618c0
BLAKE2b-256 52084ddc92c72cd3dba5c4b2b96c7f43ff5ad6b7ffc4bdda824ae154d39fe15f

See more details on using hashes here.

Provenance

The following attestation bundles were made for panel_bie-0.5.0-py3-none-any.whl:

Publisher: release.yml on egoughnour/panel-bie

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page