Classes to support AMReX HDF5 Output#5118
Open
kelseasouders wants to merge 3 commits into
Open
Conversation
Contributor
|
thanks for fixing the branch! One other thing -- with new frontend components it's nice to add tests to make sure they at least can identify and load the data they're aimed to cover. Do you happen to have any small real or synthetic datasets that you'd be willing to add? I'm happy to help with getting the data where it needs to go (also happy to help write tests). |
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.
PR Summary
Supersedes #5117 - creating PR from unique branch so that
pre-commitstays happy. I have closed the previous PR.The HDF5 plot file output produced by PeleC (and presumably all amrex-based codes) does not work directly with the existing
ChomboDatasetclass. This is most easily observable through the dimensionality - the Chombo I/O handler works withself.dim = self._handle["Chombo_global/"].attrs["SpaceDim"], howeverself.dimis not correctly read as an integer when reading the amrex-produced files, so I have fixed it by explicitly settingself.dim = int(self._handle["Chombo_global/"].attrs["SpaceDim"]). I've made this change in a few locations in this PR.I also observed some errors in the spatial positioning when working with the PeleC HDF5 output files, which appeared to come from the
_calc_left_edge()and_calc_right_edge()methods assuming that the domain starts at [0, 0, 0]. The PeleC HDF5 output files contain the edge information directly, so I have elected to read them directly from the file (since amrex includes that in the attributes anyway), which has fixed the spatial misalignment.I was torn between adding these classes to the
amrexfrontend orchombofrontend, but decided that thechombofrontend would be more appropriate since the two share the same underlying functionality. I believe that it would be fairly straightforward to integrate these changes into theChomboDatasetclass directly, but I refrained since I was unsure if they would lead to issues in other types of chombo data.Update: I did overwrite the
_is_valid()method from the ChomboDataset by checking the datatype of thedimattribute as it is read from the HDF5 file. For regular chombo files, this should be correctly read as a integer, but it is read as a list from the AMReX HDF5 plot files. I also have it check for the bounding box in thelevel_0data (which should always exist), since that is used for determining the spatial information for the domain and grids.