345 const std::string chkname1 =
m_filename + Concatenate(
"/bndry_output", t_step);
347 const std::string level_prefix =
"Level_";
350 const Box& domain =
m_geom.Domain();
352 DistributionMapping dm{ba};
354 GpuArray<GpuArray<Real, AMREX_SPACEDIM*2>, AMREX_SPACEDIM+
NBCVAR_max> l_bc_extdir_vals_d;
358 for (OrientationIter oit; oit !=
nullptr; ++oit) {
360 l_bc_extdir_vals_d[i][ori] = m_bc_extdir_vals[i][ori];
364 int n_for_density = -1;
367 if (
m_var_names[i] ==
"density") n_for_density = i;
373 for (OrientationIter oit; oit !=
nullptr; ++oit) {
375 if (ori.coordDir() < 2) {
376 FArrayBox& d = (*data_to_fill[ori])[lev];
377 const auto& bx = d.box();
378 Array4<Real> d_arr = d.array();
380 bx, ncomp_for_bc, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k,
int n) noexcept {
387 std::string filenamer = MultiFabFileFullPrefix(lev, chkname1, level_prefix,
"density");
389 bndry_r.setVal(1.0e13);
390 for (OrientationIter oit; oit !=
nullptr; ++oit) {
392 if (ori.coordDir() < 2) {
393 std::string facenamer = Concatenate(filenamer +
'_', ori, 1);
394 bndry_r[ori].read(facenamer);
398 for (
int ivar = 0; ivar <
m_var_names.size(); ivar++)
402 std::string filename1 = MultiFabFileFullPrefix(lev, chkname1, level_prefix, var_name);
405 if (var_name ==
"velocity") {
406 ncomp = AMREX_SPACEDIM;
424 bndry.setVal(1.0e13);
429 for (OrientationIter oit; oit !=
nullptr; ++oit) {
431 if (ori.coordDir() < 2) {
433 std::string facename1 = Concatenate(filename1 +
'_', ori, 1);
434 bndry[ori].read(facename1);
436 const int normal = ori.coordDir();
437 const IntVect v_offset =
offset(ori.faceDir(), normal);
439 const auto& bbx = (*data_to_fill[ori])[lev].box();
446 bndry[ori].boxArray(), bndry[ori].DistributionMap(),
449 for (MFIter mfi(bndryMF); mfi.isValid(); ++mfi) {
451 const auto& vbx = mfi.validbox();
452 const auto& bndry_read_arr = bndry[ori].array(mfi);
453 const auto& bndry_read_r_arr = bndry_r[ori].array(mfi);
454 const auto& bndry_mf_arr = bndryMF.array(mfi);
456 const auto& bx = bbx & vbx;
467 if (n_for_density >= 0) {
468 if (var_name ==
"temperature") {
470 bx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept {
471 Real R1 = bndry_read_r_arr(i, j, k, 0);
472 Real R2 = bndry_read_r_arr(i+v_offset[0],j+v_offset[1],k+v_offset[2],0);
473 Real T1 = bndry_read_arr(i, j, k, 0);
474 Real T2 = bndry_read_arr(i+v_offset[0],j+v_offset[1],k+v_offset[2],0);
477 bndry_mf_arr(i, j, k, 0) = 0.5 * (R1*Th1 + R2*Th2);
479 }
else if (var_name ==
"scalar" || var_name ==
"qv" || var_name ==
"qc" ||
482 bx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept {
483 Real R1 = bndry_read_r_arr(i, j, k, 0);
484 Real R2 = bndry_read_r_arr(i+v_offset[0],j+v_offset[1],k+v_offset[2],0);
485 bndry_mf_arr(i, j, k, 0) = 0.5 *
486 ( R1 * bndry_read_arr(i, j, k, 0) +
487 R2 * bndry_read_arr(i+v_offset[0],j+v_offset[1],k+v_offset[2], 0));
489 }
else if (var_name ==
"density") {
491 bx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept {
492 bndry_mf_arr(i, j, k, 0) = 0.5 *
493 ( bndry_read_arr(i, j, k, 0) +
494 bndry_read_arr(i+v_offset[0],j+v_offset[1],k+v_offset[2], 0));
498 if (var_name ==
"temperature") {
500 bx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept {
503 Real T1 = bndry_read_arr(i, j, k, 0);
504 Real T2 = bndry_read_arr(i+v_offset[0],j+v_offset[1],k+v_offset[2], 0);
507 bndry_mf_arr(i, j, k, 0) = 0.5 * (R1*Th1 + R2*Th2);
509 }
else if (var_name ==
"scalar" || var_name ==
"qv" || var_name ==
"qc" ||
512 bx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept {
515 bndry_mf_arr(i, j, k, 0) = 0.5 *
516 (R1 * bndry_read_arr(i, j, k, 0) +
517 R2 * bndry_read_arr(i+v_offset[0],j+v_offset[1],k+v_offset[2], 0));
523 if (var_name ==
"velocity") {
525 bx, ncomp, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k,
int n) noexcept {
526 bndry_mf_arr(i, j, k, n) = 0.5 *
527 (bndry_read_arr(i, j, k, n) +
528 bndry_read_arr(i+v_offset[0],j+v_offset[1],k+v_offset[2], n));
533 bndryMF.copyTo((*data_to_fill[ori])[lev], 0, n_offset, ncomp);
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getThgivenRandT(const amrex::Real rho, const amrex::Real T, const amrex::Real rdOcp, const amrex::Real qv=0.0)
Definition: ERF_EOS.H:67
#define NBCVAR_max
Definition: ERF_IndexDefines.H:29
AMREX_FORCE_INLINE IntVect offset(const int face_dir, const int normal)
Definition: ERF_ReadBndryPlanes.cpp:28
amrex::Vector< int > m_in_timesteps
Definition: ERF_ReadBndryPlanes.H:82
const int m_in_rad
controls extents on native bndry output
Definition: ERF_ReadBndryPlanes.H:88
int ingested_density() const
Definition: ERF_ReadBndryPlanes.H:43
const int m_out_rad
Definition: ERF_ReadBndryPlanes.H:89
const int m_extent_rad
Definition: ERF_ReadBndryPlanes.H:90
@ RhoScalar_bc_comp
Definition: ERF_IndexDefines.H:80
@ RhoQ1_bc_comp
Definition: ERF_IndexDefines.H:81
@ RhoKE_bc_comp
Definition: ERF_IndexDefines.H:79
@ RhoTheta_bc_comp
Definition: ERF_IndexDefines.H:78
@ RhoQ2_bc_comp
Definition: ERF_IndexDefines.H:82
@ Rho_bc_comp
Definition: ERF_IndexDefines.H:77
@ xvel_bc
Definition: ERF_IndexDefines.H:88