Simsopt macromag: GPMOmr#587
Conversation
…d to vetorized A construction for speedup
… coil scaling to test out stronger coils
…st no coupling solutions
…acking with non 0 backtracking threshold
… of Macromag GPMO. Added corresponding tests. Still trying to quantify error better
…s stuff since couldnt find evidence of actually needing that
…ot the case and also updated nfp since grid is predefined. Prof K. should take a look at this
…rror plot with multiple kmm values for same GPMOmr run....etc
…t tests for these functions. Get the examples fully working in the CI. Get the unit tests working in the CI. Add better docstrings and function names.
…I understand fully what is going wrong.
…iour in cpp code. Pushing to see if ci/cd is fixed
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #587 +/- ##
==========================================
+ Coverage 90.14% 90.20% +0.05%
==========================================
Files 84 85 +1
Lines 17880 19757 +1877
==========================================
+ Hits 16118 17821 +1703
- Misses 1762 1936 +174
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…e the voxel picture. Update unit tests and improve coverage.
… file for finitemu optimization with MUSE. Refactor how arguments are passed to the GPMO functions.
…ples. Added unit test that checks convergance with Nadjacent. Added unit test that validates matrix_Free=True against matrix_free=False.
|
Made some improvements and refactoring changes. Sorry everyone but some significant PM refactoring got appended here, since it really helps and is past time. Most significantly:
Sorry this ballooned but I think its running much faster, has much more documentation, and removed lots of duplicate code. Let me know what you think and please check if I managed to destroy things. The finitemu analysis and optimizations in the example files looks about the same as before, with few percent differences, but I haven't taken the time to verify the Paraview plots and so on still look good. I have also not checked the updated docs -- please verify all the new docstrings (and their mathematical formulas) are building/visualizing well. |
|
@akaptano Thanks! Will take a loook. |
…d skipping the timing test if running the CI.
Summary
This PR adds and documents the GPMOmr workflow (GPMO with macromagnetic refinement) and significantly improves reproducibility and post-processing for the permanent-magnet MUSE study. The changes align the codebase with the methodology and results presented in:
Key Improvements
Macromagnetic refinement in the greedy loop
Adds a device-scale MacroMag refinement path that accounts for finite-permeability and demagnetization effects. This includes a Python implementation of GPMO together with a Numba-accelerated implementation of the demagnetization tensors. Refinement is applied in a winner-only fashion via
mm_refine_every, preserving the efficiency of the greedy loop while incorporating realistic magnetic coupling.Standardized run artifacts
Introduces a consistent artifact format across GPMO and GPMOmr:
run_<id>.yamlfor configuration and metadatarunhistory_<id>.csvfor optimization historiesThis replaces legacy
*.txthistories and enables uniform plotting and comparison across runs.Overall, this PR makes the GPMO/GPMOmr workflows more realistic, reproducible, and directly traceable to the results reported in arXiv:2512.14997.