Numerical Tours of Computational Mechanics with FEniCSx

Jeremy Bleyer

\(\,\)

_images/logo.png

\(\,\)

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:

Introductory demos

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.

Tips and tricks
Marking facets

Marking facets with geometrical functions

tips/mark_facets/mark_facets.html
Importing meshes

Importing a .msh file generated with Gmsh

tips/import_msh/import_msh.html
Piecewise constant fields

Spatially varying material properties

tips/piecewise_constant_field/piecewise_constant_field.html
Mass lumping

Lumping a mass matrix

tips/mass_lumping/mass_lumping.html
Quadrature schemes

Choosing quadrature rules and degrees

tips/quadrature_schemes/quadrature_schemes.html
Reaction forces

Computing consistent reaction forces

tips/computing_reactions/computing_reactions.html

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.

DOI

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 license.

About the author#

Jeremy Bleyer is a researcher in Solid and Structural Mechanics at Laboratoire Navier, a joint research unit (UMR 8205) of École nationale des ponts et chaussées, Université Gustave Eiffel and CNRS.

jeremy.bleyer@enpc.fr

jeremy-bleyer

0000-0001-8212-9921

\(\,\)

_images/banner_tutelles.png

Other contributors#