libneo is the shared Fortran library and Python package of the plasma theory group at ITPcp, TU Graz. It collects equilibrium and magnetic-field readers, coordinate conversions and numerical utilities used by NEO-2, NEO-RT, SIMPLE, KAMEL, MEPHIT and related codes.
Status: research infrastructure under active development; interfaces may change.
- Magnetic-field representations and readers: G-EQDSK, VMEC
wout, Boozer (.bc,boozmn), chartmap, mgrid, SPECTRE, JOREK, coil files and Biot-Savart fields (src/field,src/magfie). - Coordinate systems and conversions, including VMEC, chartmap and geometric
flux coordinates (
src/coordinates). - Converters from EFIT/G-EQDSK and Hamada coordinates to Boozer coordinates
(
efit_to_boozer.x,hamada_to_boozer.x) and from VMEC to chartmaps (vmec_to_chartmap.x). - Splines and batch interpolation, ODE integration, collision frequencies, Poincare plots of field lines.
- HDF5 and NetCDF access through Fortio
(
hdf5_tools,nctools), without linking the system HDF5 or NetCDF libraries. - Python package
libneowith chartmap generators, VMEC/NEMEC/EQDSK tools, coil conversion and ASCOT5 field export; MATLAB classes inmatlab/.
Requirements: CMake 3.22 or newer, Ninja, GCC and gfortran, BLAS/LAPACK.
CMake fetches Fortio, Fortnum and
FortFEM at configure time (revisions
pinned in fpm.toml). On Debian or Ubuntu, setup/debian.sh installs the
system packages; for computing clusters, load the modules in
setup/<machine>.sh.
make # configure and build in build/ with CMake and Ninja
make test # run the CTest suite
Codes that use libneo usually fetch it through CMake; NEO-2, NEO-RT and KAMEL
accept LIBNEO_REF=<branch|tag|sha> to select a revision.
Inside a virtual environment, from the repository root:
pip install -e .
The Fortran wrappers are built only if numpy and f90wrap are available.
Optional extras: .[chartmap] for the chartmap generators, .[dev] for tests.
Example:
libneo-write-chartmap from-vmec wout.nc wout.chartmap.nc --nrho 33 --ntheta 65 --nzeta 33
- doc/python.md: Python package, chartmaps, VMEC and NEMEC conventions, coil and ASCOT5 tools.
- doc/efit_to_boozer/: EFIT to Boozer converter.
- doc/Poincare.md: Poincare plot module.
- doc/ascot5.md: ASCOT5 field export.
- doc/matlab.md: MATLAB library.
doc/UserDoc/: LaTeX user documentation of older modules.docs/: Sphinx documentation of the Python interface, built in CI.
See CONTRIBUTING.md for dependency pins and the merge workflow, and CODING_STANDARD.md for conventions.
Original libneo code is MIT-licensed, see LICENSE. Vendored third-party code and linked libraries carry their own licenses; THIRD_PARTY.md lists them.