655 int nlev =
static_cast<int>(vars_new.size());
656 int nplane =
static_cast<int>(
m_bnd_rbx.size());
658 bool interpolate =
true;
661 for (
int iplane(0); iplane<nplane; ++iplane) {
662 int dir =
m_dir[iplane];
663 amrex::RealBox bnd_rbx =
m_bnd_rbx[iplane];
667 for (
int ilev(nlev-1); ilev>=0; --ilev) {
670 amrex::MultiFab mf_cc_vel;
671 auto ba = vars_new[ilev][
Vars::cons].boxArray();
672 auto dm = vars_new[ilev][
Vars::cons].DistributionMap();
673 mf_cc_vel.define(ba, dm, AMREX_SPACEDIM, amrex::IntVect(1,1,1));
674 average_face_to_cellcenter(mf_cc_vel,0,
675 amrex::Array<const amrex::MultiFab*,3>{&vars_new[ilev][
Vars::xvel],
680 amrex::MultiFab mf_cc_data;
681 mf_cc_data.define(ba, dm, ncomp, 1);
683 #pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
685 for (amrex::MFIter mfi(mf_cc_data, amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi) {
686 const amrex::Box& tbx = mfi.tilebox();
687 auto const& dfab = mf_cc_data.array(mfi);
688 auto const& tfab = vars_new[ilev][
Vars::cons].array(mfi);
689 auto const& wfab = mf_cc_vel.array(mfi);
692 dfab(i,j,k,0) = tfab(i,j,k,1)/tfab(i,j,k,0);
693 dfab(i,j,k,1) = std::sqrt(wfab(i,j,k,0)*wfab(i,j,k,0)
694 + wfab(i,j,k,1)*wfab(i,j,k,1)
695 + wfab(i,j,k,2)*wfab(i,j,k,2)) ;
700 m_lev[iplane] = ilev;
701 m_ps_mf[iplane] = get_slice_data(dir, point, mf_cc_data, geom[ilev],
702 0, ncomp, interpolate, bnd_rbx);
705 auto min_bnd_bx =
m_ps_mf[iplane]->boxArray().minimalBox();
706 amrex::Box bnd_bx =
getIndexBox(bnd_rbx, geom[ilev]);
707 if (bnd_bx == min_bnd_bx) {
break; }
ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { const Real *dx=geomdata.CellSize();const Real x=(i+0.5) *dx[0];const Real y=(j+0.5) *dx[1];const Real Omg=erf_vortex_Gaussian(x, y, xc, yc, R, beta, sigma);const Real deltaT=-(gamma - 1.0)/(2.0 *sigma *sigma) *Omg *Omg;const Real rho_norm=std::pow(1.0+deltaT, inv_gm1);const Real T=(1.0+deltaT) *T_inf;const Real p=std::pow(rho_norm, Gamma)/Gamma *rho_0 *a_inf *a_inf;const Real rho_theta=rho_0 *rho_norm *(T *std::pow(p_0/p, rdOcp));state_pert(i, j, k, RhoTheta_comp)=rho_theta - getRhoThetagivenP(p_hse(i, j, k));const Real r2d_xy=std::sqrt((x-xc) *(x-xc)+(y-yc) *(y-yc));state_pert(i, j, k, RhoScalar_comp)=0.25 *(1.0+std::cos(PI *std::min(r2d_xy, R)/R));})
amrex::Real Real
Definition: ERF_ShocInterface.H:19
@ xvel
Definition: ERF_IndexDefines.H:159
@ cons
Definition: ERF_IndexDefines.H:158
@ zvel
Definition: ERF_IndexDefines.H:161
@ yvel
Definition: ERF_IndexDefines.H:160
amrex::Box getIndexBox(const amrex::RealBox &real_box, const amrex::Geometry &geom)
Definition: ERF_SampleData.H:636