



Contact mechanics in Julia, directly from the weak form
I've been working on contact mechanics in LowLevelFEM.jl and wanted to share a small 2D Hertz-type contact example.
One of my goals is to keep the implementation as close as possible to the mathematical weak form.
For example, the penalty contact stiffness is simply:
G = ContactGap(C)
Kc = ∫(G ⋅ cn ⋅ G; updateFrom=u)
The same contact operator can also be used in a Lagrange-multiplier formulation:
B = ∫(Λ ⋅ ContactGap(C, active=:all))
The figures show the resulting contact pressure, normal gap, and von Mises stress distribution.
The implementation handles closest-point contact detection at Gauss points and currently supports both 2D and 3D problems. I've also been working on multithreaded sparse assembly and lightweight geometry updates to reduce the cost of nonlinear iterations.
It's still a work in progress, particularly for more advanced contact laws, but the basic framework seems promising.
I'm curious how others working with FEM in Julia approach contact mechanics, especially the balance between a readable weak-form formulation and efficient contact search and assembly.