Function for computing the slow RHS for the evolution equations for the density, potential temperature and momentum.
39 BL_PROFILE_REGION(
"erf_add_thin_body_sources()");
41 const bool l_have_thin_xforce = (thin_xforce_lev !=
nullptr);
42 const bool l_have_thin_yforce = (thin_yforce_lev !=
nullptr);
43 const bool l_have_thin_zforce = (thin_zforce_lev !=
nullptr);
48 if (l_have_thin_xforce) {
49 MultiFab::Copy(*thin_xforce_lev, xmom_src, 0, 0, 1, 0);
50 thin_xforce_lev->mult(-1., 0, 1, 0);
52 MultiFab::Add(xmom_src, *thin_xforce_lev, 0, 0, 1, 0);
55 if (l_have_thin_yforce) {
56 MultiFab::Copy(*thin_yforce_lev, ymom_src, 0, 0, 1, 0);
57 thin_yforce_lev->mult(-1., 0, 1, 0);
59 MultiFab::Add(ymom_src, *thin_yforce_lev, 0, 0, 1, 0);
62 if (l_have_thin_zforce) {
63 MultiFab::Copy(*thin_zforce_lev, zmom_src, 0, 0, 1, 0);
64 thin_zforce_lev->mult(-1., 0, 1, 0);
66 MultiFab::Add(zmom_src, *thin_zforce_lev, 0, 0, 1, 0);
71 if (l_have_thin_xforce) {
76 const Box& tbx = mfi.nodaltilebox(0);
77 const Array4<const Real> & fx = thin_xforce_lev->const_array(mfi);
78 const Array4<const int> & mask = xflux_imask_lev->const_array(mfi);
79 ParallelFor(tbx, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) {
81 amrex::AllPrint() <<
"thin body fx"<<IntVect(i,j,k)<<
" = " << fx(i,j,k) << std::endl;
92 if (l_have_thin_yforce) {
97 const Box& tby = mfi.nodaltilebox(1);
98 const Array4<const Real> & fy = thin_yforce_lev->const_array(mfi);
99 const Array4<const int> & mask = yflux_imask_lev->const_array(mfi);
100 ParallelFor(tby, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) {
101 if (mask(i,j,k)==0) {
102 amrex::AllPrint() <<
"thin body fy"<<IntVect(i,j,k)<<
" = " << fy(i,j,k) << std::endl;
112 #ifndef AMREX_USE_GPU
113 if (l_have_thin_zforce) {
118 const Box& tbz = mfi.nodaltilebox(2);
119 const Array4<const Real> & fz = thin_zforce_lev->const_array(mfi);
120 const Array4<const int> & mask = zflux_imask_lev->const_array(mfi);
121 ParallelFor(tbz, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) {
122 if (mask(i,j,k)==0) {
123 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:383
@ cons
Definition: ERF_IndexDefines.H:139