alpha · open source · EUPL-1.2

nanoindent

Finite-element simulation and analysis of AFM nanoindentation of thin elastic films, validated against analytic contact mechanics.

git clone https://github.com/LorenaRedondo/nanoindent && cd nanoindent && uv sync

What it does

An open-source Python alternative to the commercial-FEM workflow for AFM indentation of thin films, with the analytic tools to check its answers.

solver

Axisymmetric contact FEM

Small-strain elasticity with P2 elements, an exact spherical gap function and penalty contact solved by an active-set Newton method.

benchmarks

Analytic ruler built in

Hertz, Dimitriadis 2002, Garcia and Garcia 2018 and Chadwick models, plus mesh, penalty and load-step convergence studies.

analysis

Force volume and viscoelasticity

Force maps and dynamic moduli E′(ω), E″(ω) from a single solve, since force is exactly proportional to modulus.

membranes

Supported lipid bilayers

Breakthrough force, area compressibility and modulus from force maps, with a bridge to composition-based predictions.

hs-afm

High-speed AFM movies

Readers, drift correction, tracking, diffusion and event detection for imaging dynamics.

control

Streaming and closed loop

Online analysis, safety envelope, run recording and replay, with instrument adapter scaffolds for common AFM vendors.

Validated against analytic closed forms

Agreement with another solver would show two codes made similar choices. Agreement with Hertz and the published film corrections shows the result is right.

Force versus indentation for 7 and 14 nanometre films: FEM markers against Hertz and bonded Dimitriadis curves, and the stiffening ratio.
Bottom effect for a bonded film (E = 130 MPa, ν = 0.3, R = 17 nm). FEM markers follow the bonded Dimitriadis 2002 correction; the half-space Hertz curve sits well below.

A bonded thin film is stiffer than the Hertz half-space, and thinner films are stiffer still. At δ = 1 nm the solver gives:

1.88×F / FHertz, h = 7 nm
1.34×F / FHertz, h = 14 nm

Equilibrium is checked with two independent reaction-force measures, and the test suite pins the solver to analytic laws in the thick-film limit.

Quick start

Python 3.11+. The default backend is scikit-fem, installed from PyPI with no compiler needed.

1 · Install with uv

git clone https://github.com/LorenaRedondo/nanoindent.git
cd nanoindent
uv sync
uv run python examples/paper_reproduction.py

2 · Run a simulation

from nanoindent import SimulationConfig, IndentationSolver

cfg = SimulationConfig(R=17.0, E=130.0, nu=0.3,
                       h=7.0, L=100.0, delta_max=1.0)
result = IndentationSolver(cfg).run()
result.plot(compare=["hertz", "dimitriadis_bonded"])

Lengths in nm, moduli in MPa, forces in pN. Optional features install as extras, for example uv sync --extra web --extra viz.

Project status

Alpha software, use at your own risk

nanoindent began as an internal research tool. The API may change between releases, and the software is provided as is, without warranty. Validate results independently before they inform scientific conclusions.

About

nanoindent is a collaboration between Lorena Redondo-Morata’s lab and Alpibru.

Resources