how to compute 1d profile along an axis? #2939
-
I'd like to compute the average of a derived state variable along the z-axis (in 3D Cartesian coordinates) each timestep. Should I write my own GPU reduction functions to produce a 1D profile on each GPU and then perform a parallel sum of the profiles? Or is there a clever way to do this with the existing MultiFab functions? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 6 replies
-
I agree this would be useful to have in general. We have something in MAESTROeX to do this, but that is probably not general. |
Beta Was this translation helpful? Give feedback.
-
it is essentially what the average process does -- we need to average lots of quantities down to the 1-d base state (and map back): https://github.com/AMReX-Astro/MAESTROeX/blob/main/Source/MaestroAverage.cpp |
Beta Was this translation helpful? Give feedback.
-
This MAESTROeX example may not be the easiest to follow since we use a fancy BaseState class for 1d quantities. I think I may have something else, let me dig. |
Beta Was this translation helpful? Give feedback.
-
In https://github.com/AMReX-FHD/FHDeX.git |
Beta Was this translation helpful? Give feedback.
-
Does this function do what you want? https://amrex-codes.github.io/amrex/doxygen/namespaceamrex.html#a882a700cf7fab66ee3ce8de37de3ef73 |
Beta Was this translation helpful? Give feedback.
Does this function do what you want? https://amrex-codes.github.io/amrex/doxygen/namespaceamrex.html#a882a700cf7fab66ee3ce8de37de3ef73