Skip to main content

Universal Partial Differential Equations Simulator

Project description

𝕌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}}

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

updes-1.0.2.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

updes-1.0.2-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file updes-1.0.2.tar.gz.

File metadata

  • Download URL: updes-1.0.2.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for updes-1.0.2.tar.gz
Algorithm Hash digest
SHA256 754faca126c65835f57edd463cc29382dc1254fd354f6166491195ca82f80d7e
MD5 ea718ed91947c78c7f956f364e546896
BLAKE2b-256 d57253d1115446c239fbee35631f0ab5c5c9af5ed2f622d0d8dff983894e6acf

See more details on using hashes here.

File details

Details for the file updes-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: updes-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for updes-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 203124e9f4afca903013a8f0ec19e71a0c31a9fd351b1c9dfbd8000ece797073
MD5 0b2b9348e53174121354d516b41c19f8
BLAKE2b-256 41cfbac0676f6d308a87ee7a7a6d1445cd3d09a610041d8e0ac15f81ef0091c7

See more details on using hashes here.

Supported by

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