Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update examples #9

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 11 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


<p align="center">
<img alt="Header image of pinnx." src="https://github.com/chaobrain/pinnx/blob/main/docs/_static/pinnx.png" width=50%>
<img alt="Header image of pinnx." src="https://github.com/chaobrain/pinnx/blob/main/docs/_static/pinnx.png" width=40%>
</p>


Expand All @@ -11,8 +11,8 @@
[![PyPI Version](https://badge.fury.io/py/pinnx.svg)](https://badge.fury.io/py/pinnx)
[![License](https://img.shields.io/github/license/chaobrain/pinnx)](https://github.com/chaobrain/pinnx/blob/master/LICENSE)

``PINNx`` is a library for scientific machine learning and physics-informed learning.
It is rewritten according to [DeepXDE](https://github.com/lululxvi/deepxde) but is enhanced by our
``PINNx`` is a library for scientific machine learning and physics-informed learning in JAX.
It is inspired from [DeepXDE](https://github.com/lululxvi/deepxde) but is enhanced by our
[Brain Dynamics Programming (BDP) ecosystem](https://ecosystem-for-brain-dynamics.readthedocs.io/).
For example, it leverages

Expand All @@ -21,34 +21,14 @@ For example, it leverages
- [braintools](https://braintools.readthedocs.io/) for checkpointing, loss functions, and other utilities.


## Algorithms


``PINNx`` implements the following algorithms, but with the flexibility and efficiency of JAX:

- solving different PINN problems
- solving forward/inverse ordinary/partial differential equations (ODEs/PDEs) [[SIAM Rev.](https://doi.org/10.1137/19M1274067)]
- solving forward/inverse integro-differential equations (IDEs) [[SIAM Rev.](https://doi.org/10.1137/19M1274067)]
- fPINN: solving forward/inverse fractional PDEs (fPDEs) [[SIAM J. Sci. Comput.](https://doi.org/10.1137/18M1229845)]
- NN-arbitrary polynomial chaos (NN-aPC): solving forward/inverse stochastic PDEs (sPDEs) [[J. Comput. Phys.](https://doi.org/10.1016/j.jcp.2019.07.048)]
- PINN with hard constraints (hPINN): solving inverse design/topology optimization [[SIAM J. Sci. Comput.](https://doi.org/10.1137/21M1397908)]
- improving PINN accuracy
- residual-based adaptive
sampling [[SIAM Rev.](https://doi.org/10.1137/19M1274067), [Comput. Methods Appl. Mech. Eng.](https://doi.org/10.1016/j.cma.2022.115671)]
- gradient-enhanced PINN (gPINN) [[Comput. Methods Appl. Mech. Eng.](https://doi.org/10.1016/j.cma.2022.114823)]
- PINN with multi-scale Fourier features [[Comput. Methods Appl. Mech. Eng.](https://doi.org/10.1016/j.cma.2021.113938)]
- (physics-informed) deep operator network (DeepONet)
- DeepONet: learning operators [[Nat. Mach. Intell.](https://doi.org/10.1038/s42256-021-00302-5)]
- DeepONet extensions, e.g., POD-DeepONet [[Comput. Methods Appl. Mech. Eng.](https://doi.org/10.1016/j.cma.2022.114778)]
- MIONet: learning multiple-input operators [[SIAM J. Sci. Comput.](https://doi.org/10.1137/22M1477751)]
- Fourier-DeepONet [[Comput. Methods Appl. Mech. Eng.](https://doi.org/10.1016/j.cma.2023.116300)],
Fourier-MIONet [[arXiv](https://arxiv.org/abs/2303.04778)]
- physics-informed DeepONet [[Sci. Adv.](https://doi.org/10.1126/sciadv.abi8605)]
- multifidelity DeepONet [[Phys. Rev. Research](https://doi.org/10.1103/PhysRevResearch.4.023210)]
- DeepM&Mnet: solving multiphysics and multiscale problems [[J. Comput. Phys.](https://doi.org/10.1016/j.jcp.2021.110296), [J. Comput. Phys.](https://doi.org/10.1016/j.jcp.2021.110698)]
- Reliable extrapolation [[Comput. Methods Appl. Mech. Eng.](https://doi.org/10.1016/j.cma.2023.116064)]
- multifidelity neural network (MFNN)
- learning from multifidelity data [[J. Comput. Phys.](https://doi.org/10.1016/j.jcp.2019.109020), [PNAS](https://doi.org/10.1073/pnas.1922210117)]
## Quickstart


```python

```



## Installation

Expand Down
4 changes: 2 additions & 2 deletions docs/about.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
More Information about PINNx
=============================
About ``PINNx``
===============

`PINNx <https://github.com/chaobrain/pinnx>`_ is a library for scientific machine learning and physics-informed learning.
It is rewritten according to `DeepXDE <https://github.com/lululxvi/deepxde>`_ but is enhanced by our
Expand Down
11 changes: 0 additions & 11 deletions docs/examples-unit.rst

This file was deleted.

12 changes: 6 additions & 6 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ User guide
.. toctree::
:maxdepth: 1

examples-unit.rst
examples-unitless.rst
about.rst

About PINNx
^^^^^^^^^^^

.. toctree::
:maxdepth: 1
:maxdepth: 2

examples-unit.rst
examples-unitless.rst


about.rst


See also the BDP ecosystem
Expand Down
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
12 changes: 12 additions & 0 deletions docs/unit-examples-forward.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
PINN Forward Examples
=====================

.. toctree::
:maxdepth: 1

unit-examples-forward/Burgers.ipynb
unit-examples-forward/Burgers_RAR.ipynb
unit-examples-forward/heat.ipynb
unit-examples-forward/heat_resample.ipynb
unit-examples-forward/Laplace_disk.ipynb

Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
"\n",
"## Problem setup\n",
"We will solve a heat equation:\n",
"\n",
"$$\n",
"\\frac{\\partial u}{\\partial t}=\\alpha \\frac{\\partial^2u}{\\partial x^2}, \\qquad x \\in [0, 1], \\quad t \\in [0, 1]\n",
"$$\n",
"\n",
"where $alpha=0.4$ is the thermal diffusivity constant.\n",
"\n",
"With Dirichlet boundary conditions:\n",
Expand All @@ -20,6 +22,7 @@
"$$\n",
"\n",
"and periodic(sinusoidal) inital condition:\n",
"\n",
"$$\n",
"u(x,0) = \\sin (\\frac{n\\pi x}{L}),\\qquad 0<x<L, \\quad n = 1,2,.....\n",
"$$\n",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
"\n",
"## Problem setup\n",
"We will solve a heat equation:\n",
"\n",
"$$\n",
"\\frac{\\partial u}{\\partial t}=\\alpha \\frac{\\partial^2u}{\\partial x^2}, \\qquad x \\in [0, 1], \\quad t \\in [0, 1]\n",
"$$\n",
"\n",
"where $alpha=0.4$ is the thermal diffusivity constant.\n",
"\n",
"With Dirichlet boundary conditions:\n",
Expand All @@ -20,6 +22,7 @@
"$$\n",
"\n",
"and periodic(sinusoidal) inital condition:\n",
"\n",
"$$\n",
"u(x,0) = \\sin (\\frac{n\\pi x}{L}),\\qquad 0<x<L, \\quad n = 1,2,.....\n",
"$$\n",
Expand Down
24 changes: 0 additions & 24 deletions pinnx/nn/output.py

This file was deleted.

Loading