diff --git a/chapter1/complex_mode.ipynb b/chapter1/complex_mode.ipynb index 3f7c8310..0fb38eed 100644 --- a/chapter1/complex_mode.ipynb +++ b/chapter1/complex_mode.ipynb @@ -34,7 +34,8 @@ "We now need to define our inner product space.\n", "We choose the $L^2$ inner product spaces, which is a _[sesquilinear](https://en.wikipedia.org/wiki/Sesquilinear_form) 2-form_,\n", "meaning that $\\langle u, v\\rangle$ is a map from $V_h\\times V_h\\mapsto K$, and\n", - "$\\langle u, v \\rangle = \\int_\\Omega u \\cdot \\bar v ~\\mathrm{d} x$. As it is sesquilinear, we have the following properties:\n", + "$\\langle u, v \\rangle = \\int_\\Omega u \\cdot \\bar v ~\\mathrm{d} x$.\n", + "As it is sesquilinear, we have the following properties:\n", "\n", "$$\n", "\\begin{align}\n", @@ -243,7 +244,7 @@ "x = ufl.SpatialCoordinate(mesh)\n", "u_ex = 0.5 * x[0] ** 2 + 1j * x[1] ** 2\n", "L2_error = dolfinx.fem.form(\n", - " ufl.dot(uh - u_ex, uh - u_ex) * ufl.dx(metadata={\"quadrature_degree\": 5})\n", + " ufl.inner(uh - u_ex, uh - u_ex) * ufl.dx(metadata={\"quadrature_degree\": 5})\n", ")\n", "local_error = dolfinx.fem.assemble_scalar(L2_error)\n", "global_error = np.sqrt(mesh.comm.allreduce(local_error, op=MPI.SUM))\n", diff --git a/chapter1/complex_mode.py b/chapter1/complex_mode.py index ba5f68f2..6349163a 100644 --- a/chapter1/complex_mode.py +++ b/chapter1/complex_mode.py @@ -42,7 +42,8 @@ # We now need to define our inner product space. # We choose the $L^2$ inner product spaces, which is a _[sesquilinear](https://en.wikipedia.org/wiki/Sesquilinear_form) 2-form_, # meaning that $\langle u, v\rangle$ is a map from $V_h\times V_h\mapsto K$, and -# $\langle u, v \rangle = \int_\Omega u \cdot \bar v ~\mathrm{d} x$. As it is sesquilinear, we have the following properties: +# $\langle u, v \rangle = \int_\Omega u \cdot \bar v ~\mathrm{d} x$. +# As it is sesquilinear, we have the following properties: # # $$ # \begin{align} @@ -166,7 +167,7 @@ x = ufl.SpatialCoordinate(mesh) u_ex = 0.5 * x[0] ** 2 + 1j * x[1] ** 2 L2_error = dolfinx.fem.form( - ufl.dot(uh - u_ex, uh - u_ex) * ufl.dx(metadata={"quadrature_degree": 5}) + ufl.inner(uh - u_ex, uh - u_ex) * ufl.dx(metadata={"quadrature_degree": 5}) ) local_error = dolfinx.fem.assemble_scalar(L2_error) global_error = np.sqrt(mesh.comm.allreduce(local_error, op=MPI.SUM))