Skip to content

Commit

Permalink
Clean up spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
cgilet committed Mar 5, 2024
1 parent 1e9258a commit 5fd9da7
Showing 1 changed file with 26 additions and 27 deletions.
53 changes: 26 additions & 27 deletions src/convection/incflo_compute_advection_term.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -669,40 +669,39 @@ incflo::compute_convective_term (Vector<MultiFab*> const& conv_u,
drdt_tmp.FillBoundary(geom[lev].periodicity());
dtdt_tmp.FillBoundary(geom[lev].periodicity());

//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();

// velocity
auto const& bc_vel = get_velocity_bcrec_device_ptr();
redistribute_term(mfi, *conv_u[lev], dvdt_tmp,
(m_advect_momentum) ? rhovel[lev] : *vel[lev],
bc_vel, lev);

// density
if (!m_constant_density) {
auto const& bc_den = get_density_bcrec_device_ptr();
redistribute_term(mfi, *conv_r[lev], drdt_tmp,
*density[lev], bc_den, lev);
} else {
auto const& drdt = conv_r[lev]->array(mfi);
amrex::ParallelFor(bx,
Box const& bx = mfi.tilebox();

// velocity
auto const& bc_vel = get_velocity_bcrec_device_ptr();
redistribute_term(mfi, *conv_u[lev], dvdt_tmp,
(m_advect_momentum) ? rhovel[lev] : *vel[lev],
bc_vel, lev);

// density
if (!m_constant_density) {
auto const& bc_den = get_density_bcrec_device_ptr();
redistribute_term(mfi, *conv_r[lev], drdt_tmp,
*density[lev], bc_den, lev);
} 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();
redistribute_term(mfi, *conv_t[lev], dtdt_tmp,
rhotrac[lev], bc_tra, lev);
}
} // mfi
if (m_advect_tracer) {
auto const& bc_tra = get_tracer_bcrec_device_ptr();
redistribute_term(mfi, *conv_t[lev], dtdt_tmp,
rhotrac[lev], bc_tra, lev);
}
} // mfi
#endif
} // lev
}

0 comments on commit 5fd9da7

Please sign in to comment.