-
Notifications
You must be signed in to change notification settings - Fork 7
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
Modif correct distortion #17
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing! As I mentioned in the review, I'd like to hear more about the modifications/additions to the distortion correction feature. I'm sure others would be interested as well
if (np.linalg.norm(N_minimizer - magx) >= self.eps): | ||
self.flip_NSEW_lookup(xpt_ID) | ||
# if (np.linalg.norm(N_minimizer - magx) >= self.eps): | ||
# self.flip_NSEW_lookup(xpt_ID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you remember the motivation for commenting out this block? Was this causing an incorrect classification?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. That block created a misclassification of a LSN into a USN (for a very large equilibrium with R0 = 5m)
# self.config = 'LSN' if (abs((self.NSEW_lookup['xpt1']['coor']['N']- xpt)/xpt))[1] <1e-3 else 'USN' | ||
self.config = 'LSN' if self.NSEW_lookup['xpt1']['coor']['N'][1] > xpt[1] else 'USN' | ||
|
||
self.config = 'LSN' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will always result in single nulls being labeled LSN
. Is this intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. That should not be there. This is just a fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this to the example file dir? Also can you modify the paths to work for someone who checks out this repo? I believe the other files are just using relative paths. This might have to do for now until another system gets put in place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be skip
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar comment. Moving this to the resources/data dir would have to do
# correction of distortion ---------------------- | ||
|
||
if not self.distortion_correction['reverse']: | ||
print("distortion correction : regular", "has_limit", | ||
self.distortion_correction['has_limit'], | ||
self.distortion_correction["du_min"], self.distortion_correction[ | ||
"MaxTol"], self.distortion_correction["reverse_j"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the new reverse
mode for distortion_correction
? I'm curious about the grid differences. Can you describe the differences so we can document this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the idea is to generate the poloidal points starting from the separatrix for all patches to avoid the deformation of the cells near the separatrix (this is because poloidal points are generated from the splines with a normalized distance between 0 and 1). du_min is here to prevent cells form being too close from the patch boundary.
|
||
if self.distortion_correction['active']: | ||
for j in range(1, np_lines-1): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following up the description request, is this suggesting that we are still maintaining the old code capabilities of distortion_correction
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. This is just improvement through optional keywords. The default capabilities is untouched (but need to be validated due to refactoring of the correction implementation)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the example gridue associated with a particular case? Or is this some reference file that we should document?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be removed. I need to produce a proper example
check modif for grid generation. Need clean up and testing