quadcoil.io package
This package handles file input/output, coil cutting, and provides interfaces for DESC, Simsopt, JAX, and FOCUS.
Submodules
quadcoil.io.coil_cutting module
- quadcoil.io.coil_cutting.coil_xyz_from_qp(qp: jax.tree_util.register_pytree_node_class, dofs, coils_per_half_period=1, theta_shift=0, save=False, save_name='placeholder')[source]
- quadcoil.io.coil_cutting.coil_zeta_theta_from_qp(qp: jax.tree_util.register_pytree_node_class, dofs, coils_per_half_period=5, theta_shift=0)[source]
- quadcoil.io.coil_cutting.simsopt_coil_from_qp(qp, dofs, coils_per_half_period, theta_shift=0, method=<function coil_xyz_from_qp>, base_mode=False, order=10, ppp=40)[source]
Cut a QUADCOIL current-potential solution into a Simsopt coil set.
This helper contours the full current potential on
qp.winding_surface, fits each contour with asimsopt.geo.CurveXYZFourier, assigns asimsopt.field.Current, and, by default, expands the base curves using Simsopt field-period and stellarator symmetries.- Parameters:
qp (QuadcoilParams) – QUADCOIL problem configuration returned by
quadcoil.quadcoil.dofs (dict) – Optimized QUADCOIL degrees of freedom, typically the
dofs_optdictionary returned byquadcoil.quadcoil.coils_per_half_period (int) – Number of current-potential contours to cut per half field period.
theta_shift (float, optional) – Fractional shift applied to the contour levels. Nonzero shifts are ignored when stellarator symmetry is enabled.
method (callable, optional) – Function used to generate coil contour coordinates from
qpanddofs. By default,coil_xyz_from_qpis used.base_mode (bool, optional) – If
True, return the base curves and currents before symmetry expansion. IfFalse, return the symmetry-expanded Simsopt coil set.order (int, optional) – Fourier order for the fitted
CurveXYZFouriercurves.ppp (int, optional) – Quadrature points per Fourier period used for the fitted curves.
- Returns:
list – A list of Simsopt coils generated by
coils_via_symmetrieswhenbase_mode=False.tuple –
(curves, currents)whenbase_mode=True.
quadcoil.io.focus module
quadcoil.io.simsopt module
quadcoil.io.desc module
- quadcoil.io.desc.generate_desc_scaling(objective_name, constraint_name, scales)[source]
A helper method for calculating the units of each objectives and constraints using quantities scales = desc.objectives.normalization.compute_scaling_factors(eq). The formula must be first implemented as quadcoil.objective.<quantity_name>_desc_unit.
- quadcoil.io.desc.load_FourierCurrentPotentialField(eq, scf, winding_quadpoints_phi=None, winding_quadpoints_theta=None, source_grid=None)[source]
- quadcoil.io.desc.quadcoil_desc(desc_eq, vacuum: bool, plasma_M_theta: int, plasma_N_phi: int, desc_scaling: bool = True, **kwargs)[source]
A simple DESC interface for
quadcoil.quadcoil, that replaces the following parameters using information extracted from DESC:nfp stellsym plasma_mpol plasma_ntor plasma_quadpoints_phi plasma_quadpoints_theta plasma_dofs net_poloidal_current_amperes Bnormal_plasma winding_dofs