Skip to content

Commit

Permalink
More whitespace clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
cgilet committed Oct 2, 2023
1 parent d0b1869 commit 254e682
Show file tree
Hide file tree
Showing 9 changed files with 161 additions and 153 deletions.
41 changes: 22 additions & 19 deletions src/convection/incflo_compute_advection_term.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ incflo::compute_convective_term (Vector<MultiFab*> const& conv_u,
// We now re-compute the velocity forcing terms including the pressure gradient,
// and compute the tracer forcing terms for the first time
if (m_advection_type != "MOL") {

compute_vel_forces(vel_forces, vel, density, tracer, tracer);

if (m_godunov_include_diff_in_forcing) {

for (int lev = 0; lev <= finest_level; ++lev) {
auto& ld = *m_leveldata[lev];
#ifdef _OPENMP
Expand Down Expand Up @@ -250,6 +250,7 @@ incflo::compute_convective_term (Vector<MultiFab*> const& conv_u,
u[1] = v_mac[lev];,
u[2] = w_mac[lev];);

VisMF::Write(*u_mac[lev], "umac");
#ifdef AMREX_USE_EB
const auto& ebfact = EBFactory(lev, time);

Expand Down Expand Up @@ -727,44 +728,46 @@ incflo::compute_convective_term (Vector<MultiFab*> const& conv_u,
dtdt_tmp.FillBoundary(geom[lev].periodicity());
//get_velocity_eb()[lev]->FillBoundary(geom[lev].periodicity());

VisMF::Write(dvdt_tmp,"dvdt");
//Was this OMP intentionally left off?
#ifdef _OPENMP
#pragma omp parallel if (Gpu::notInLaunchRegion())
#endif
for (MFIter mfi(*density[lev],TilingIfNotGPU()); mfi.isValid(); ++mfi)
{
Box const& bx = mfi.tilebox();
Box const& bx = mfi.tilebox();

// SRD returning an update, not full state

// velocity
auto const& bc_vel = get_velocity_bcrec_device_ptr();
// velocity
auto const& bc_vel = get_velocity_bcrec_device_ptr();
redistribute_term(mfi, conv_u[lev]->array(mfi), dvdt_tmp.array(mfi),
(m_advect_momentum) ? rhovel[lev].array(mfi) : vel[lev]->array(mfi),
bc_vel, lev, Array4<Real const>{});

// density
if (!m_constant_density) {
auto const& bc_den = get_density_bcrec_device_ptr();
// density
if (!m_constant_density) {
auto const& bc_den = get_density_bcrec_device_ptr();
redistribute_term(mfi, conv_r[lev]->array(mfi), drdt_tmp.array(mfi),
density[lev]->array(mfi), bc_den, lev,
Array4<Real const>{});
} else {
auto const& drdt = conv_r[lev]->array(mfi);
amrex::ParallelFor(bx,
} else {
auto const& drdt = conv_r[lev]->array(mfi);
amrex::ParallelFor(bx,
[=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
{
drdt(i,j,k) = 0.;
});
}
{
drdt(i,j,k) = 0.;
});
}

if (m_advect_tracer) {
auto const& bc_tra = get_tracer_bcrec_device_ptr();
if (m_advect_tracer) {
auto const& bc_tra = get_tracer_bcrec_device_ptr();
redistribute_term(mfi, conv_t[lev]->array(mfi), dtdt_tmp.array(mfi),
rhotrac[lev].array(mfi), bc_tra, lev,
Array4<Real const>{});
}
} // mfi
}
} // mfi
VisMF::Write(*conv_u[lev],"conv");
#endif
#endif
} // lev
Expand Down
8 changes: 4 additions & 4 deletions src/diffusion/DiffusionScalarOp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,13 +490,13 @@ void DiffusionScalarOp::compute_laps (Vector<MultiFab*> const& a_laps,
for(int lev = 0; lev <= finest_level; lev++)
{
// Flux redistribution
amrex::single_level_redistribute(laps_tmp[lev],
*a_laps[lev], 0, m_incflo->m_ntrac,
amrex::single_level_redistribute(laps_tmp[lev],
*a_laps[lev], 0, m_incflo->m_ntrac,
m_incflo->Geom(lev));
//
// If we want to allow option of SRD, use incflo::redistribute_term.
//
// auto const& bc = m_incflo->get_tracer_bcrec_device_ptr();
// auto const& bc = m_incflo->get_tracer_bcrec_device_ptr();
// m_incflo->redistribute_term(*a_laps[lev], laps_tmp[lev], *a_scalar[lev],
// bc, lev, Array4<Real const>{});
}
Expand Down Expand Up @@ -615,7 +615,7 @@ void DiffusionScalarOp::compute_divtau (Vector<MultiFab*> const& a_divtau,
#else
for(int lev = 0; lev <= finest_level; lev++)
{
amrex::single_level_redistribute(divtau_tmp[lev],
amrex::single_level_redistribute(divtau_tmp[lev],
*a_divtau[lev], 0, a_divtau[lev]->nComp(),
m_incflo->Geom(lev));
//
Expand Down
2 changes: 1 addition & 1 deletion src/diffusion/DiffusionTensorOp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ void DiffusionTensorOp::compute_divtau (Vector<MultiFab*> const& a_divtau,
for(int lev = 0; lev <= finest_level; lev++)
{
// Flux redistribution
amrex::single_level_redistribute( divtau_tmp[lev], *a_divtau[lev], 0, AMREX_SPACEDIM, m_incflo->Geom(lev));
amrex::single_level_redistribute( divtau_tmp[lev], *a_divtau[lev], 0, AMREX_SPACEDIM, m_incflo->Geom(lev));
//
// If we want to allow option of SRD, use incflo::redistribute_term.
//
Expand Down
5 changes: 5 additions & 0 deletions src/incflo.H
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ private:

#ifdef AMREX_USE_EB
#ifdef INCFLO_USE_MOVING_EB
// FIXME - probably should clean this up so we just have EBFactory(lev, time)
[[nodiscard]] amrex::EBFArrayBoxFactory const&
EBFactory (int lev) const noexcept {
return static_cast<amrex::EBFArrayBoxFactory const&>(*m_new_factory[lev]); }
Expand All @@ -712,6 +713,10 @@ private:
EBFactory (int lev) const noexcept {
return static_cast<amrex::EBFArrayBoxFactory const&>(*m_factory[lev]);
}
[[nodiscard]] amrex::EBFArrayBoxFactory const&
EBFactory (int lev, amrex::Real /*time*/) const noexcept {
return static_cast<amrex::EBFArrayBoxFactory const&>(*m_factory[lev]);
}
#endif
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/incflo_advance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void incflo::Advance(Real orig_mass, Real& prev_mass)
{
m_t_old[lev] = m_cur_time;
m_t_new[lev] = m_cur_time + m_dt;
Print()<<"ADVANCE times : "<<m_t_old[lev]<<" "<<m_t_new[lev]<<std::endl;
Print()<<"ADVANCE times : "<<m_t_old[lev]<<" "<<m_t_new[lev]<<std::endl;
}

#ifdef INCFLO_USE_MOVING_EB
Expand Down
8 changes: 4 additions & 4 deletions src/incflo_apply_predictor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -825,10 +825,10 @@ void incflo::ApplyPredictor (bool incremental_projection)
// // VisMF::Write(density_nph_neweb[0],"rnph");
// VisMF::Write(m_leveldata[0]->velocity,"vel");

// std::string save = m_plot_file;
// m_plot_file = "pred";
// WritePlotFile();
// m_plot_file = save;
std::string save = m_plot_file;
m_plot_file = "pred";
WritePlotFile();
m_plot_file = save;
// static int count = 0;
// count++;
//if (count > 0) Abort();
Expand Down
Loading

0 comments on commit 254e682

Please sign in to comment.