PDE solvers using the Grid-Based Multinode Shepard Collocation method.
Project description
gbmsc-pde
gbmsc-pde is a Python package for solving linear PDEs on two-dimensional
rectangular domains with the Grid-Based Multinode Shepard Collocation Method
(GBMSC).
Version: 0.1.0
Method
GBMSC uses a structured source grid, samples local multinode tensor-product subgrids, builds local Lagrange interpolants on those subgrids, and blends the local interpolants with Shepard weights. PDE equations are enforced by collocation at source nodes, with sparse differential operators assembled from the blended approximation.
Features
- Structured 2D source-grid generation.
- Local multinode Lagrange interpolation on sliding subgrids.
- Shepard blending of local approximants.
- Sparse first- and second-derivative operators.
- Linear PDE assembly with diffusion, convection, reaction, and source terms.
- Dirichlet, Neumann, and Robin boundary-condition helpers.
- Direct, CG, and GMRES sparse linear solvers.
- Exact-nodal interpolation mode for source-node reconstruction.
Installation
Install from a local checkout:
pip install .
For development:
pip install -e ".[dev]"
For documentation tooling:
pip install -e ".[docs]"
For plotting support:
pip install ".[plot]"
Quick Start
import numpy as np
from gbmsc_pde import (
BoundaryConditions,
GBMSCApproximation,
LinearPDE,
LinearSolver,
SourceGrid,
)
grid = SourceGrid(grid_shape=(21, 21), subgrid_shape=(5, 5))
approximation = GBMSCApproximation(grid, step=(4, 4), support_mode="nodal_limit")
pde = LinearPDE(approximation)
pde.add_diffusion_term(-1.0)
pde.add_source_term(lambda x, y: np.ones_like(x))
bcs = BoundaryConditions(grid)
bcs.add_dirichlet(grid.boundary_indices()["all"], 0.0)
u = LinearSolver(pde, bcs).solve()
solution_grid = u.reshape(grid.grid_shape)
grid.plot(solution_grid, view="2d")
The step must align with the local subgrid size:
N_x = step_x * k_x + n_x
N_y = step_y * k_y + n_y
for integer k_x and k_y.
Public API
Preferred names:
from gbmsc_pde import (
SourceGrid,
GBMSCApproximation,
BoundaryConditions,
LinearPDE,
LinearSolver,
)
New code should use these names consistently: SourceGrid,
GBMSCApproximation, BoundaryConditions, LinearPDE, and LinearSolver.
Project Layout
src/
gbmsc_pde/
approximation/ GBMSC approximation and interpolation routines
boundary/ Boundary-condition containers and appliers
source_grid/ Structured source-grid utilities
operators/ Sparse differential-operator builders
pde/ Linear PDE terms and assembly
solvers/ Linear solvers
Development
Run tests:
pytest
Run lightweight lint checks:
ruff check src tests examples/gbmsc_pde/*.py
Build source and wheel distributions:
python -m build
Check package metadata before uploading:
twine check dist/*
Build the documentation site:
mkdocs build
See CONTRIBUTING.md for the full release checklist.
Contribution Policy
This project is currently not accepting external contributions. Issues and pull requests may be used by the maintainer for project tracking, but there is no expectation that external contributions will be reviewed or merged.
Versioning
This project uses semantic versioning. The first public release is 0.1.0.
Citation
If this package supports academic work, please cite it using the metadata in
CITATION.cff. If you also use the underlying numerical method, cite the
method preprint as described in the documentation citation page.
License
Distributed under the Apache License 2.0. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gbmsc_pde-0.1.0.tar.gz.
File metadata
- Download URL: gbmsc_pde-0.1.0.tar.gz
- Upload date:
- Size: 62.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49e74b2b2789a4e50ab59a1b14e07c2ceef1d2e3051d3439638ea13013db767e
|
|
| MD5 |
293608603605d5e096660a1326850766
|
|
| BLAKE2b-256 |
365dc1aef585af1850b498e84bb6a16b1d82bbdb38cf52de0cb306c2c2ca1732
|
Provenance
The following attestation bundles were made for gbmsc_pde-0.1.0.tar.gz:
Publisher:
publish.yml on e-anouar/gbmsc-pde
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gbmsc_pde-0.1.0.tar.gz -
Subject digest:
49e74b2b2789a4e50ab59a1b14e07c2ceef1d2e3051d3439638ea13013db767e - Sigstore transparency entry: 1792036689
- Sigstore integration time:
-
Permalink:
e-anouar/gbmsc-pde@56936695c51b38ad542d4eb8aef2716d2685ac8a -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/e-anouar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@56936695c51b38ad542d4eb8aef2716d2685ac8a -
Trigger Event:
push
-
Statement type:
File details
Details for the file gbmsc_pde-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gbmsc_pde-0.1.0-py3-none-any.whl
- Upload date:
- Size: 32.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
629a832b7bc820e2a3582143d88521571ffabcc66ecc61d11e3493102a025e49
|
|
| MD5 |
40f4cab8a57f12ff510e819a126c4152
|
|
| BLAKE2b-256 |
b53f540af209fdb2b678e8b02619db6b807548f790ceafb8aa02abd449277016
|
Provenance
The following attestation bundles were made for gbmsc_pde-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on e-anouar/gbmsc-pde
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gbmsc_pde-0.1.0-py3-none-any.whl -
Subject digest:
629a832b7bc820e2a3582143d88521571ffabcc66ecc61d11e3493102a025e49 - Sigstore transparency entry: 1792036738
- Sigstore integration time:
-
Permalink:
e-anouar/gbmsc-pde@56936695c51b38ad542d4eb8aef2716d2685ac8a -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/e-anouar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@56936695c51b38ad542d4eb8aef2716d2685ac8a -
Trigger Event:
push
-
Statement type: