Skip to content

Commit 0b3745e

Browse files
committed
Merge branch 'main' into release
2 parents 7b2ccb0 + dcecbeb commit 0b3745e

28 files changed

+476
-3831
lines changed

.github/dependabot.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "github-actions" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"
12+
- package-ecosystem: "pip" # See documentation for possible values
13+
directory: "python/"
14+
schedule:
15+
interval: "weekly"

.pre-commit-config.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
repos:
2+
- repo: https://github.com/kynan/nbstripout
3+
rev: 0.7.1
4+
hooks:
5+
- id: nbstripout

README.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# The DOLFINx tutorial
22

3-
[![Test, build and publish](https://github.com/jorgensd/dolfinx-tutorial/actions/workflows/build-publish.yml/badge.svg)](https://github.com/jorgensd/dolfinx-tutorial/actions/workflows/build-publish.yml)
4-
[![Test release branch against DOLFINx nightly build](https://github.com/jorgensd/dolfinx-tutorial/actions/workflows/nightly.yml/badge.svg)](https://github.com/jorgensd/dolfinx-tutorial/actions/workflows/nightly.yml)
3+
[![Test, build and publish](https://github.com/jorgensd/dolfinx-tutorial/actions/workflows/deploy.yml/badge.svg)](https://github.com/jorgensd/dolfinx-tutorial/actions/workflows/deploy.yml)
4+
[![Test release branch against DOLFINx nightly build](https://github.com/jorgensd/dolfinx-tutorial/actions/workflows/test_nightly.yml/badge.svg)](https://github.com/jorgensd/dolfinx-tutorial/actions/workflows/test_nightly.yml)
55

66
Author: Jørgen S. Dokken
77

@@ -26,6 +26,12 @@ python3 -m jupytext --sync */*.ipynb
2626

2727
Any code added to the tutorial should work in parallel.
2828

29+
To strip notebook output, one can use pre-commit.
30+
31+
```bash
32+
pre-commit run --all-files
33+
```
34+
2935
## Dependencies
3036

3137
It is adviced to use a pre-installed version of DOLFINx, for instance through conda or docker. Remaining dependencies can be installed with
@@ -55,3 +61,4 @@ from the root of this repository, and run
5561
```
5662

5763
from the main directory.
64+

chapter1/complex_mode.ipynb

+19-19
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"id": "116651d1-d44d-471d-b13c-36855d8464ec",
5+
"id": "0",
66
"metadata": {},
77
"source": [
88
"# The Poisson problem with complex numbers\n",
@@ -40,7 +40,7 @@
4040
{
4141
"cell_type": "code",
4242
"execution_count": null,
43-
"id": "b52b39d9-260d-4c54-b62a-7440c3b92e5a",
43+
"id": "1",
4444
"metadata": {},
4545
"outputs": [],
4646
"source": [
@@ -59,7 +59,7 @@
5959
},
6060
{
6161
"cell_type": "markdown",
62-
"id": "699ab6a9-4427-4c54-95c8-ce5de5d11b97",
62+
"id": "2",
6363
"metadata": {},
6464
"source": [
6565
"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",
@@ -72,7 +72,7 @@
7272
{
7373
"cell_type": "code",
7474
"execution_count": null,
75-
"id": "4d5b03e3-4d7f-45b7-95eb-9130a5141f34",
75+
"id": "3",
7676
"metadata": {},
7777
"outputs": [],
7878
"source": [
@@ -84,7 +84,7 @@
8484
},
8585
{
8686
"cell_type": "markdown",
87-
"id": "9ea24650-5027-4491-a459-375d7cf69fe3",
87+
"id": "4",
8888
"metadata": {},
8989
"source": [
9090
"## Variational problem\n",
@@ -94,7 +94,7 @@
9494
{
9595
"cell_type": "code",
9696
"execution_count": null,
97-
"id": "be8461a0-a089-4ff3-8bc8-61b016407e70",
97+
"id": "5",
9898
"metadata": {},
9999
"outputs": [],
100100
"source": [
@@ -108,7 +108,7 @@
108108
},
109109
{
110110
"cell_type": "markdown",
111-
"id": "d6f70a1e-d128-470b-9b32-b86dd807a0bf",
111+
"id": "6",
112112
"metadata": {},
113113
"source": [
114114
"Note that we have used the `PETSc.ScalarType` to wrap the constant source on the right hand side. This is because we want the integration kernels to assemble into the correct floating type.\n",
@@ -121,7 +121,7 @@
121121
{
122122
"cell_type": "code",
123123
"execution_count": null,
124-
"id": "779ab267-4609-4628-9577-a280b9c18b6d",
124+
"id": "7",
125125
"metadata": {},
126126
"outputs": [],
127127
"source": [
@@ -132,7 +132,7 @@
132132
},
133133
{
134134
"cell_type": "markdown",
135-
"id": "9efe0968-bf32-4184-85f7-4e8cc3401cfb",
135+
"id": "8",
136136
"metadata": {},
137137
"source": [
138138
"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"
@@ -141,7 +141,7 @@
141141
{
142142
"cell_type": "code",
143143
"execution_count": null,
144-
"id": "d61c477a-d364-4a81-9362-42f1eb4cd8ee",
144+
"id": "9",
145145
"metadata": {},
146146
"outputs": [],
147147
"source": [
@@ -153,7 +153,7 @@
153153
},
154154
{
155155
"cell_type": "markdown",
156-
"id": "1b664480-fc11-404d-83ea-7e2548894904",
156+
"id": "10",
157157
"metadata": {},
158158
"source": [
159159
"We define our Dirichlet condition and setup and solve the variational problem.\n",
@@ -163,7 +163,7 @@
163163
{
164164
"cell_type": "code",
165165
"execution_count": null,
166-
"id": "eb2357ae-ac71-4407-bf37-432f1b1e31d0",
166+
"id": "11",
167167
"metadata": {},
168168
"outputs": [],
169169
"source": [
@@ -177,7 +177,7 @@
177177
},
178178
{
179179
"cell_type": "markdown",
180-
"id": "053bfa60-c382-4216-beaf-c06e95e70067",
180+
"id": "12",
181181
"metadata": {},
182182
"source": [
183183
"We compute the $L^2$ error and the max error.\n",
@@ -188,7 +188,7 @@
188188
{
189189
"cell_type": "code",
190190
"execution_count": null,
191-
"id": "f51d9a7a-2cde-4d0f-8606-91f91c372c4b",
191+
"id": "13",
192192
"metadata": {},
193193
"outputs": [],
194194
"source": [
@@ -203,7 +203,7 @@
203203
},
204204
{
205205
"cell_type": "markdown",
206-
"id": "36431a2a-2063-4070-b1fc-3f58a3b7316b",
206+
"id": "14",
207207
"metadata": {},
208208
"source": [
209209
"## Plotting\n",
@@ -214,7 +214,7 @@
214214
{
215215
"cell_type": "code",
216216
"execution_count": null,
217-
"id": "7a3f89d0-4771-4cc3-a0cd-ce8451a414ba",
217+
"id": "15",
218218
"metadata": {},
219219
"outputs": [],
220220
"source": [
@@ -232,7 +232,7 @@
232232
{
233233
"cell_type": "code",
234234
"execution_count": null,
235-
"id": "9564e40a-ca18-497a-8de0-ef075aae3199",
235+
"id": "16",
236236
"metadata": {},
237237
"outputs": [],
238238
"source": [
@@ -247,7 +247,7 @@
247247
{
248248
"cell_type": "code",
249249
"execution_count": null,
250-
"id": "c179fdda-6ae6-4979-a19b-fadfebab2f0e",
250+
"id": "17",
251251
"metadata": {},
252252
"outputs": [],
253253
"source": [
@@ -263,7 +263,7 @@
263263
{
264264
"cell_type": "code",
265265
"execution_count": null,
266-
"id": "a63144b5-e3fc-445e-acea-b5d744bf7634",
266+
"id": "18",
267267
"metadata": {},
268268
"outputs": [],
269269
"source": []

0 commit comments

Comments
 (0)