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 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/demo/demo_kirchhoff-love-clamped.py b/demo/demo_kirchhoff-love-clamped.py index 37f3a25..0fa79aa 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_nonlinear-naghdi-clamped-semicylinder.py b/demo/demo_nonlinear-naghdi-clamped-semicylinder.py index 2adda06..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 # %% @@ -45,11 +46,13 @@ 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 +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.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) cells = point_ownership_data.dest_cells @@ -589,7 +590,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, diff --git a/demo/demo_reissner-mindlin-clamped-tdnns.py b/demo/demo_reissner-mindlin-clamped-tdnns.py index 7e65a38..1705700 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..5bfd199 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..52820ab 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..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:nightly +${CONTAINER_ENGINE} run --rm -ti -v $(pwd):/shared -w /shared dolfinx/dolfinx:v0.10.0-r1 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]