Add reusable coil optimization geometry interfaces - #58
Open
rogeriojorge wants to merge 11 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
|
rogeriojorge
marked this pull request as ready for review
August 15, 2026 04:51
This was referenced Aug 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Curves.dofsandCoils.dofs, with functional differentiablewith_dofs(...)updatesBiotSavart.b_cyl(R, phi, Z)so VMEX/NESTOR can evaluate moving-boundary coil fields and retain coil derivatives without an mgrid filetrace_field_lines(...)with explicit toroidal-angle or physical-arclength coverage, progress reporting, bounded stopping events, and robust multi-device placementThe additions reuse ESSOS's existing coil, field, surface, and
Tracingrepresentations. They remove repeated indexing and tracing setup from coupled VMEX/ESSOS examples without introducing a parallel abstraction.Low-beta finite-pressure coil example
examples/coil_optimization/optimize_coils_finite_beta_vmex.pybelongs in ESSOS because ESSOS owns the coil degrees of freedom and engineering objectives. VMEX supplies a prescribed fixed-boundary 0.5%-beta QA/bootstrap equilibrium; virtual casing supplies the plasma-current field and total-pressure interface condition. The script shows the scalar, exact JAX gradient, and SciPy adapter explicitly.The coil-current orientation is selected by alignment with the VMEX total field, avoiding the globally reversed near-solution admitted by squared residuals. In the representative 120-iteration CPU run, cost fell from 58.32 to 0.01772 and the interface reached mean/RMS/max
B.n/Bof 0.094%/0.118%/0.548%, normalized total-pressure-jump RMS1.14e-3, approximately 5.02 m coils, and maximum curvature5.18 1/m. A normalized[-1,1]box stalled near 1.7% maximumB.n/B; the documented[-3,3]bound is deliberate for this independent vacuum seed.Validation
origin/main; unreachable field-line energy/velocity branches were removed rather than tested as fictitious physicsb_cylis checked against Cartesian Biot--Savart values and differentiated with JAXgit diff --checkpassesThe repository-wide style backlog is intentionally outside this PR; existing source conventions are retained rather than applying an unrelated bulk reformat.