# \[ANN\] LowLevelFEM.jl v1.14.2 – Contact mechanics directly from weak forms

**URL:** <https://discourse.julialang.org/t/ann-lowlevelfem-jl-v1-14-2-contact-mechanics-directly-from-weak-forms/139957>\
**Category:** Package Announcements\
**Tags:** fem, finite-element, mechanics\
**Created:** [October 11, 2026, 8:35pm UTC](https://discourse.julialang.org/t/ann-lowlevelfem-jl-v1-14-2-contact-mechanics-directly-from-weak-forms/139957 "2026-10-11T20:35:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![perebalazs](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/perebalazs/32/49662_2.png) [@perebalazs](https://discourse.julialang.org/u/perebalazs)\
**Post date:** [October 11, 2026, 8:35pm UTC](https://discourse.julialang.org/t/ann-lowlevelfem-jl-v1-14-2-contact-mechanics-directly-from-weak-forms/139957/1 "2026-10-11T20:35:12Z")

</div>

**Contact mechanics — almost exactly as written on paper!**

LowLevelFEM.jl now supports 2D and 3D contact mechanics using penalty and Lagrange-multiplier formulations.

The framework also provides the building blocks for frictional contact, allowing more advanced contact laws to be implemented directly at notebook level.

The idea is simple: **write the weak form, assemble the operator, solve the problem.**

For penalty contact, the contact stiffness is

K\_c = \int\_{\Gamma\_c} G^T c\_n G\,d\Gamma

And in Julia:

```julia
C = contact(U, master="master", slave="slave", displacement=u)
G = ContactGap(C)
Kc = ∫(G ⋅ cn ⋅ G; updateFrom=u)

```

The nonlinear iteration is just as transparent:

```julia
R = K*u - f + Kc*(r+u)
Δu = solveField(K+Kc, -R, support=support_increment)

```

Prefer Lagrange multipliers? The same contact operator can be used directly in a mixed formulation:

```julia
B = ∫(Λ ⋅ ContactGap(C, active=:all))
A = SystemMatrix([K B'; B Zλ])

```

**Simple syntax does not mean a simple implementation.**

Under the hood, the contact machinery already includes multithreaded, memory-efficient sparse assembly, lightweight geometry updates for faster nonlinear iterations, and support for multiple contact pairs.

This is still a preview of a developing contact framework, but the foundations are already in place — including a path toward dynamic contact simulations.

Meanwhile, I’m continuing to refactor and optimize LowLevelFEM to make its components more consistent, efficient, and reusable.

**Next major development: the Spectral Element Method (SEM).**

The goal remains the same: bringing mathematical formulations as directly as possible into executable finite element code.

📌 Full reproducible examples in LowLevelFEM.jl:

🔹 **2D Hertz contact — Penalty method**  
[https://github.com/perebalazs/LowLevelFEM.jl/blob/main/examples/2D-Hertz-penalty-minimal.ipynb](https://github.com/perebalazs/LowLevelFEM.jl/blob/main/examples/2D-Hertz-penalty-minimal.ipynb)

🔹 **2D Hertz contact — Lagrange multipliers**  
[https://github.com/perebalazs/LowLevelFEM.jl/blob/main/examples/2D-Hertz-lagrange-minimal.ipynb](https://github.com/perebalazs/LowLevelFEM.jl/blob/main/examples/2D-Hertz-lagrange-minimal.ipynb)

🔹 **3D contact — Penalty method**  
[https://github.com/perebalazs/LowLevelFEM.jl/blob/main/examples/contact-3D-penalty-minimal.ipynb](https://github.com/perebalazs/LowLevelFEM.jl/blob/main/examples/contact-3D-penalty-minimal.ipynb)

Documentation:  
[https://perebalazs.github.io/LowLevelFEM.jl/stable/](https://perebalazs.github.io/LowLevelFEM.jl/stable/)

Feedback, suggestions, and contributions are welcome!

 ![vonMises](https://global.discourse-cdn.com/julialang/original/3X/2/0/2023d4724abb60b76e03aa290b84da434d92eef1.png)  
 ![vonMises2](https://global.discourse-cdn.com/julialang/original/3X/7/6/761f1404b2b648d8af7e1bd59cf4ba4331a6b92d.png)  
 ![pressure](https://global.discourse-cdn.com/julialang/original/3X/3/a/3a03104f8d1603459a0e3e249cc18bb6790be934.png)
