r/Julia

Image 1 — Contact mechanics in Julia, directly from the weak form
Image 2 — Contact mechanics in Julia, directly from the weak form
Image 3 — Contact mechanics in Julia, directly from the weak form
Image 4 — Contact mechanics in Julia, directly from the weak form
▲ 20 r/Julia

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.

u/perebal — 4 days ago
▲ 30 r/Julia

GraphiC.jl: Ultra-fast vector scientific graphics & publication-grade SVG for Julia

I am pleased to announce **GraphiC.jl**, bringing the **GraphiC 2026** scientific graphics engine natively to the Julia language.

GraphiC was originally developed for research computing and fusion energy visualization at Oak Ridge National Laboratory (ORNL). In 2026, it has been modernized with a 64-bit C99 vector core, interactive SVG/HTML driver, and zero-overhead `ccall` bindings for Julia.

### Key Highlights

* **Zero Compilation Latency**: Instantaneous execution with sub-millisecond time-to-first-plot.

* **Pure Vector SVG**: Tightly cropped vector graphics with infinite resolution scaling and interactive web zooming.

* **Dual API Paradigm**:

  1. *High-level 1-line plotting*: `GraphiC.plot()`, `GraphiC.scatter()`, `GraphiC.surface_plot()`, `GraphiC.contour_plot()`

  2. *Procedural state-machine API*: 1:1 parity with classic C and Fortran GraphiC scientific routines.

* **Specialized Visualizations**: True 3D hidden-line surface meshes, contour topography, polar antenna diagrams, vector fields, and RF/microwave Smith charts.

* **Seamless Notebook Integration**: First-class MIME support renders vector graphics inline in Jupyter, Pluto.jl, and VS Code.

### Quick Example

```julia

using GraphiC

x = range(0.0, 4π, length=150)

y = exp.(-0.2 * x) .* sin.(x)

GraphiC.plot(x, y;

title="Damped Harmonic Oscillator",

xlabel="Time (s)",

ylabel="Amplitude",

color=:blue,

grid=true,

filename="oscillator.svg"

)

Manual, documentation, and Community Edition downloads are available at: https://jamesrome.com/GraphiC2026

Feedback, suggestions, and benchmarks from the Julia scientific community are warmly welcome!

reddit.com
u/BJTN — 12 days ago
▲ 27 r/Julia+1 crossposts

Molecular Dynamics with Julia - Automatic Ring Detection

My program (working name is JuliaMD), can now detect isolated aromatic rings, and has more complete atom typing, which allows better simulations with the gaff2 forcefield. I haven't yet implemented specific aromatic atom types, but after the ring detection tool it will be easy to do.

Here is the link to the video, just out of the oven!

https://youtu.be/Qw5HjzkS9UY

u/NicoN_1983 — 13 days ago