updes


Nameupdes JSON
Version 1.0.1.post0 PyPI version JSON
download
home_pageNone
SummaryUniversal Partial Differential Equations Simulator
upload_time2024-04-18 13:17:04
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseNone
keywords differentiable-programming radial-basis-function meshfree optimisation differentiable-physics pdes
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 𝕌pdes

𝕌pdes is a general-purpose library for mesh-free PDE simulation and control.
- GitHub project: https://github.com/ddrous/Updes
- Documentation: https://ddrous.github.io/Updes/


## 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:
```python
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](https://ddrous.github.io/Updes/) and the folder [`demos`](./demos)!


## Dependencies
- **Core**: JAX - GMSH - 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}}
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "updes",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "differentiable-programming, radial-basis-function, meshfree, optimisation, differentiable-physics, PDEs",
    "author": null,
    "author_email": "Roussel Desmond Nzoyem <desmond.ngueguin@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/32/e9/0ddeffffdff8ee85d63458e2876493bb6cee92ba12524bedbe26e350d308/updes-1.0.1.post0.tar.gz",
    "platform": null,
    "description": "# \ud835\udd4cpdes\n\n\ud835\udd4cpdes is a general-purpose library for mesh-free PDE simulation and control.\n- GitHub project: https://github.com/ddrous/Updes\n- Documentation: https://ddrous.github.io/Updes/\n\n\n## Features\n\ud835\udd4cpdes leverages Radial Basis Functions (RBFs) and JAX to provide the following features:\n- User-centric design: no need to re-implement a solver for each new PDE\n- Lightning fast mesh-free simulation via Radial Basis Functions\n- Robust differentiable simulation via JAX, and portable across CPU, GPU, and TPU\n- Support for Dirichlet, Neumann, Robin, and Periodic boundary conditions\n- Automatic generation of normals from 2D GMSH meshes\n\n\ud835\udd4cpdes in incredibly extendable, with additional features added frequently.\n\n\n## Getting started\nThe package is available on PyPi. You can install it with\n```\npip install updes\n```\n\nThe example below illustrates how to solve the Laplace equation with Dirichlet and Neumann boundary conditions:\n```python\nimport updes\nimport jax.numpy as jnp\n\n# Create a mesh-free cloud of points on a unit square\nfacet_types={\"South\":\"n\", \"West\":\"d\", \"North\":\"d\", \"East\":\"d\"}\ncloud = updes.SquareCloud(Nx=30, Ny=20, facet_types=facet_types)\n\n# Define the differential operator (left-hand side of the PDE)\ndef my_diff_operator(x, center, rbf, monomial, fields):\n    return updes.nodal_laplacian(x, center, rbf, monomial)\n\n# Define the right-hand side of the PDE\ndef my_rhs_operator(x, centers, rbf, fields):\n    return 0.0\n\n# Set a sin function as the Dirichlet BC on the North, and zero everywhere else\nsine = lambda coord: jnp.sin(jnp.pi * coord[0])\nzero = lambda coord: 0.0\nboundary_conditions = {\"South\":zero, \"West\":zero, \"North\":sine, \"East\":zero}\n\n# Solve the Laplace equation with a JIT-compiled solver\nsol = updes.pde_solver_jit(diff_operator=my_diff_operator, \n                    rhs_operator=my_rhs_operator, \n                    cloud=cloud, \n                    boundary_conditions=boundary_conditions, \n                    rbf=updes.polyharmonic,\n                    max_degree=1)\n\n# Visualize the solution\ncloud.visualize_field(sol.vals, cmap=\"jet\", projection=\"3d\", title=\"RBF solution\")\n```\n\n\ud835\udd4cpdes can handle much complicated cases with little to no modifications to the code above. Check out further notebooks and scripts in the [documentation](https://ddrous.github.io/Updes/) and the folder [`demos`](./demos)!\n\n\n## Dependencies\n- **Core**: JAX - GMSH - Matplotlib - Seaborn - Scikit-Learn\n- **Optional**: PyVista - FFMPEG - QuartoDoc\n\nSee the `pyproject.toml` file the specific versions of the dependencies.\n\n\n## Cite us !\nIf you use this software, please cite us with the following BibTeX entry:\n```\n@inproceedings{nzoyem2023comparison,\n  title={A comparison of mesh-free differentiable programming and data-driven strategies for optimal control under PDE constraints},\n  author={Nzoyem Ngueguin, Roussel Desmond and Barton, David AW and Deakin, Tom},\n  booktitle={Proceedings of the SC'23 Workshops of The International Conference on High Performance Computing, Network, Storage, and Analysis},\n  pages={21--28},\n  year={2023}}\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Universal Partial Differential Equations Simulator",
    "version": "1.0.1.post0",
    "project_urls": null,
    "split_keywords": [
        "differentiable-programming",
        " radial-basis-function",
        " meshfree",
        " optimisation",
        " differentiable-physics",
        " pdes"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "29fa7014cdc47e890ae6f2e9d41f258f8e968c473acc8a4789239f256e9d6297",
                "md5": "8bbd7318bf1e5d0539c4d4f08dc9db26",
                "sha256": "2af083c8bd2d298db94564c50d0fc10b7f93e4a90751355fe68565875657c35a"
            },
            "downloads": -1,
            "filename": "updes-1.0.1.post0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8bbd7318bf1e5d0539c4d4f08dc9db26",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 9755,
            "upload_time": "2024-04-18T13:17:02",
            "upload_time_iso_8601": "2024-04-18T13:17:02.967566Z",
            "url": "https://files.pythonhosted.org/packages/29/fa/7014cdc47e890ae6f2e9d41f258f8e968c473acc8a4789239f256e9d6297/updes-1.0.1.post0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "32e90ddeffffdff8ee85d63458e2876493bb6cee92ba12524bedbe26e350d308",
                "md5": "6b9230026ddb645ccef54a1522803255",
                "sha256": "9e24161d2086817b4ca5b658682075454738e2c40d47840155ffe9aeb794d280"
            },
            "downloads": -1,
            "filename": "updes-1.0.1.post0.tar.gz",
            "has_sig": false,
            "md5_digest": "6b9230026ddb645ccef54a1522803255",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 10274,
            "upload_time": "2024-04-18T13:17:04",
            "upload_time_iso_8601": "2024-04-18T13:17:04.682607Z",
            "url": "https://files.pythonhosted.org/packages/32/e9/0ddeffffdff8ee85d63458e2876493bb6cee92ba12524bedbe26e350d308/updes-1.0.1.post0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-18 13:17:04",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "updes"
}
        
Elapsed time: 0.23151s