Numerical Tours of Computational Mechanics with FEniCSx
Jeremy Bleyer
\(\,\)
\(\,\)
Welcome#
What is it about?#
These numerical tours will introduce you to a wide variety of topics in computational continuum and structural mechanics using the finite element software FEniCSx.
Important
These tours are compatible with dolfinx v0.11. A suitable environment can be installed from conda-forge with:
conda create -n fenicsx-0.11 -c conda-forge \
fenics-dolfinx=0.11 dolfinx_mpc=0.11 scifem python-gmsh pyvista jax matplotlib
The book is organized in the following parts:
Introduction#
This part contains a set of short demos to get started with FEniCSx via basic examples:
See also
For another general introduction to FEniCSx, we strongly recommend the “official” FEniCSx tutorial by Jørgen S. Dokken.
Tours#
This part is the main body of the book. These numerical tours are intended to complement the existing FEniCSx tutorials in the official documentation by focusing on specific applications within the field of computational solid and structural mechanics. The purpose of these tours is to offer users with a background in mechanics a starting point for using FEniCSx, with examples familiar to them.
Many of the covered topics are standard and relatively easy to implement. Others, such as structural elements (beams, plates and shells), nonlinear constitutive models or interface problems, are more involved, and some reflect current research topics, illustrating the versatility of FEniCSx for handling advanced models. The difficulty of each tour is indicated by stars, from (easy) to (difficult).
See also
The previous set of numerical tours based on the legacy FEniCS version can be found here https://comet-fenics.readthedocs.io/.
Tips and tricks#
This part provides code snippets for various small tasks frequently encountered in computational mechanics with FEniCSx.
Marking facets with geometrical functions
Importing a .msh file generated with Gmsh
Spatially varying material properties
Lumping a mass matrix
Choosing quadrature rules and degrees
Computing consistent reaction forces
Citing#
If you find these tours useful for your research or teaching, please consider citing them using the following Zenodo DOI. This DOI always points to the latest release; the Zenodo page also gives the DOI of each individual release, should you need to refer to a specific version.
J. Bleyer, Numerical tours of Computational Mechanics with FEniCSx, Zenodo, 2024. https://doi.org/10.5281/zenodo.10470942
@software{bleyer2024comet,
author = {Bleyer, Jeremy},
title = {{Numerical tours of Computational Mechanics with FEniCSx}},
year = {2024},
publisher = {Zenodo},
doi = {10.5281/zenodo.10470942},
url = {https://doi.org/10.5281/zenodo.10470942}
}
Some tours have been written with the help of other contributors, who are acknowledged at the top of the corresponding pages.
Important
These tours rely on the FEniCSx project. If you use them in published work, please also cite the FEniCSx components as recommended by the FEniCS project, namely:
I. A. Baratta, J. P. Dean, J. S. Dokken, M. Habera, J. S. Hale, C. N. Richardson, M. E. Rognes, M. W. Scroggs, N. Sime, G. N. Wells. DOLFINx: the next generation FEniCS problem solving environment, preprint, 2023. doi:10.5281/zenodo.10447666
M. W. Scroggs, I. A. Baratta, C. N. Richardson, G. N. Wells. Basix: a runtime finite element basis evaluation library, Journal of Open Source Software 7(73), 3982, 2022. doi:10.21105/joss.03982
M. S. Alnæs, A. Logg, K. B. Ølgaard, M. E. Rognes, G. N. Wells. Unified Form Language: a domain-specific language for weak formulations of partial differential equations, ACM Transactions on Mathematical Software 40, 2014. doi:10.1145/2566630
as well as the other libraries used in a given tour (e.g. PETSc, Gmsh, dolfinx_mpc, JAX) following their own recommendations.
All this work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License
.