openPMD viewer: visualize AMR simulation #4725
-
Hi! I recently got into running WarpX with mesh refinement with multiple levels. I can view the individual levels separately, but not together. Is there a current solution for viewing them together in the same plot? What is the recommended way to visualize this? Also, is there a way to create complex mesh refinement shapes or can you only make boxes as of right now? For example, I've tried creating a refined torus shape in 3D, but the result is a box enclosing the torus. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Thanks for the question. Regarding visualizing the fields with MR, there are two options:
|
Beta Was this translation helpful? Give feedback.
-
Regarding refined refinement: thanks for reporting this. Did you use this feature, in order to create the patch: One thing to keep in mind is that, by construction in WarpX/AMReX, the MR refinement patch consists of a collection of patches of size amr.blocking_factor |
Beta Was this translation helpful? Give feedback.
Thanks for the question.
Regarding visualizing the fields with MR, there are two options:
yt
(see here), which does have extensive support for MR visualization.openPMD-viewer
. In that particular case, you can use the fact that, for refined levels, the fields outside the MR patch are seen as NaN (openPMD/openPMD-viewer#334)So, if you call
get_field
withplot=True
, and call the fields in the order going from low-level to high level, you will automatically see the right thing. (since, in matplotlib'simshow
, NaNs are just transparent):