Add restart.change_grid function#56
Merged
Merged
Conversation
Only works for nz=1 for now, as testing for axisymmetric simulations. Asserts that nz=1, and could be extended in future, perhaps by interpolating one Z slice at a time.
Apparently needed by xBOUT
6 tasks
johnomotani
requested changes
Jan 1, 2022
johnomotani
left a comment
Contributor
There was a problem hiding this comment.
Looks pretty good to me, just a few minor suggestions.
Comment on lines
+1049
to
+1052
| from_Rxy = extrapolate_yguards(from_Rxy, copy_data["MYG"]) | ||
| from_Zxy = extrapolate_yguards(from_Zxy, copy_data["MYG"]) | ||
| to_Rxy = extrapolate_yguards(to_Rxy, copy_data["MYG"]) | ||
| to_Zxy = extrapolate_yguards(to_Zxy, copy_data["MYG"]) |
Contributor
There was a problem hiding this comment.
What if the grid file contains y-boundary cells? It gets a bit complicated to deal with, especially allowing for an upper divertor, so suggest just adding some check like
if g.get("y_boundary_guards", 0) != 0:
raise ValueError("Support for grid files with y-boundary cells not implemented yet")
when opening the grid files.
Contributor
Author
There was a problem hiding this comment.
Thanks @johnomotani for the suggestions, and happy New Year!
Co-authored-by: johnomotani <john.omotani@ukaea.uk>
Co-authored-by: johnomotani <john.omotani@ukaea.uk>
Co-authored-by: johnomotani <john.omotani@ukaea.uk>
Not currently supported, so raise error if encountered.
Ensure that 3D inputs are 3D in the output, and that the BOUT_VERSION and MZ variables are in the outputs. This allows the output to be collected, and used as input to another interpolation if needed.
johnomotani
approved these changes
Jan 6, 2022
johnomotani
left a comment
Contributor
There was a problem hiding this comment.
Nice! Thanks @bendudson
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Converts restart files from one input grid to another, by interpolating in the R-Z plane. Intended for doing resolution scans with axisymmetric simulations.
Only works for nz=1 for now, as testing for axisymmetric simulations.
Asserts that nz=1, and could be extended in future, perhaps by interpolating one Z slice at a time.