From ab2b264b9a5effa655f618b1f497f2c2b33e7fec Mon Sep 17 00:00:00 2001 From: nick7 Date: Thu, 9 Nov 2023 10:15:16 +0100 Subject: [PATCH 1/3] Add reference to survey paper in readme Signed-off-by: nick7 --- README.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.rst b/README.rst index 7baa893f..7cb9c461 100644 --- a/README.rst +++ b/README.rst @@ -133,6 +133,23 @@ since we aim to develop a reliable code basis and extend the library to include .. _GitHub: https://github.com/boschresearch/torchphysics +Cite TorchPhysics +================= +If TorchPhysics has been helpful for your research, please cite: + +.. code-block:: latex + + @article{TorchPhysics, + author = {Derick Nganyu Tanyu and Jianfeng Ning and Tom Freudenberg and Nick Heilenkötter and Andreas Rademacher and Uwe Iben and Peter Maass}, + title = {Deep learning methods for partial differential equations and related parameter identification problems}, + journal = {Inverse Problems}, + doi = {10.1088/1361-6420/ace9d4}, + year = {2023}, + publisher = {IOP Publishing}, + volume = {39}, + number = {10}, + pages = {103001}} + License ======= TorchPhysics uses an Apache License, see the LICENSE_ file. From 8a90383e1da459249f68b1a5499bf08f98b2acc3 Mon Sep 17 00:00:00 2001 From: nick7 Date: Tue, 28 Nov 2023 14:19:23 +0100 Subject: [PATCH 2/3] fix branch input size for multi-channel inputs Signed-off-by: nick7 --- src/torchphysics/models/deeponet/branchnets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/torchphysics/models/deeponet/branchnets.py b/src/torchphysics/models/deeponet/branchnets.py index 05d34d0a..e8c30c5f 100644 --- a/src/torchphysics/models/deeponet/branchnets.py +++ b/src/torchphysics/models/deeponet/branchnets.py @@ -25,7 +25,7 @@ def __init__(self, function_space, discretization_sampler): super().__init__(function_space, output_space=None) self.output_neurons = 0 self.discretization_sampler = discretization_sampler - self.input_dim = len(self.discretization_sampler) + self.input_dim = len(self.discretization_sampler) * function_space.output_space.dim self.current_out = torch.empty(0) def finalize(self, output_space, output_neurons): From ba06977986cf6edb7db0bf9ac8e378479742a053 Mon Sep 17 00:00:00 2001 From: Tom Freudenberg Date: Fri, 1 Mar 2024 09:52:07 +0100 Subject: [PATCH 3/3] fix links in docs Signed-off-by: Tom Freudenberg --- .gitignore | 4 +++- README.rst | 4 ++-- docs/tutorial/applied_tutorial_start.rst | 2 +- docs/tutorial/condition_tutorial.rst | 2 +- docs/tutorial/differentialoperators.rst | 2 +- docs/tutorial/model_creation.rst | 2 +- docs/tutorial/sampler_tutorial.rst | 2 +- docs/tutorial/solve_pde.rst | 2 +- docs/tutorial/tutorial_domain_basics.rst | 2 +- docs/tutorial/tutorial_start.rst | 2 +- examples/tutorial/solve_pde.ipynb | 2 +- examples/tutorial/solve_pde_drm.ipynb | 2 +- examples/workshop/Exercise3_2.ipynb | 2 +- examples/workshop/Sol3_2.ipynb | 2 +- setup.cfg | 2 +- src/torchphysics/problem/conditions/__init__.py | 2 +- 16 files changed, 19 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index f24bb887..2ae8dbdb 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,9 @@ __pycache__/* # Log folders **/lightning_logs/** - +**/fluid_logs/** +**/Multiscale/** +**/bosch/** # Project files .ropeproject .project diff --git a/README.rst b/README.rst index 7baa893f..75c9da53 100644 --- a/README.rst +++ b/README.rst @@ -71,9 +71,9 @@ to have a look at the following sections: - `Examples: Different applications with detailed explanations`_ - Documentation_ -.. _`Tutorial: Understanding the structure of TorchPhysics`: https://torchphysics.readthedocs.io/en/latest/tutorial/tutorial_start.html +.. _`Tutorial: Understanding the structure of TorchPhysics`: https://boschresearch.github.io/torchphysics/tutorial/tutorial_start.html .. _`Examples: Different applications with detailed explanations`: https://github.com/boschresearch/torchphysics/tree/main/examples -.. _Documentation: https://torchphysics.readthedocs.io/en/latest/api/modules.html +.. _Documentation: https://boschresearch.github.io/torchphysics/index.html Installation diff --git a/docs/tutorial/applied_tutorial_start.rst b/docs/tutorial/applied_tutorial_start.rst index e5cdc613..6e7adb62 100644 --- a/docs/tutorial/applied_tutorial_start.rst +++ b/docs/tutorial/applied_tutorial_start.rst @@ -42,4 +42,4 @@ More applications can be found on the `example page`_. .. _`PINNs for Poisson`: https://github.com/boschresearch/torchphysics/blob/main/examples/tutorial/solve_pde.ipynb .. _`DRM for Poisson`: https://github.com/boschresearch/torchphysics/blob/main/examples/tutorial/solve_pde_drm.ipynb -.. _`example page`: https://torchphysics.readthedocs.io/en/latest/examples.html \ No newline at end of file +.. _`example page`: https://boschresearch.github.io/torchphysics/examples.html \ No newline at end of file diff --git a/docs/tutorial/condition_tutorial.rst b/docs/tutorial/condition_tutorial.rst index d0ac1d25..c00b3fbd 100644 --- a/docs/tutorial/condition_tutorial.rst +++ b/docs/tutorial/condition_tutorial.rst @@ -8,7 +8,7 @@ Many kinds of conditions are pre implemented, they can be found in the docs_. Depending on the used type, the condition get different inputs. The five arguments that almost all conditions need, are: -.. _docs: https://torchphysics.readthedocs.io/en/latest/api/torchphysics.problem.conditions.html +.. _docs: https://boschresearch.github.io/torchphysics/api/torchphysics.problem.conditions.html module Your model that should be trained, with the condition you are creating. The definition diff --git a/docs/tutorial/differentialoperators.rst b/docs/tutorial/differentialoperators.rst index abcd7a6c..1f4516d9 100644 --- a/docs/tutorial/differentialoperators.rst +++ b/docs/tutorial/differentialoperators.rst @@ -27,7 +27,7 @@ entry is specified. E.g. :math:`u: \mathbb{R}^3 \to \mathbb{R}^3` then do ``laplacian`` (:math:`u[:, 0], x`), to get the laplacian of the first entry. The newest version of all implemented operators can be found under the docs_. -.. _docs: https://torchphysics.readthedocs.io/en/latest/api/torchphysics.utils.html +.. _docs: https://boschresearch.github.io/torchphysics/api/torchphysics.utils.html Since ``autograd`` is used, the differential operators can work with neural networks and functions that use PyTorch-Tensors. It follow a short example of the usage: diff --git a/docs/tutorial/model_creation.rst b/docs/tutorial/model_creation.rst index 9f5dcf3d..6abcda34 100644 --- a/docs/tutorial/model_creation.rst +++ b/docs/tutorial/model_creation.rst @@ -6,7 +6,7 @@ What basics network structures are implemented, can be found under the `model-do All networks can found under ``torchphysics.models``. For example, a simple fully connected neural network can be created with: -.. _`model-docs`: https://torchphysics.readthedocs.io/en/latest/api/torchphysics.models.html +.. _`model-docs`: https://boschresearch.github.io/torchphysics/api/torchphysics.models.html .. code-block:: python diff --git a/docs/tutorial/sampler_tutorial.rst b/docs/tutorial/sampler_tutorial.rst index c837899f..1a5aab11 100644 --- a/docs/tutorial/sampler_tutorial.rst +++ b/docs/tutorial/sampler_tutorial.rst @@ -13,7 +13,7 @@ are implemented, for example: And many more, see `sampler-docs`_. The samplers lay all under ``torchphysics.samplers``. -.. _`sampler-docs`: https://torchphysics.readthedocs.io/en/latest/api/torchphysics.problem.samplers.html +.. _`sampler-docs`: https://boschresearch.github.io/torchphysics/api/torchphysics.problem.samplers.html In general, a sampler gets the following arguments: diff --git a/docs/tutorial/solve_pde.rst b/docs/tutorial/solve_pde.rst index 99e3b17c..f8df86cb 100644 --- a/docs/tutorial/solve_pde.rst +++ b/docs/tutorial/solve_pde.rst @@ -209,4 +209,4 @@ be found under the `example-folder`_. And more in-depth information can be found on the `tutorial page`_. .. _`example-folder`: https://github.com/boschresearch/torchphysics/tree/main/examples -.. _`tutorial page`: https://torchphysics.readthedocs.io/en/latest/tutorial/tutorial_start.html \ No newline at end of file +.. _`tutorial page`: https://boschresearch.github.io/torchphysics/tutorial/tutorial_start.html \ No newline at end of file diff --git a/docs/tutorial/tutorial_domain_basics.rst b/docs/tutorial/tutorial_domain_basics.rst index a27428b0..9705d022 100644 --- a/docs/tutorial/tutorial_domain_basics.rst +++ b/docs/tutorial/tutorial_domain_basics.rst @@ -16,7 +16,7 @@ For explicit documentation of each method and all implemented domains, see the d All domains can be found under ``torchphysics.domains``. Some pre implemented domains are: ``Point, Interval, Parallelogram, Circle...`` -.. _docs: https://torchphysics.readthedocs.io/en/latest/api/torchphysics.problem.domains.html +.. _docs: https://boschresearch.github.io/torchphysics/api/torchphysics.problem.domains.html Here we focus now on the creation of different domains. To create a domain, we need a space to which the domain belongs. diff --git a/docs/tutorial/tutorial_start.rst b/docs/tutorial/tutorial_start.rst index 951cab0c..05f8f53c 100644 --- a/docs/tutorial/tutorial_start.rst +++ b/docs/tutorial/tutorial_start.rst @@ -62,7 +62,7 @@ Utils .. _`PointSampler tutorial`: sampler_tutorial.html .. _`model creation tutorial`: model_creation.html .. _`condition tutorial`: condition_tutorial.html -.. _docs: https://torchphysics.readthedocs.io/en/latest/api/torchphysics.utils.html +.. _docs: https://boschresearch.github.io/torchphysics/api/torchphysics.utils.html .. _`differential operators`: differentialoperators.html .. _`Creating plots`: plotting.html .. _`solving a simple PDE`: solve_pde.html diff --git a/examples/tutorial/solve_pde.ipynb b/examples/tutorial/solve_pde.ipynb index c8b576fd..6d81b74c 100644 --- a/examples/tutorial/solve_pde.ipynb +++ b/examples/tutorial/solve_pde.ipynb @@ -478,7 +478,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.15 (main, Nov 4 2022, 16:13:54) \n[GCC 11.2.0]" + "version": "3.9.15" }, "orig_nbformat": 4 }, diff --git a/examples/tutorial/solve_pde_drm.ipynb b/examples/tutorial/solve_pde_drm.ipynb index e9cd6bb7..5a936b4a 100644 --- a/examples/tutorial/solve_pde_drm.ipynb +++ b/examples/tutorial/solve_pde_drm.ipynb @@ -6,7 +6,7 @@ "source": [ "Solving a simple PDE with the DeepRitz-approach\n", "===========================================\n", - "Here we give a beginner-friendly introduction to TorchPhysics, going over all the basic concepts and steps. For a more in-depth explanation, we recommend the [tutorial page](https://torchphysics.readthedocs.io/en/latest/tutorial/tutorial_start.html).\n", + "Here we give a beginner-friendly introduction to TorchPhysics, going over all the basic concepts and steps. For a more in-depth explanation, we recommend the [tutorial page](https://boschresearch.github.io/torchphysics/tutorial/tutorial_start.html).\n", "We introduce the library with the aim to solve the following PDE:\n", "\n", "\\begin{align*}\n", diff --git a/examples/workshop/Exercise3_2.ipynb b/examples/workshop/Exercise3_2.ipynb index 05f44e89..3cc38d38 100644 --- a/examples/workshop/Exercise3_2.ipynb +++ b/examples/workshop/Exercise3_2.ipynb @@ -209,7 +209,7 @@ "metadata": {}, "source": [ "##### c) Construct the DeepONet\n", - "Build a DeepONet consisting of a fully connected TrunkNet and BranchNet. Check the `TorchPhysics` [documentation](https://torchphysics.readthedocs.io/en/latest/api/torchphysics.models.deeponet.html), to see how this has to implemented. \n", + "Build a DeepONet consisting of a fully connected TrunkNet and BranchNet. Check the `TorchPhysics` [documentation](https://boschresearch.github.io/torchphysics/tutorial/tutorial_start.html), to see how this has to implemented. \n", "\n", "Both (TrunkNet and BranchNet) should have 3 hidden layers with 25 neurons each. The output of both networks should be 30 neurons." ] diff --git a/examples/workshop/Sol3_2.ipynb b/examples/workshop/Sol3_2.ipynb index 96733200..ac4d0afe 100644 --- a/examples/workshop/Sol3_2.ipynb +++ b/examples/workshop/Sol3_2.ipynb @@ -217,7 +217,7 @@ "metadata": {}, "source": [ "##### c) Construct the DeepONet\n", - "Build a DeepONet consisting of a fully connected TrunkNet and BranchNet. Check the `TorchPhysics` [documentation](https://torchphysics.readthedocs.io/en/latest/api/torchphysics.models.deeponet.html), to see how this has to implemented. \n", + "Build a DeepONet consisting of a fully connected TrunkNet and BranchNet. Check the `TorchPhysics` [documentation](https://boschresearch.github.io/torchphysics/tutorial/tutorial_start.html), to see how this has to implemented. \n", "\n", "Both (TrunkNet and BranchNet) should have 3 hidden layers with 25 neurons each. The output of both networks should be 30 neurons." ] diff --git a/setup.cfg b/setup.cfg index 14129f83..d6694aa0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,7 +14,7 @@ long_description_content_type = text/x-rst; charset=UTF-8 url = https://github.com/boschresearch/torchphysics # Add here related links, for example: project_urls = - Documentation = https://torchphysics.readthedocs.io/en/latest/ + Documentation = https://boschresearch.github.io/torchphysics/index.html Source = https://github.com/boschresearch/torchphysics Changelog = https://github.com/boschresearch/torchphysics/blob/main/CHANGELOG.rst # Tracker = https://github.com/pyscaffold/pyscaffold/issues diff --git a/src/torchphysics/problem/conditions/__init__.py b/src/torchphysics/problem/conditions/__init__.py index 7ec59768..09a3a4c7 100644 --- a/src/torchphysics/problem/conditions/__init__.py +++ b/src/torchphysics/problem/conditions/__init__.py @@ -4,7 +4,7 @@ A tutorial on the usage of Conditions can be found here_. -.. _here: https://torchphysics.readthedocs.io/en/latest/tutorial/condition_tutorial.html +.. _here: https://boschresearch.github.io/torchphysics/tutorial/tutorial_start.html """ from .condition import (Condition,