Skip to main content

𝕌pdes

𝕌pdes is a general-purpose library for mesh-free PDE simulation and control.

Features

𝕌pdes leverages Radial Basis Functions (RBFs) and JAX to provide the following features:

  • User-centric design: no need to re-implement a solver for each new PDE
  • Lightning fast mesh-free simulation via Radial Basis Functions
  • Robust differentiable simulation via JAX, and portable across CPU, GPU, and TPU
  • Support for Dirichlet, Neumann, Robin, and Periodic boundary conditions
  • Automatic generation of normals from 2D GMSH meshes

𝕌pdes in incredibly extendable, with additional features added frequently.

Getting started

The package is available on PyPI. You can install it with

pip install updes

The example below illustrates how to solve the Laplace equation with Dirichlet and Neumann boundary conditions:

import updes
import jax.numpy as jnp

# Create a mesh-free cloud of points on a unit square
facet_types={"South":"n", "West":"d", "North":"d", "East":"d"}
cloud = updes.SquareCloud(Nx=30, Ny=20, facet_types=facet_types)

# Define the differential operator (left-hand side of the PDE)
def my_diff_operator(x, center, rbf, monomial, fields):
    return updes.nodal_laplacian(x, center, rbf, monomial)

# Define the right-hand side of the PDE
def my_rhs_operator(x, centers, rbf, fields):
    return 0.0

# Set a sin function as the Dirichlet BC on the North, and zero everywhere else
sine = lambda coord: jnp.sin(jnp.pi * coord[0])
zero = lambda coord: 0.0
boundary_conditions = {"South":zero, "West":zero, "North":sine, "East":zero}

# Solve the Laplace equation with a JIT-compiled solver
sol = updes.pde_solver_jit(diff_operator=my_diff_operator, 
                    rhs_operator=my_rhs_operator, 
                    cloud=cloud, 
                    boundary_conditions=boundary_conditions, 
                    rbf=updes.polyharmonic,
                    max_degree=1)

# Visualize the solution
cloud.visualize_field(sol.vals, cmap="jet", projection="3d", title="RBF solution")

𝕌pdes can handle much complicated cases with little to no modifications to the code above. Check out further notebooks and scripts in the documentation and the folder demos!

Dependencies

  • Core: JAX - GMSH - Lineax - Matplotlib - Seaborn - Scikit-Learn
  • Optional: PyVista - FFMPEG - QuartoDoc

See the pyproject.toml file the specific versions of the dependencies.

Cite us !

If you use this software, please cite us with the following BibTeX entry:

@inproceedings{nzoyem2023comparison,
  title={A comparison of mesh-free differentiable programming and data-driven strategies for optimal control under PDE constraints},
  author={Nzoyem Ngueguin, Roussel Desmond and Barton, David AW and Deakin, Tom},
  booktitle={Proceedings of the SC'23 Workshops of The International Conference on High Performance Computing, Network, Storage, and Analysis},
  pages={21--28},
  year={2023}}

Metadata

Release files for updes 1.0.2.post1

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

Source distribution (sdist)

Source distribution for updes 1.0.2.post1
File Size Uploaded
updes-1.0.2.post1.tar.gz 26.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for updes 1.0.2.post1
File Interpreter ABI Platform
updes-1.0.2.post1-py3-none-any.whl Python 3 none any Details

Total release size: 52.9 kB

Release files / updes-1.0.2.post1.tar.gz

Download URL updes-1.0.2.post1.tar.gz
Size 26.8 kB
Tags Source
SHA-256 checksum
How to use checksums
421ae8d6234011c501fdbf899ffd88f215cab72ed0cf17ca314a9691404e2459
BLAKE2b-256 checksum
How to use checksums
1d578a4e9d13c8b1fa52aa8388dbcd8cca976ff95820826f3b99668f30b067bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Release files / updes-1.0.2.post1-py3-none-any.whl

Download URL updes-1.0.2.post1-py3-none-any.whl
Size 26.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f7634843f2e7428d9973247bb510acc3980fba76e9bd1e921b358c087338aa0
BLAKE2b-256 checksum
How to use checksums
e860cb3f2dccd6f122179f8adf008c8de7d63389b6842bfdf10c321ef020c0e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Release history Release notifications | RSS feed

This release

1.0.2.post1 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

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