`evaluate_solovev` in `vaft/process/_equilibrium_parametric.py` returns `b_r = -dpsi_dz/R` and `b_z = +dpsi_dr/R`, which is the `k = +1` form, the orientation family with a positive product of the toroidal and poloidal sign conventions (COCOS 1/4/5/8).
Everywhere else in the module the poloidal field comes from `_bp_factor`, whose fallback for an unidentified convention is `k = -1` (COCOS 2/3/6/7). So the analytic Solovev field is in the opposite family from every numerically derived one.
`solovev_to_equilibrium` reconciles the two only on the 2pi axis: its docstring and its code handle the full-weber scaling and say nothing about the sign. A round trip through `solovev_to_equilibrium(convention=11)` into `derive_global_descriptors` gets the factor of 2pi right and, if the declared index is honoured for the sign, can invert the field relative to the analytic `b_r` and `b_z` it came from.
Decide which family the analytic model is in, state it, and make the export reconcile both halves rather than one.
Found while documenting the equilibrium layer under the process documentation contract (#419). Filed rather than fixed, per that issue's rule that a convention applied inconsistently is a numerical-correctness bug with its own review.
🤖 Generated with Claude Code
`evaluate_solovev` in `vaft/process/_equilibrium_parametric.py` returns `b_r = -dpsi_dz/R` and `b_z = +dpsi_dr/R`, which is the `k = +1` form, the orientation family with a positive product of the toroidal and poloidal sign conventions (COCOS 1/4/5/8).
Everywhere else in the module the poloidal field comes from `_bp_factor`, whose fallback for an unidentified convention is `k = -1` (COCOS 2/3/6/7). So the analytic Solovev field is in the opposite family from every numerically derived one.
`solovev_to_equilibrium` reconciles the two only on the 2pi axis: its docstring and its code handle the full-weber scaling and say nothing about the sign. A round trip through `solovev_to_equilibrium(convention=11)` into `derive_global_descriptors` gets the factor of 2pi right and, if the declared index is honoured for the sign, can invert the field relative to the analytic `b_r` and `b_z` it came from.
Decide which family the analytic model is in, state it, and make the export reconcile both halves rather than one.
Found while documenting the equilibrium layer under the process documentation contract (#419). Filed rather than fixed, per that issue's rule that a convention applied inconsistently is a numerical-correctness bug with its own review.
🤖 Generated with Claude Code