Skip to content

Add to_standard_orientation for SurfaceRZFourier#103

Merged
scadena-pf merged 1 commit intoproximafusion:mainfrom
scadena-pf:add-to-standard-orientation
Feb 11, 2026
Merged

Add to_standard_orientation for SurfaceRZFourier#103
scadena-pf merged 1 commit intoproximafusion:mainfrom
scadena-pf:add-to-standard-orientation

Conversation

@scadena-pf
Copy link
Collaborator

Summary

  • Adds to_standard_orientation() to normalize the poloidal angle parametrization of stellarator-symmetric SurfaceRZFourier surfaces so that theta=0 is on the outboard side and theta increases counterclockwise in an R-Z cross-section.
  • Reuses existing evaluate_points_rz and _evaluate_dz_dtheta to detect the current orientation, then applies Fourier coefficient transformations as needed.
  • Includes 4 test cases covering all orientation combinations (external/internal × ccw/cw), each verifying geometric equivalence via evaluate_points_xyz.
  • This function was already referenced (but missing) in the from_points docstring.

Details

Five new functions added to surface_rz_fourier.py:

Function Purpose
_is_theta_external Checks if theta=0 is on the outboard side
_is_theta_counterclockwise Checks if theta increases CCW in R-Z plane
_surface_shift_theta_by_pi Shifts theta origin by multiplying coefficients by (-1)^m
_surface_change_theta_sign Reverses theta direction by flipping toroidal mode arrays
to_standard_orientation Public entry point combining the above

Test plan

  • 4 new tests covering all orientation combinations pass
  • All 55 existing + new tests pass
  • ruff, black, isort all clean

🤖 Generated with Claude Code

Normalizes the poloidal angle parametrization of stellarator-symmetric
surfaces so that theta=0 is on the outboard side and theta increases
counterclockwise in an R-Z cross-section.

Reuses existing evaluate_points_rz and _evaluate_dz_dtheta to detect
the current orientation, then applies Fourier coefficient
transformations (theta shift by pi and/or theta sign flip) as needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@scadena-pf scadena-pf requested a review from amerlo-pf February 10, 2026 22:09
@graphite-app
Copy link

graphite-app bot commented Feb 11, 2026

Merge activity

  • Feb 11, 8:22 AM UTC: scadena-pf added this pull request to the Graphite merge queue.
  • Feb 11, 8:23 AM UTC: The Graphite merge queue couldn't merge this PR because it failed for an unknown reason (Fast-forward merges are not supported for forked repositories. Please create a branch in the target repository in order to merge).
  • Feb 11, 8:49 AM UTC: scadena-pf added this pull request to the Graphite merge queue.
  • Feb 11, 8:51 AM UTC: The Graphite merge queue couldn't merge this PR because it failed for an unknown reason (Fast-forward merges are not supported for forked repositories. Please create a branch in the target repository in order to merge).

@scadena-pf scadena-pf merged commit 036e090 into proximafusion:main Feb 11, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants