VACUUM - Migrate surface current calculation into the VACUUM module - #345
VACUUM - Migrate surface current calculation into the VACUUM module#345jhalpern30 wants to merge 16 commits into
Conversation
…uum module and making it a flag to compute it
… comments from Claude
…egularization in L calculation and moving to ResponseMatrices.jl
…g advantage of it to remove some lines
…SIONToolkit/GPEC into feature/vacuum-surface-inductance
|
Regression tests - this only really affects PerturbedEquilibrium so I ran DIIID The small changes are due to slight variations in the order that Hermitization is performed. The 1 changed value is not physical, since it is just slightly above the arbitrary limit of 1e-10 that we set |
|
@claude review |
Review: #345 — Migrate surface current calculation into VACUUM moduleVerified the core refactor algebraically: the interior-kernel solve now uses Issues
Regression harnessGood to see this was already run and posted ( Removed try/catch regularization in surface inductanceAgree with removing the ad hoc regularization/try-catch fallback in the old No pull request should be merged without human review. Per this repo's CLAUDE.md, this is non-negotiable — please make sure a third-party human reviewer signs off before merging into |
This PR moves the surface inductance calculation (or at least the majority of it) into the VACUUM module. The surface inductance calculation is fundamentally a vacuum quantity. It was hacked into GPEC to avoid cross-code changes, but can more simply be integrated into the VACUUM module and passed into the PerturbedEquilibrium module.
This also makes it a boolean if it is computed or not. For the standard stability calculation where only Wv is needed, computing the surface current calculation costs an extra matrix inversion + storage since it requires forming and solving the interior kernel, which can add up especially when making the Wv spline in the edge. I didn't benchmark the speedup in 2D since its not massive, but this will be very helpful for 3D.
I have looked at the Fortran and checked that no not-yet-ported code will require the old way of doing this. And if anything new does, its more suitable to be coded up in the VACUUM module instead anyway.
Some notes on specific changes:
I_vcompute_surface_current_from_greensis now drastically simplifiedSingularCoupling.jl. I looked at the Fortran and this was unfounded, and screamed "Claude did this because it had one failing test case while porting over the code and added try/catch logic". This same type of code appeared when we were doing the edge matrix splining forpsiedge < 1logic.