--- /srv/rebuilderd/tmp/rebuilderdpmaix9/inputs/dolfinx-doc_0.9.0-7_all.deb +++ /srv/rebuilderd/tmp/rebuilderdpmaix9/out/dolfinx-doc_0.9.0-7_all.deb ├── file list │ @@ -1,3 +1,3 @@ │ -rw-r--r-- 0 0 0 4 2025-03-29 15:17:31.000000 debian-binary │ --rw-r--r-- 0 0 0 21920 2025-03-29 15:17:31.000000 control.tar.xz │ --rw-r--r-- 0 0 0 1217436 2025-03-29 15:17:31.000000 data.tar.xz │ +-rw-r--r-- 0 0 0 21912 2025-03-29 15:17:31.000000 control.tar.xz │ +-rw-r--r-- 0 0 0 1217608 2025-03-29 15:17:31.000000 data.tar.xz ├── control.tar.xz │ ├── control.tar │ │ ├── ./md5sums │ │ │ ├── ./md5sums │ │ │ │┄ Files differ ├── data.tar.xz │ ├── data.tar │ │ ├── file list │ │ │ @@ -905,17 +905,17 @@ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-03-29 15:17:31.000000 ./usr/share/doc/dolfinx-doc/python/_downloads/56ce7e71d8c71b4d8ef7c699176dd4fd/ │ │ │ -rw-r--r-- 0 root (0) root (0) 19507 2025-03-29 15:17:31.000000 ./usr/share/doc/dolfinx-doc/python/_downloads/56ce7e71d8c71b4d8ef7c699176dd4fd/demo_stokes.py │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-03-29 15:17:31.000000 ./usr/share/doc/dolfinx-doc/python/_downloads/67f8546536727bd5386a27073bd16e12/ │ │ │ -rw-r--r-- 0 root (0) root (0) 8141 2025-03-29 15:17:31.000000 ./usr/share/doc/dolfinx-doc/python/_downloads/67f8546536727bd5386a27073bd16e12/demo_elasticity.py │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-03-29 15:17:31.000000 ./usr/share/doc/dolfinx-doc/python/_downloads/6ad57720b461988475bd5c9286e3f111/ │ │ │ -rw-r--r-- 0 root (0) root (0) 7325 2025-03-29 15:17:31.000000 ./usr/share/doc/dolfinx-doc/python/_downloads/6ad57720b461988475bd5c9286e3f111/demo_types.py │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-03-29 15:17:31.000000 ./usr/share/doc/dolfinx-doc/python/_downloads/9561cf6cd1a70079b986f4eb31580cbd/ │ │ │ --rw-r--r-- 0 root (0) root (0) 3861 2025-03-29 15:17:31.000000 ./usr/share/doc/dolfinx-doc/python/_downloads/9561cf6cd1a70079b986f4eb31580cbd/demo_poisson_matrix_free.ipynb.gz │ │ │ +-rw-r--r-- 0 root (0) root (0) 3867 2025-03-29 15:17:31.000000 ./usr/share/doc/dolfinx-doc/python/_downloads/9561cf6cd1a70079b986f4eb31580cbd/demo_poisson_matrix_free.ipynb.gz │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-03-29 15:17:31.000000 ./usr/share/doc/dolfinx-doc/python/_downloads/9ed4657d08dda04de30e6463e2f58d75/ │ │ │ --rw-r--r-- 0 root (0) root (0) 2722 2025-03-29 15:17:31.000000 ./usr/share/doc/dolfinx-doc/python/_downloads/9ed4657d08dda04de30e6463e2f58d75/demo_mixed-poisson.ipynb.gz │ │ │ +-rw-r--r-- 0 root (0) root (0) 2721 2025-03-29 15:17:31.000000 ./usr/share/doc/dolfinx-doc/python/_downloads/9ed4657d08dda04de30e6463e2f58d75/demo_mixed-poisson.ipynb.gz │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-03-29 15:17:31.000000 ./usr/share/doc/dolfinx-doc/python/_downloads/b94ac7be61dc3726ca331afd20f195d2/ │ │ │ -rw-r--r-- 0 root (0) root (0) 5886 2025-03-29 15:17:31.000000 ./usr/share/doc/dolfinx-doc/python/_downloads/b94ac7be61dc3726ca331afd20f195d2/demo_poisson.py │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-03-29 15:17:31.000000 ./usr/share/doc/dolfinx-doc/python/_downloads/e8140d02a100265518e126a3cfe79d8e/ │ │ │ -rw-r--r-- 0 root (0) root (0) 3877 2025-03-29 15:17:31.000000 ./usr/share/doc/dolfinx-doc/python/_downloads/e8140d02a100265518e126a3cfe79d8e/demo_interpolation-io.py │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-03-29 15:17:31.000000 ./usr/share/doc/dolfinx-doc/python/_downloads/e8b180b39a27d7b04c2f666d14475ee3/ │ │ │ -rw-r--r-- 0 root (0) root (0) 11424 2025-03-29 15:17:31.000000 ./usr/share/doc/dolfinx-doc/python/_downloads/e8b180b39a27d7b04c2f666d14475ee3/demo_cahn-hilliard.py │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2025-03-29 15:17:31.000000 ./usr/share/doc/dolfinx-doc/python/_downloads/f6f3cc4d9540871af057920d1ddb5561/ │ │ ├── ./usr/share/doc/dolfinx-doc/python/_downloads/9561cf6cd1a70079b986f4eb31580cbd/demo_poisson_matrix_free.ipynb.gz │ │ │ ├── demo_poisson_matrix_free.ipynb │ │ │ │ ├── Pretty-printed │ │ │ │ │┄ Similarity: 0.9876077586206897% │ │ │ │ │┄ Differences: {"'cells'": "{0: {'id': 'e4125d48'}, 1: {'id': '4cc63393'}, 2: {'id': 'ecb24f22'}, 3: {'id': " │ │ │ │ │┄ "'2cbcb654'}, 4: {'id': 'd1e16c16'}, 5: {'id': '58671937'}, 6: {'id': '8821e9f0'}, 7: " │ │ │ │ │┄ "{'id': 'f442e62f'}, 8: {'id': 'c3cb00b1'}, 9: {'id': 'b214fb47'}, 10: {'id': " │ │ │ │ │┄ "'298129e9'}, 11: {'id': 'd8e53b5c'}, 12: {'id': 'ef8e8e62'}, 13: {'id': 'b9d3fa47'}, " │ │ │ │ │┄ "14: {'id': 'ed31b45d'}, 15: {'id': '89796b7d'}, 16: {'id': '6edc35b1'}, 17: {'id': " │ │ │ │ │┄ "'1fb722ec'}, 1 […] │ │ │ │ │ @@ -1,12 +1,12 @@ │ │ │ │ │ { │ │ │ │ │ "cells": [ │ │ │ │ │ { │ │ │ │ │ "cell_type": "markdown", │ │ │ │ │ - "id": "5fa5dbd1", │ │ │ │ │ + "id": "e4125d48", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "source": [ │ │ │ │ │ "# Matrix-free conjugate gradient solver for the Poisson equation\n", │ │ │ │ │ "\n", │ │ │ │ │ "This demo illustrates how to solve the Poisson equation using a\n", │ │ │ │ │ "matrix-free conjugate gradient (CG) solver. In particular, it\n", │ │ │ │ │ "illustrates how to\n", │ │ │ │ │ @@ -68,84 +68,84 @@ │ │ │ │ │ "\n", │ │ │ │ │ "The modules that will be used are imported:" │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "code", │ │ │ │ │ "execution_count": null, │ │ │ │ │ - "id": "251fe459", │ │ │ │ │ + "id": "4cc63393", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "outputs": [], │ │ │ │ │ "source": [ │ │ │ │ │ "from mpi4py import MPI" │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "code", │ │ │ │ │ "execution_count": null, │ │ │ │ │ - "id": "b10dd62d", │ │ │ │ │ + "id": "ecb24f22", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "outputs": [], │ │ │ │ │ "source": [ │ │ │ │ │ "import numpy as np" │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "code", │ │ │ │ │ "execution_count": null, │ │ │ │ │ - "id": "f22ca54d", │ │ │ │ │ + "id": "2cbcb654", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "outputs": [], │ │ │ │ │ "source": [ │ │ │ │ │ "import dolfinx\n", │ │ │ │ │ "import ufl\n", │ │ │ │ │ "from dolfinx import fem, la\n", │ │ │ │ │ "from ufl import action, dx, grad, inner" │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "markdown", │ │ │ │ │ - "id": "8a3dafa1", │ │ │ │ │ + "id": "d1e16c16", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "source": [ │ │ │ │ │ "We begin by using {py:func}`create_rectangle\n", │ │ │ │ │ "` to create a rectangular\n", │ │ │ │ │ "{py:class}`Mesh ` of the domain, and creating a\n", │ │ │ │ │ "finite element {py:class}`FunctionSpace `\n", │ │ │ │ │ "on the mesh." │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "code", │ │ │ │ │ "execution_count": null, │ │ │ │ │ - "id": "375339cb", │ │ │ │ │ + "id": "58671937", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "outputs": [], │ │ │ │ │ "source": [ │ │ │ │ │ "dtype = dolfinx.default_scalar_type\n", │ │ │ │ │ "real_type = np.real(dtype(0.0)).dtype\n", │ │ │ │ │ "comm = MPI.COMM_WORLD\n", │ │ │ │ │ "mesh = dolfinx.mesh.create_rectangle(comm, [[0.0, 0.0], [1.0, 1.0]], [10, 10], dtype=real_type)" │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "code", │ │ │ │ │ "execution_count": null, │ │ │ │ │ - "id": "23b5d0df", │ │ │ │ │ + "id": "8821e9f0", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "outputs": [], │ │ │ │ │ "source": [ │ │ │ │ │ "# Create function space\n", │ │ │ │ │ "degree = 2\n", │ │ │ │ │ "V = fem.functionspace(mesh, (\"Lagrange\", degree))" │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "markdown", │ │ │ │ │ - "id": "b4d9033a", │ │ │ │ │ + "id": "f442e62f", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "source": [ │ │ │ │ │ "The second argument to {py:class}`functionspace\n", │ │ │ │ │ "` is a tuple consisting of `(family,\n", │ │ │ │ │ "degree)`, where `family` is the finite element family, and `degree`\n", │ │ │ │ │ "specifies the polynomial degree. In this case `V` consists of\n", │ │ │ │ │ "third-order, continuous Lagrange finite element functions.\n", │ │ │ │ │ @@ -156,94 +156,94 @@ │ │ │ │ │ "and then retrieving all facets on the boundary using\n", │ │ │ │ │ "{py:func}`exterior_facet_indices `." │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "code", │ │ │ │ │ "execution_count": null, │ │ │ │ │ - "id": "6053c0b7", │ │ │ │ │ + "id": "c3cb00b1", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "outputs": [], │ │ │ │ │ "source": [ │ │ │ │ │ "tdim = mesh.topology.dim\n", │ │ │ │ │ "mesh.topology.create_connectivity(tdim - 1, tdim)\n", │ │ │ │ │ "facets = dolfinx.mesh.exterior_facet_indices(mesh.topology)" │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "markdown", │ │ │ │ │ - "id": "e323fa4e", │ │ │ │ │ + "id": "b214fb47", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "source": [ │ │ │ │ │ "We now find the degrees of freedom that are associated with the boundary\n", │ │ │ │ │ "facets using\n", │ │ │ │ │ "{py:func}`locate_dofs_topological `" │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "code", │ │ │ │ │ "execution_count": null, │ │ │ │ │ - "id": "37419a3f", │ │ │ │ │ + "id": "298129e9", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "outputs": [], │ │ │ │ │ "source": [ │ │ │ │ │ "dofs = fem.locate_dofs_topological(V=V, entity_dim=tdim - 1, entities=facets)" │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "markdown", │ │ │ │ │ - "id": "25b222ce", │ │ │ │ │ + "id": "d8e53b5c", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "source": [ │ │ │ │ │ "and use {py:func}`dirichletbc ` to define the\n", │ │ │ │ │ "essential boundary condition. On the boundary we prescribe the\n", │ │ │ │ │ "{py:class}`Function ` `uD`, which we create by\n", │ │ │ │ │ "interpolating the expression $u_{\\rm D}$ in the finite element space\n", │ │ │ │ │ "$V$." │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "code", │ │ │ │ │ "execution_count": null, │ │ │ │ │ - "id": "31e75442", │ │ │ │ │ + "id": "ef8e8e62", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "outputs": [], │ │ │ │ │ "source": [ │ │ │ │ │ "uD = fem.Function(V, dtype=dtype)\n", │ │ │ │ │ "uD.interpolate(lambda x: 1 + x[0] ** 2 + 2 * x[1] ** 2)\n", │ │ │ │ │ "bc = fem.dirichletbc(value=uD, dofs=dofs)" │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "markdown", │ │ │ │ │ - "id": "ebd506ea", │ │ │ │ │ + "id": "b9d3fa47", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "source": [ │ │ │ │ │ "Next, we express the variational problem using UFL." │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "code", │ │ │ │ │ "execution_count": null, │ │ │ │ │ - "id": "5acc84e4", │ │ │ │ │ + "id": "ed31b45d", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "outputs": [], │ │ │ │ │ "source": [ │ │ │ │ │ "x = ufl.SpatialCoordinate(mesh)\n", │ │ │ │ │ "u = ufl.TrialFunction(V)\n", │ │ │ │ │ "v = ufl.TestFunction(V)\n", │ │ │ │ │ "f = fem.Constant(mesh, dtype(-6.0))\n", │ │ │ │ │ "a = inner(grad(u), grad(v)) * dx\n", │ │ │ │ │ "L = inner(f, v) * dx\n", │ │ │ │ │ "L_fem = fem.form(L, dtype=dtype)" │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "markdown", │ │ │ │ │ - "id": "0164c14d", │ │ │ │ │ + "id": "89796b7d", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "source": [ │ │ │ │ │ "For the matrix-free solvers we also define a second linear form `M` as\n", │ │ │ │ │ "the {py:class}`action ` of the bilinear form $a$ on an\n", │ │ │ │ │ "arbitrary {py:class}`Function ` `ui`. This linear\n", │ │ │ │ │ "form is defined as\n", │ │ │ │ │ "\n", │ │ │ │ │ @@ -251,78 +251,78 @@ │ │ │ │ │ "M(v) = a(u_i, v) \\quad \\text{for} \\; \\ u_i \\in V.\n", │ │ │ │ │ "$$" │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "code", │ │ │ │ │ "execution_count": null, │ │ │ │ │ - "id": "71c85993", │ │ │ │ │ + "id": "6edc35b1", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "outputs": [], │ │ │ │ │ "source": [ │ │ │ │ │ "ui = fem.Function(V, dtype=dtype)\n", │ │ │ │ │ "M = action(a, ui)\n", │ │ │ │ │ "M_fem = fem.form(M, dtype=dtype)" │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "markdown", │ │ │ │ │ - "id": "e3500687", │ │ │ │ │ + "id": "1fb722ec", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "source": [ │ │ │ │ │ "### Matrix-free conjugate gradient solver\n", │ │ │ │ │ "\n", │ │ │ │ │ "The right hand side vector $b - A x_{\\rm bc}$ is the assembly of the linear\n", │ │ │ │ │ "form $L$ where the essential Dirichlet boundary conditions are implemented\n", │ │ │ │ │ "using lifting. Since we want to avoid assembling the matrix `A`, we compute\n", │ │ │ │ │ "the necessary matrix-vector product using the linear form `M` explicitly." │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "code", │ │ │ │ │ "execution_count": null, │ │ │ │ │ - "id": "927e705d", │ │ │ │ │ + "id": "b9738947", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "outputs": [], │ │ │ │ │ "source": [ │ │ │ │ │ "# Apply lifting: b <- b - A * x_bc\n", │ │ │ │ │ "b = fem.assemble_vector(L_fem)\n", │ │ │ │ │ "ui.x.array[:] = 0.0\n", │ │ │ │ │ "bc.set(ui.x.array, alpha=-1.0)\n", │ │ │ │ │ "fem.assemble_vector(b.array, M_fem)\n", │ │ │ │ │ "b.scatter_reverse(la.InsertMode.add)" │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "code", │ │ │ │ │ "execution_count": null, │ │ │ │ │ - "id": "2bc7c2c8", │ │ │ │ │ + "id": "dafc3857", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "outputs": [], │ │ │ │ │ "source": [ │ │ │ │ │ "# Set BC dofs to zero on right hand side\n", │ │ │ │ │ "bc.set(b.array, alpha=0.0)\n", │ │ │ │ │ "b.scatter_forward()" │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "markdown", │ │ │ │ │ - "id": "999e193a", │ │ │ │ │ + "id": "c6a31b69", │ │ │ │ │ "metadata": { │ │ │ │ │ "lines_to_next_cell": 2 │ │ │ │ │ }, │ │ │ │ │ "source": [ │ │ │ │ │ "To implement the matrix-free CG solver using *DOLFINx* vectors, we define the\n", │ │ │ │ │ "function `action_A` to compute the matrix-vector product $y = A x$." │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "code", │ │ │ │ │ "execution_count": null, │ │ │ │ │ - "id": "0f2524af", │ │ │ │ │ + "id": "abeb3c3b", │ │ │ │ │ "metadata": { │ │ │ │ │ "lines_to_next_cell": 2 │ │ │ │ │ }, │ │ │ │ │ "outputs": [], │ │ │ │ │ "source": [ │ │ │ │ │ "def action_A(x, y):\n", │ │ │ │ │ " # Set coefficient vector of the linear form M and ensure it is updated\n", │ │ │ │ │ @@ -337,15 +337,15 @@ │ │ │ │ │ "\n", │ │ │ │ │ " # Set BC dofs to zero\n", │ │ │ │ │ " bc.set(y.array, alpha=0.0)" │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "markdown", │ │ │ │ │ - "id": "c2cc291a", │ │ │ │ │ + "id": "f1580674", │ │ │ │ │ "metadata": { │ │ │ │ │ "lines_to_next_cell": 2 │ │ │ │ │ }, │ │ │ │ │ "source": [ │ │ │ │ │ "### Basic conjugate gradient solver\n", │ │ │ │ │ "\n", │ │ │ │ │ "Solves the problem `A x = b`, using the function `action_A` as the operator,\n", │ │ │ │ │ @@ -353,15 +353,15 @@ │ │ │ │ │ "vector. `comm` is the MPI Communicator, `max_iter` is the maximum number of\n", │ │ │ │ │ "iterations, `rtol` is the relative tolerance." │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "code", │ │ │ │ │ "execution_count": null, │ │ │ │ │ - "id": "5b280483", │ │ │ │ │ + "id": "86ed85b9", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "outputs": [], │ │ │ │ │ "source": [ │ │ │ │ │ "def cg(comm, action_A, x: la.Vector, b: la.Vector, max_iter: int = 200, rtol: float = 1e-6):\n", │ │ │ │ │ " rtol2 = rtol**2\n", │ │ │ │ │ "\n", │ │ │ │ │ " nr = b.index_map.size_local\n", │ │ │ │ │ @@ -399,61 +399,61 @@ │ │ │ │ │ " p.array[:] = beta * p.array + r\n", │ │ │ │ │ "\n", │ │ │ │ │ " raise RuntimeError(f\"Solver exceeded max iterations ({max_iter}).\")" │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "markdown", │ │ │ │ │ - "id": "8138092d", │ │ │ │ │ + "id": "25b68cfa", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "source": [ │ │ │ │ │ "This matrix-free solver is now used to compute the finite element solution.\n", │ │ │ │ │ "The finite element solution's approximation error as compared with the\n", │ │ │ │ │ "exact solution is measured in the $L_2$-norm." │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "code", │ │ │ │ │ "execution_count": null, │ │ │ │ │ - "id": "345c61e1", │ │ │ │ │ + "id": "be18bea7", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "outputs": [], │ │ │ │ │ "source": [ │ │ │ │ │ "rtol = 1e-6\n", │ │ │ │ │ "u = fem.Function(V, dtype=dtype)\n", │ │ │ │ │ "iter_cg1 = cg(mesh.comm, action_A, u.x, b, max_iter=200, rtol=rtol)" │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "code", │ │ │ │ │ "execution_count": null, │ │ │ │ │ - "id": "4550ae57", │ │ │ │ │ + "id": "9580c9ec", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "outputs": [], │ │ │ │ │ "source": [ │ │ │ │ │ "# Set BC values in the solution vector\n", │ │ │ │ │ "bc.set(u.x.array, alpha=1.0)" │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "code", │ │ │ │ │ "execution_count": null, │ │ │ │ │ - "id": "df65f87d", │ │ │ │ │ + "id": "353a55ff", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "outputs": [], │ │ │ │ │ "source": [ │ │ │ │ │ "def L2Norm(u):\n", │ │ │ │ │ " val = fem.assemble_scalar(fem.form(inner(u, u) * dx, dtype=dtype))\n", │ │ │ │ │ " return np.sqrt(comm.allreduce(val, op=MPI.SUM))" │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "code", │ │ │ │ │ "execution_count": null, │ │ │ │ │ - "id": "3f1d1c08", │ │ │ │ │ + "id": "7a9854b8", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "outputs": [], │ │ │ │ │ "source": [ │ │ │ │ │ "# Print CG iteration number and error\n", │ │ │ │ │ "error_L2_cg1 = L2Norm(u - uD)\n", │ │ │ │ │ "if mesh.comm.rank == 0:\n", │ │ │ │ │ " print(\"Matrix-free CG solver using DOLFINx vectors:\")\n", │ │ ├── ./usr/share/doc/dolfinx-doc/python/_downloads/9ed4657d08dda04de30e6463e2f58d75/demo_mixed-poisson.ipynb.gz │ │ │ ├── demo_mixed-poisson.ipynb │ │ │ │ ├── Pretty-printed │ │ │ │ │┄ Similarity: 0.9856770833333333% │ │ │ │ │┄ Differences: {"'cells'": "{0: {'id': '11658d7f'}, 1: {'id': '2c7f2a91'}, 2: {'id': '5fc9dd45'}, 3: {'id': " │ │ │ │ │┄ "'ceaf6c8b'}}"} │ │ │ │ │ @@ -1,32 +1,32 @@ │ │ │ │ │ { │ │ │ │ │ "cells": [ │ │ │ │ │ { │ │ │ │ │ "cell_type": "markdown", │ │ │ │ │ - "id": "309780a6", │ │ │ │ │ + "id": "11658d7f", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "source": [ │ │ │ │ │ "# Mixed formulation for the Poisson equation" │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "markdown", │ │ │ │ │ - "id": "6af51c42", │ │ │ │ │ + "id": "2c7f2a91", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "source": [ │ │ │ │ │ "This demo illustrates how to solve Poisson equation using a mixed\n", │ │ │ │ │ "(two-field) formulation. In particular, it illustrates how to\n", │ │ │ │ │ "\n", │ │ │ │ │ "* Use mixed and non-continuous finite element spaces.\n", │ │ │ │ │ "* Set essential boundary conditions for subspaces and $H(\\mathrm{div})$ spaces.\n" │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "markdown", │ │ │ │ │ - "id": "c7814f47", │ │ │ │ │ + "id": "5fc9dd45", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "source": [ │ │ │ │ │ "```{admonition} Download sources\n", │ │ │ │ │ ":class: download\n", │ │ │ │ │ "\n", │ │ │ │ │ "* {download}`Python script <./demo_mixed-poisson.py>`\n", │ │ │ │ │ "* {download}`Jupyter notebook <./demo_mixed-poisson.ipynb>`\n", │ │ │ │ │ @@ -99,15 +99,15 @@ │ │ │ │ │ "\n", │ │ │ │ │ "## Implementation" │ │ │ │ │ ] │ │ │ │ │ }, │ │ │ │ │ { │ │ │ │ │ "cell_type": "code", │ │ │ │ │ "execution_count": null, │ │ │ │ │ - "id": "bde3f403", │ │ │ │ │ + "id": "ceaf6c8b", │ │ │ │ │ "metadata": {}, │ │ │ │ │ "outputs": [], │ │ │ │ │ "source": [ │ │ │ │ │ "\n", │ │ │ │ │ "try:\n", │ │ │ │ │ " from petsc4py import PETSc\n", │ │ │ │ │ "\n",