8 #ifndef WARPX_PushFieldsEM_K_h
9 #define WARPX_PushFieldsEM_K_h
32 const int tb_smallEnd,
35 using namespace amrex;
45 const int n_guard = -tb_smallEnd;
46 const int upper_bound = (tb_smallEnd < 0 ? -n_guard/2 : tb_smallEnd);
52 const int n_guard = tb_bigEnd - n_domain;
53 const int lower_bound = (tb_bigEnd > n_domain ? n_domain + n_guard/2 : tb_bigEnd);
57 return constrained_tb;
82 const int tb_smallEnd,
85 using namespace amrex;
90 const int idx = ((dir == 0) ?
i : ((dir == 1) ? j : k));
95 const int n_guard = -tb_smallEnd;
97 const auto cell =
static_cast<amrex::Real
>(idx + n_guard);
99 const amrex::Real phase = MathConst::pi * cell / n_guard;
100 const amrex::Real sin_phase = std::sin(phase);
101 const amrex::Real damp_factor = sin_phase * sin_phase;
103 mf_arr(
i,j,k,icomp) *= damp_factor;
105 else if (idx > n_domain)
108 const int n_guard = tb_bigEnd - n_domain;
110 const auto cell =
static_cast<amrex::Real
>(tb_bigEnd - idx);
112 const amrex::Real phase = MathConst::pi * cell / n_guard;
113 const amrex::Real sin_phase = std::sin(phase);
114 const amrex::Real damp_factor = sin_phase * sin_phase;
116 mf_arr(
i,j,k,icomp) *= damp_factor;
#define AMREX_GPU_HOST_DEVICE
AMREX_GPU_HOST_DEVICE AMREX_INLINE void damp_field_in_guards(amrex::Array4< amrex::Real > const &mf_arr, const int i, const int j, const int k, const int icomp, const int dir, const int n_domain, const int tb_smallEnd, const int tb_bigEnd)
Definition: WarpXPushFieldsEM_K.H:74
AMREX_GPU_HOST_DEVICE AMREX_INLINE amrex::Box constrain_tilebox_to_guards(const amrex::Box &input_tb, const int dir, const int iside, const int n_domain, const int tb_smallEnd, const int tb_bigEnd)
Definition: WarpXPushFieldsEM_K.H:27
AMREX_GPU_HOST_DEVICE Box & setSmall(const IntVect &sm) noexcept
AMREX_GPU_HOST_DEVICE Box & setBig(const IntVect &bg) noexcept
AMREX_GPU_HOST_DEVICE ItType upper_bound(ItType first, ItType last, const ValType &val)
AMREX_GPU_HOST_DEVICE ItType lower_bound(ItType first, ItType last, const ValType &val)
i
Definition: check_interp_points_and_weights.py:174