From bee862f1872eb49cf9cab85a5fcf792de0a4f2a2 Mon Sep 17 00:00:00 2001 From: kvrigor Date: Tue, 11 Mar 2025 19:16:18 +0100 Subject: [PATCH 01/13] CI: Added steps for checking dirty notebooks --- .github/workflows/build-deploy-book.yml | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/build-deploy-book.yml b/.github/workflows/build-deploy-book.yml index cb71533..407c0cb 100644 --- a/.github/workflows/build-deploy-book.yml +++ b/.github/workflows/build-deploy-book.yml @@ -71,6 +71,35 @@ jobs: pip install --upgrade pip pip install -r requirements.txt + - name: Get list of changed Python notebooks + id: changed-python-notebooks + uses: tj-actions/changed-files@v45 + with: + files: **.ipynb + + - name: Check for dirty Python notebooks + if: steps.changed-python-notebooks.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed-python-notebooks.outputs.all_changed_files }} + run: | + # Check if there are dirty notebooks + dirty_ipynb=() + for file in ${ALL_CHANGED_FILES[*]}; do + echo "Checking $file..." + if ! nb-clean check $file >/dev/null 2>&1; then + dirty_ipynb+=($file) + fi + done + + # Trigger failure if dirty notebooks were found + if [[ ! -z "${dirty_ipynb[@]}" ]]; then + echo "ERROR: Found dirty Python notebooks. Please clean the notebooks by running" + echo "" + echo "nb-clean clean --remove-empty-cells --remove-all-notebook-metadata ${dirty_ipynb[*]}" + echo "" + exit 1 + fi + - name: Build Jupyter Book run: make docs From 47a6bac0e63576ca00c16e7f0167c660614f4114 Mon Sep 17 00:00:00 2001 From: kvrigor Date: Tue, 11 Mar 2025 19:16:51 +0100 Subject: [PATCH 02/13] Commit dirty notebooks --- chapter1/poisson.ipynb | 66 ++++++++++++++++++++++++++++------- chapter2/vector-poisson.ipynb | 66 ++++++++++++++++++++++++++++------- 2 files changed, 108 insertions(+), 24 deletions(-) diff --git a/chapter1/poisson.ipynb b/chapter1/poisson.ipynb index c8ec097..9bbf0d9 100644 --- a/chapter1/poisson.ipynb +++ b/chapter1/poisson.ipynb @@ -45,7 +45,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "id": "d742586c", "metadata": {}, "outputs": [], @@ -116,7 +116,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "id": "a2a0a2a1", "metadata": {}, "outputs": [], @@ -126,7 +126,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "id": "00e54163", "metadata": {}, "outputs": [], @@ -137,7 +137,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "id": "5999c62b", "metadata": {}, "outputs": [], @@ -162,7 +162,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "id": "541192ee", "metadata": {}, "outputs": [], @@ -196,10 +196,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "id": "5925c6cd", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "9.49756716724664e-07\n" + ] + } + ], "source": [ "ue = sin(pi*x)*sin(pi*y)\n", "\n", @@ -228,10 +236,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 15, "id": "e5c1a8b8", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "9.768702410721585e-05\n" + ] + } + ], "source": [ "# create the formal Norm object\n", "h1norm = SemiNorm(u - ue, domain, kind='h1')\n", @@ -256,10 +272,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 16, "id": "d829e410", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "9.769164089397408e-05\n" + ] + } + ], "source": [ "# create the formal Norm object\n", "h1norm = Norm(u - ue, domain, kind='h1')\n", @@ -275,7 +299,25 @@ ] } ], - "metadata": {}, + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.9" + } + }, "nbformat": 4, "nbformat_minor": 5 } diff --git a/chapter2/vector-poisson.ipynb b/chapter2/vector-poisson.ipynb index 47c46bb..20d71cf 100644 --- a/chapter2/vector-poisson.ipynb +++ b/chapter2/vector-poisson.ipynb @@ -44,7 +44,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "d742586c", "metadata": {}, "outputs": [], @@ -100,7 +100,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "id": "a2a0a2a1", "metadata": {}, "outputs": [], @@ -110,7 +110,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "id": "00e54163", "metadata": {}, "outputs": [], @@ -121,7 +121,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "id": "5999c62b", "metadata": {}, "outputs": [], @@ -146,7 +146,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "id": "541192ee", "metadata": {}, "outputs": [], @@ -180,10 +180,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "id": "5925c6cd", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.0003267962376349343\n" + ] + } + ], "source": [ "ue1 = sin(pi*x)*sin(pi*y)*sin(pi*z)\n", "ue2 = sin(pi*x)*sin(pi*y)*sin(pi*z)\n", @@ -217,10 +225,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "id": "e5c1a8b8", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.01956220393797005\n" + ] + } + ], "source": [ "# create the formal Norm object\n", "h1norm = SemiNorm(error, domain, kind='h1')\n", @@ -245,10 +261,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "id": "d829e410", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.01956493339348906\n" + ] + } + ], "source": [ "# create the formal Norm object\n", "h1norm = Norm(error, domain, kind='h1')\n", @@ -264,7 +288,25 @@ ] } ], - "metadata": {}, + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.9" + } + }, "nbformat": 4, "nbformat_minor": 5 } From b89dcd174a12d1ef81c94aa927a5364b33f98de5 Mon Sep 17 00:00:00 2001 From: kvrigor Date: Tue, 11 Mar 2025 19:26:13 +0100 Subject: [PATCH 03/13] Pointed SymPDE and Psydac documentation to official sources --- _toc.yml | 7 +++++-- documentation/psydac.rst | 19 ------------------- documentation/sympde.rst | 14 -------------- 3 files changed, 5 insertions(+), 35 deletions(-) delete mode 100644 documentation/psydac.rst delete mode 100644 documentation/sympde.rst diff --git a/_toc.yml b/_toc.yml index 1db5e02..1f7600b 100644 --- a/_toc.yml +++ b/_toc.yml @@ -175,5 +175,8 @@ parts: - file: chapter5/multiphysics - caption: Documentation chapters: - - file: documentation/sympde - - file: documentation/psydac + - url: https://pyccel.github.io/psydac/index.html + title: Psydac + - url: https://sympde.readthedocs.io/en/latest/ + title: SymPDE + diff --git a/documentation/psydac.rst b/documentation/psydac.rst deleted file mode 100644 index dd90723..0000000 --- a/documentation/psydac.rst +++ /dev/null @@ -1,19 +0,0 @@ -Psydac API Reference -==================== - -.. autosummary:: - :toctree: _autosummary - :recursive: - - psydac.api - psydac.cad - psydac.cmd - psydac.core - psydac.ddm - psydac.feec - psydac.fem - psydac.linalg - psydac.mapping - psydac.polar - psydac.pyccel - psydac.utilities diff --git a/documentation/sympde.rst b/documentation/sympde.rst deleted file mode 100644 index 3fc651f..0000000 --- a/documentation/sympde.rst +++ /dev/null @@ -1,14 +0,0 @@ -SymPDE API Reference -==================== - -.. autosummary:: - :toctree: _autosummary - :recursive: - - sympde.core - sympde.calculus - sympde.topology - sympde.expr - sympde.printing - sympde.exterior - sympde.utilities From 18107e949d8e0dd76ac13a05614b9388f3c72466 Mon Sep 17 00:00:00 2001 From: kvrigor Date: Tue, 11 Mar 2025 19:34:05 +0100 Subject: [PATCH 04/13] CI: Fixed YAML syntax complaint --- .github/workflows/build-deploy-book.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-deploy-book.yml b/.github/workflows/build-deploy-book.yml index 407c0cb..193fba2 100644 --- a/.github/workflows/build-deploy-book.yml +++ b/.github/workflows/build-deploy-book.yml @@ -75,7 +75,8 @@ jobs: id: changed-python-notebooks uses: tj-actions/changed-files@v45 with: - files: **.ipynb + files: | + **.ipynb - name: Check for dirty Python notebooks if: steps.changed-python-notebooks.outputs.any_changed == 'true' From 92843a14219b330e5d8ac95ff92795dd8b68758a Mon Sep 17 00:00:00 2001 From: kvrigor Date: Tue, 11 Mar 2025 19:38:39 +0100 Subject: [PATCH 05/13] Cleaned dirty notebooks --- chapter1/poisson.ipynb | 66 +++++++---------------------------- chapter2/vector-poisson.ipynb | 66 +++++++---------------------------- 2 files changed, 24 insertions(+), 108 deletions(-) diff --git a/chapter1/poisson.ipynb b/chapter1/poisson.ipynb index 9bbf0d9..c8ec097 100644 --- a/chapter1/poisson.ipynb +++ b/chapter1/poisson.ipynb @@ -45,7 +45,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "id": "d742586c", "metadata": {}, "outputs": [], @@ -116,7 +116,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "id": "a2a0a2a1", "metadata": {}, "outputs": [], @@ -126,7 +126,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "id": "00e54163", "metadata": {}, "outputs": [], @@ -137,7 +137,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "id": "5999c62b", "metadata": {}, "outputs": [], @@ -162,7 +162,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "id": "541192ee", "metadata": {}, "outputs": [], @@ -196,18 +196,10 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": null, "id": "5925c6cd", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "9.49756716724664e-07\n" - ] - } - ], + "outputs": [], "source": [ "ue = sin(pi*x)*sin(pi*y)\n", "\n", @@ -236,18 +228,10 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": null, "id": "e5c1a8b8", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "9.768702410721585e-05\n" - ] - } - ], + "outputs": [], "source": [ "# create the formal Norm object\n", "h1norm = SemiNorm(u - ue, domain, kind='h1')\n", @@ -272,18 +256,10 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": null, "id": "d829e410", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "9.769164089397408e-05\n" - ] - } - ], + "outputs": [], "source": [ "# create the formal Norm object\n", "h1norm = Norm(u - ue, domain, kind='h1')\n", @@ -299,25 +275,7 @@ ] } ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.12.9" - } - }, + "metadata": {}, "nbformat": 4, "nbformat_minor": 5 } diff --git a/chapter2/vector-poisson.ipynb b/chapter2/vector-poisson.ipynb index 20d71cf..47c46bb 100644 --- a/chapter2/vector-poisson.ipynb +++ b/chapter2/vector-poisson.ipynb @@ -44,7 +44,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "d742586c", "metadata": {}, "outputs": [], @@ -100,7 +100,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "a2a0a2a1", "metadata": {}, "outputs": [], @@ -110,7 +110,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "id": "00e54163", "metadata": {}, "outputs": [], @@ -121,7 +121,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "id": "5999c62b", "metadata": {}, "outputs": [], @@ -146,7 +146,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "id": "541192ee", "metadata": {}, "outputs": [], @@ -180,18 +180,10 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "id": "5925c6cd", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0.0003267962376349343\n" - ] - } - ], + "outputs": [], "source": [ "ue1 = sin(pi*x)*sin(pi*y)*sin(pi*z)\n", "ue2 = sin(pi*x)*sin(pi*y)*sin(pi*z)\n", @@ -225,18 +217,10 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "id": "e5c1a8b8", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0.01956220393797005\n" - ] - } - ], + "outputs": [], "source": [ "# create the formal Norm object\n", "h1norm = SemiNorm(error, domain, kind='h1')\n", @@ -261,18 +245,10 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "id": "d829e410", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0.01956493339348906\n" - ] - } - ], + "outputs": [], "source": [ "# create the formal Norm object\n", "h1norm = Norm(error, domain, kind='h1')\n", @@ -288,25 +264,7 @@ ] } ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.12.9" - } - }, + "metadata": {}, "nbformat": 4, "nbformat_minor": 5 } From 2769106ac136d8963a9f7d1b444bfa2efc9d57d1 Mon Sep 17 00:00:00 2001 From: kvrigor Date: Tue, 11 Mar 2025 19:45:31 +0100 Subject: [PATCH 06/13] CI: List of changed files weren't captured. --- .github/workflows/build-deploy-book.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-deploy-book.yml b/.github/workflows/build-deploy-book.yml index 193fba2..72026bd 100644 --- a/.github/workflows/build-deploy-book.yml +++ b/.github/workflows/build-deploy-book.yml @@ -75,6 +75,7 @@ jobs: id: changed-python-notebooks uses: tj-actions/changed-files@v45 with: + since_last_remote_commit: true files: | **.ipynb From d053090bc8d8a4c1e0e9860dec07b4f1f152645a Mon Sep 17 00:00:00 2001 From: kvrigor Date: Tue, 11 Mar 2025 19:53:22 +0100 Subject: [PATCH 07/13] CI: Always execute 'Check for dirty Python notebooks' step --- .github/workflows/build-deploy-book.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build-deploy-book.yml b/.github/workflows/build-deploy-book.yml index 72026bd..0a6f849 100644 --- a/.github/workflows/build-deploy-book.yml +++ b/.github/workflows/build-deploy-book.yml @@ -72,15 +72,12 @@ jobs: pip install -r requirements.txt - name: Get list of changed Python notebooks - id: changed-python-notebooks uses: tj-actions/changed-files@v45 with: - since_last_remote_commit: true files: | **.ipynb - name: Check for dirty Python notebooks - if: steps.changed-python-notebooks.outputs.any_changed == 'true' env: ALL_CHANGED_FILES: ${{ steps.changed-python-notebooks.outputs.all_changed_files }} run: | From 961baa336d14cd62084e214413827a7d7ddb9c4c Mon Sep 17 00:00:00 2001 From: kvrigor Date: Tue, 11 Mar 2025 20:01:08 +0100 Subject: [PATCH 08/13] CI: Added log if no dirty notebooks were found --- .github/workflows/build-deploy-book.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-deploy-book.yml b/.github/workflows/build-deploy-book.yml index 0a6f849..37683d5 100644 --- a/.github/workflows/build-deploy-book.yml +++ b/.github/workflows/build-deploy-book.yml @@ -97,6 +97,8 @@ jobs: echo "nb-clean clean --remove-empty-cells --remove-all-notebook-metadata ${dirty_ipynb[*]}" echo "" exit 1 + else + echo "SUCCESS: All changed notebooks are clean." fi - name: Build Jupyter Book From c76446fa4aab8d64b130f2ee0b565aad1b164b9c Mon Sep 17 00:00:00 2001 From: kvrigor Date: Tue, 11 Mar 2025 20:17:36 +0100 Subject: [PATCH 09/13] CI: Fixed wrong ALL_CHANGED_FILES --- .github/workflows/build-deploy-book.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-deploy-book.yml b/.github/workflows/build-deploy-book.yml index 37683d5..58a577c 100644 --- a/.github/workflows/build-deploy-book.yml +++ b/.github/workflows/build-deploy-book.yml @@ -72,14 +72,16 @@ jobs: pip install -r requirements.txt - name: Get list of changed Python notebooks + id: changed-ipynb-files uses: tj-actions/changed-files@v45 with: files: | **.ipynb - name: Check for dirty Python notebooks + if: steps.changed-ipynb-files.outputs.any_changed == 'true' env: - ALL_CHANGED_FILES: ${{ steps.changed-python-notebooks.outputs.all_changed_files }} + ALL_CHANGED_FILES: ${{ steps.changed-ipynb-files.outputs.all_changed_files }} run: | # Check if there are dirty notebooks dirty_ipynb=() From 92c02ce06af4d52a09e5b2cb03d979203649fb66 Mon Sep 17 00:00:00 2001 From: kvrigor Date: Tue, 11 Mar 2025 20:18:16 +0100 Subject: [PATCH 10/13] Test dirty notebooks once more --- chapter1/poisson.ipynb | 67 ++++++++++++++---- chapter2/poisson.ipynb | 68 +++++++++++++++---- chapter4/poisson-two-subdomains-nitsche.ipynb | 44 +++++++++--- 3 files changed, 144 insertions(+), 35 deletions(-) diff --git a/chapter1/poisson.ipynb b/chapter1/poisson.ipynb index c8ec097..b48ad34 100644 --- a/chapter1/poisson.ipynb +++ b/chapter1/poisson.ipynb @@ -6,7 +6,6 @@ "metadata": {}, "source": [ "# Your first code using SymPDE & PsyDAC\n", - "*Author: Ahmed Ratnani*\n", "\n", "We start by writing our first example using SymPDE.\n", "Let $\\Omega := (0,1)^2$. We consider the Poisson problem with homogeneous Dirichlet boundary conditions. \n", @@ -45,7 +44,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "d742586c", "metadata": {}, "outputs": [], @@ -116,7 +115,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "id": "a2a0a2a1", "metadata": {}, "outputs": [], @@ -126,7 +125,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "id": "00e54163", "metadata": {}, "outputs": [], @@ -137,7 +136,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "id": "5999c62b", "metadata": {}, "outputs": [], @@ -162,7 +161,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "id": "541192ee", "metadata": {}, "outputs": [], @@ -196,10 +195,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "id": "5925c6cd", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "9.49756716724664e-07\n" + ] + } + ], "source": [ "ue = sin(pi*x)*sin(pi*y)\n", "\n", @@ -228,10 +235,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "id": "e5c1a8b8", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "9.768702410721585e-05\n" + ] + } + ], "source": [ "# create the formal Norm object\n", "h1norm = SemiNorm(u - ue, domain, kind='h1')\n", @@ -256,10 +271,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "id": "d829e410", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "9.769164089397408e-05\n" + ] + } + ], "source": [ "# create the formal Norm object\n", "h1norm = Norm(u - ue, domain, kind='h1')\n", @@ -275,7 +298,25 @@ ] } ], - "metadata": {}, + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.9" + } + }, "nbformat": 4, "nbformat_minor": 5 } diff --git a/chapter2/poisson.ipynb b/chapter2/poisson.ipynb index 76aad47..4ad78c7 100644 --- a/chapter2/poisson.ipynb +++ b/chapter2/poisson.ipynb @@ -18,7 +18,7 @@ "\\end{align}\n", "$$\n", "\n", - "## Variational Formulation\n", + "## Variational Form\n", "\n", "An $H^1$-conforming variational formulation of reads\n", "\n", @@ -45,7 +45,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "d742586c", "metadata": {}, "outputs": [], @@ -106,7 +106,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "id": "00e54163", "metadata": {}, "outputs": [], @@ -117,7 +117,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "id": "5999c62b", "metadata": {}, "outputs": [], @@ -142,7 +142,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "id": "004dfdb3", "metadata": {}, "outputs": [], @@ -152,7 +152,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "id": "541192ee", "metadata": {}, "outputs": [], @@ -186,10 +186,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "id": "5925c6cd", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.00042499840633644024\n" + ] + } + ], "source": [ "u = element_of(V, name='u')\n", "\n", @@ -216,10 +224,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "id": "e5c1a8b8", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.025283770887649267\n" + ] + } + ], "source": [ "# create the formal Norm object\n", "h1norm = SemiNorm(u - ue, domain, kind='h1')\n", @@ -244,10 +260,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "id": "d829e410", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.025287342563909892\n" + ] + } + ], "source": [ "# create the formal Norm object\n", "h1norm = Norm(u - ue, domain, kind='h1')\n", @@ -263,7 +287,25 @@ ] } ], - "metadata": {}, + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.9" + } + }, "nbformat": 4, "nbformat_minor": 5 } diff --git a/chapter4/poisson-two-subdomains-nitsche.ipynb b/chapter4/poisson-two-subdomains-nitsche.ipynb index ae82d93..c65fdf6 100644 --- a/chapter4/poisson-two-subdomains-nitsche.ipynb +++ b/chapter4/poisson-two-subdomains-nitsche.ipynb @@ -21,7 +21,7 @@ "\\end{align}\n", "$$\n", "\n", - "## Variational Formulation\n", + "## Variational Form\n", "\n", "The variational formulation reads\n", "\n", @@ -48,7 +48,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "2ae922ff", "metadata": {}, "outputs": [], @@ -117,7 +117,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "id": "dba29398", "metadata": {}, "outputs": [], @@ -128,7 +128,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "id": "4c341883", "metadata": {}, "outputs": [], @@ -153,7 +153,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "id": "b6ad348a", "metadata": {}, "outputs": [], @@ -163,7 +163,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "id": "11c1b23b", "metadata": {}, "outputs": [], @@ -189,10 +189,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "id": "e295fb37", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.0002193529744905818\n" + ] + } + ], "source": [ "ue = sin(pi*x)*sin(pi*y)\n", "\n", @@ -258,7 +266,25 @@ ] } ], - "metadata": {}, + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.9" + } + }, "nbformat": 4, "nbformat_minor": 5 } From ba751f3d4163f5ebc316923807cffcdaa3e97c28 Mon Sep 17 00:00:00 2001 From: kvrigor Date: Tue, 11 Mar 2025 20:22:40 +0100 Subject: [PATCH 11/13] Cleaned dirty notebooks --- chapter1/poisson.ipynb | 66 ++++--------------- chapter2/poisson.ipynb | 66 ++++--------------- chapter4/poisson-two-subdomains-nitsche.ipynb | 42 +++--------- 3 files changed, 32 insertions(+), 142 deletions(-) diff --git a/chapter1/poisson.ipynb b/chapter1/poisson.ipynb index b48ad34..118e607 100644 --- a/chapter1/poisson.ipynb +++ b/chapter1/poisson.ipynb @@ -44,7 +44,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "d742586c", "metadata": {}, "outputs": [], @@ -115,7 +115,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "a2a0a2a1", "metadata": {}, "outputs": [], @@ -125,7 +125,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "id": "00e54163", "metadata": {}, "outputs": [], @@ -136,7 +136,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "id": "5999c62b", "metadata": {}, "outputs": [], @@ -161,7 +161,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "id": "541192ee", "metadata": {}, "outputs": [], @@ -195,18 +195,10 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "id": "5925c6cd", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "9.49756716724664e-07\n" - ] - } - ], + "outputs": [], "source": [ "ue = sin(pi*x)*sin(pi*y)\n", "\n", @@ -235,18 +227,10 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "id": "e5c1a8b8", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "9.768702410721585e-05\n" - ] - } - ], + "outputs": [], "source": [ "# create the formal Norm object\n", "h1norm = SemiNorm(u - ue, domain, kind='h1')\n", @@ -271,18 +255,10 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "id": "d829e410", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "9.769164089397408e-05\n" - ] - } - ], + "outputs": [], "source": [ "# create the formal Norm object\n", "h1norm = Norm(u - ue, domain, kind='h1')\n", @@ -298,25 +274,7 @@ ] } ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.12.9" - } - }, + "metadata": {}, "nbformat": 4, "nbformat_minor": 5 } diff --git a/chapter2/poisson.ipynb b/chapter2/poisson.ipynb index 4ad78c7..45d394d 100644 --- a/chapter2/poisson.ipynb +++ b/chapter2/poisson.ipynb @@ -45,7 +45,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "d742586c", "metadata": {}, "outputs": [], @@ -106,7 +106,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "00e54163", "metadata": {}, "outputs": [], @@ -117,7 +117,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "id": "5999c62b", "metadata": {}, "outputs": [], @@ -142,7 +142,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "id": "004dfdb3", "metadata": {}, "outputs": [], @@ -152,7 +152,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "id": "541192ee", "metadata": {}, "outputs": [], @@ -186,18 +186,10 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "id": "5925c6cd", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0.00042499840633644024\n" - ] - } - ], + "outputs": [], "source": [ "u = element_of(V, name='u')\n", "\n", @@ -224,18 +216,10 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "id": "e5c1a8b8", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0.025283770887649267\n" - ] - } - ], + "outputs": [], "source": [ "# create the formal Norm object\n", "h1norm = SemiNorm(u - ue, domain, kind='h1')\n", @@ -260,18 +244,10 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "id": "d829e410", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0.025287342563909892\n" - ] - } - ], + "outputs": [], "source": [ "# create the formal Norm object\n", "h1norm = Norm(u - ue, domain, kind='h1')\n", @@ -287,25 +263,7 @@ ] } ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.12.9" - } - }, + "metadata": {}, "nbformat": 4, "nbformat_minor": 5 } diff --git a/chapter4/poisson-two-subdomains-nitsche.ipynb b/chapter4/poisson-two-subdomains-nitsche.ipynb index c65fdf6..fc7024d 100644 --- a/chapter4/poisson-two-subdomains-nitsche.ipynb +++ b/chapter4/poisson-two-subdomains-nitsche.ipynb @@ -48,7 +48,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "2ae922ff", "metadata": {}, "outputs": [], @@ -117,7 +117,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "dba29398", "metadata": {}, "outputs": [], @@ -128,7 +128,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "id": "4c341883", "metadata": {}, "outputs": [], @@ -153,7 +153,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "id": "b6ad348a", "metadata": {}, "outputs": [], @@ -163,7 +163,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "id": "11c1b23b", "metadata": {}, "outputs": [], @@ -189,18 +189,10 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "id": "e295fb37", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0.0002193529744905818\n" - ] - } - ], + "outputs": [], "source": [ "ue = sin(pi*x)*sin(pi*y)\n", "\n", @@ -266,25 +258,7 @@ ] } ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.12.9" - } - }, + "metadata": {}, "nbformat": 4, "nbformat_minor": 5 } From 15ea615a522f1ea6a2b390f733a5af8abc83c07d Mon Sep 17 00:00:00 2001 From: kvrigor Date: Tue, 11 Mar 2025 20:26:13 +0100 Subject: [PATCH 12/13] Reverted dummy changes to notebooks --- chapter1/poisson.ipynb | 1 + chapter2/poisson.ipynb | 2 +- chapter4/poisson-two-subdomains-nitsche.ipynb | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/chapter1/poisson.ipynb b/chapter1/poisson.ipynb index 118e607..57020a9 100644 --- a/chapter1/poisson.ipynb +++ b/chapter1/poisson.ipynb @@ -7,6 +7,7 @@ "source": [ "# Your first code using SymPDE & PsyDAC\n", "\n", + "*Author: Ahmed Ratnani*\n", "We start by writing our first example using SymPDE.\n", "Let $\\Omega := (0,1)^2$. We consider the Poisson problem with homogeneous Dirichlet boundary conditions. \n", "\n", diff --git a/chapter2/poisson.ipynb b/chapter2/poisson.ipynb index 45d394d..76aad47 100644 --- a/chapter2/poisson.ipynb +++ b/chapter2/poisson.ipynb @@ -18,7 +18,7 @@ "\\end{align}\n", "$$\n", "\n", - "## Variational Form\n", + "## Variational Formulation\n", "\n", "An $H^1$-conforming variational formulation of reads\n", "\n", diff --git a/chapter4/poisson-two-subdomains-nitsche.ipynb b/chapter4/poisson-two-subdomains-nitsche.ipynb index fc7024d..ae82d93 100644 --- a/chapter4/poisson-two-subdomains-nitsche.ipynb +++ b/chapter4/poisson-two-subdomains-nitsche.ipynb @@ -21,7 +21,7 @@ "\\end{align}\n", "$$\n", "\n", - "## Variational Form\n", + "## Variational Formulation\n", "\n", "The variational formulation reads\n", "\n", From ffd63ea94f051e4af9e6e15b32ba9731e8ff655d Mon Sep 17 00:00:00 2001 From: kvrigor Date: Tue, 11 Mar 2025 20:44:59 +0100 Subject: [PATCH 13/13] Reverted dummy change to chapter1/poisson.ipynb --- chapter1/poisson.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter1/poisson.ipynb b/chapter1/poisson.ipynb index 57020a9..c8ec097 100644 --- a/chapter1/poisson.ipynb +++ b/chapter1/poisson.ipynb @@ -6,8 +6,8 @@ "metadata": {}, "source": [ "# Your first code using SymPDE & PsyDAC\n", - "\n", "*Author: Ahmed Ratnani*\n", + "\n", "We start by writing our first example using SymPDE.\n", "Let $\\Omega := (0,1)^2$. We consider the Poisson problem with homogeneous Dirichlet boundary conditions. \n", "\n",