Ext: PatchBasedMeshRefinement - #252
Conversation
|
I see two major issues with the current state of mesh refinement:
|
|
Potential directions for HDF5 support of MR in openPMD: |
|
This is clearly motivated specifically with a patch-based refinement strategy in mind, and as such probably works very well. However, I would like to point out that this structure would seem quite alien to other refined mesh approaches (tree-based or individuall-cell-based ones). Deliberately grouping mesh data by refinement level does not come natural to them! Sorry about this nonproductive comment, as I do not have a suggestion for a suitable, more general approach. There certainly is merit in the proposal as it is specified here, but you might want to adapt a more specific name ("PatchBasedMeshRefinement"), as to not encumber future applications with different approaches. |
Thank you, Urs!
| The coarsest level of a record is implicitly assigned the level `0` of a simulation. | ||
| The record names of finer levels are suffixed with `_lvl<N>` where `<N>` is the integer of the refined level. | ||
|
|
||
| A patch of a refinemnet level shall be a spatially hyperrectangular subselection of the previous level. |
There was a problem hiding this comment.
| A patch of a refinemnet level shall be a spatially hyperrectangular subselection of the previous level. | |
| A patch of a refinement level shall be a spatially hyperrectangular subselection of the previous level. |
|
|
||
| A mesh record describing a refined level shall add the following attribute: | ||
|
|
||
| - `refinementRatio` |
There was a problem hiding this comment.
I don't think that is needed, because we already save the cell size at each level. So this would duplicate the same info.
| see [EXT_BeamPhysics.md](EXT_BeamPhysics.md). | ||
| - **ED-PIC**: electro-dynamic/static particle-in-cell codes, | ||
| see [EXT_ED-PIC.md](EXT_ED-PIC.md). | ||
| - **MeshRefinement**: mesh records refined over multiple levels of resolution, |
There was a problem hiding this comment.
| - **MeshRefinement**: mesh records refined over multiple levels of resolution, | |
| - **PatchBasedMeshRefinement**: mesh records refined over multiple levels of resolution, |
There was a problem hiding this comment.
Following up on the comment above, are there advantages to differentiate between patch-based refinement and other types of refinement?
Or could all types be covered by a very simple/basic extension?
| The coarsest level of a record is implicitly assigned the level `0` of a simulation. | ||
| The record names of finer levels are suffixed with `_lvl<N>` where `<N>` is the integer of the refined level. | ||
|
|
||
| A patch of a refinemnet level shall be a spatially hyperrectangular subselection of the previous level. |
There was a problem hiding this comment.
| A patch of a refinemnet level shall be a spatially hyperrectangular subselection of the previous level. | |
| A patch of a refinement level shall be a spatially hyperrectangular subselection of the previous level. |
|
This is supported by This plugin has also been tested with Quokka and WarpX outputs, which AFAIK adhere more strictly to this proposal. |
pgrete
left a comment
There was a problem hiding this comment.
Dear all,
what would be required to push this across the finish line?
There are now multiple codes that use (some variant) of this extension plus some downstream tooling is available, too.
It seems like a good time to finalize the extension.
| The coarsest level of a record is implicitly assigned the level `0` of a simulation. | ||
| The record names of finer levels are suffixed with `_lvl<N>` where `<N>` is the integer of the refined level. |
There was a problem hiding this comment.
Does the "implicit" imply that level 0 cannot (or may not) carry the _lvl suffix?
| A patch of a refinemnet level shall be a spatially hyperrectangular subselection of the previous level. | ||
| Multiple patches might exist in a refined level. | ||
|
|
||
| If the implemented file format supports sparse data sets, i.e. through efficient chunking of patches, the refined level must over the previous level in extend and store multiple patches through its chunking mechanism. | ||
|
|
||
| File formats that do not support efficient storage a sparesly populated refinement level can store continguous patches on the same level with an additional suffix `_<P>` where `<P>` is the number of the (hyperrectangular) patch in the refinement level. |
There was a problem hiding this comment.
Does this need to be specified at all?
For example, if I have a mesh where half of the domain is refined and the other is not, the current wording suggests a either a global mesh with sparse data or a patched based one.
I could imagine that a simpler logic (i..e, just the _lvlN without considering sparse or patches) could be enough as it would already allow a code to query if data at certain location (and a certain level) exist.
I would also consider keeping the _<P> suffix, but optional and allowing for overlapping region (without making guarantees on the data in the overlapping regions), as it would allow to write individual patches/blocks with individual ghost zones (e.g., for debugging or calculating derived quantity on fine levels without prolongation from coarser ones).
This should then also cover/provide flexibility other MR strategies without breaking the existing usage, doesn't it?
| see [EXT_BeamPhysics.md](EXT_BeamPhysics.md). | ||
| - **ED-PIC**: electro-dynamic/static particle-in-cell codes, | ||
| see [EXT_ED-PIC.md](EXT_ED-PIC.md). | ||
| - **MeshRefinement**: mesh records refined over multiple levels of resolution, |
There was a problem hiding this comment.
Following up on the comment above, are there advantages to differentiate between patch-based refinement and other types of refinement?
Or could all types be covered by a very simple/basic extension?
Adds a simple convention for patch based mesh refinement.
Description
This adds a naming convention to efficiently identify levels of a refined mesh.
Affected Components
base(cosmetic)EXT: PatchBasedMeshRefinementLogic Changes
Adds a naming convention through record suffixes for meshes that can be used to identify refined meshes.
Allows two ways to store a refined mesh: through one record per refinement level (e.g. for ADIOS) or through one record per refinement level and patch (for non-contiguous refinements).
Writer Changes
A writer can suffix the meshes to express levels.
openPMD-api: https://github.com/openPMD/openPMD-apiWarpX: openPMD: Support for mesh refinement BLAST-WarpX/warpx#1842Reader Changes
A reader can group mesh-refined records visually or build an MR structure.
Good candidates:
yt: https://github.com/yt-project/ytParaView: ...Unaffected for now:
openPMD-validator: https://github.com/openPMD/openPMD-validatoropenPMD-viewer: https://github.com/openPMD/openPMD-viewerVisIt: https://github.com/openPMD/openPMD-visit-pluginconverter: https://github.com/openPMD/openPMD-converteropenPMD-api: https://github.com/openPMD/openPMD-apiData Updater
New functionality. No data update needed.