Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jguterl
Copy link
Contributor

@jguterl jguterl commented Sep 13, 2023

check modif for grid generation. Need clean up and testing

Copy link
Collaborator

@bryan-garcia bryan-garcia left a 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

Comment on lines -301 to +305
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)
Copy link
Collaborator

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?

Copy link
Contributor Author

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)

Comment on lines +307 to +309
# 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'
Copy link
Collaborator

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?

Copy link
Contributor Author

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

Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be skip

Copy link
Collaborator

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

Comment on lines +1037 to +1043
# 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"]
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Comment on lines +1232 to +1234

if self.distortion_correction['active']:
for j in range(1, np_lines-1):
Copy link
Collaborator

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?

Copy link
Contributor Author

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)

Copy link
Collaborator

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?

Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants