Question about collecting diagnostic information #3952
Unanswered
ambipomyan
asked this question in
Q&A
Replies: 3 comments 1 reply
-
Could you be a little more clear about what code you're running?
You are correct that the index (30,30,30) might appear on both the coarse
and fine grid -- and there would be different MultiFabs at the different
levels so the value at (30,30,30) would be different at the different
levels because they are different data containers.
What do you mean by having "multiple values of the same variable on each
level"?
…On Wed, May 22, 2024 at 10:25 AM Kewei Yan ***@***.***> wrote:
Dear all, I am considering to manually collect some diagnostic quantities,
such as velocity, after coarseTimeStep, but I am confused about how to
handle the values collected from each levels. Given the same coordinates,
there are multiple values of the same variable on each level. Can you give
me any idea that if I collected velocity values on level 0, 1, 2, and 3,
how do I know the "equivalence" of the velocity on these positions? Thank
you in advance.
—
Reply to this email directly, view it on GitHub
<#3952>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACRE6YSWDAMT6A2SQBQSD7TZDTIHNAVCNFSM6AAAAABIECVJ56VHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZWG4YTGMJRGY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
Ann Almgren
Senior Scientist; Dept. Head, Applied Mathematics
Pronouns: she/her/hers
|
Beta Was this translation helpful? Give feedback.
1 reply
-
I think by equivalence is you would like to be able to put the plot of
level 0 velocity on top of the plot of level 1 velocity for example, and
see they show the same velocity in the same physical location.
If that is what you mean -- what you want to do is plot "v vs x" instead of
"v vs i" -- because the physical location of cell i is different on each
level because dx is different
So try plotting out x,y,z,mf_array(i,j,k,QU) instead of
i,j,k,mf_array(i,j,k,QU) -- where x = (i+0.5)*dx[0], etc, where dx is the
dx for that level.
…On Wed, May 22, 2024 at 11:01 AM Kewei Yan ***@***.***> wrote:
Hi, thank you for your reply!
I am running a Castro code and the path for compile and run can be find
here
https://github.com/AMReX-Astro/Castro/tree/main/Exec/hydro_tests/Sedov
I modified the *GNUmakefile* to build a 2d executable, disabled OpenMP,
and run it with *inputs.2d.sph_in_cylcoords* using 1 MPI process.
The *main.cpp* can be found here
https://github.com/AMReX-Astro/Castro/blob/main/Source/driver/main.cpp
The *while* loop for time stepping is on line 165 and the call of
*coarseTimeStep* is on line 173.
===========================================================
I added code in between line 173 and 174 to manually collect velocity as
follows,
amrex::Vector< std::unique_ptr<AmrLevel> >& amr_levels = amrptr->getAmrLevels();
for (int l = 0; l < n_levels; ++l) {
amrex::MultiFab& mf = amr_levels[l]->get_new_data(State_Type);
amrex::Array4<amrex::Real> mf_array = mf[0].array();
for (int i = x_lo; i < x_hi; ++i) {
printf("%d, %d, %d, %lf ", i, j, k, mf_array(i, j, k, QU));
}
}
The *State_Type* and *QU* are used for collecting Velocity on x-axis.
I traversed all the amr levels and realized that for each level, there is
a velocity given by *mf_array(i, j, k, QU)*.
The following image shows the visualized velocities on each level. The
pattern looks good, but I still want to know if I can find a "equivalence"
of these velocities.
Screen.Shot.2024-05-22.at.12.56.53.PM.png (view on web)
<https://github.com/AMReX-Codes/amrex/assets/32471604/f4abfa88-7289-4abe-ba18-332b9d2aa68d>
Can you give me some suggestions?
Thank you!
—
Reply to this email directly, view it on GitHub
<#3952 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACRE6YTQCQDDE66HOEBUUJDZDTMOPAVCNFSM6AAAAABIECVJ56VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TKMRVGM4DM>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
Ann Almgren
Senior Scientist; Dept. Head, Applied Mathematics
Pronouns: she/her/hers
|
Beta Was this translation helpful? Give feedback.
0 replies
-
This will only work under special conditions. For example, if there are more than one MPI process, it will succeed only on the process that actually owns box # 0. You might want to take a look at #3859. And |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Dear all, I am considering to manually collect some diagnostic quantities, such as velocity, after coarseTimeStep, but I am confused about how to handle the values collected from each levels. Given the same coordinates, there are multiple values of the same variable on each level. Can you give me any idea that if I collected velocity values on level 0, 1, 2, and 3, how do I know the "equivalence" of the velocity on these positions? Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions