From 8af8ed53b7b4e81811075c698a9c4e7ebd0b44dc Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Tue, 18 Nov 2025 09:48:47 +0100 Subject: [PATCH 1/6] Fixes for LinearProblem API change. --- demo/demo_kirchhoff-love-clamped.py | 1 + demo/demo_reissner-mindlin-clamped-tdnns.py | 1 + demo/demo_reissner-mindlin-clamped.py | 1 + demo/demo_reissner-mindlin-simply-supported.py | 1 + launch-container.sh | 2 +- 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/demo/demo_kirchhoff-love-clamped.py b/demo/demo_kirchhoff-love-clamped.py index 37f3a25..3414012 100644 --- a/demo/demo_kirchhoff-love-clamped.py +++ b/demo/demo_kirchhoff-love-clamped.py @@ -211,6 +211,7 @@ def all_boundary(x): L, bcs=bcs, petsc_options={"ksp_type": "preonly", "pc_type": "lu", "pc_factor_mat_solver_type": "mumps"}, + petsc_options_prefix="problem_" ) u_h = problem.solve() diff --git a/demo/demo_reissner-mindlin-clamped-tdnns.py b/demo/demo_reissner-mindlin-clamped-tdnns.py index 7e65a38..be9114f 100644 --- a/demo/demo_reissner-mindlin-clamped-tdnns.py +++ b/demo/demo_reissner-mindlin-clamped-tdnns.py @@ -244,6 +244,7 @@ def all_boundary(x): L, bcs=bcs, petsc_options={"ksp_type": "preonly", "pc_type": "lu", "pc_factor_mat_solver_type": "mumps"}, + petsc_options_prefix="problem_" ) u_h = problem.solve() diff --git a/demo/demo_reissner-mindlin-clamped.py b/demo/demo_reissner-mindlin-clamped.py index 17ff6aa..c7abaa7 100644 --- a/demo/demo_reissner-mindlin-clamped.py +++ b/demo/demo_reissner-mindlin-clamped.py @@ -222,6 +222,7 @@ def all_boundary(x): -F, bcs=bcs, petsc_options={"ksp_type": "preonly", "pc_type": "lu", "pc_factor_mat_solver_type": "mumps"}, + petsc_options_prefix="problem_" ) u_ = problem.solve() diff --git a/demo/demo_reissner-mindlin-simply-supported.py b/demo/demo_reissner-mindlin-simply-supported.py index 95749b4..05d09e9 100644 --- a/demo/demo_reissner-mindlin-simply-supported.py +++ b/demo/demo_reissner-mindlin-simply-supported.py @@ -239,6 +239,7 @@ def make_bc(value, V, on_boundary): -F, bcs=bcs, petsc_options={"ksp_type": "preonly", "pc_type": "lu", "pc_factor_mat_solver_type": "mumps"}, + petsc_options_prefix="problem_" ) u_ = problem.solve() diff --git a/launch-container.sh b/launch-container.sh index 87960d9..dd995f2 100755 --- a/launch-container.sh +++ b/launch-container.sh @@ -1,3 +1,3 @@ #!/bin/bash CONTAINER_ENGINE="podman" -${CONTAINER_ENGINE} run -ti -v $(pwd):/shared -w /shared dolfinx/dolfinx:nightly +${CONTAINER_ENGINE} run -ti -v $(pwd):/shared -w /shared dolfinx/dolfinx:v0.10.0-r1 From 46bda91430d50c06e993d18c1ef7535dc1e36db4 Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Tue, 18 Nov 2025 09:54:06 +0100 Subject: [PATCH 2/6] Cheap fix for deprecated NewtonSolver - should switch to NonlinearProblem. --- demo/demo_nonlinear-naghdi-clamped-semicylinder.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/demo/demo_nonlinear-naghdi-clamped-semicylinder.py b/demo/demo_nonlinear-naghdi-clamped-semicylinder.py index 2adda06..0a4977f 100644 --- a/demo/demo_nonlinear-naghdi-clamped-semicylinder.py +++ b/demo/demo_nonlinear-naghdi-clamped-semicylinder.py @@ -45,7 +45,7 @@ from dolfinx.fem import Expression, Function, dirichletbc, functionspace, locate_dofs_topological from dolfinx.fem.bcs import DirichletBC from dolfinx.fem.function import Function as _Function -from dolfinx.fem.petsc import NonlinearProblem, apply_lifting, assemble_vector, set_bc +from dolfinx.fem.petsc import NewtonSolverNonlinearProblem, apply_lifting, assemble_vector, set_bc from dolfinx.mesh import CellType, create_rectangle, locate_entities_boundary from dolfinx.nls.petsc import NewtonSolver from ufl import grad, inner, split @@ -545,8 +545,8 @@ def compute_cell_contributions(V, points): at that point""" # Determine what process owns a point and what cells it lies within mesh = V.mesh - point_ownership_data = dolfinx.cpp.geometry.determine_point_ownership( - mesh._cpp_object, points, 1e-6 + point_ownership_data = dolfinx.geometry.determine_point_ownership( + mesh, points, 1e-6 ) owning_points = np.asarray(point_ownership_data.dest_points).reshape(-1, 3) @@ -589,7 +589,7 @@ def compute_cell_contributions(V, points): # We define a custom `NonlinearProblem` which is able to include the point # force. # %% -class NonlinearProblemPointSource(NonlinearProblem): +class NonlinearProblemPointSource(NewtonSolverNonlinearProblem): def __init__( self, F: ufl.form.Form, From 933fe2007d2342d80f49abbfd9a47284bddfc40c Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Tue, 18 Nov 2025 10:08:04 +0100 Subject: [PATCH 3/6] Fixup. --- demo/demo_kirchhoff-love-clamped.py | 2 +- demo/demo_nonlinear-naghdi-clamped-semicylinder.py | 7 ++++--- demo/demo_reissner-mindlin-clamped-tdnns.py | 2 +- demo/demo_reissner-mindlin-clamped.py | 2 +- demo/demo_reissner-mindlin-simply-supported.py | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/demo/demo_kirchhoff-love-clamped.py b/demo/demo_kirchhoff-love-clamped.py index 3414012..0fa79aa 100644 --- a/demo/demo_kirchhoff-love-clamped.py +++ b/demo/demo_kirchhoff-love-clamped.py @@ -211,7 +211,7 @@ def all_boundary(x): L, bcs=bcs, petsc_options={"ksp_type": "preonly", "pc_type": "lu", "pc_factor_mat_solver_type": "mumps"}, - petsc_options_prefix="problem_" + petsc_options_prefix="problem_", ) u_h = problem.solve() diff --git a/demo/demo_nonlinear-naghdi-clamped-semicylinder.py b/demo/demo_nonlinear-naghdi-clamped-semicylinder.py index 0a4977f..3c151c6 100644 --- a/demo/demo_nonlinear-naghdi-clamped-semicylinder.py +++ b/demo/demo_nonlinear-naghdi-clamped-semicylinder.py @@ -28,6 +28,7 @@ # # %% import typing +import warnings from pathlib import Path # %% @@ -50,6 +51,8 @@ from dolfinx.nls.petsc import NewtonSolver from ufl import grad, inner, split +warnings.simplefilter("default", DeprecationWarning) + # %% [markdown] # We consider a semi-cylindrical shell of radius $r$ and axis length $L$. The # shell is made of a linear elastic isotropic homogeneous material with Young @@ -545,9 +548,7 @@ def compute_cell_contributions(V, points): at that point""" # Determine what process owns a point and what cells it lies within mesh = V.mesh - point_ownership_data = dolfinx.geometry.determine_point_ownership( - mesh, points, 1e-6 - ) + point_ownership_data = dolfinx.geometry.determine_point_ownership(mesh, points, 1e-6) owning_points = np.asarray(point_ownership_data.dest_points).reshape(-1, 3) cells = point_ownership_data.dest_cells diff --git a/demo/demo_reissner-mindlin-clamped-tdnns.py b/demo/demo_reissner-mindlin-clamped-tdnns.py index be9114f..1705700 100644 --- a/demo/demo_reissner-mindlin-clamped-tdnns.py +++ b/demo/demo_reissner-mindlin-clamped-tdnns.py @@ -244,7 +244,7 @@ def all_boundary(x): L, bcs=bcs, petsc_options={"ksp_type": "preonly", "pc_type": "lu", "pc_factor_mat_solver_type": "mumps"}, - petsc_options_prefix="problem_" + petsc_options_prefix="problem_", ) u_h = problem.solve() diff --git a/demo/demo_reissner-mindlin-clamped.py b/demo/demo_reissner-mindlin-clamped.py index c7abaa7..5bfd199 100644 --- a/demo/demo_reissner-mindlin-clamped.py +++ b/demo/demo_reissner-mindlin-clamped.py @@ -222,7 +222,7 @@ def all_boundary(x): -F, bcs=bcs, petsc_options={"ksp_type": "preonly", "pc_type": "lu", "pc_factor_mat_solver_type": "mumps"}, - petsc_options_prefix="problem_" + petsc_options_prefix="problem_", ) u_ = problem.solve() diff --git a/demo/demo_reissner-mindlin-simply-supported.py b/demo/demo_reissner-mindlin-simply-supported.py index 05d09e9..52820ab 100644 --- a/demo/demo_reissner-mindlin-simply-supported.py +++ b/demo/demo_reissner-mindlin-simply-supported.py @@ -239,7 +239,7 @@ def make_bc(value, V, on_boundary): -F, bcs=bcs, petsc_options={"ksp_type": "preonly", "pc_type": "lu", "pc_factor_mat_solver_type": "mumps"}, - petsc_options_prefix="problem_" + petsc_options_prefix="problem_", ) u_ = problem.solve() From ac13466c4bff689bd3e4a952556b4e3ef541f310 Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Tue, 18 Nov 2025 10:12:17 +0100 Subject: [PATCH 4/6] Bump. --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e80ef9c..aa0be84 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,8 +13,9 @@ authors = [ { name = "Jack S. Hale", email = "mail@jackhale.co.uk" }, { name = "Tian Yang" } ] +# Get UFL, FFCx and Basix through transitive dependency on fenics-dolfinx. dependencies = [ - "fenics-dolfinx>=0.10.0.dev0,<0.11.0", + "fenics-dolfinx>=0.10.0,<0.11.0", ] [project.optional-dependencies] From 228d32c3d0b76bbcbc6b5951a67532944eed693d Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Tue, 18 Nov 2025 11:01:03 +0100 Subject: [PATCH 5/6] Update README. --- README.md | 18 +++++++++++++++--- launch-container.sh | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e9e32a9..0e1f330 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ numerical methods for solving a wide range of thin structural models (beams, plates and shells) expressed in the Unified Form Language (UFL) of the FEniCS Project. -*FEniCSx-Shells is an experimental version targeting version v0.10.0.dev0 of the new +*FEniCSx-Shells is an experimental version targeting version v0.10.0 of the new [DOLFINx solver](https://github.com/fenics/dolfinx).* The foundational aspects of the FEniCS-Shells project are described in the paper: @@ -22,6 +22,20 @@ code generation tools, J. S. Hale, M. Brunetti, S. P. A. Bordas, C. Maurini. Computers & Structures, 209, 163-181, [doi:10.1016/j.compstruc.2018.08.001](https://doi.org/10.1016/j.compstruc.2018.08.001). +## Installation + +See the [DOLFINx README - +Installation](https://github.com/FEniCS/dolfinx/blob/main/README.md#installation) for +instructions on installing DOLFINx with petsc4py support. + +Then: + + pip install fenicsx-shells[demos]@git+https://github.com/FEniCS-Shells/fenicsx-shells.git + +At the current time, the `fenicsx-shells` module is empty, and the content of +the 'library' is in the demos. This may change as we begin implementing e.g. +custom assemblers. + ## Documentation The documentation can be viewed [here](https://fenics-shells.github.io/fenicsx-shells). @@ -33,8 +47,6 @@ FEniCSx-Shells currently includes implementations of the following structural mo * Reissner-Mindlin plates. * Kirchhoff-Love plates. -A roadmap for future developments will be shared soon. - We are using a variety of numerical techniques for discretising the PDEs including: diff --git a/launch-container.sh b/launch-container.sh index dd995f2..c9101f3 100755 --- a/launch-container.sh +++ b/launch-container.sh @@ -1,3 +1,3 @@ #!/bin/bash CONTAINER_ENGINE="podman" -${CONTAINER_ENGINE} run -ti -v $(pwd):/shared -w /shared dolfinx/dolfinx:v0.10.0-r1 +${CONTAINER_ENGINE} run --rm -ti -v $(pwd):/shared -w /shared dolfinx/dolfinx:v0.10.0-r1 From baa5c221a14554ea2edebfcddc04d98648045734 Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Tue, 18 Nov 2025 11:04:50 +0100 Subject: [PATCH 6/6] Fix test. --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 85cea69..6ed0adc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ on: jobs: build-and-test: runs-on: ubuntu-latest - container: ghcr.io/fenics/dolfinx/dolfinx:nightly + container: ghcr.io/fenics/dolfinx/dolfinx:v0.10.0-r1 steps: - name: Checkout uses: actions/checkout@v5