-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Priority: Medium
Problem
The coordinate scaling system (sqrt_s_scaling vs identity_scaling) requires careful Jacobian handling that is easy to get wrong. The relationship between different radial coordinates:
s= normalized toroidal flux (VMEC native)rho = sqrt(s)= common radial coordinate- Jacobian factor:
d(rho)/ds = 1/(2*sqrt(s))
When switching between scalings or adding new coordinate systems, it is easy to miss the required Jacobian adjustments.
Current State
- Code works correctly but the scaling logic is spread across multiple files
- Comments explaining the transformations are sparse
- New developers may introduce bugs when modifying coordinate handling
Proposed Solution
- Add detailed comments at key transformation points in:
field_splined.f90(spline construction)reference_coordinates.f90(scaling selection)- libneo coordinate implementations
- Consider adding validation/assertions for coordinate ranges
- Document the full transformation chain in code comments
Related
- See
DOC/coordinates-and-fields.mdSection 2.4 and Appendix A.2
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request