8#ifndef HYDRO_EBMOL_EDGE_STATE_K_H_
9#define HYDRO_EBMOL_EDGE_STATE_K_H_
11#include <AMReX_EB_Slopes_K.H>
30 int order,
const bool is_velocity,
bool allow_inflow_on_outflow)
noexcept
33#if (AMREX_SPACEDIM==2)
38 int domlo = domain.smallEnd(0);
39 int domhi = domain.bigEnd(0);
47 if ( extlo && i < domlo)
49 qs = q(domlo-1,j,k,n);
51 else if ( exthi && i > domhi+1)
53 qs = q(domhi+1,j,k,n);
57 const int domain_ilo = domain.smallEnd(0);
58 const int domain_ihi = domain.bigEnd(0);
59 const int domain_jlo = domain.smallEnd(1);
60 const int domain_jhi = domain.bigEnd(1);
61#if (AMREX_SPACEDIM == 3)
62 const int domain_klo = domain.smallEnd(2);
63 const int domain_khi = domain.bigEnd(2);
67#if (AMREX_SPACEDIM==3)
96 const auto& slopes_eb_hi =
97 amrex_lim_slopes_extdir_eb(i, j, k, n, q, ccc, vfrac,
99 AMREX_D_DECL(extdir_or_ho_ilo, extdir_or_ho_jlo, extdir_or_ho_klo),
100 AMREX_D_DECL(extdir_or_ho_ihi, extdir_or_ho_jhi, extdir_or_ho_khi),
106#if (AMREX_SPACEDIM==3)
107 amrex::Real qpls = q(i ,j,k,n) - delta_x * slopes_eb_hi[0]
108 + delta_y * slopes_eb_hi[1]
109 + delta_z * slopes_eb_hi[2];
111 amrex::Real qpls = q(i ,j,k,n) - delta_x * slopes_eb_hi[0]
112 + delta_y * slopes_eb_hi[1];
118 yc = ccc(i-1,j,k,1);,
119 zc = ccc(i-1,j,k,2););
126 const auto& slopes_eb_lo =
127 amrex_lim_slopes_extdir_eb(i-1, j, k, n, q, ccc, vfrac,
129 AMREX_D_DECL(extdir_or_ho_ilo, extdir_or_ho_jlo, extdir_or_ho_klo),
130 AMREX_D_DECL(extdir_or_ho_ihi, extdir_or_ho_jhi, extdir_or_ho_khi),
135#if (AMREX_SPACEDIM==3)
136 amrex::Real qmns = q(i-1,j,k,n) + delta_x * slopes_eb_lo[0]
137 + delta_y * slopes_eb_lo[1]
138 + delta_z * slopes_eb_lo[2];
140 amrex::Real qmns = q(i-1,j,k,n) + delta_x * slopes_eb_lo[0]
141 + delta_y * slopes_eb_lo[1];
146 HydroBC::SetEdgeBCsLo(0, i, j, k, n, q, qmns, qpls, umac(i,j,k), d_bcrec[n].lo(0), domain_ilo, is_velocity);
147 HydroBC::SetEdgeBCsHi(0, i, j, k, n, q, qmns, qpls, umac(i,j,k), d_bcrec[n].hi(0), domain_ihi, is_velocity);
152 if (!allow_inflow_on_outflow)
195 int order,
const bool is_velocity,
bool allow_inflow_on_outflow)
noexcept
197#if (AMREX_SPACEDIM==2)
201 const int domain_ilo = domain.smallEnd(0);
202 const int domain_ihi = domain.bigEnd(0);
206#if (AMREX_SPACEDIM==3)
222 const auto& slopes_eb_hi = amrex_lim_slopes_eb(i, j, k, n, q, ccc, vfrac,
226#if (AMREX_SPACEDIM==3)
227 amrex::Real qpls = q(i ,j,k,n) - delta_x * slopes_eb_hi[0]
228 + delta_y * slopes_eb_hi[1]
229 + delta_z * slopes_eb_hi[2];
231 amrex::Real qpls = q(i ,j,k,n) - delta_x * slopes_eb_hi[0]
232 + delta_y * slopes_eb_hi[1];
238 yc = ccc(i-1,j,k,1);,
239 zc = ccc(i-1,j,k,2););
246 const auto& slopes_eb_lo = amrex_lim_slopes_eb(i-1, j, k, n, q, ccc, vfrac,
250#if (AMREX_SPACEDIM==3)
251 amrex::Real qmns = q(i-1,j,k,n) + delta_x * slopes_eb_lo[0]
252 + delta_y * slopes_eb_lo[1]
253 + delta_z * slopes_eb_lo[2];
255 amrex::Real qmns = q(i-1,j,k,n) + delta_x * slopes_eb_lo[0]
256 + delta_y * slopes_eb_lo[1];
261 HydroBC::SetEdgeBCsLo(0, i, j, k, n, q, qmns, qpls, umac(i,j,k), d_bcrec[n].lo(0), domain_ilo, is_velocity);
262 HydroBC::SetEdgeBCsHi(0, i, j, k, n, q, qmns, qpls, umac(i,j,k), d_bcrec[n].hi(0), domain_ihi, is_velocity);
267 if (!allow_inflow_on_outflow)
311 int order,
const bool is_velocity,
bool allow_inflow_on_outflow)
noexcept
314#if (AMREX_SPACEDIM==2)
319 int domlo = domain.smallEnd(1);
320 int domhi = domain.bigEnd(1);
328 if ( extlo && j < domlo)
330 qs = q(i,domlo-1,k,n);
332 else if (exthi && j > domhi+1)
334 qs = q(i,domhi+1,k,n);
338 const int domain_ilo = domain.smallEnd(0);
339 const int domain_ihi = domain.bigEnd(0);
340 const int domain_jlo = domain.smallEnd(1);
341 const int domain_jhi = domain.bigEnd(1);
342#if (AMREX_SPACEDIM == 3)
343 const int domain_klo = domain.smallEnd(2);
344 const int domain_khi = domain.bigEnd(2);
362#if (AMREX_SPACEDIM==3)
378 const auto& slopes_eb_hi =
379 amrex_lim_slopes_extdir_eb(i, j, k, n, q, ccc, vfrac,
381 AMREX_D_DECL(extdir_or_ho_ilo, extdir_or_ho_jlo, extdir_or_ho_klo),
382 AMREX_D_DECL(extdir_or_ho_ihi, extdir_or_ho_jhi, extdir_or_ho_khi),
387#if (AMREX_SPACEDIM==3)
388 amrex::Real qpls = q(i ,j,k,n) + delta_x * slopes_eb_hi[0]
389 - delta_y * slopes_eb_hi[1]
390 + delta_z * slopes_eb_hi[2];
392 amrex::Real qpls = q(i ,j,k,n) + delta_x * slopes_eb_hi[0]
393 - delta_y * slopes_eb_hi[1];
399 yc = ccc(i,j-1,k,1);,
400 zc = ccc(i,j-1,k,2););
407 const auto& slopes_eb_lo =
408 amrex_lim_slopes_extdir_eb(i, j-1, k, n, q, ccc, vfrac,
410 AMREX_D_DECL(extdir_or_ho_ilo, extdir_or_ho_jlo, extdir_or_ho_klo),
411 AMREX_D_DECL(extdir_or_ho_ihi, extdir_or_ho_jhi, extdir_or_ho_khi),
417#if (AMREX_SPACEDIM==3)
418 amrex::Real qmns = q(i,j-1,k,n) + delta_x * slopes_eb_lo[0]
419 + delta_y * slopes_eb_lo[1]
420 + delta_z * slopes_eb_lo[2];
422 amrex::Real qmns = q(i,j-1,k,n) + delta_x * slopes_eb_lo[0]
423 + delta_y * slopes_eb_lo[1];
428 HydroBC::SetEdgeBCsLo(1, i, j, k, n, q, qmns, qpls, vmac(i,j,k), d_bcrec[n].lo(1), domain_jlo, is_velocity);
429 HydroBC::SetEdgeBCsHi(1, i, j, k, n, q, qmns, qpls, vmac(i,j,k), d_bcrec[n].hi(1), domain_jhi, is_velocity);
434 if (!allow_inflow_on_outflow)
479 int order,
const bool is_velocity,
bool allow_inflow_on_outflow)
noexcept
481#if (AMREX_SPACEDIM==2)
485 const int domain_jlo = domain.smallEnd(1);
486 const int domain_jhi = domain.bigEnd(1);
490#if (AMREX_SPACEDIM==3)
506 const auto& slopes_eb_hi = amrex_lim_slopes_eb(i, j, k, n, q, ccc, vfrac,
510#if (AMREX_SPACEDIM==3)
511 amrex::Real qpls = q(i ,j,k,n) + delta_x * slopes_eb_hi[0]
512 - delta_y * slopes_eb_hi[1]
513 + delta_z * slopes_eb_hi[2];
515 amrex::Real qpls = q(i ,j,k,n) + delta_x * slopes_eb_hi[0]
516 - delta_y * slopes_eb_hi[1];
522 yc = ccc(i,j-1,k,1);,
523 zc = ccc(i,j-1,k,2););
530 const auto& slopes_eb_lo = amrex_lim_slopes_eb(i, j-1, k, n, q, ccc, vfrac,
534#if (AMREX_SPACEDIM==3)
535 amrex::Real qmns = q(i,j-1,k,n) + delta_x * slopes_eb_lo[0]
536 + delta_y * slopes_eb_lo[1]
537 + delta_z * slopes_eb_lo[2];
539 amrex::Real qmns = q(i,j-1,k,n) + delta_x * slopes_eb_lo[0]
540 + delta_y * slopes_eb_lo[1];
545 HydroBC::SetEdgeBCsLo(1, i, j, k, n, q, qmns, qpls, vmac(i,j,k), d_bcrec[n].lo(1), domain_jlo, is_velocity);
546 HydroBC::SetEdgeBCsHi(1, i, j, k, n, q, qmns, qpls, vmac(i,j,k), d_bcrec[n].hi(1), domain_jhi, is_velocity);
551 if (!allow_inflow_on_outflow)
583#if (AMREX_SPACEDIM==3)
586amrex::Real hydro_ebmol_zedge_state_extdir (
int i,
int j,
int k,
int n,
597 int order,
const bool is_velocity,
bool allow_inflow_on_outflow)
noexcept
600 int domlo = domain.smallEnd(2);
601 int domhi = domain.bigEnd(2);
609 if ( extlo && k < domlo)
611 qs = q(i,j,domlo-1,n);
613 else if ( exthi && k > domhi+1)
615 qs = q(i,j,domhi+1,n);
619 const int domain_ilo = domain.smallEnd(0);
620 const int domain_ihi = domain.bigEnd(0);
621 const int domain_jlo = domain.smallEnd(1);
622 const int domain_jhi = domain.bigEnd(1);
623#if (AMREX_SPACEDIM == 3)
624 const int domain_klo = domain.smallEnd(2);
625 const int domain_khi = domain.bigEnd(2);
657 const auto& slopes_eb_hi =
658 amrex_lim_slopes_extdir_eb(i, j, k, n, q, ccc, vfrac,
660 AMREX_D_DECL(extdir_or_ho_ilo, extdir_or_ho_jlo, extdir_or_ho_klo),
661 AMREX_D_DECL(extdir_or_ho_ihi, extdir_or_ho_jhi, extdir_or_ho_khi),
666 amrex::Real qpls = q(i,j,k ,n) + delta_x * slopes_eb_hi[0]
667 + delta_y * slopes_eb_hi[1]
668 - delta_z * slopes_eb_hi[2];
681 const auto& slopes_eb_lo =
682 amrex_lim_slopes_extdir_eb(i, j, k-1, n, q, ccc, vfrac,
684 AMREX_D_DECL(extdir_or_ho_ilo, extdir_or_ho_jlo, extdir_or_ho_klo),
685 AMREX_D_DECL(extdir_or_ho_ihi, extdir_or_ho_jhi, extdir_or_ho_khi),
690 amrex::Real qmns = q(i,j,k-1,n) + delta_x * slopes_eb_lo[0]
691 + delta_y * slopes_eb_lo[1]
692 + delta_z * slopes_eb_lo[2];
696 HydroBC::SetEdgeBCsLo(2, i, j, k, n, q, qmns, qpls, wmac(i,j,k), d_bcrec[n].lo(2), domain_klo, is_velocity);
697 HydroBC::SetEdgeBCsHi(2, i, j, k, n, q, qmns, qpls, wmac(i,j,k), d_bcrec[n].hi(2), domain_khi, is_velocity);
702 if (!allow_inflow_on_outflow)
737amrex::Real hydro_ebmol_zedge_state (
int i,
int j,
int k,
int n,
748 int order,
const bool is_velocity,
bool allow_inflow_on_outflow)
noexcept
750 const int domain_klo = domain.smallEnd(2);
751 const int domain_khi = domain.bigEnd(2);
768 const auto& slopes_eb_hi = amrex_lim_slopes_eb(i, j, k, n, q, ccc, vfrac,
772 amrex::Real qpls = q(i,j,k ,n) + delta_x * slopes_eb_hi[0]
773 + delta_y * slopes_eb_hi[1]
774 - delta_z * slopes_eb_hi[2];
787 const auto& slopes_eb_lo = amrex_lim_slopes_eb(i, j, k-1, n, q, ccc, vfrac,
791 amrex::Real qmns = q(i,j,k-1,n) + delta_x * slopes_eb_lo[0]
792 + delta_y * slopes_eb_lo[1]
793 + delta_z * slopes_eb_lo[2];
797 HydroBC::SetEdgeBCsLo(2, i, j, k, n, q, qmns, qpls, wmac(i,j,k), d_bcrec[n].lo(2), domain_klo, is_velocity);
798 HydroBC::SetEdgeBCsHi(2, i, j, k, n, q, qmns, qpls, wmac(i,j,k), d_bcrec[n].hi(2), domain_khi, is_velocity);
803 if (!allow_inflow_on_outflow)
#define AMREX_FORCE_INLINE
#define AMREX_D_TERM(a, b, c)
#define AMREX_D_DECL(a, b, c)
#define YVEL
Definition hydro_constants.H:29
static constexpr amrex::Real small_vel
Definition hydro_constants.H:37
#define XVEL
Definition hydro_constants.H:28
#define ZVEL
Definition hydro_constants.H:30
__host__ __device__ constexpr const T & min(const T &a, const T &b) noexcept
__host__ __device__ constexpr const T & max(const T &a, const T &b) noexcept
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real hydro_ebmol_yedge_state(AMREX_D_DECL(int i, int j, int k), int n, amrex::Array4< amrex::Real const > const &q, amrex::Array4< amrex::Real const > const &vmac, AMREX_D_DECL(amrex::Array4< amrex::Real const > const &fcx, amrex::Array4< amrex::Real const > const &fcy, amrex::Array4< amrex::Real const > const &fcz), amrex::Array4< amrex::Real const > const &ccc, amrex::Array4< amrex::Real const > const &vfrac, amrex::Array4< amrex::EBCellFlag const > const &flag, amrex::BCRec const *const d_bcrec, amrex::Box const &domain, int order, const bool is_velocity, bool allow_inflow_on_outflow) noexcept
Definition hydro_ebmol_edge_state_K.H:468
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real hydro_ebmol_xedge_state_extdir(AMREX_D_DECL(int i, int j, int k), int n, amrex::Array4< amrex::Real const > const &q, amrex::Array4< amrex::Real const > const &umac, AMREX_D_DECL(amrex::Array4< amrex::Real const > const &fcx, amrex::Array4< amrex::Real const > const &fcy, amrex::Array4< amrex::Real const > const &fcz), amrex::Array4< amrex::Real const > const &ccc, amrex::Array4< amrex::Real const > const &vfrac, amrex::Array4< amrex::EBCellFlag const > const &flag, amrex::BCRec const *const d_bcrec, amrex::Box const &domain, int order, const bool is_velocity, bool allow_inflow_on_outflow) noexcept
Definition hydro_ebmol_edge_state_K.H:19
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real hydro_ebmol_xedge_state(AMREX_D_DECL(int i, int j, int k), int n, amrex::Array4< amrex::Real const > const &q, amrex::Array4< amrex::Real const > const &umac, AMREX_D_DECL(amrex::Array4< amrex::Real const > const &fcx, amrex::Array4< amrex::Real const > const &fcy, amrex::Array4< amrex::Real const > const &fcz), amrex::Array4< amrex::Real const > const &ccc, amrex::Array4< amrex::Real const > const &vfrac, amrex::Array4< amrex::EBCellFlag const > const &flag, amrex::BCRec const *const d_bcrec, amrex::Box const &domain, int order, const bool is_velocity, bool allow_inflow_on_outflow) noexcept
Definition hydro_ebmol_edge_state_K.H:184
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real hydro_ebmol_yedge_state_extdir(AMREX_D_DECL(int i, int j, int k), int n, amrex::Array4< amrex::Real const > const &q, amrex::Array4< amrex::Real const > const &vmac, AMREX_D_DECL(amrex::Array4< amrex::Real const > const &fcx, amrex::Array4< amrex::Real const > const &fcy, amrex::Array4< amrex::Real const > const &fcz), amrex::Array4< amrex::Real const > const &ccc, amrex::Array4< amrex::Real const > const &vfrac, amrex::Array4< amrex::EBCellFlag const > const &flag, amrex::BCRec const *const d_bcrec, amrex::Box const &domain, int order, const bool is_velocity, bool allow_inflow_on_outflow) noexcept
Definition hydro_ebmol_edge_state_K.H:300
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void SetEdgeBCsHi(int edge_dir, int i, int j, int k, int n, const amrex::Array4< const amrex::Real > &s, amrex::Real &lo, amrex::Real &hi, amrex::Real macvel, int bchi, int domhi, bool is_velocity)
Boundary condition effects.
Definition hydro_bcs_K.H:272
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void SetEdgeBCsLo(int edge_dir, int i, int j, int k, int n, const amrex::Array4< const amrex::Real > &s, amrex::Real &lo, amrex::Real &hi, amrex::Real macvel, int bclo, int domlo, bool is_velocity)
Boundary condition effects.
Definition hydro_bcs_K.H:204