You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the amrcore exaples, I want to add the phi_old to the output file.
In the "PlotFileMF()" function, i add the following line, but it seems doesn't work. the "phi_old" variable take nan values in visit.
amrex::Vector<const amrex::MultiFab*> ScalarTransport_MultiLevel::PlotFileMF () const
{
amrex::Vector<const amrex::MultiFab*> r;
for (int i = 0; i <= finest_level; ++i) {
r.push_back(&phi_new[i]);
}
for (int i = 0; i <= finest_level; ++i) {
r.push_back(&phi_old[i]);
}
return r;
}
The text was updated successfully, but these errors were encountered:
First, you need to make sure phi_old does not contain NaNs. In the AmrCore example, we do not initialize phi_old because it is not needed. But if you want to save phi_old in plotfiles, you need to initialize phi_old every time you remake an old level or creating a new level from scratch.
The modification to PlotFileMF will not work even if phi_old has no NaNs. The returned vector must have the size of finest_level+1, not 2*(finiest_level+1), because it is expected to have one MulitFab per level. There are two approaches you can take. You can put phi_new and phi_old in the same MultiFab. Or you can create a temporary 2 components MultiFab for plotfiles. For example,
In the amrcore exaples, I want to add the phi_old to the output file.
In the "PlotFileMF()" function, i add the following line, but it seems doesn't work. the "phi_old" variable take nan values in visit.
The text was updated successfully, but these errors were encountered: