From 8cde85abb6cd039d0b9ecf04cd9e099e83236ee1 Mon Sep 17 00:00:00 2001 From: luiz_monteiro <69694529+Luhenmo@users.noreply.github.com> Date: Sat, 9 May 2026 13:27:05 +0200 Subject: [PATCH 1/3] fix: Supported elements in DOLFINx link was broken. --- chapter1/fundamentals_code.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chapter1/fundamentals_code.ipynb b/chapter1/fundamentals_code.ipynb index 2e0fd9bc..a8e7a586 100644 --- a/chapter1/fundamentals_code.ipynb +++ b/chapter1/fundamentals_code.ipynb @@ -124,11 +124,11 @@ " Once the mesh has been created, we can create the finite element function space $V$.\n", "The finite element function space does not need to be the same as the one used to describe the mesh.\n", "DOLFINx supports a wide range of arbitrary order finite element function spaces, see:\n", - "[Supported elements in DOLFINx](https://defelement.org/lists/implementations/basix.ufl.html)\n", + "[Supported elements in DOLFINx](https://defelement.org/lists/implementations/basix_ufl.html)\n", "for an extensive list.\n", "To create a function space, we need to specify what mesh the space is defined on,\n", - "what element famil the space is based on, and the degree of the element.\n", - "These can for instance be defned through a tuple `(\"family\", degree)`, as shown below" + "what element family the space is based on, and the degree of the element.\n", + "These can for instance be defined through a tuple `(\"family\", degree)`, as shown below" ] }, { From 72a263a43a1ee2c727a927e1e52d0321e87308b4 Mon Sep 17 00:00:00 2001 From: Jorgen Schartum Dokken Date: Fri, 3 Jul 2026 12:45:45 +0200 Subject: [PATCH 2/3] Bump to 0.11. Update jupytext version. Sync notebook with .py file --- chapter1/complex_mode.py | 2 +- chapter1/fundamentals_code.py | 8 ++++---- chapter1/membrane_code.py | 2 +- chapter1/nitsche.py | 2 +- chapter2/amr.ipynb | 1 + chapter2/amr.py | 2 +- chapter2/diffusion_code.py | 2 +- chapter2/heat_code.py | 2 +- chapter2/helmholtz_code.py | 2 +- chapter2/hyperelasticity.py | 2 +- chapter2/linearelasticity_code.py | 2 +- chapter2/nonlinpoisson_code.py | 2 +- chapter2/ns_code1.py | 2 +- chapter2/ns_code2.py | 2 +- chapter2/singular_poisson.py | 2 +- chapter3/component_bc.py | 2 +- chapter3/em.py | 2 +- chapter3/multiple_dirichlet.py | 2 +- chapter3/neumann_dirichlet_code.py | 2 +- chapter3/robin_neumann_dirichlet.py | 2 +- chapter3/subdomains.py | 2 +- chapter4/compiler_parameters.py | 2 +- chapter4/convergence.py | 2 +- chapter4/mixed_poisson.py | 2 +- chapter4/newton-solver.py | 2 +- chapter4/solvers.py | 2 +- pyproject.toml | 4 ++-- 27 files changed, 31 insertions(+), 30 deletions(-) diff --git a/chapter1/complex_mode.py b/chapter1/complex_mode.py index a68d8481..ba5f68f2 100644 --- a/chapter1/complex_mode.py +++ b/chapter1/complex_mode.py @@ -6,7 +6,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.18.1 +# jupytext_version: 1.19.4 # kernelspec: # display_name: Python 3 (DOLFINx complex) # language: python diff --git a/chapter1/fundamentals_code.py b/chapter1/fundamentals_code.py index 4c8d0c20..2e8b57aa 100644 --- a/chapter1/fundamentals_code.py +++ b/chapter1/fundamentals_code.py @@ -6,7 +6,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.19.1 +# jupytext_version: 1.19.4 # kernelspec: # display_name: Python 3 (ipykernel) # language: python @@ -114,11 +114,11 @@ # Once the mesh has been created, we can create the finite element function space $V$. # The finite element function space does not need to be the same as the one used to describe the mesh. # DOLFINx supports a wide range of arbitrary order finite element function spaces, see: -# [Supported elements in DOLFINx](https://defelement.org/lists/implementations/basix.ufl.html) +# [Supported elements in DOLFINx](https://defelement.org/lists/implementations/basix_ufl.html) # for an extensive list. # To create a function space, we need to specify what mesh the space is defined on, -# what element famil the space is based on, and the degree of the element. -# These can for instance be defned through a tuple `("family", degree)`, as shown below +# what element family the space is based on, and the degree of the element. +# These can for instance be defined through a tuple `("family", degree)`, as shown below # + from dolfinx import fem diff --git a/chapter1/membrane_code.py b/chapter1/membrane_code.py index 81363110..0d2584c5 100644 --- a/chapter1/membrane_code.py +++ b/chapter1/membrane_code.py @@ -6,7 +6,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.18.1 +# jupytext_version: 1.19.4 # kernelspec: # display_name: Python 3 (ipykernel) # language: python diff --git a/chapter1/nitsche.py b/chapter1/nitsche.py index 5f74bb1f..7b3b69c6 100644 --- a/chapter1/nitsche.py +++ b/chapter1/nitsche.py @@ -6,7 +6,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.18.1 +# jupytext_version: 1.19.4 # kernelspec: # display_name: Python 3 (ipykernel) # language: python diff --git a/chapter2/amr.ipynb b/chapter2/amr.ipynb index 2ec33082..31269ae2 100644 --- a/chapter2/amr.ipynb +++ b/chapter2/amr.ipynb @@ -191,6 +191,7 @@ }, "outputs": [], "source": [ + "plotter = pyvista.Plotter()\n", "curved_grid = pyvista.UnstructuredGrid(*dolfinx.plot.vtk_mesh(curved_mesh))\n", "curved_grid.cell_data[\"ct\"] = ct.values\n", "plotter.add_mesh(\n", diff --git a/chapter2/amr.py b/chapter2/amr.py index 2f2fd2eb..1453049e 100644 --- a/chapter2/amr.py +++ b/chapter2/amr.py @@ -7,7 +7,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.18.1 +# jupytext_version: 1.19.4 # --- # # Adaptive mesh refinement with NetGen and DOLFINx diff --git a/chapter2/diffusion_code.py b/chapter2/diffusion_code.py index 61edc349..1593521a 100644 --- a/chapter2/diffusion_code.py +++ b/chapter2/diffusion_code.py @@ -6,7 +6,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.18.1 +# jupytext_version: 1.19.4 # kernelspec: # display_name: Python 3 (ipykernel) # language: python diff --git a/chapter2/heat_code.py b/chapter2/heat_code.py index 4b29da37..1b5776b8 100644 --- a/chapter2/heat_code.py +++ b/chapter2/heat_code.py @@ -6,7 +6,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.18.1 +# jupytext_version: 1.19.4 # kernelspec: # display_name: Python 3 (ipykernel) # language: python diff --git a/chapter2/helmholtz_code.py b/chapter2/helmholtz_code.py index 6f638509..2507c57d 100644 --- a/chapter2/helmholtz_code.py +++ b/chapter2/helmholtz_code.py @@ -6,7 +6,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.18.1 +# jupytext_version: 1.19.4 # kernelspec: # display_name: Python 3 (DOLFINx complex) # language: python diff --git a/chapter2/hyperelasticity.py b/chapter2/hyperelasticity.py index b3fb1069..17572923 100644 --- a/chapter2/hyperelasticity.py +++ b/chapter2/hyperelasticity.py @@ -6,7 +6,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.18.1 +# jupytext_version: 1.19.4 # kernelspec: # display_name: Python 3 (ipykernel) # language: python diff --git a/chapter2/linearelasticity_code.py b/chapter2/linearelasticity_code.py index 2485bf22..f04b573c 100644 --- a/chapter2/linearelasticity_code.py +++ b/chapter2/linearelasticity_code.py @@ -6,7 +6,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.18.1 +# jupytext_version: 1.19.4 # kernelspec: # display_name: Python 3 (ipykernel) # language: python diff --git a/chapter2/nonlinpoisson_code.py b/chapter2/nonlinpoisson_code.py index 52a3bde3..db636b93 100644 --- a/chapter2/nonlinpoisson_code.py +++ b/chapter2/nonlinpoisson_code.py @@ -6,7 +6,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.18.1 +# jupytext_version: 1.19.4 # kernelspec: # display_name: Python 3 (ipykernel) # language: python diff --git a/chapter2/ns_code1.py b/chapter2/ns_code1.py index 802e1ae9..7ca88041 100644 --- a/chapter2/ns_code1.py +++ b/chapter2/ns_code1.py @@ -6,7 +6,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.18.1 +# jupytext_version: 1.19.4 # kernelspec: # display_name: Python 3 (ipykernel) # language: python diff --git a/chapter2/ns_code2.py b/chapter2/ns_code2.py index 94a2da59..1d0e9bc8 100644 --- a/chapter2/ns_code2.py +++ b/chapter2/ns_code2.py @@ -6,7 +6,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.18.1 +# jupytext_version: 1.19.4 # kernelspec: # display_name: Python 3 (ipykernel) # language: python diff --git a/chapter2/singular_poisson.py b/chapter2/singular_poisson.py index 78f0945e..0c6dfe6f 100644 --- a/chapter2/singular_poisson.py +++ b/chapter2/singular_poisson.py @@ -7,7 +7,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.18.1 +# jupytext_version: 1.19.4 # --- # # Singular Poisson problem diff --git a/chapter3/component_bc.py b/chapter3/component_bc.py index d82365d0..0d2d0847 100644 --- a/chapter3/component_bc.py +++ b/chapter3/component_bc.py @@ -6,7 +6,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.18.1 +# jupytext_version: 1.19.4 # kernelspec: # display_name: Python 3 (ipykernel) # language: python diff --git a/chapter3/em.py b/chapter3/em.py index 6efe178a..0fdf59f2 100644 --- a/chapter3/em.py +++ b/chapter3/em.py @@ -6,7 +6,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.18.1 +# jupytext_version: 1.19.4 # kernelspec: # display_name: Python 3 (ipykernel) # language: python diff --git a/chapter3/multiple_dirichlet.py b/chapter3/multiple_dirichlet.py index cf020c1e..9edf23d8 100644 --- a/chapter3/multiple_dirichlet.py +++ b/chapter3/multiple_dirichlet.py @@ -6,7 +6,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.18.1 +# jupytext_version: 1.19.4 # kernelspec: # display_name: Python 3 (ipykernel) # language: python diff --git a/chapter3/neumann_dirichlet_code.py b/chapter3/neumann_dirichlet_code.py index 6a481d15..397d0202 100644 --- a/chapter3/neumann_dirichlet_code.py +++ b/chapter3/neumann_dirichlet_code.py @@ -6,7 +6,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.18.1 +# jupytext_version: 1.19.4 # kernelspec: # display_name: Python 3 (ipykernel) # language: python diff --git a/chapter3/robin_neumann_dirichlet.py b/chapter3/robin_neumann_dirichlet.py index 4e5b54ff..a068e7c6 100644 --- a/chapter3/robin_neumann_dirichlet.py +++ b/chapter3/robin_neumann_dirichlet.py @@ -6,7 +6,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.18.1 +# jupytext_version: 1.19.4 # kernelspec: # display_name: Python 3 (ipykernel) # language: python diff --git a/chapter3/subdomains.py b/chapter3/subdomains.py index 3f368778..2815ec04 100644 --- a/chapter3/subdomains.py +++ b/chapter3/subdomains.py @@ -6,7 +6,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.18.1 +# jupytext_version: 1.19.4 # kernelspec: # display_name: Python 3 (ipykernel) # language: python diff --git a/chapter4/compiler_parameters.py b/chapter4/compiler_parameters.py index 97e5c33c..a1a3a8f3 100644 --- a/chapter4/compiler_parameters.py +++ b/chapter4/compiler_parameters.py @@ -6,7 +6,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.18.1 +# jupytext_version: 1.19.4 # kernelspec: # display_name: Python 3 (ipykernel) # language: python diff --git a/chapter4/convergence.py b/chapter4/convergence.py index 7171451c..ee8043d3 100644 --- a/chapter4/convergence.py +++ b/chapter4/convergence.py @@ -6,7 +6,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.18.1 +# jupytext_version: 1.19.4 # kernelspec: # display_name: Python 3 (ipykernel) # language: python diff --git a/chapter4/mixed_poisson.py b/chapter4/mixed_poisson.py index 30d93c03..e34feb03 100644 --- a/chapter4/mixed_poisson.py +++ b/chapter4/mixed_poisson.py @@ -7,7 +7,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.18.1 +# jupytext_version: 1.19.4 # --- # # Mixed Poisson with a Schur complement pre-conditioner diff --git a/chapter4/newton-solver.py b/chapter4/newton-solver.py index 80b460af..97c9e184 100644 --- a/chapter4/newton-solver.py +++ b/chapter4/newton-solver.py @@ -6,7 +6,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.19.1 +# jupytext_version: 1.19.4 # kernelspec: # display_name: Python 3 (ipykernel) # language: python diff --git a/chapter4/solvers.py b/chapter4/solvers.py index fc3999f9..d541f4f9 100644 --- a/chapter4/solvers.py +++ b/chapter4/solvers.py @@ -6,7 +6,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.18.1 +# jupytext_version: 1.19.4 # kernelspec: # display_name: Python 3 (ipykernel) # language: python diff --git a/pyproject.toml b/pyproject.toml index ee1104ec..79075ad2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "DOLFINx_Tutorial" -version = "0.10.0" +version = "0.11.0" dependencies = [ "jupyter-book<2.0", "meshio", @@ -13,7 +13,7 @@ dependencies = [ "pandas", "tqdm", "pyvista[all]>=0.45.0", - "fenics-dolfinx>=0.10.0,<0.11.0", + "fenics-dolfinx>=0.11.0,<0.12.0", "sphinx-codeautolink", "trame_jupyter_extension", "jupytext", From ee5e0f8492db704d587aa0caa204ba0b22103352 Mon Sep 17 00:00:00 2001 From: Jorgen Schartum Dokken Date: Fri, 3 Jul 2026 14:37:16 +0200 Subject: [PATCH 3/3] Update mixed poisson example with new pullback arguments and interpolation API --- chapter4/mixed_poisson.ipynb | 4 ++-- chapter4/mixed_poisson.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/chapter4/mixed_poisson.ipynb b/chapter4/mixed_poisson.ipynb index 11e15f8a..2678f396 100644 --- a/chapter4/mixed_poisson.ipynb +++ b/chapter4/mixed_poisson.ipynb @@ -336,7 +336,7 @@ " interpolation_points = Q_el.basix_element.x\n", " for i, points in enumerate(interpolation_points[fdim]):\n", " geom = ref_geom[ref_top[fdim][i]]\n", - " ref_points = facet_cel.pull_back(points, geom)\n", + " ref_points = facet_cel.pull_back(points, geom, tol=1e-6, maxit=25)\n", " # Assert that interpolation points are all equal on all facets\n", " if reference_facet_points is None:\n", " reference_facet_points = ref_points\n", @@ -378,7 +378,7 @@ " # Use lower-level interpolation that takes in the function evaluated at the physical\n", " # interpolation points of the mesh.\n", " qh = dolfinx.fem.Function(Q)\n", - " qh._cpp_object.interpolate(\n", + " qh._cpp_object.interpolate_f(\n", " values.reshape(-1, domain.geometry.dim).T.copy(), boundary_entities[::2].copy()\n", " )\n", " qh.x.scatter_forward()\n", diff --git a/chapter4/mixed_poisson.py b/chapter4/mixed_poisson.py index e34feb03..828a4c60 100644 --- a/chapter4/mixed_poisson.py +++ b/chapter4/mixed_poisson.py @@ -223,7 +223,7 @@ def interpolate_facet_expression( interpolation_points = Q_el.basix_element.x for i, points in enumerate(interpolation_points[fdim]): geom = ref_geom[ref_top[fdim][i]] - ref_points = facet_cel.pull_back(points, geom) + ref_points = facet_cel.pull_back(points, geom, tol=1e-6, maxit=25) # Assert that interpolation points are all equal on all facets if reference_facet_points is None: reference_facet_points = ref_points @@ -265,7 +265,7 @@ def interpolate_facet_expression( # Use lower-level interpolation that takes in the function evaluated at the physical # interpolation points of the mesh. qh = dolfinx.fem.Function(Q) - qh._cpp_object.interpolate( + qh._cpp_object.interpolate_f( values.reshape(-1, domain.geometry.dim).T.copy(), boundary_entities[::2].copy() ) qh.x.scatter_forward()