571 int nlev =
static_cast<int>(vars_new.size());
572 int nplane =
static_cast<int>(
m_bnd_rbx.size());
574 bool interpolate =
true;
577 for (
int iplane(0); iplane<nplane; ++iplane) {
578 int dir =
m_dir[iplane];
579 amrex::RealBox bnd_rbx =
m_bnd_rbx[iplane];
583 for (
int ilev(nlev-1); ilev>=0; --ilev) {
586 amrex::MultiFab mf_cc_vel;
587 auto ba = vars_new[ilev][
Vars::cons].boxArray();
588 auto dm = vars_new[ilev][
Vars::cons].DistributionMap();
589 mf_cc_vel.define(ba, dm, AMREX_SPACEDIM, amrex::IntVect(1,1,1));
590 average_face_to_cellcenter(mf_cc_vel,0,
591 amrex::Array<const amrex::MultiFab*,3>{&vars_new[ilev][
Vars::xvel],
596 amrex::MultiFab mf_cc_data;
597 mf_cc_data.define(ba, dm, ncomp, 1);
599 #pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
601 for (amrex::MFIter mfi(mf_cc_data, amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi) {
602 const amrex::Box& tbx = mfi.tilebox();
603 auto const& dfab = mf_cc_data.array(mfi);
604 auto const& tfab = vars_new[ilev][
Vars::cons].array(mfi);
605 auto const& wfab = mf_cc_vel.array(mfi);
608 dfab(i,j,k,0) = tfab(i,j,k,1)/tfab(i,j,k,0);
609 dfab(i,j,k,1) = std::sqrt(wfab(i,j,k,0)*wfab(i,j,k,0)
610 + wfab(i,j,k,1)*wfab(i,j,k,1)
611 + wfab(i,j,k,2)*wfab(i,j,k,2)) ;
616 m_lev[iplane] = ilev;
617 m_ps_mf[iplane] = get_slice_data(dir, point, mf_cc_data, geom[ilev],
618 0, ncomp, interpolate, bnd_rbx);
621 auto min_bnd_bx =
m_ps_mf[iplane]->boxArray().minimalBox();
622 amrex::Box bnd_bx =
getIndexBox(bnd_rbx, geom[ilev]);
623 if (bnd_bx == min_bnd_bx) {
break; }
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+0.5) *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<=1.0) { Real dT=T_pert *(std::cos(PI *L)+1.0)/2.0;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
@ xvel
Definition: ERF_IndexDefines.H:141
@ cons
Definition: ERF_IndexDefines.H:140
@ zvel
Definition: ERF_IndexDefines.H:143
@ yvel
Definition: ERF_IndexDefines.H:142
amrex::Box getIndexBox(const amrex::RealBox &real_box, const amrex::Geometry &geom)
Definition: ERF_SampleData.H:552