Function for computing the slow RHS for the evolution equations for the density, potential temperature and momentum.
37 BL_PROFILE_REGION(
"erf_add_thin_body_sources()");
39 const bool l_have_thin_xforce = (thin_xforce_lev !=
nullptr);
40 const bool l_have_thin_yforce = (thin_yforce_lev !=
nullptr);
41 const bool l_have_thin_zforce = (thin_zforce_lev !=
nullptr);
46 if (l_have_thin_xforce) {
47 MultiFab::Copy(*thin_xforce_lev, xmom_src, 0, 0, 1, 0);
48 thin_xforce_lev->mult(-1., 0, 1, 0);
50 MultiFab::Add(xmom_src, *thin_xforce_lev, 0, 0, 1, 0);
53 if (l_have_thin_yforce) {
54 MultiFab::Copy(*thin_yforce_lev, ymom_src, 0, 0, 1, 0);
55 thin_yforce_lev->mult(-1., 0, 1, 0);
57 MultiFab::Add(ymom_src, *thin_yforce_lev, 0, 0, 1, 0);
60 if (l_have_thin_zforce) {
61 MultiFab::Copy(*thin_zforce_lev, zmom_src, 0, 0, 1, 0);
62 thin_zforce_lev->mult(-1., 0, 1, 0);
64 MultiFab::Add(zmom_src, *thin_zforce_lev, 0, 0, 1, 0);
69 if (l_have_thin_xforce) {
74 const Box& tbx = mfi.nodaltilebox(0);
75 const Array4<const Real> & fx = thin_xforce_lev->const_array(mfi);
76 const Array4<const int> & mask = xflux_imask_lev->const_array(mfi);
77 ParallelFor(tbx, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) {
79 amrex::AllPrint() <<
"thin body fx"<<IntVect(i,j,k)<<
" = " << fx(i,j,k) << std::endl;
90 if (l_have_thin_yforce) {
95 const Box& tby = mfi.nodaltilebox(1);
96 const Array4<const Real> & fy = thin_yforce_lev->const_array(mfi);
97 const Array4<const int> & mask = yflux_imask_lev->const_array(mfi);
98 ParallelFor(tby, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) {
100 amrex::AllPrint() <<
"thin body fy"<<IntVect(i,j,k)<<
" = " << fy(i,j,k) << std::endl;
110 #ifndef AMREX_USE_GPU
111 if (l_have_thin_zforce) {
116 const Box& tbz = mfi.nodaltilebox(2);
117 const Array4<const Real> & fz = thin_zforce_lev->const_array(mfi);
118 const Array4<const int> & mask = zflux_imask_lev->const_array(mfi);
119 ParallelFor(tbz, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) {
120 if (mask(i,j,k)==0) {
121 amrex::AllPrint() <<
"thin body fz"<<IntVect(i,j,k)<<
" = " << fz(i,j,k) << std::endl;
AMREX_FORCE_INLINE amrex::IntVect TileNoZ()
Definition: ERF_TileNoZ.H:11
AMREX_GPU_HOST AMREX_FORCE_INLINE void ApplyInvertedMask(amrex::MultiFab &dst, const amrex::iMultiFab &imask, const int nghost=0)
Definition: ERF_Utils.H:409
@ cons
Definition: ERF_IndexDefines.H:158