-
Notifications
You must be signed in to change notification settings - Fork 77
Fix logical errors and typos in Spec equilibrium object #457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
I noticed, that parts of the codebase assume all profiles to be the same size (mvol), in this example according to the error message simsopt/src/simsopt/mhd/profiles.py Lines 93 to 98 in 9fc2c36
or here, where volume_current_profile is simply overwritten in the vacuum region for freeboundary runs, so although nvol elements are used, the profile has to be at least mvol in size:simsopt/src/simsopt/mhd/spec.py Lines 1001 to 1019 in 9fc2c36
while other parts create different sizes for different profiles. simsopt/src/simsopt/mhd/spec.py Lines 766 to 781 in 9fc2c36
What is the intended design @smiet ? I think variable size will result in stricter error handling, whereas having all profiles the same size makes them easier to switch out, iterate over, etc. On the other hand, having the same size might confuse users about which elements actually affect the result. |
|
Also @smiet , shouldn't iota profiles be |
|
@missing-user Thank you for the great work! Sorry to keep you waiting. The inconsistencies are not intentional and need to be addressed. The design relies on the user to enforce that the 'ProfileSpec' object is the right size and type for the profile in question. There are some helper functions that aid the user in generating profiles. From the
The error is in the message here, the test compares to the number of degrees-of-freedom of the SpecProfile instance against the 'volume' (interface label) that is trying to be set, which depends on the profile, and the message should be changed to reflect that.
This is due to the (confusing) use of 'cumulative profiles'. The profile on the We have to keep the DoFs on the I have not tested the profiles extensively, and there are indeed likely inconsistensies that you point out, like:
Yes, this must be wrong. I now see that the the I see you refactored the NormalField, but there is a I did very much appreciate the full-array setters and getters |
|
Thanks for the thorough feedback @smiet , I'll pick this back up after I submit my thesis next month. Just wanted to confirm know that I haven't forgotten about this PR. |
There were a few bugs in the Spec equilibrium object that I spotted:
raiseclause was omitted, so they didn't take effectsi.iota[0:self.nvol+1]andsi.oita[0:self.nvol+1]had the wrong shapeas_speccompared tuple to list and always raisednvolelements, notmvol-1