Skip to content

Update membrane_code.ipynb #210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: Install dependencies
runs:
using: composite
steps:
- name: Install apt dependencies and upgrade pip
shell: bash -el {0}
run: |
apt-get update && apt-get install -y libgl1-mesa-glx libxrender1 xvfb
python3 -m pip install -U pip
- name: Install apt dependencies and upgrade pip
shell: bash -el {0}
run: |
apt-get update && apt-get install -y libxrender1 xvfb
7 changes: 4 additions & 3 deletions .github/workflows/book_stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ on:
workflow_dispatch:
workflow_call:
pull_request:
branches: ["main"]

branches: ["release"]
push:
branches: ["release"]
env:
HDF5_MPI: "ON"
HDF5_DIR: "/usr/local/"
Expand All @@ -15,7 +16,7 @@ env:
jobs:
build-book:
runs-on: ubuntu-latest
container: ghcr.io/fenics/dolfinx/lab:v0.7.3
container: ghcr.io/fenics/dolfinx/lab:v0.8.0

env:
PYVISTA_TRAME_SERVER_PROXY_PREFIX: "/proxy/"
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish book
on:
push:
branches:
- "main"
- "release"
workflow_dispatch:

# Weekly build on Mondays at 8 am
Expand All @@ -19,12 +19,6 @@ concurrency:
group: "pages"
cancel-in-progress: true

env:
HDF5_MPI: "ON"
HDF5_DIR: "/usr/local/"
DISPLAY: ":99.0"
DEB_PYTHON_INSTALL_LAYOUT: deb_system

jobs:
run-tests:
uses: ./.github/workflows/test_stable.yml
Expand Down
23 changes: 20 additions & 3 deletions .github/workflows/publish_docker.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: Publish tutorial docker image
on:
push:
branches:
- "!*"
- "release"
tags:
- "v*"

pull_request:
branches:
- "release"
workflow_dispatch:

env:
Expand Down Expand Up @@ -41,8 +44,22 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
load: true
push: false
file: docker/Dockerfile
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}



- name: Build (arm) and push (amd/arm) Docker image
uses: docker/build-push-action@v5
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
with:
context: .
push: true
Expand Down
51 changes: 26 additions & 25 deletions .github/workflows/test_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ name: Test release branch against DOLFINx nightly build
on:
pull_request:
branches:
- release
- main

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

workflow_call:
schedule:
- cron: "0 9 * * *"

Expand All @@ -23,68 +23,69 @@ jobs:
HDF5_MPI: "ON"
PYVISTA_OFF_SCREEN: true
DISPLAY: ":99.0"
PYVISTA_JUPYTER_BACKEND: panel
PYVISTA_JUPYTER_BACKEND: html

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checkout release branch to work on schedule
- name: Checkout release branch
uses: actions/checkout@v4
if: ${{ github.event_name == 'schedule' }}
with:
ref: release

- name: Use current branch
uses: actions/checkout@v4
if: ${{ github.event_name != 'schedule' }}
- uses: actions/checkout@v4

- name: Special handling of some installation
uses: ./.github/actions/install-dependencies

- name: Install requirements
run: python3 -m pip install --no-cache-dir --no-binary=h5py . --upgrade
run: |
python3 -m pip install --break-system-packages -U pip setuptools pkgconfig
python3 -m pip install --no-build-isolation --break-system-packages --no-cache-dir --no-binary=h5py . --upgrade

- name: Test building the book
run: PYVISTA_OFF_SCREEN=false jupyter-book build -W .

- name: Test complex notebooks in parallel
working-directory: chapter1
run: |
export PKG_CONFIG_PATH=/usr/local/dolfinx-complex/lib/pkgconfig:$PKG_CONFIG_PATH
export PETSC_ARCH=linux-gnu-complex128-32
export PYTHONPATH=/usr/local/dolfinx-complex/lib/python3.10/dist-packages:$PYTHONPATH
export PYTHONPATH=/usr/local/dolfinx-complex/lib/python3.12/dist-packages:$PYTHONPATH
export LD_LIBRARY_PATH=/usr/local/dolfinx-complex/lib:$LD_LIBRARY_PATH
cd chapter1
python3 complex_mode.py
mpirun -n 2 python3 complex_mode.py

- name: Test real notebooks in parallel
- name: Test chapter 1
working-directory: chapter1
run: |
cd chapter1
python3 -c "from pyvista import start_xvfb; start_xvfb(0.1)"
mpirun -n 2 python3 fundamentals_code.py
mpirun -n 2 python3 nitsche.py
mpirun -n 2 python3 membrane_code.py
cd ../chapter2

- name: Test chapter 2
working-directory: chapter2
run: |
mpirun -n 2 python3 diffusion_code.py
mpirun -n 2 python3 heat_code.py
mpirun -n 2 python3 linearelasticity_code.py
mpirun -n 2 python3 hyperelasticity.py
mpirun -n 2 python3 nonlinpoisson_code.py
mpirun -n 2 python3 ns_code1.py
mpirun -n 2 python3 ns_code2.py
cd ../chapter3

- name: Test chapter 3
working-directory: chapter3
run: |
mpirun -n 2 python3 neumann_dirichlet_code.py
mpirun -n 2 python3 multiple_dirichlet.py
mpirun -n 2 python3 subdomains.py
mpirun -n 2 python3 robin_neumann_dirichlet.py
mpirun -n 2 python3 component_bc.py
mpirun -n 2 python3 em.py
cd ../chapter4

- name: Test chapter 4
working-directory: chapter4
run: |
mpirun -n 2 python3 solvers.py
mpirun -n 2 python3 convergence.py
mpirun -n 2 python3 compiler_parameters.py
mpirun -n 2 python3 newton-solver.py

- name: Test building the book
run: PYVISTA_OFF_SCREEN=false jupyter-book build -W .

- uses: actions/upload-artifact@v4
if: always()
with:
Expand Down
44 changes: 24 additions & 20 deletions .github/workflows/test_stable.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
name: Check that all python files run in parallel
name: Test stable release

# Controls when the action will run.
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
workflow_call:
pull_request:
branches: ["main"]
branches: ["release"]
env:
# Directory that will be published on github pages
HDF5_MPI: "ON"
HDF5_DIR: "/usr/local/"
DISPLAY: ":99.0"
DEB_PYTHON_INSTALL_LAYOUT: deb_system

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
container: ghcr.io/fenics/dolfinx/lab:v0.7.2
container: ghcr.io/fenics/dolfinx/lab:v0.8.0
env:
PYVISTA_OFF_SCREEN: true

Expand All @@ -35,41 +29,51 @@ jobs:
python3 -m pip install --no-binary=h5py .

- name: Test complex notebooks in parallel
working-directory: chapter1
run: |
export PKG_CONFIG_PATH=/usr/local/dolfinx-complex/lib/pkgconfig:$PKG_CONFIG_PATH
export PETSC_ARCH=linux-gnu-complex128-32
export PYTHONPATH=/usr/local/dolfinx-complex/lib/python3.10/dist-packages:$PYTHONPATH
export LD_LIBRARY_PATH=/usr/local/dolfinx-complex/lib:$LD_LIBRARY_PATH
python3 -c "from pyvista import start_xvfb; start_xvfb(0.1)"
cd chapter1
python3 complex_mode.py
mpirun -n 2 python3 complex_mode.py

- name: Test notebooks in parallel

- name: Test chapter 1
working-directory: chapter1
run: |
python3 -c "from pyvista import start_xvfb; start_xvfb(0.1)"
cd chapter1
mpirun -n 2 python3 fundamentals_code.py
mpirun -n 2 python3 membrane_code.py
cd ../chapter2
python3 -c "from pyvista import start_xvfb; start_xvfb(0.1)"
mpirun -n 2 python3 fundamentals_code.py
mpirun -n 2 python3 nitsche.py
mpirun -n 2 python3 membrane_code.py

- name: Test chapter 2
working-directory: chapter2
run: |
mpirun -n 2 python3 diffusion_code.py
mpirun -n 2 python3 heat_code.py
mpirun -n 2 python3 linearelasticity_code.py
mpirun -n 2 python3 hyperelasticity.py
mpirun -n 2 python3 nonlinpoisson_code.py
mpirun -n 2 python3 ns_code1.py
mpirun -n 2 python3 ns_code2.py
cd ../chapter3

- name: Test chapter 3
working-directory: chapter3
run: |
mpirun -n 2 python3 neumann_dirichlet_code.py
mpirun -n 2 python3 multiple_dirichlet.py
mpirun -n 2 python3 subdomains.py
mpirun -n 2 python3 robin_neumann_dirichlet.py
mpirun -n 2 python3 component_bc.py
mpirun -n 2 python3 em.py
cd ../chapter4

- name: Test chapter 4
working-directory: chapter4
run: |
mpirun -n 2 python3 solvers.py
mpirun -n 2 python3 convergence.py
mpirun -n 2 python3 compiler_parameters.py
mpirun -n 2 python3 newton-solver.py

- name: Upload Navier-Stokes DFG 2D 3 plots
uses: actions/upload-artifact@v4
Expand Down
17 changes: 12 additions & 5 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# Changelog

## v0.8.0

- Replace all `ufl.FiniteElement` and `ufl.VectorElement` with the appropriate `basix.ufl.element`
- Replace `dolfinx.fem.FunctionSpace` with `dolfinx.fem.functionspace`

## v0.7.2
- Change pyvista backend to `html`, using Pyvista main branch
- Using DOLFINx v0.7.2 https://github.com/FEniCS/dolfinx/releases/tag/v0.7.2 as base

- Change pyvista backend to `html`, using Pyvista main branch
- Using DOLFINx v0.7.2 https://github.com/FEniCS/dolfinx/releases/tag/v0.7.2 as base

## v0.7.1
- No API changes, release due to various bug-fixes from the 0.7.0 release, see:
https://github.com/FEniCS/dolfinx/releases/tag/v0.7.1 for more information

- No API changes, release due to various bug-fixes from the 0.7.0 release, see:
https://github.com/FEniCS/dolfinx/releases/tag/v0.7.1 for more information

## v0.7.0

Expand Down Expand Up @@ -46,7 +53,7 @@
- API updates wrt. DOLFINx. `Form`->`form`, `DirichletBC`->`dirichletbc`.
- Updates on error computations in [Error control: Computing convergence rates](chapter4/convergence).
- Added tutorial on interpolation of `ufl.Expression` in [Deflection of a membrane](chapter1/membrane_code).
- Added tutorial on how to apply constant-valued Dirichet conditions in [Deflection of a membrane](chapter1/membrane_code).
- Added tutorial on how to apply constant-valued Dirichlet conditions in [Deflection of a membrane](chapter1/membrane_code).
- Various API changes relating to the import structure of DOLFINx

## 0.3.0 (09.09.2021)
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ Additional requirements on top of the `dolfinx/lab:nightly` images can be found
An image building DOLFINx, Basix, UFL and FFCx from source can be built using:

```bash
cd docker
docker build -f ./docker/Dockerfile -t local_lab_env .
```

Expand Down
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ execute:
repository:
url: https://github.com/jorgensd/dolfinx-tutorial # Online location of your book
path_to_book: . # Optional path to your book, relative to the repository root
branch: main # Which branch of the repository should be used when creating links (optional)
branch: release # Which branch of the repository should be used when creating links (optional)

# Add a bibtex file so that we can create citations
bibtex_bibfiles:
Expand Down
Loading