4 for (MFIter mfi(state, TilingIfNotGPU()); mfi.isValid(); ++mfi) {
5 const auto &box = mfi.tilebox();
6 auto state_arr = state.const_array(mfi);
7 ParallelFor(box, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept {
13 Gpu::copy(Gpu::deviceToHost,
rho_d.begin(),
rho_d.end(),
rho_h.begin());
19 for (
int k = 1; k <=
khi; k++) {
24 for (
int k = 0; k <=
khi+1; k++) {
33 amrex::Gpu::copy(amrex::Gpu::hostToDevice,
wbar.begin(),
wbar.end(), d_wbar.begin());
constexpr amrex::Real zero
Definition: ERF_Constants.H:6
constexpr amrex::Real myhalf
Definition: ERF_Constants.H:11
constexpr amrex::Real PI
Definition: ERF_Constants.H:16
@ wbar
Definition: ERF_DataStruct.H:98
#define Rho_comp
Definition: ERF_IndexDefines.H:36
const int khi
Definition: ERF_InitCustomPert_Bubble.H:21
ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { const auto prob_lo=geomdata.ProbLo();const auto dx=geomdata.CellSize();const Real x=(prob_lo[0]+(i+myhalf) *dx[0])/mf_m(i, j, 0);const Real z=z_cc(i, j, k);Real L=std::sqrt(std::pow((x - x_c)/x_r, 2)+std::pow((z - z_c)/z_r, 2));if(L<=one) { Real dT=T_pert *(std::cos(PI *L)+one)/two;Real Tbar_hse=p_hse(i, j, k)/(R_d *r_hse(i, j, k));Real theta_perturbed=(Tbar_hse+dT) *std::pow(p_0/p_hse(i, j, k), rdOcp);Real theta_0=(Tbar_hse) *std::pow(p_0/p_hse(i, j, k), rdOcp);if(const_rho) { state_pert(i, j, k, RhoTheta_comp)=r_hse(i, j, k) *(theta_perturbed - theta_0);} else { state_pert(i, j, k, Rho_comp)=getRhoThetagivenP(p_hse(i, j, k))/theta_perturbed - r_hse(i, j, k);} } })
amrex::Real Real
Definition: ERF_ShocInterface.H:19
auto rho_arr
Definition: ERF_UpdateWSubsidence_SineMassFlux.H:3
Vector< Real > rho_h(khi+1, zero)
rho_stag[0]
Definition: ERF_UpdateWSubsidence_SineMassFlux.H:17
Gpu::DeviceVector< Real > rho_d(khi+1, zero)