5 Vector<MultiFab>& S_old,
6 Vector<MultiFab>& F_slow,
7 const Real time_for_fp,
const Real slow_dt,
10 BL_PROFILE(
"no_substep_fun");
11 amrex::ignore_unused(nrk);
14 const auto& dxInv = fine_geom.InvCellSizeArray();
16 const amrex::GpuArray<int, IntVars::NumTypes> scomp_fast = {0,0,0,0};
17 const amrex::GpuArray<int, IntVars::NumTypes> ncomp_fast = {2,1,1,1};
19 if (verbose) amrex::Print() <<
" No-substepping time integration at level " << level
20 <<
" to " << time_for_fp
21 <<
" with dt = " << slow_dt << std::endl;
25 #pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
28 for ( MFIter mfi(S_sum[
IntVars::cons],TilingIfNotGPU()); mfi.isValid(); ++mfi)
30 const Box bx = mfi.tilebox();
31 Box tbx = mfi.nodaltilebox(0);
32 Box tby = mfi.nodaltilebox(1);
33 Box tbz = mfi.nodaltilebox(2);
35 Vector<Array4<Real> > ssum_h(n_data);
36 Vector<Array4<Real> > sold_h(n_data);
37 Vector<Array4<Real> > fslow_h(n_data);
39 for (
int i = 0; i < n_data; ++i) {
40 ssum_h[i] = S_sum[i].array(mfi);
41 sold_h[i] = S_old[i].array(mfi);
42 fslow_h[i] = F_slow[i].array(mfi);
45 Gpu::AsyncVector<Array4<Real> > sold_d(n_data);
46 Gpu::AsyncVector<Array4<Real> > ssum_d(n_data);
47 Gpu::AsyncVector<Array4<Real> > fslow_d(n_data);
49 Gpu::copy(Gpu::hostToDevice, sold_h.begin(), sold_h.end(), sold_d.begin());
50 Gpu::copy(Gpu::hostToDevice, ssum_h.begin(), ssum_h.end(), ssum_d.begin());
51 Gpu::copy(Gpu::hostToDevice, fslow_h.begin(), fslow_h.end(), fslow_d.begin());
53 Array4<Real>* sold = sold_d.dataPtr();
54 Array4<Real>* ssum = ssum_d.dataPtr();
55 Array4<Real>* fslow = fslow_d.dataPtr();
58 if ( solverChoice.terrain_type == TerrainType::Moving )
60 const Array4<const Real>& dJ_old = detJ_cc[level]->const_array(mfi);
61 const Array4<const Real>& dJ_new = detJ_cc_new[level]->const_array(mfi);
63 const Array4<const Real>& z_nd_old = z_phys_nd[level]->const_array(mfi);
64 const Array4<const Real>& z_nd_new = z_phys_nd_new[level]->const_array(mfi);
66 const Array4<Real >& z_t_arr = z_t_rk[level]->array(mfi);
70 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k,
int nn) {
79 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept {
85 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept {
92 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept {
101 Real dJ_old_kface = 0.5 * (dJ_old(i,j,k) + dJ_old(i,j,k-1));
102 Real dJ_new_kface = 0.5 * (dJ_new(i,j,k) + dJ_new(i,j,k-1));
110 const Array4<const Real>& dJ_old = detJ_cc[level]->const_array(mfi);
113 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k,
int nn) {
116 if (dJ_old(i,j,k) > 0.0) {
126 ParallelFor(tbx, tby, tbz,
127 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept {
135 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept {
143 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept {
167 fast_only=
true, vel_and_mom_synced=
false);
169 if (solverChoice.anelastic[level]) {
170 bool have_tb = (thin_xforce[0] || thin_yforce[0] || thin_zforce[0]);
172 project_velocities_tb(level, slow_dt, S_sum, pp_inc[level]);
174 project_velocities(level, slow_dt, S_sum, pp_inc[level]);
#define Rho_comp
Definition: ERF_IndexDefines.H:36
auto no_substep_fun
Definition: ERF_TI_no_substep_fun.H:4
auto apply_bcs
Definition: ERF_TI_utils.H:50
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real WFromOmega(int i, int j, int k, amrex::Real omega, amrex::Real u, amrex::Real v, const amrex::Array4< const amrex::Real > &z_nd, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dxInv)
Definition: ERF_TerrainMetrics.H:407
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_zeta_AtIface(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:87
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_zeta_AtJface(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:130
@ NumTypes
Definition: ERF_IndexDefines.H:143
@ ymom
Definition: ERF_IndexDefines.H:141
@ cons
Definition: ERF_IndexDefines.H:139
@ zmom
Definition: ERF_IndexDefines.H:142
@ xmom
Definition: ERF_IndexDefines.H:140