Potential
Point values; a scalar field with continuity across element interfaces.
How it works
Struphy discretizes fields with B-splines arranged into a de Rham complex: four spline spaces connected by the exact differential operators gradient, curl, and divergence,V₀ --grad--> V₁ --curl--> V₂ --div--> V₃. Every model's variables live in one of these four spaces, chosen so the discretization preserves the underlying vector calculus exactly — not just approximately.
Click a space to see which Struphy models place a variable there.
Select a space above.
Scalar potentials — continuous, no derivative constraint.
13 variable(s) across Struphy's models:
Vector fields with a well-defined curl (e.g. electric fields).
10 variable(s) across Struphy's models:
Vector fields with a well-defined divergence (e.g. magnetic fields).
25 variable(s) across Struphy's models:
Densities — no continuity constraint at all.
31 variable(s) across Struphy's models:
The names 0-form, 1-form, and so on are a compact way to say what a quantity is measured over: values at points, circulation along curves, flux through surfaces, and amount in a volume. Gradient turns a potential into a circulation-carrying field; curl turns circulation into flux; divergence turns flux into a density. FEEC makes the discrete degrees of freedom follow that same chain.
Plasma models contain identities that hold before any model-specific approximation is made:curl(grad φ) = 0 and div(curl A) = 0. In the discrete complex the corresponding matrices satisfy C G = 0 and D C = 0 up to round-off, so a magnetic field obtained as a discrete curl is divergence-free by construction and no clean-up step is needed.
This does not make the computation exact: resolution, quadrature, time stepping, particle sampling and nonlinear solves still introduce errors. FEEC removes one class of error, namely an incompatible spatial representation, so that refinement improves the physical approximation and does not have to compete with spurious sources created by the grid.
Point values; a scalar field with continuity across element interfaces.
Tangential information is shared, so curl has a consistent meaning.
Normal information is shared, so flux does not disappear or appear at an interface.
Cell-wise amount; discontinuities are allowed because no further derivative is required.
A finite-element field is a weighted sum of local basis functions. For example,uₕ(x) = Σᵢ uᵢ Λᵢ(x): the stored numbers uᵢ are the field, as far as the computer is concerned; the B-spline basis Λᵢ tells it how to evaluate that field between grid locations. Local support keeps assembly and evaluation sparse, while higher-degree B-splines give smooth fields without giving every basis function global reach.
Differentiation becomes sparse linear algebra on those coefficients. The gradient matrix Gmaps coefficients in V₀ to V₁, C maps V₁ to V₂, and D maps V₂ to V₃. Their product vanishes for algebraic reasons, independently of the mesh spacing. Integrals — energy, weak forms, and source terms — add mass matrices, often called discrete Hodge operators, which encode the metric, material coefficients, and mapped geometry.
The two roles are independent. The complex describes topology, i.e. which derivative maps which space into which. The mass matrices describe geometry: lengths, areas, volumes, and how the logical grid is mapped to physical space. Because of this separation the same FEEC operators can be used on Cartesian, periodic and mapped domains.
Set elements, mapping, and periodic or physical boundaries.
Choose spline degrees and compatible spaces V₀ through V₃.
Use the space demanded by its derivative and conservation law.
Combine derivative and mass operators with a time integrator.
Every space above is spanned by B-splines of some degree. Adjust the degree and element count to see how the basis changes — degree p splines are C^(p−1)-continuous across element boundaries, and always sum to exactly 1 everywhere (the "partition of unity").
The number of elements sets the smallest spatial scale that can be represented; the spline degree sets the smoothness and the approximation order within and across elements. Increasing either improves the accuracy but also raises the cost of field evaluation, quadrature and linear solves. A refinement study, varying the number of elements first and then the degree, is the recommended way to select them.
Boundary conditions are part of the space definition. Periodic directions use periodic splines. On a bounded direction, the conditions selected for the fields and potentials must agree with the model's physical boundary conditions. Mapped geometries add a further step: components are transformed so that the tangential or normal continuity appropriate to their form degree is retained in physical space.
A simulation should be checked with both physical and discrete diagnostics: conserved energy or the expected dissipation, the charge and magnetic-divergence constraints, and the convergence of the solution under spatial and temporal refinement. A structure-preserving discretization guarantees some of these properties but does not replace such checks.
Numerical methods describes how these field spaces are coupled to particle markers and advanced in time.
Implementation documentation and background theory.
The project’s detailed account of spline spaces, discrete operators, projectors, and mapped geometry.
Tutorial notebooksNotebooks on the FEEC basics and on boundary conditions.
Foundational paperArnold, Falk and Winther: Hodge theory, compatible discretizations and numerical stability.
Underlying libraryThe Python library that supplies the spline-based de Rham infrastructure used by Struphy.