Skip to content

Commit 96fa05d

Browse files
jorgensdnavlalli
andauthored
Typo fixes by @navlalli (#188)
* Fix typos * Fix typos in chapter 1 * Change u * exact to u_exact * Add complex back to display_name * Add message about jupytext in README * Fix typos in chapter 2 * Fix typos in chapter 3 * Fix typos in subdomains tutorial * Fix typos in chapter 4 * Revert import order --------- Co-authored-by: Navraj Lalli <navrajsinghlalli@gmail.com>
1 parent a679ec4 commit 96fa05d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+150
-998
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ If you want to contribute to this tutorial, please make a fork of the repository
1616
act -j test-nightly
1717
```
1818

19-
Any code added to the tutorial should work in parallel.
20-
2119
Alternatively, if you want to add a separate chapter, a Jupyter notebook can be added to a pull request, without integrating it into the tutorial. If so, the notebook will be reviewed and modified to be included in the tutorial.
2220

23-
Also ensure that both Python file and notebook files are updated by using jupytext, i.e.
21+
Any code added to the tutorial should work in parallel. If any changes are made to `ipynb` files, please ensure that these changes are reflected in the corresponding `py` files by using [`jupytext`](https://jupytext.readthedocs.io/en/latest/faq.html#can-i-use-jupytext-with-jupyterhub-binder-nteract-colab-saturn-or-azure):
2422

2523
```bash
2624
python3 -m jupytext --sync */*.ipynb
2725
```
2826

27+
Any code added to the tutorial should work in parallel.
28+
2929
## Dependencies
3030

3131
It is adviced to use a pre-installed version of DOLFINx, for instance through conda or docker. Remaining dependencies can be installed with

chapter1/complex_mode.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"source": [
7474
"However, as we would like to solve linear algebra problems of the form $Ax=b$, we need to be able to use matrices and vectors that support real and complex numbers. As [PETSc](https://petsc.org/release/) is one of the most popular interfaces to linear algebra packages, we need to be able to work with their matrix and vector structures.\n",
7575
"\n",
76-
"Unfortunately, PETSc only supports one floating type in their matrices, thus we need to install two versions of PETSc, one that supports `float64` and one that supports `complex128`. In the [docker images](https://hub.docker.com/r/dolfinx/dolfinx) for DOLFINx, both versions are installed, and one can switch between them by calling `source dolfinx-real-mode` or `source dolfinx-complex-mode`. For the `dolfinx/lab` images, one can change the Python kernel to be either the real or complex mode, by going to `Kernel->Change Kernel...` and choose `Python3 (ipykernel)` (for real mode) or `Python3 (DOLFINx complex)` (for complex mode).\n",
76+
"Unfortunately, PETSc only supports one floating type in their matrices, thus we need to install two versions of PETSc, one that supports `float64` and one that supports `complex128`. In the [docker images](https://hub.docker.com/r/dolfinx/dolfinx) for DOLFINx, both versions are installed, and one can switch between them by calling `source dolfinx-real-mode` or `source dolfinx-complex-mode`. For the `dolfinx/lab` images, one can change the Python kernel to be either the real or complex mode, by going to `Kernel->Change Kernel...` and choosing `Python3 (ipykernel)` (for real mode) or `Python3 (DOLFINx complex)` (for complex mode).\n",
7777
"\n",
7878
"We check that we are using the correct installation of PETSc by inspecting the scalar type.\n"
7979
]
@@ -162,7 +162,7 @@
162162
"id": "9efe0968-bf32-4184-85f7-4e8cc3401cfb",
163163
"metadata": {},
164164
"source": [
165-
"Similarly, if we want to use the function `ufl.derivative` to take derivatives of functionals, we need to take some special care. As `derivative` inserts a `ufl.TestFunction` to represent the variation, we need to take the conjugate of this to in order to assemble vectors.\n"
165+
"Similarly, if we want to use the function `ufl.derivative` to take derivatives of functionals, we need to take some special care. As `ufl.derivative` inserts a `ufl.TestFunction` to represent the variation, we need to take the conjugate of this to be able to use it to assemble vectors.\n"
166166
]
167167
},
168168
{

chapter1/complex_mode.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959

6060
# However, as we would like to solve linear algebra problems of the form $Ax=b$, we need to be able to use matrices and vectors that support real and complex numbers. As [PETSc](https://petsc.org/release/) is one of the most popular interfaces to linear algebra packages, we need to be able to work with their matrix and vector structures.
6161
#
62-
# Unfortunately, PETSc only supports one floating type in their matrices, thus we need to install two versions of PETSc, one that supports `float64` and one that supports `complex128`. In the [docker images](https://hub.docker.com/r/dolfinx/dolfinx) for DOLFINx, both versions are installed, and one can switch between them by calling `source dolfinx-real-mode` or `source dolfinx-complex-mode`. For the `dolfinx/lab` images, one can change the Python kernel to be either the real or complex mode, by going to `Kernel->Change Kernel...` and choose `Python3 (ipykernel)` (for real mode) or `Python3 (DOLFINx complex)` (for complex mode).
62+
# Unfortunately, PETSc only supports one floating type in their matrices, thus we need to install two versions of PETSc, one that supports `float64` and one that supports `complex128`. In the [docker images](https://hub.docker.com/r/dolfinx/dolfinx) for DOLFINx, both versions are installed, and one can switch between them by calling `source dolfinx-real-mode` or `source dolfinx-complex-mode`. For the `dolfinx/lab` images, one can change the Python kernel to be either the real or complex mode, by going to `Kernel->Change Kernel...` and choosing `Python3 (ipykernel)` (for real mode) or `Python3 (DOLFINx complex)` (for complex mode).
6363
#
6464
# We check that we are using the correct installation of PETSc by inspecting the scalar type.
6565
#
@@ -92,7 +92,7 @@
9292
print(L)
9393
print(L2)
9494

95-
# Similarly, if we want to use the function `ufl.derivative` to take derivatives of functionals, we need to take some special care. As `derivative` inserts a `ufl.TestFunction` to represent the variation, we need to take the conjugate of this to in order to assemble vectors.
95+
# Similarly, if we want to use the function `ufl.derivative` to take derivatives of functionals, we need to take some special care. As `ufl.derivative` inserts a `ufl.TestFunction` to represent the variation, we need to take the conjugate of this to be able to use it to assemble vectors.
9696
#
9797

9898
J = u_c**2 * ufl.dx

chapter1/fundamentals_code.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"\n",
3636
"Inserting $u_e$ in the original boundary problem, we find that \n",
3737
"\\begin{align}\n",
38-
" f(x,y)= -6,\\qquad u_d(x,y)=u_e(x,y)=1+x^2+2y^2,\n",
38+
" f(x,y)= -6,\\qquad u_D(x,y)=u_e(x,y)=1+x^2+2y^2,\n",
3939
"\\end{align}\n",
4040
"regardless of the shape of the domain as long as we prescribe \n",
4141
"$u_e$ on the boundary.\n",
@@ -1541,7 +1541,7 @@
15411541
"name": "python",
15421542
"nbconvert_exporter": "python",
15431543
"pygments_lexer": "ipython3",
1544-
"version": "3.10.6"
1544+
"version": "3.10.12"
15451545
},
15461546
"vscode": {
15471547
"interpreter": {

chapter1/fundamentals_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
#
4444
# Inserting $u_e$ in the original boundary problem, we find that
4545
# \begin{align}
46-
# f(x,y)= -6,\qquad u_d(x,y)=u_e(x,y)=1+x^2+2y^2,
46+
# f(x,y)= -6,\qquad u_D(x,y)=u_e(x,y)=1+x^2+2y^2,
4747
# \end{align}
4848
# regardless of the shape of the domain as long as we prescribe
4949
# $u_e$ on the boundary.

chapter1/membrane.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ In this section, we will turn our attentition to a physically more relevant prob
88

99
We would like to compute the deflection $D(x,y)$ of a two-dimensional, circular membrane of radius $R$, subject to a load $p$ over the membrane. The appropriate PDE model is
1010
\begin{align}
11-
-T \nabla^2D&=p \quad\text{in }\quad \Omega=\{(x,y)\vert x^2+y^2\leq R \}.
11+
-T \nabla^2D&=p \quad\text{in }\quad \Omega=\{(x,y)\vert x^2+y^2\leq R^2 \}.
1212
\end{align}
1313
Here, $T$ is the tension in the membrane (constant), and $p$ is the external pressure load. The boundary of the membrane has no deflection. This implies that $D=0$ is the boundary condition. We model a localized load as a Gaussian function:
1414
\begin{align}
@@ -36,7 +36,7 @@ With $D_e=\frac{AR^2}{8\pi\sigma T}$ and dropping the bars we obtain the scaled
3636
\begin{align}
3737
-\nabla^2 w = 4e^{-\beta^2(x^2+(y-R_0)^2)}
3838
\end{align}
39-
to be solved over the unit disc with $w=0$ on the boundary. Now there are only two parameters which vary the dimensionless extent of the pressure, $\beta$, and the location of the pressure peak, $R_0\in[0,1]$. As $\beta\to 0$, the solution will approach the special case $w=1-x^2-y^2$. Given a computed scaed solution $w$, the physical deflection can be computed by
39+
to be solved over the unit disc with $w=0$ on the boundary. Now there are only two parameters which vary the dimensionless extent of the pressure, $\beta$, and the location of the pressure peak, $R_0\in[0,1]$. As $\beta\to 0$, the solution will approach the special case $w=1-x^2-y^2$. Given a computed scaled solution $w$, the physical deflection can be computed by
4040
\begin{align}
4141
D=\frac{AR^2}{8\pi\sigma T}w.
4242
\end{align}

0 commit comments

Comments
 (0)