Stiffness matrix is singular when including subdomain in elasticity problem

Hello everyone,

I’m solving a linear elasticity problem on a mesh with three different material subdomains, each marked using a MeshTags object with values 1,2,3. I define a measure dx and then I define the total bilinear form as a = a1 + a2 + a3, with each subdomain’s contribution as ai = ufl.inner(Stress(u, E_i, nu_i), epsilon(v)) * dx(i). E_i and nu_i are the material parameters for i-th subdomain. The mesh is discretized by continuous second order Continuous Lagrangian elements. The problem is:

  • If I include all three subdomains**, the assembled stiffness matrix is singular.
  • If I only include subdomains 1 and 2 (a = a1 + a2), the matrix is non-singular, as domain 3 behaves like a rigid body, but I observe large, unrealistic deformations at its interfaces.

I’ve checked that the mesh is conforming and unified, and all cells are tagged. Also, the bc are well defined. I don’t know what the issue might be, do anybody have any guess?

I have included pictures of the problem definition and results at https://drive.google.com/drive/folders/1yvhzBUB6vrwRvIrmy9qOHEbxKTswnNab?usp=sharing

Thanks!

Adding just a link to google drive with figures, and not adding the actual code, makes it impossible to reproduce the issue.