spectre.converters.compute_guesses_map2disc

map2disc (BCM) interface guesses from boundary Fourier coefficients.

The map2disc package provides a 2-D boundary-conformal map (BCM) that maps the unit disc onto an arbitrary poloidal cross-section. By evaluating the map at radii rho = sqrt(tflux) it produces geometrically smooth nested interfaces inside a given plasma boundary.

This module holds the converter-side entry point compute_interface_guesses_map2disc(), which maps a boundary given directly as Fourier-coefficient dicts (no SPECTRE object required). The actual conformal mapping loop lives in spectre.mesh_gen.map2disc.map_boundary_to_interfaces() and is shared with the SPECTRE-state mesh generation in spectre.mesh_gen.

Module Contents

spectre.converters.compute_guesses_map2disc.compute_interface_guesses_map2disc(rbc, zbs, nfp, tfluxes, mpol, ntor, ntheta=124, nzeta=78, bcm_m=6)

Generate interface geometry guesses using conformal mapping (map2disc).

Uses the map2disc BCM solver to conformally map the plasma boundary inward to each interface position, producing geometrically smooth nested surfaces. Only the boundary Fourier harmonics are required — no VMEC wout or SPECTRE object is needed — so this works from both input.* and wout_*.nc sources.

The rbc / zbs dicts must be in SPECTRE convention (angle-fix applied, i.e. the output of vmec_boundary_to_fourier_coeffs() with angle_fix=True). The same sign convention (th_arr = -th_arr) as gen_infaces() is used internally so the FFT output is directly compatible with allrzrz.

Args:
rbc: boundary R cosine harmonics as {'(m, n)': value} dict

(SPECTRE convention, angle-fix applied).

zbs: boundary Z sine harmonics as {'(m, n)': value} dict

(SPECTRE convention, angle-fix applied).

nfp: number of toroidal field periods. tfluxes: 1-D array of interface toroidal-flux values in (0, 1]. mpol: maximum poloidal mode number for the output. ntor: maximum toroidal mode number (reduced, without nfp) for the output. ntheta: number of poloidal quadrature points (default 124). nzeta: number of toroidal quadrature points per field period (default 78). bcm_m: number of Fourier modes used by BCM (default 6).

Returns:

dict suitable for PhysicsParameters.allrzrz: {'interface_1': {'rbc': {...}, 'zbs': {...}, 'rbs': {...}, 'zbc': {...}}, ...}

Raises:

ImportError: if map2disc is not installed.