Skip to content

Commit aa4ef09

Browse files
committed
Merge branch 'main' into release
2 parents adf0314 + d054ef7 commit aa4ef09

26 files changed

+85
-164
lines changed

.github/actions/install-dependencies/action.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ name: Install dependencies
33
runs:
44
using: composite
55
steps:
6-
- name: Install apt dependencies and upgrade pip
7-
shell: bash -el {0}
8-
run: |
9-
apt-get update && apt-get install -y libgl1-mesa-glx libxrender1 xvfb
10-
python3 -m pip install -U pip
6+
- name: Install apt dependencies and upgrade pip
7+
shell: bash -el {0}
8+
run: |
9+
apt-get update && apt-get install -y libxrender1 xvfb

.github/workflows/publish_docker.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,10 @@ jobs:
5454
platforms: linux/amd64
5555
tags: ${{ steps.meta.outputs.tags }}
5656
labels: ${{ steps.meta.outputs.labels }}
57-
58-
5957

6058
- name: Build (arm) and push (amd/arm) Docker image
6159
uses: docker/build-push-action@v5
62-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
60+
if: github.event_name == 'push'
6361
with:
6462
context: .
6563
push: true

.github/workflows/test_nightly.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ jobs:
3232
uses: ./.github/actions/install-dependencies
3333

3434
- name: Install requirements
35-
run: python3 -m pip install --no-cache-dir --no-binary=h5py . --upgrade
35+
run: |
36+
python3 -m pip install --break-system-packages -U pip setuptools pkgconfig
37+
python3 -m pip install --no-build-isolation --break-system-packages --no-cache-dir --no-binary=h5py . --upgrade
38+
39+
- name: Test building the book
40+
run: PYVISTA_OFF_SCREEN=false jupyter-book build -W .
3641

3742
- name: Test building the book
3843
run: PYVISTA_OFF_SCREEN=false jupyter-book build -W .
@@ -42,30 +47,29 @@ jobs:
4247
run: |
4348
export PKG_CONFIG_PATH=/usr/local/dolfinx-complex/lib/pkgconfig:$PKG_CONFIG_PATH
4449
export PETSC_ARCH=linux-gnu-complex128-32
45-
export PYTHONPATH=/usr/local/dolfinx-complex/lib/python3.10/dist-packages:$PYTHONPATH
50+
export PYTHONPATH=/usr/local/dolfinx-complex/lib/python3.12/dist-packages:$PYTHONPATH
4651
export LD_LIBRARY_PATH=/usr/local/dolfinx-complex/lib:$LD_LIBRARY_PATH
4752
python3 complex_mode.py
4853
mpirun -n 2 python3 complex_mode.py
4954
5055
- name: Test chapter 1
5156
working-directory: chapter1
5257
run: |
53-
python3 -c "from pyvista import start_xvfb; start_xvfb(0.1)"
54-
mpirun -n 2 python3 fundamentals_code.py
55-
mpirun -n 2 python3 nitsche.py
56-
mpirun -n 2 python3 membrane_code.py
58+
python3 -c "from pyvista import start_xvfb; start_xvfb(0.1)"
59+
mpirun -n 2 python3 fundamentals_code.py
60+
mpirun -n 2 python3 nitsche.py
61+
mpirun -n 2 python3 membrane_code.py
5762
5863
- name: Test chapter 2
5964
working-directory: chapter2
60-
run: |
65+
run: |
6166
mpirun -n 2 python3 diffusion_code.py
6267
mpirun -n 2 python3 heat_code.py
6368
mpirun -n 2 python3 linearelasticity_code.py
6469
mpirun -n 2 python3 hyperelasticity.py
6570
mpirun -n 2 python3 nonlinpoisson_code.py
6671
mpirun -n 2 python3 ns_code1.py
6772
mpirun -n 2 python3 ns_code2.py
68-
6973
- name: Test chapter 3
7074
working-directory: chapter3
7175
run: |
@@ -75,7 +79,6 @@ jobs:
7579
mpirun -n 2 python3 robin_neumann_dirichlet.py
7680
mpirun -n 2 python3 component_bc.py
7781
mpirun -n 2 python3 em.py
78-
7982
- name: Test chapter 4
8083
working-directory: chapter4
8184
run: |

Changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## v0.9.0
4+
5+
- `scale` in `apply_lifting` has been renamed to `alpha`
6+
- Use `dolfinx.fem.Function.x.petsc_vec` as opposed to `dolfinx.fem.Function.vector`
7+
38
## v0.8.0
49

510
- Replace all `ufl.FiniteElement` and `ufl.VectorElement` with the appropriate `basix.ufl.element`

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/jorgensd/dolfinx-tutorial:v0.7.2
1+
FROM ghcr.io/jorgensd/dolfinx-tutorial:release
22

33
# create user with a home directory
44
ARG NB_USER=jovyan

chapter1/complex_mode.ipynb

Lines changed: 13 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,10 @@
3939
},
4040
{
4141
"cell_type": "code",
42-
"execution_count": 1,
42+
"execution_count": null,
4343
"id": "b52b39d9-260d-4c54-b62a-7440c3b92e5a",
4444
"metadata": {},
45-
"outputs": [
46-
{
47-
"name": "stdout",
48-
"output_type": "stream",
49-
"text": [
50-
"float64\n",
51-
"complex128\n"
52-
]
53-
}
54-
],
45+
"outputs": [],
5546
"source": [
5647
"from mpi4py import MPI\n",
5748
"import dolfinx\n",
@@ -80,18 +71,10 @@
8071
},
8172
{
8273
"cell_type": "code",
83-
"execution_count": 2,
74+
"execution_count": null,
8475
"id": "4d5b03e3-4d7f-45b7-95eb-9130a5141f34",
8576
"metadata": {},
86-
"outputs": [
87-
{
88-
"name": "stdout",
89-
"output_type": "stream",
90-
"text": [
91-
"<class 'numpy.complex128'>\n"
92-
]
93-
}
94-
],
77+
"outputs": [],
9578
"source": [
9679
"from petsc4py import PETSc\n",
9780
"from dolfinx.fem.petsc import assemble_vector\n",
@@ -110,7 +93,7 @@
11093
},
11194
{
11295
"cell_type": "code",
113-
"execution_count": 3,
96+
"execution_count": null,
11497
"id": "be8461a0-a089-4ff3-8bc8-61b016407e70",
11598
"metadata": {},
11699
"outputs": [],
@@ -137,19 +120,10 @@
137120
},
138121
{
139122
"cell_type": "code",
140-
"execution_count": 4,
123+
"execution_count": null,
141124
"id": "779ab267-4609-4628-9577-a280b9c18b6d",
142125
"metadata": {},
143-
"outputs": [
144-
{
145-
"name": "stdout",
146-
"output_type": "stream",
147-
"text": [
148-
"{ c_0 * (conj((v_0))) } * dx(<Mesh #0>[everywhere], {})\n",
149-
"{ c_0 * (conj((v_0))) } * dx(<Mesh #0>[everywhere], {})\n"
150-
]
151-
}
152-
],
126+
"outputs": [],
153127
"source": [
154128
"L2 = f * ufl.conj(v) * ufl.dx\n",
155129
"print(L)\n",
@@ -166,78 +140,10 @@
166140
},
167141
{
168142
"cell_type": "code",
169-
"execution_count": 5,
143+
"execution_count": null,
170144
"id": "d61c477a-d364-4a81-9362-42f1eb4cd8ee",
171145
"metadata": {},
172-
"outputs": [
173-
{
174-
"name": "stdout",
175-
"output_type": "stream",
176-
"text": [
177-
"[4.21666667e-03+3.33333333e-05j 1.58750000e-03+8.33333333e-06j\n",
178-
" 4.68333333e-03+1.00000000e-04j 8.13333333e-03+2.66666667e-04j\n",
179-
" 3.35000000e-03+3.33333333e-05j 4.68333333e-03+3.66666667e-04j\n",
180-
" 6.43333333e-03+2.66666667e-04j 8.13333333e-03+8.66666667e-04j\n",
181-
" 2.58333333e-03+3.33333333e-05j 4.68333333e-03+8.33333333e-04j\n",
182-
" 4.93333333e-03+2.66666667e-04j 6.43333333e-03+8.66666667e-04j\n",
183-
" 8.13333333e-03+1.86666667e-03j 1.91666667e-03+3.33333333e-05j\n",
184-
" 4.68333333e-03+1.50000000e-03j 3.63333333e-03+2.66666667e-04j\n",
185-
" 4.93333333e-03+8.66666667e-04j 6.43333333e-03+1.86666667e-03j\n",
186-
" 8.13333333e-03+3.26666667e-03j 1.35000000e-03+3.33333333e-05j\n",
187-
" 4.68333333e-03+2.36666667e-03j 2.53333333e-03+2.66666667e-04j\n",
188-
" 3.63333333e-03+8.66666667e-04j 4.93333333e-03+1.86666667e-03j\n",
189-
" 6.43333333e-03+3.26666667e-03j 8.13333333e-03+5.06666667e-03j\n",
190-
" 8.83333333e-04+3.33333333e-05j 4.68333333e-03+3.43333333e-03j\n",
191-
" 1.63333333e-03+2.66666667e-04j 2.53333333e-03+8.66666667e-04j\n",
192-
" 3.63333333e-03+1.86666667e-03j 4.93333333e-03+3.26666667e-03j\n",
193-
" 6.43333333e-03+5.06666667e-03j 8.13333333e-03+7.26666667e-03j\n",
194-
" 5.16666667e-04+3.33333333e-05j 4.68333333e-03+4.70000000e-03j\n",
195-
" 9.33333333e-04+2.66666667e-04j 1.63333333e-03+8.66666667e-04j\n",
196-
" 2.53333333e-03+1.86666667e-03j 3.63333333e-03+3.26666667e-03j\n",
197-
" 4.93333333e-03+5.06666667e-03j 6.43333333e-03+7.26666667e-03j\n",
198-
" 8.13333333e-03+9.86666667e-03j 2.50000000e-04+3.33333333e-05j\n",
199-
" 4.68333333e-03+6.16666667e-03j 4.33333333e-04+2.66666667e-04j\n",
200-
" 9.33333333e-04+8.66666667e-04j 1.63333333e-03+1.86666667e-03j\n",
201-
" 2.53333333e-03+3.26666667e-03j 3.63333333e-03+5.06666667e-03j\n",
202-
" 4.93333333e-03+7.26666667e-03j 6.43333333e-03+9.86666667e-03j\n",
203-
" 8.13333333e-03+1.28666667e-02j 8.33333333e-05+3.33333333e-05j\n",
204-
" 4.68333333e-03+7.83333333e-03j 1.33333333e-04+2.66666667e-04j\n",
205-
" 4.33333333e-04+8.66666667e-04j 9.33333333e-04+1.86666667e-03j\n",
206-
" 1.63333333e-03+3.26666667e-03j 2.53333333e-03+5.06666667e-03j\n",
207-
" 3.63333333e-03+7.26666667e-03j 4.93333333e-03+9.86666667e-03j\n",
208-
" 6.43333333e-03+1.28666667e-02j 8.13333333e-03+1.62666667e-02j\n",
209-
" 1.25000000e-05+2.50000000e-05j 3.09583333e-03+6.19166667e-03j\n",
210-
" 1.66666667e-05+1.66666667e-04j 1.33333333e-04+8.66666667e-04j\n",
211-
" 4.33333333e-04+1.86666667e-03j 9.33333333e-04+3.26666667e-03j\n",
212-
" 1.63333333e-03+5.06666667e-03j 2.53333333e-03+7.26666667e-03j\n",
213-
" 3.63333333e-03+9.86666667e-03j 4.93333333e-03+1.28666667e-02j\n",
214-
" 6.43333333e-03+1.62666667e-02j 3.91666667e-03+9.36666667e-03j\n",
215-
" 1.66666667e-05+5.00000000e-04j 1.33333333e-04+1.86666667e-03j\n",
216-
" 4.33333333e-04+3.26666667e-03j 9.33333333e-04+5.06666667e-03j\n",
217-
" 1.63333333e-03+7.26666667e-03j 2.53333333e-03+9.86666667e-03j\n",
218-
" 3.63333333e-03+1.28666667e-02j 4.93333333e-03+1.62666667e-02j\n",
219-
" 3.08333333e-03+9.36666667e-03j 1.66666667e-05+1.03333333e-03j\n",
220-
" 1.33333333e-04+3.26666667e-03j 4.33333333e-04+5.06666667e-03j\n",
221-
" 9.33333333e-04+7.26666667e-03j 1.63333333e-03+9.86666667e-03j\n",
222-
" 2.53333333e-03+1.28666667e-02j 3.63333333e-03+1.62666667e-02j\n",
223-
" 2.35000000e-03+9.36666667e-03j 1.66666667e-05+1.76666667e-03j\n",
224-
" 1.33333333e-04+5.06666667e-03j 4.33333333e-04+7.26666667e-03j\n",
225-
" 9.33333333e-04+9.86666667e-03j 1.63333333e-03+1.28666667e-02j\n",
226-
" 2.53333333e-03+1.62666667e-02j 1.71666667e-03+9.36666667e-03j\n",
227-
" 1.66666667e-05+2.70000000e-03j 1.33333333e-04+7.26666667e-03j\n",
228-
" 4.33333333e-04+9.86666667e-03j 9.33333333e-04+1.28666667e-02j\n",
229-
" 1.63333333e-03+1.62666667e-02j 1.18333333e-03+9.36666667e-03j\n",
230-
" 1.66666667e-05+3.83333333e-03j 1.33333333e-04+9.86666667e-03j\n",
231-
" 4.33333333e-04+1.28666667e-02j 9.33333333e-04+1.62666667e-02j\n",
232-
" 7.50000000e-04+9.36666667e-03j 1.66666667e-05+5.16666667e-03j\n",
233-
" 1.33333333e-04+1.28666667e-02j 4.33333333e-04+1.62666667e-02j\n",
234-
" 4.16666667e-04+9.36666667e-03j 1.66666667e-05+6.70000000e-03j\n",
235-
" 1.33333333e-04+1.62666667e-02j 1.83333333e-04+9.36666667e-03j\n",
236-
" 1.66666667e-05+8.43333333e-03j 5.00000000e-05+9.36666667e-03j\n",
237-
" 4.16666667e-06+3.17500000e-03j]\n"
238-
]
239-
}
240-
],
146+
"outputs": [],
241147
"source": [
242148
"J = u_c**2 * ufl.dx\n",
243149
"F = ufl.derivative(J, u_c, ufl.conj(v))\n",
@@ -256,7 +162,7 @@
256162
},
257163
{
258164
"cell_type": "code",
259-
"execution_count": 6,
165+
"execution_count": null,
260166
"id": "eb2357ae-ac71-4407-bf37-432f1b1e31d0",
261167
"metadata": {},
262168
"outputs": [],
@@ -281,18 +187,10 @@
281187
},
282188
{
283189
"cell_type": "code",
284-
"execution_count": 7,
190+
"execution_count": null,
285191
"id": "f51d9a7a-2cde-4d0f-8606-91f91c372c4b",
286192
"metadata": {},
287-
"outputs": [
288-
{
289-
"name": "stdout",
290-
"output_type": "stream",
291-
"text": [
292-
"(0.0007865435216227239+0.0017660156338113711j) 3.553078358632328e-06\n"
293-
]
294-
}
295-
],
193+
"outputs": [],
296194
"source": [
297195
"x = ufl.SpatialCoordinate(mesh)\n",
298196
"u_ex = 0.5 * x[0]**2 + 1j*x[1]**2\n",
@@ -322,6 +220,7 @@
322220
"source": [
323221
"import pyvista\n",
324222
"pyvista.start_xvfb()\n",
223+
"mesh.topology.create_connectivity(mesh.topology.dim, mesh.topology.dim)\n",
325224
"p_mesh = pyvista.UnstructuredGrid(*dolfinx.plot.vtk_mesh(mesh, mesh.topology.dim))\n",
326225
"pyvista_cells, cell_types, geometry = dolfinx.plot.vtk_mesh(V)\n",
327226
"grid = pyvista.UnstructuredGrid(pyvista_cells, cell_types, geometry)\n",

chapter1/complex_mode.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@
126126

127127
import pyvista
128128
pyvista.start_xvfb()
129+
mesh.topology.create_connectivity(mesh.topology.dim, mesh.topology.dim)
129130
p_mesh = pyvista.UnstructuredGrid(*dolfinx.plot.vtk_mesh(mesh, mesh.topology.dim))
130131
pyvista_cells, cell_types, geometry = dolfinx.plot.vtk_mesh(V)
131132
grid = pyvista.UnstructuredGrid(pyvista_cells, cell_types, geometry)

chapter1/fundamentals_code.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,7 @@
453453
"source": [
454454
"from dolfinx import plot\n",
455455
"pyvista.start_xvfb()\n",
456+
"domain.topology.create_connectivity(tdim, tdim)\n",
456457
"topology, cell_types, geometry = plot.vtk_mesh(domain, tdim)\n",
457458
"grid = pyvista.UnstructuredGrid(topology, cell_types, geometry)"
458459
]

chapter1/fundamentals_code.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@
232232
# + vscode={"languageId": "python"}
233233
from dolfinx import plot
234234
pyvista.start_xvfb()
235+
domain.topology.create_connectivity(tdim, tdim)
235236
topology, cell_types, geometry = plot.vtk_mesh(domain, tdim)
236237
grid = pyvista.UnstructuredGrid(topology, cell_types, geometry)
237238
# -

chapter1/membrane_code.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@
338338
"metadata": {},
339339
"source": [
340340
"Now we can compute which cells the bounding box tree collides with using `dolfinx.geometry.compute_collisions_points`. This function returns a list of cells whose bounding box collide for each input point. As different points might have different number of cells, the data is stored in `dolfinx.cpp.graph.AdjacencyList_int32`, where one can access the cells for the `i`th point by calling `links(i)`.\n",
341-
"However, as the bounding box of a cell spans more of $\\mathbb{R}^n$ than the actual cell, we check that the actual cell collides with cell\n",
341+
"However, as the bounding box of a cell spans more of $\\mathbb{R}^n$ than the actual cell, we check that the actual cell collides with the input point\n",
342342
"using `dolfinx.geometry.select_colliding_cells`, which measures the exact distance between the point and the cell (approximated as a convex hull for higher order geometries).\n",
343343
"This function also returns an adjacency-list, as the point might align with a facet, edge or vertex that is shared between multiple cells in the mesh.\n",
344344
"\n",

0 commit comments

Comments
 (0)