Skip to content

Commit

Permalink
fix tagging with multiple criteria (#1538)
Browse files Browse the repository at this point in the history
  • Loading branch information
asalmgren authored Mar 28, 2024
1 parent ea1c819 commit 4b8461e
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions Source/ERF_Tagging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,28 @@ ERF::ErrorEst (int levc, TagBoxArray& tags, Real time, int /*ngrow*/)
{
const int clearval = TagBox::CLEAR;
const int tagval = TagBox::SET;

for (int j=0; j < ref_tags.size(); ++j)
{
std::unique_ptr<MultiFab> mf = std::make_unique<MultiFab>(grids[levc], dmap[levc], 1, 0);

bool tag_found = false;

// This allows dynamic refinement based on the value of the density
if (ref_tags[j].Field() == "density")
{
MultiFab::Copy(*mf,vars_new[levc][Vars::cons],Rho_comp,0,1,0);
tag_found = true;

// This allows dynamic refinement based on the value of qv
} else if ( ref_tags[j].Field() == "qv" ) {
MultiFab qv(vars_new[levc][Vars::cons],make_alias,0,RhoQ1_comp+1);
MultiFab::Copy( *mf, qv, RhoQ1_comp, 0, 1, 0);
MultiFab::Divide(*mf, qv, Rho_comp , 0, 1, 0);
tag_found = true;


// This allows dynamic refinement based on the value of qc
} else if (ref_tags[j].Field() == "qc" ) {
MultiFab qc(vars_new[levc][Vars::cons],make_alias,0,RhoQ2_comp+1);
MultiFab::Copy( *mf, qc, RhoQ2_comp, 0, 1, 0);
MultiFab::Divide(*mf, qc, Rho_comp , 0, 1, 0);
tag_found = true;


// This allows dynamic refinement based on the value of the scalar/pressure/theta
Expand All @@ -60,7 +56,6 @@ ERF::ErrorEst (int levc, TagBoxArray& tags, Real time, int /*ngrow*/)
derived::erf_dertheta(bx, dfab, 0, 1, sfab, Geom(levc), time, nullptr, levc);
}
} // mfi
tag_found = true;
#ifdef ERF_USE_PARTICLES
} else {
//
Expand Down Expand Up @@ -95,15 +90,12 @@ ERF::ErrorEst (int levc, TagBoxArray& tags, Real time, int /*ngrow*/)
MultiFab::Add(*mf, temp_dat_crse, 0, 0, 1, 0);
}
}
tag_found = true;
}
}
#endif
}

if (tag_found) {
ref_tags[j](tags,mf.get(),clearval,tagval,time,levc,geom[levc]);
}
ref_tags[j](tags,mf.get(),clearval,tagval,time,levc,geom[levc]);
} // loop over j
}

Expand Down

0 comments on commit 4b8461e

Please sign in to comment.