263 int nlev = vars_new.size();
266 bool interpolate =
true;
269 for (
int iplane(0); iplane<nplane; ++iplane) {
270 int dir =
m_dir[iplane];
271 amrex::RealBox bnd_rbx =
m_bnd_rbx[iplane];
272 amrex::Real point = bnd_rbx.lo(dir);
275 for (
int ilev(nlev-1); ilev>=0; --ilev) {
278 amrex::MultiFab mf_cc_vel;
279 auto ba = vars_new[ilev][
Vars::cons].boxArray();
280 auto dm = vars_new[ilev][
Vars::cons].DistributionMap();
281 mf_cc_vel.define(ba, dm, AMREX_SPACEDIM, amrex::IntVect(1,1,1));
282 average_face_to_cellcenter(mf_cc_vel,0,
283 amrex::Array<const amrex::MultiFab*,3>{&vars_new[ilev][
Vars::xvel],
288 amrex::MultiFab mf_cc_data;
289 mf_cc_data.define(ba, dm, ncomp, 1);
291 #pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
293 for (amrex::MFIter mfi(mf_cc_data, amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi) {
294 const amrex::Box& tbx = mfi.tilebox();
295 auto const& dfab = mf_cc_data.array(mfi);
296 auto const& tfab = vars_new[ilev][
Vars::cons].array(mfi);
297 auto const& wfab = mf_cc_vel.array(mfi);
298 amrex::ParallelFor(tbx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept
300 dfab(i,j,k,0) = tfab(i,j,k,1)/tfab(i,j,k,0);
301 dfab(i,j,k,1) = std::sqrt(wfab(i,j,k,0)*wfab(i,j,k,0)
302 + wfab(i,j,k,1)*wfab(i,j,k,1)
303 + wfab(i,j,k,2)*wfab(i,j,k,2)) ;
308 m_lev[iplane] = ilev;
309 m_ps_mf[iplane] = get_slice_data(dir, point, mf_cc_data, geom[ilev],
310 0, ncomp, interpolate, bnd_rbx);
313 auto min_bnd_bx =
m_ps_mf[iplane]->boxArray().minimalBox();
314 amrex::Box bnd_bx =
getIndexBox(bnd_rbx, geom[ilev]);
315 if (bnd_bx == min_bnd_bx) {
continue; }
@ xvel
Definition: ERF_IndexDefines.H:130
@ cons
Definition: ERF_IndexDefines.H:129
@ zvel
Definition: ERF_IndexDefines.H:132
@ yvel
Definition: ERF_IndexDefines.H:131
amrex::Box getIndexBox(const amrex::RealBox &real_box, const amrex::Geometry &geom)
Definition: ERF_SampleData.H:244