Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only call setVal on defined p_nd/p_cc #141

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/incflo_regrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ void incflo::MakeNewLevelFromCoarse (int lev,
}
fillcoarsepatch_gradp(lev, time, new_leveldata->gp, 0);

new_leveldata->p_cc.setVal(0.0);
new_leveldata->p_nd.setVal(0.0);
if (m_use_cc_proj) {
new_leveldata->p_cc.setVal(0.0);
} else {
new_leveldata->p_nd.setVal(0.0);
}

m_leveldata[lev] = std::move(new_leveldata);
m_factory[lev] = std::move(new_fact);
Expand Down Expand Up @@ -85,8 +88,11 @@ void incflo::RemakeLevel (int lev, Real time, const BoxArray& ba,
}
fillpatch_gradp(lev, time, new_leveldata->gp, 0);

new_leveldata->p_cc.setVal(0.0);
new_leveldata->p_nd.setVal(0.0);
if (m_use_cc_proj) {
new_leveldata->p_cc.setVal(0.0);
} else {
new_leveldata->p_nd.setVal(0.0);
}

m_leveldata[lev] = std::move(new_leveldata);
m_factory[lev] = std::move(new_fact);
Expand Down
7 changes: 5 additions & 2 deletions src/prob/prob_init_fluid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ void incflo::prob_init_fluid (int lev)
auto const& problo = geom[lev].ProbLoArray();
auto const& probhi = geom[lev].ProbHiArray();

ld.p_cc.setVal(0.0);
ld.p_nd.setVal(0.0);
if (m_use_cc_proj) {
ld.p_cc.setVal(0.0);
} else {
ld.p_nd.setVal(0.0);
}

ld.gp.setVal(0.0);

Expand Down
7 changes: 5 additions & 2 deletions src/setup/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,11 @@ void incflo::InitialProjection()
// We set p and gp back to zero (p0 may still be still non-zero)
for (int lev = 0; lev <= finest_level; lev++)
{
m_leveldata[lev]->p_nd.setVal(0.0);
m_leveldata[lev]->p_cc.setVal(0.0);
if (m_use_cc_proj) {
m_leveldata[lev]->p_cc.setVal(0.0);
} else {
m_leveldata[lev]->p_nd.setVal(0.0);
}
m_leveldata[lev]->gp.setVal(0.0);
}
}
Expand Down
Loading