Skip to content

Commit

Permalink
Remove prints (#1614)
Browse files Browse the repository at this point in the history
* remove print statements

* remove print statements
  • Loading branch information
asalmgren authored May 10, 2024
1 parent 44e68bf commit 871395c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Source/Utils/ERF_PoissonSolve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ void ERF::project_velocities (int lev, Real l_dt, Vector<MultiFab>& vmf, MultiFa
if (need_adjust_rhs)
{
Real offset = volWgtSumMF(lev, rhs[0], 0, *mapfac_m[lev], false, false);
amrex::Print() << "Poisson solvability offset = " << offset << std::endl;
// amrex::Print() << "Poisson solvability offset = " << offset << std::endl;
rhs[0].plus(-offset, 0, 1);
}

Expand Down Expand Up @@ -162,7 +162,7 @@ void ERF::project_velocities (int lev, Real l_dt, Vector<MultiFab>& vmf, MultiFa
MultiFab::Add(vmf[Vars::yvel], fluxes[0][1], 0,0,1,0);
MultiFab::Add(vmf[Vars::zvel], fluxes[0][2], 0,0,1,0);

#if 1
#if 0
// Confirm that the velocity is now divergence free
u[0] = &(vmf[Vars::xvel]);
u[1] = &(vmf[Vars::yvel]);
Expand Down
12 changes: 9 additions & 3 deletions Source/Utils/ERF_PoissonSolve_tb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void ERF::project_velocities_tb (int lev, Real l_dt, Vector<MultiFab>& vmf, Mult
Vector<BoxArray> ba_tmp; ba_tmp.push_back(vmf[Vars::cons].boxArray());
Vector<DistributionMapping> dm_tmp; dm_tmp.push_back(vmf[Vars::cons].DistributionMap());
Vector<Geometry> geom_tmp; geom_tmp.push_back(geom[lev]);
amrex::Print() << "AT LEVEL " << lev << " BA FOR POISSON SOLVE " << vmf[Vars::cons].boxArray() << std::endl;
// amrex::Print() << "AT LEVEL " << lev << " BA FOR POISSON SOLVE " << vmf[Vars::cons].boxArray() << std::endl;

// Use the default settings
LPInfo info;
Expand Down Expand Up @@ -76,12 +76,14 @@ void ERF::project_velocities_tb (int lev, Real l_dt, Vector<MultiFab>& vmf, Mult
deltaf[0][idim].setVal(0.0); // start with f^* == f^{n-1}
}

#if 0
// DEBUG
u[0] = &(vmf[Vars::xvel]);
u[1] = &(vmf[Vars::yvel]);
u[2] = &(vmf[Vars::zvel]);
computeDivergence(rhs[0], u, geom[0]);
Print() << "Max norm of divergence before solve at level 0 : " << rhs[0].norm0() << std::endl;
#endif

for (int itp = 0; itp < solverChoice.ncorr; ++itp)
{
Expand All @@ -99,6 +101,7 @@ void ERF::project_velocities_tb (int lev, Real l_dt, Vector<MultiFab>& vmf, Mult
u[2] = &(u_plus_dtdf[0][2]);
computeDivergence(rhs[0], u, geom_tmp[0]);

#if 0
// DEBUG
if (itp==0) {
for (MFIter mfi(rhs[0], TilingIfNotGPU()); mfi.isValid(); ++mfi)
Expand All @@ -120,11 +123,12 @@ void ERF::project_velocities_tb (int lev, Real l_dt, Vector<MultiFab>& vmf, Mult
});
}
}
#endif

// If all Neumann BCs, adjust RHS to make sure we can converge
if (need_adjust_rhs) {
Real offset = volWgtSumMF(lev, rhs[0], 0, *mapfac_m[lev], false, false);
amrex::Print() << "Poisson solvability offset = " << offset << std::endl;
// amrex::Print() << "Poisson solvability offset = " << offset << std::endl;
rhs[0].plus(-offset, 0, 1);
}

Expand Down Expand Up @@ -212,14 +216,15 @@ void ERF::project_velocities_tb (int lev, Real l_dt, Vector<MultiFab>& vmf, Mult
// }
// }

#if 1
#if 0
// Confirm that the velocity is now divergence free
u[0] = &(vmf[Vars::xvel]);
u[1] = &(vmf[Vars::yvel]);
u[2] = &(vmf[Vars::zvel]);
computeDivergence(rhs[0], u, geom_tmp[0]);
Print() << "Max norm of divergence after solve at level " << lev << " : " << rhs[0].norm0() << std::endl;

#if 0
for (MFIter mfi(rhs[0], TilingIfNotGPU()); mfi.isValid(); ++mfi)
{
const Box& bx = mfi.tilebox();
Expand All @@ -242,5 +247,6 @@ void ERF::project_velocities_tb (int lev, Real l_dt, Vector<MultiFab>& vmf, Mult
});
}
#endif
#endif
}
#endif

0 comments on commit 871395c

Please sign in to comment.