Structure-preserving plasma physics in Python.

Struphy is an open-source framework for solving fluid, kinetic, and hybrid plasma models with geometric finite elements and Lagrangian particles.

Curved wireframe GVEC unit domain generated with Struphy
GVEC unit domain generated with Struphy.

What "structure-preserving" means

Many plasma physics PDEs carry exact invariants: energy, mass, and the divergence-free condition on magnetic fields among them. Standard discretizations can violate these invariants over long simulations, letting numerical error accumulate. Struphy instead builds its finite-element and particle discretizations from a discrete de Rham complex, so these structural properties hold exactly at the discrete level, not only in the limit of vanishing grid size.

The discrete de Rham complexFour compatible finite-element spaces are connected by the gradient, curl, and divergence operators: H1 maps to H(curl) via grad, H(curl) maps to H(div) via curl, and H(div) maps to L2 via div. Because these discrete spaces and operators commute exactly with their continuous counterparts, identities such as curl grad equals zero and div curl equals zero hold to machine precision, not just approximately.scalar potentialsH(curl)electric fieldH(div)magnetic fieldmass densitygradcurldiv
Discrete fields live in compatible finite-element spaces linked by exact discrete operators, so identities like ∇·(∇×E) = 0 hold precisely, not just approximately.

Models

A common numerical framework supports several descriptions of plasma dynamics while preserving their underlying geometric structure.

Fluid

Maxwell, MHD, and multi-fluid systems using compatible finite elements.

Kinetic

Vlasov and drift-kinetic models represented by Lagrangian particles.

Hybrid

Coupled field-particle descriptions, including MHD-kinetic models.

Quick start

Install Struphy and compile its performance-critical kernels.

Continue with the installation guide andtutorials.

$ pip install struphy
$ struphy compile

Publications

A selection of papers describing the methods and algorithms behind Struphy. See thefull publication list for more.