See, e.g., dolfinx/python/demo/demo_elasticity.py at dbbbf9167f662f4bcc2c45da5a5998433ae24863 · FEniCS/dolfinx · GitHub