Skip to content

Commit 69bf939

Browse files
authored
Updates compatible with nightly branch of DOLFINx (#156)
* Replace VectorElement and FiniteElement with `basix.ufl.element`. Replace `dolfinx.fem.FunctionSpace` with `dolfinx.fem.functionspace` * More updates * And more * Last vector element updates * Bump pyvista and dolfinx to v0.7.2 (#159) * Bump pyvista and dolfinx to v0.7.2 * remove -r * Add further pyvista deps * Bump versions * Update petsc solver and pc links. Resolves #143 (#160) * Fix typo and issue Issue on page /fem.html #122 (#161) * Compute entity-cell connectivity before calling locate_dofs_topological. Remove soon to be deprecated pyvista syntax for updating time dependent fields. Fix range->np.arange conversion * Update backend in workflow * Fix broken link (#140) + http:// to https:// (#162) * Run book build prior to parallel run * Add back write frame
1 parent 26ad6bf commit 69bf939

Some content is hidden

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

57 files changed

+681
-5478
lines changed

.github/workflows/book_stable.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ env:
1515
jobs:
1616
build-book:
1717
runs-on: ubuntu-latest
18-
container: ghcr.io/fenics/dolfinx/lab:v0.7.1
18+
container: ghcr.io/fenics/dolfinx/lab:v0.7.2
1919

2020
env:
2121
PYVISTA_TRAME_SERVER_PROXY_PREFIX: "/proxy/"
2222
PYVISTA_TRAME_SERVER_PROXY_ENABLED: "True"
2323
PYVISTA_OFF_SCREEN: false
24-
PYVISTA_JUPYTER_BACKEND: "panel"
24+
PYVISTA_JUPYTER_BACKEND: "html"
2525

2626
steps:
2727
- uses: actions/checkout@v4
@@ -30,7 +30,7 @@ jobs:
3030
uses: ./.github/actions/install-dependencies
3131

3232
- name: Install book deps
33-
run: python3 -m pip install -r docker/requirements.txt
33+
run: python3 -m pip install --no-binary=h5py .
3434

3535
- name: Build the book
3636
run: jupyter-book build . -W

.github/workflows/deploy.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
uses: actions/checkout@v4
4545

4646
- name: Setup Pages
47-
uses: actions/configure-pages@v2
47+
uses: actions/configure-pages@v4
4848

4949
- name: Download docs artifact
5050
uses: actions/download-artifact@v3
@@ -53,10 +53,10 @@ jobs:
5353
path: "./public"
5454

5555
- name: Upload page artifact
56-
uses: actions/upload-pages-artifact@v1
56+
uses: actions/upload-pages-artifact@v2
5757
with:
5858
path: "./public"
5959

6060
- name: Deploy coverage report to GH Pages
6161
id: deployment
62-
uses: actions/deploy-pages@v1
62+
uses: actions/deploy-pages@v3

.github/workflows/publish_docker.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
- name: Build and push Docker image
4545
uses: docker/build-push-action@v3
4646
with:
47-
context: ./docker
47+
context: .
4848
push: true
4949
file: docker/Dockerfile
5050
platforms: linux/amd64,linux/arm64

.github/workflows/test_nightly.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ jobs:
1717
test-nightly:
1818
# The type of runner that the job will run on
1919
runs-on: ubuntu-latest
20-
container: ghcr.io/fenics/dolfinx/lab:v0.7.1
20+
container: ghcr.io/fenics/dolfinx/lab:nightly
2121

2222
env:
2323
HDF5_MPI: "ON"
2424
PYVISTA_OFF_SCREEN: true
2525
DISPLAY: ":99.0"
26-
PYVISTA_JUPYTER_BACKEND: panel
26+
PYVISTA_JUPYTER_BACKEND: html
2727

2828
# Steps represent a sequence of tasks that will be executed as part of the job
2929
steps:
@@ -42,7 +42,10 @@ jobs:
4242
uses: ./.github/actions/install-dependencies
4343

4444
- name: Install requirements
45-
run: python3 -m pip install --no-cache-dir -r docker/requirements.txt --upgrade
45+
run: python3 -m pip install --no-cache-dir --no-binary=h5py . --upgrade
46+
47+
- name: Test building the book
48+
run: PYVISTA_OFF_SCREEN=false jupyter-book build -W .
4649

4750
- name: Test complex notebooks in parallel
4851
run: |
@@ -82,9 +85,6 @@ jobs:
8285
mpirun -n 2 python3 compiler_parameters.py
8386
mpirun -n 2 python3 newton-solver.py
8487
85-
- name: Test building the book
86-
run: PYVISTA_OFF_SCREEN=false jupyter-book build -W .
87-
8888
- uses: actions/upload-artifact@v3
8989
with:
9090
name: webpage

.github/workflows/test_stable.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
test:
2121
# The type of runner that the job will run on
2222
runs-on: ubuntu-latest
23-
container: ghcr.io/fenics/dolfinx/lab:v0.7.1
23+
container: ghcr.io/fenics/dolfinx/lab:v0.7.2
2424
env:
2525
PYVISTA_OFF_SCREEN: true
2626

@@ -32,7 +32,7 @@ jobs:
3232

3333
- name: Install additional deps
3434
run: |
35-
python3 -m pip install -r docker/requirements.txt
35+
python3 -m pip install --no-binary=h5py .
3636
3737
- name: Test complex notebooks in parallel
3838
run: |

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ _build
88
**/.cache
99
*.png
1010
*.pvtu
11-
*.msh
11+
*.msh
12+
*.bp

Changelog.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## Release
4+
- Replace all `ufl.FiniteElement` and `ufl.VectorElement` with the appropriate `basix.ufl.element`
5+
- Replace `dolfinx.fem.FunctionSpace` with `dolfinx.fem.functionspace`
6+
7+
## v0.7.2
8+
- Change pyvista backend to `html`, using Pyvista main branch
9+
- Using DOLFINx v0.7.2 https://github.com/FEniCS/dolfinx/releases/tag/v0.7.2 as base
10+
311
## v0.7.1
412
- No API changes, release due to various bug-fixes from the 0.7.0 release, see:
513
https://github.com/FEniCS/dolfinx/releases/tag/v0.7.1 for more information

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/jorgensd/dolfinx-tutorial:v0.7.1
1+
FROM ghcr.io/jorgensd/dolfinx-tutorial:v0.7.2
22

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

README.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,26 @@ Any code added to the tutorial should work in parallel.
1616

1717
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.
1818

19+
Note that every chapter is written as an IPython notebook and a Python file. These are kept in sync by jupytext. See [their notes](https://jupytext.readthedocs.io/en/latest/install.html#jupytext-commands-in-jupyterlab) on how to keep them in sync.
20+
21+
## Dependencies
22+
It is adviced to use a pre-installed version of DOLFINx, for instance through conda or docker. Remaining dependencies can be installed with
23+
```bash
24+
python3 -m pip install --no-binary=h5py -e .
25+
```
26+
1927
# Docker images
2028
Docker images for this tutorial can be found in the [packages tab](https://github.com/jorgensd/dolfinx-tutorial/pkgs/container/dolfinx-tutorial)
2129

22-
Additional requirements on top of the `dolfinx/lab:nightly` images can be found at [Dockerfile](docker/Dockerfile) and [requirements.txt](docker/requirements.txt)
30+
Additional requirements on top of the `dolfinx/lab:nightly` images can be found at [Dockerfile](docker/Dockerfile) and [pyproject.toml](./pyproject.toml)
2331

2432
##
2533
An image building DOLFINx, Basix, UFL and FFCx from source can be built using:
2634
```bash
2735
cd docker
28-
docker build -f LocalDockerfile -t local_lab_env .
36+
docker build -f ./docker/Dockerfile -t local_lab_env .
2937
```
30-
and run
38+
from the root of this repository, and run
3139
```bash
3240
docker run --rm -ti -v $(pwd):/root/shared -w /root/shared --init -p 8888:8888 local_lab_env
3341
```

_config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ sphinx:
3838

3939
# To avoid warning about default changing due to
4040
# https://github.com/pydata/pydata-sphinx-theme/issues/1492
41-
html_theme_options:
42-
navigation_with_keys: false
41+
# html_theme_options:
42+
# navigation_with_keys: false
4343
parse:
4444
myst_enable_extensions:
4545
- "amsmath"

chapter1/complex_mode.ipynb

+26-302
Large diffs are not rendered by default.

chapter1/complex_mode.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# extension: .py
77
# format_name: light
88
# format_version: '1.5'
9-
# jupytext_version: 1.14.7
9+
# jupytext_version: 1.15.2
1010
# kernelspec:
1111
# display_name: Python 3 (DOLFINx complex)
1212
# language: python
@@ -47,7 +47,7 @@
4747
from mpi4py import MPI
4848
import numpy as np
4949
mesh = dolfinx.mesh.create_unit_square(MPI.COMM_WORLD, 10, 10)
50-
V = dolfinx.fem.FunctionSpace(mesh, ("Lagrange", 1))
50+
V = dolfinx.fem.functionspace(mesh, ("Lagrange", 1))
5151
u_r = dolfinx.fem.Function(V, dtype=np.float64)
5252
u_r.interpolate(lambda x: x[0])
5353
u_c = dolfinx.fem.Function(V, dtype=np.complex128)

chapter1/fundamentals.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Authors: Hans Petter Langtangen, Anders Logg
44

55
Adapted to FEniCSx by Jørgen S. Dokken
66

7-
The goal of this tutorial is to solve one of the most basic PDEs, the Poisson equations, with a few lines of code in FEniCSx. We start by introducing the most fundamental FEniCSx objects, such as `Function`, `FunctionSpace`, `TrialFunction` and `TestFunction`, and learn how to write a basic PDE solver.
7+
The goal of this tutorial is to solve one of the most basic PDEs, the Poisson equations, with a few lines of code in FEniCSx. We start by introducing the most fundamental FEniCSx objects, such as `Function`, `functionspace`, `TrialFunction` and `TestFunction`, and learn how to write a basic PDE solver.
88
This will include:
99
- How to formulate a mathematical variational problem
1010
- How to apply boundary conditions

0 commit comments

Comments
 (0)