Skip to main content

RBFLAB

From geometry to equations, with radial basis functions.

Build labeled 2D and 3D point clouds, write equations with SymPy, and choose global collocation, local Hermite interpolation or RBF-FD. Inspect local weights and sparse matrices when you want to go beyond the high-level API.

Read the manual · Geometry cookbook · Mathematical foundations · API reference

Actual generated clouds: obstacles, curved holes, a concave polygon and a 3D volume

Install and start

python -m pip install rbflab
# Optional plots and animations:
python -m pip install "rbflab[examples]"

The Python core needs no compiler, Gmsh or tensor framework. Geometry generation is built in. See the installation guide for optional backends and exact dependencies. The new polygon and hole-composition helpers below require RBFLAB 0.3 or newer.

One domain. One equation. A numerical solution.

Solve Poisson's equation on an ellipse with two holes. Here a known solution, sin(x)*cos(y), supplies boundary data and lets us check the numerical error.

import sympy as sp
import rbflab as rbf
from rbflab import geometry, meshgen

domain = geometry.with_holes(
    geometry.Ellipse(1.6, 1., labels=("wall",)),
    {"round_hole": geometry.Disk(.28, center=(-.65, 0)),
     "slot": geometry.Ellipse(.24, .43, center=(.6, 0), angle=-.3)},
)
cloud = meshgen.generate(domain, interior=500,
    boundary={"wall": 120, "round_hole": 32, "slot": 40}, seed=42)

model = rbf.SymbolicScalar(2)
u = model.field
x, y = model.coordinates
exact = sp.sin(x)*sp.cos(y)
problem = model.stationary(
    sp.Eq(-model.laplacian(u), 2*exact),
    boundary=[model.bc(label, sp.Eq(u, exact)) for label in domain.boundaries],
)
method = rbf.RBFFD(rbf.PHS(5), 35, polynomial_degree=3,
    stencil_policy=rbf.StencilPolicy(scaling="local"),
    local_backend=rbf.PythonBackend(compute_condition=False))
solution = problem.solve(cloud, method)
print(solution.evaluate([[0., 0.], [0., .5]]))

Generated labeled nodes and the computed solution on a perforated ellipse

With this 692-node recipe, the Float64 Python run gives maximum nodal error 3.77 × 10⁻⁵ and independent off-node error 3.86 × 10⁻⁵. Read the step-by-step tutorial for the mathematics, plotting, and checks on independent clouds.

Plotting stays short:

from rbflab import viz
fig, ax = viz.plot_scalar(solution, domain=domain, title="Poisson / two holes")
fig.savefig("solution.png", dpi=180)

See the methods at work

Computed heat evolution on a flower-shaped domain Computed velocity streamlines between rotating cylinders
Heat on a flower
Symbolic forcing, BDF2 time stepping and animation.
Stokes between cylinders
Divergence-free velocity spaces on a curved domain.
Explore Learn to use
Geometry cookbook Named walls, holes, concave polygons and 3D volumes
One local stencil Approximation, differentiation weights and sparse rows
Heat from matrices Finite differences, RBF-FD and time integration
Mixed conditions Dirichlet, Neumann and Robin data on curved boundaries
Compare methods Global collocation and local Hermite interpolation
Poisson in a ball 3D scalar operators and independent error checks
Custom kernels Symbolic kernels, derivatives and optional C++ compilation
Navier–Stokes cavity An experimental staggered-flow showcase with documented limitations

Choose a backend; keep the problem

Backend Installation Role
Python / NumPy / SciPy pip install rbflab Default numerical implementation
C++ / Eigen Source-build setup Supported local assembly in Float64 or MPFR
PyTorch pip install "rbflab[torch]" Supported local tensor assembly; documented CPU Float64 path
Gmsh (optional geometry) pip install "rbflab[mesh]" Tagged meshes and explicit staggered layouts

From a source checkout, run the same example with a different local backend:

python -m examples.poisson_perforated --backend python --plot solution.png
python -m examples.poisson_perforated --backend cpp
python -m examples.poisson_perforated --backend torch

The example prepares compiled/tensor kernels before assembly. Its global sparse solve uses SciPy Float64. Backend coverage and precision differ by method; see capabilities. Small problems do not necessarily run faster with extra threads or a tensor backend.

Research tools with explicit limits

  • Use PointCloud with your own coordinates, or generate labeled nodes in RBFLAB. The sampler does not enforce minimum inter-node separation.
  • Access discrete operators, sparse matrices, local weights and reconstruction diagnostics. Keep algebraic residuals separate from solution and PDE errors.
  • Divergence-free Stokes spaces build incompressibility into the velocity kernel. LHI pressure-gradient reconstruction and nearest-stencil off-node evaluation have their own accuracy limits.
  • Extended-precision local weights do not automatically make a global sparse solve extended precision. The cavity showcase is not a validated general Navier–Stokes solver.

Contribute and reproduce

Source code lives in python/rbflab, runnable examples in examples, and focused regression tests in tests. Gallery figures are reproducible from geometry_gallery.py and make_method_gallery.py.

Maintaining the documentation · Changelog · MIT license

Metadata

Release files for rbflab 0.3.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 rbflab 0.3.0
File Size Uploaded Provenance Actions
rbflab-0.3.0.tar.gz 7.2 MB With provenance Details for rbflab-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rbflab 0.3.0
File Interpreter ABI Platform Actions
rbflab-0.3.0-py3-none-any.whl Python 3 none any Details for rbflab-0.3.0-py3-none-any.whl

Total release size: 7.4 MB

Release files / rbflab-0.3.0.tar.gz

Download URL rbflab-0.3.0.tar.gz
Size 7.2 MB
Tags Source
SHA-256 checksum
How to use checksums
fc9388d227bae004c415c9048752699c4c066f51b44d2368f879c4ed38400810
BLAKE2b-256 checksum
How to use checksums
6bd5f17831e140385cd1a3eb839bfd189dcf002ce15706fc2e1e2e8cc7743f3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 9, 2026.

Transparency log

Release files / rbflab-0.3.0-py3-none-any.whl

Download URL rbflab-0.3.0-py3-none-any.whl
Size 177.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26e2465e632b0b5d65937858a057e4278edca54a974c46907615114bc1a8a1ac
BLAKE2b-256 checksum
How to use checksums
d3737d2096723a871e337d42ef389a65ef5c9da4fc125fbcf76ae249e84da305
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 9, 2026.

Transparency log

Security for rbflab 0.3.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for rbflab-0.3.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 Oct 9, 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