Selected topics in computational mechanics

Authors
Affiliation

Mohit Pundir

Institute for Building Materials, ETH Zurich

Flavio Lorez

Institute for Building Materials, ETH Zurich

This website contains the course material for the course “Selected topics in computational mechanics” at ETH Zurich. The Moodle link to the course is here. STCM is an advanced course in computational mechanics, focusing on modern methods for modeling nonlinear and coupled phenomena. Topics covered in the course include contact, fracture, and multiphysics problems. Students gain both theoretical insight and practical skills to address complex boundary value problems in solid mechanics.

Learning Objectives

  • Perform large scale simulation using sparse solvers/matrix-free methods
  • Formulate and implement constrained minimization problems
  • Model and simulate contact and fracture phenomena
  • Solve coupled problems using staggered and monolithic strategies
  • Apply computational tools to nonlinear, coupled boundary value problems

Tools and Libraries

The programming language used is Python and below are the python-libraries necessary for this course.

  • tatva: our own small library for common FEM operations
  • JAX: for computing stiffness matrix and internal force vector
  • scipy: for sparse solvers
  • matplotlib: visualization

Besides tatva, you might also be unfamiliar with JAX, but rest assured, you are not expected to. We will only use certain functionalities of these libraries, which will be introduced in the course.

To be ready for the course, you should be familiar with Jupyter notebooks. All the in-class activities and the assignments will be in the form of Jupyter notebooks. So, for this course, you will need a python environment with jupyter and the above libraries installed.

Installation of the libraries

Installing the tatva library will install the dependencies like JAX, matplotlib, and scipy necessary for this course. We will also be using Jupyter notebooks for the course, so you should also install Jupyter. Assuming you have a recent version of python installed (see here), you can set up a virtual environment using venv.

Create a new virtual environment using venv: In your terminal,

cd <your_project_directory>
python -m venv venv_stcm

Activate the virtual environment:

source venv_stcm/bin/activate

Then, install the dependencies to your environment:

pip install tatva==0.1.2 jupyter

For Windows users, you can execute the above command in PowerShell terminal.

Once installed, you can verify the installation by running the following within a Jupyter notebook in your preferred editor (VS Code, PyCharm, etc.). Make sure you are in the virtual environment that you just created.

import tatva
import jax

If you see no error, then the installation is successful.

Usage of tatva and JAX

In this course, we will use tatva for performing Finite Element operations such as integration, gradient and interpolation at quadrature point. The basic usage of tatva necessary for this course is given in Appendix A — Basics of tatva. Please refer to this section for the basic usage of tatva.

Similarly, we will use JAX for performing automatic differentiation of python functions. The basic usage of JAX necessary for this course is given in Appendix B — Basics of JAX. Please refer to this section for the basic usage of JAX.