vmec_jax.energy

Energy functionals.

This module provides a minimal, differentiable magnetic energy functional, intended as the first objective for a fixed-boundary solver.

We match VMEC’s reported wb normalization:

wb = (1 / (2π)^2) * ∫ (B·B)/2 dV

where the integral is over the full torus.

Functions

flux_profiles_from_indata(indata, s, *, signgs)

Construct simple flux profiles (phipf/chipf) from &INDATA.

flux_profiles_from_indata_host_default(...)

Return NumPy flux profiles for the common non-RFP default-APHI path.

integrate_volume_density(density, sqrtg, s, ...)

Integrate density over the full torus using sqrtg and grid spacings.

magnetic_wb_from_state(state, static, ...)

Compute VMEC-style wb and a small diagnostics dict.

Classes

FluxProfiles(phipf, chipf, phips, signgs, ...)

Simple 1D flux functions.