8 #ifndef HYDRO_PLM_GODUNOV_H
9 #define HYDRO_PLM_GODUNOV_H
40 #if (AMREX_SPACEDIM==3)
41 void PredictVelOnZFace (
amrex::Box const& zebox,
int ncomp,
54 const amrex::Real dt,
const amrex::Real dx,
55 amrex::Real& Im, amrex::Real& Ip,
57 const amrex::Real& umac,
59 const int domain_ilo,
const int domain_ihi,
60 const bool is_velocity )
62 using namespace amrex;
64 bool extdir_or_ho_ilo = (bc.
lo(0) == BCType::ext_dir) ||
65 (bc.
lo(0) == BCType::hoextrap);
66 bool extdir_or_ho_ihi = (bc.
hi(0) == BCType::ext_dir) ||
67 (bc.
hi(0) == BCType::hoextrap);
73 if (i == domain_ilo && (bc.
lo(0) == BCType::ext_dir))
77 if ( n==
XVEL && is_velocity )
83 upls = S(i ,j,k,n) + Real(0.5) * (-Real(1.0) - umac * dt/dx) *
88 else if (i == domain_ihi+1 && (bc.
hi(0) == BCType::ext_dir))
92 if ( n==
XVEL && is_velocity )
98 umns = S(i-1,j,k,n) + Real(0.5) * ( Real(1.0) - umac * dt/dx) *
107 upls = S(i ,j,k,n) + Real(0.5) * (-Real(1.0) - umac * dt/dx) *
109 umns = S(i-1,j,k,n) + Real(0.5) * ( Real(1.0) - umac * dt/dx) *
121 const amrex::Real dt,
const amrex::Real dy,
122 amrex::Real& Im, amrex::Real& Ip,
124 const amrex::Real& vmac,
126 const int domain_jlo,
const int domain_jhi,
127 const bool is_velocity )
129 using namespace amrex;
131 bool extdir_or_ho_jlo = (bc.
lo(1) == BCType::ext_dir) ||
132 (bc.
lo(1) == BCType::hoextrap);
133 bool extdir_or_ho_jhi = (bc.
hi(1) == BCType::ext_dir) ||
134 (bc.
hi(1) == BCType::hoextrap);
140 if (j == domain_jlo && (bc.
lo(1) == BCType::ext_dir))
143 if ( n==
YVEL && is_velocity )
149 vpls = S(i,j ,k,n) + Real(0.5) * (-Real(1.0) - vmac * dt/dy) *
153 else if (j == domain_jhi+1 && (bc.
hi(1) == BCType::ext_dir))
156 if ( n==
YVEL && is_velocity )
162 vmns = S(i,j-1,k,n) + Real(0.5) * ( Real(1.0) - vmac * dt/dy) *
171 vpls = S(i,j ,k,n) + Real(0.5) * (-Real(1.0) - vmac * dt/dy) *
173 vmns = S(i,j-1,k,n) + Real(0.5) * ( Real(1.0) - vmac * dt/dy) *
182 #if (AMREX_SPACEDIM==3)
185 void PredictStateOnZFace (
const int i,
const int j,
const int k,
const int n,
186 const amrex::Real dt,
const amrex::Real dz,
187 amrex::Real& Im, amrex::Real& Ip,
189 const amrex::Real& wmac,
191 const int domain_klo,
const int domain_khi,
192 const bool is_velocity )
194 using namespace amrex;
196 bool extdir_or_ho_klo = (bc.
lo(2) == BCType::ext_dir) ||
197 (bc.
lo(2) == BCType::hoextrap);
198 bool extdir_or_ho_khi = (bc.
hi(2) == BCType::ext_dir) ||
199 (bc.
hi(2) == BCType::hoextrap);
205 if (k == domain_klo && (bc.
lo(2) == BCType::ext_dir))
208 if ( n ==
ZVEL && is_velocity )
214 wpls = S(i,j,k ,n) + Real(0.5) * (-Real(1.0) - wmac * dt/dz) *
215 amrex_calc_zslope_extdir(i,j,k ,n,order,S, extdir_or_ho_klo, extdir_or_ho_khi, domain_klo, domain_khi);
218 else if (k == domain_khi+1 && (bc.
hi(2) == BCType::ext_dir))
221 if ( n ==
ZVEL && is_velocity )
227 wmns = S(i,j,k-1,n) + Real(0.5) * ( Real(1.0) - wmac * dt/dz) *
228 amrex_calc_zslope_extdir(i,j,k-1,n,order,S, extdir_or_ho_klo, extdir_or_ho_khi, domain_klo, domain_khi);
236 wpls = S(i,j,k ,n) + Real(0.5) * (-Real(1.0) - wmac * dt/dz) *
237 amrex_calc_zslope_extdir(i,j,k ,n,order,S, extdir_or_ho_klo, extdir_or_ho_khi, domain_klo, domain_khi);
238 wmns = S(i,j,k-1,n) + Real(0.5) * ( Real(1.0) - wmac * dt/dz) *
239 amrex_calc_zslope_extdir(i,j,k-1,n,order,S, extdir_or_ho_klo, extdir_or_ho_khi, domain_klo, domain_khi);
#define AMREX_FORCE_INLINE
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const int * hi() const &noexcept
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const int * lo() const &noexcept
#define YVEL
Definition: hydro_constants.H:29
#define XVEL
Definition: hydro_constants.H:28
#define ZVEL
Definition: hydro_constants.H:30
Definition: hydro_godunov_plm.H:20
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void PredictStateOnYFace(const int i, const int j, const int k, const int n, const amrex::Real dt, const amrex::Real dy, amrex::Real &Im, amrex::Real &Ip, const amrex::Array4< const amrex::Real > &S, const amrex::Real &vmac, const amrex::BCRec bc, const int domain_jlo, const int domain_jhi, const bool is_velocity)
Definition: hydro_godunov_plm.H:120
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void PredictStateOnXFace(const int i, const int j, const int k, const int n, const amrex::Real dt, const amrex::Real dx, amrex::Real &Im, amrex::Real &Ip, const amrex::Array4< const amrex::Real > &S, const amrex::Real &umac, const amrex::BCRec bc, const int domain_ilo, const int domain_ihi, const bool is_velocity)
Definition: hydro_godunov_plm.H:53
void PredictVelOnYFace(amrex::Box const &yebox, int ncomp, amrex::Array4< amrex::Real > const &Imy, amrex::Array4< amrex::Real > const &Ipy, amrex::Array4< amrex::Real const > const &q, amrex::Array4< amrex::Real const > const &vcc, const amrex::Geometry &geom, amrex::Real dt, amrex::Vector< amrex::BCRec > const &h_bcrec, amrex::BCRec const *pbc)
void PredictVelOnXFace(amrex::Box const &xebox, int ncomp, amrex::Array4< amrex::Real > const &Imx, amrex::Array4< amrex::Real > const &Ipx, amrex::Array4< amrex::Real const > const &q, amrex::Array4< amrex::Real const > const &vcc, const amrex::Geometry &geom, amrex::Real dt, amrex::Vector< amrex::BCRec > const &h_bcrec, amrex::BCRec const *pbc)
AMREX_GPU_DEVICE AMREX_FORCE_INLINE Real amrex_calc_yslope_extdir(int i, int j, int k, int n, int order, amrex::Array4< Real const > const &q, bool edlo, bool edhi, int domlo, int domhi) noexcept
AMREX_GPU_DEVICE AMREX_FORCE_INLINE Real amrex_calc_xslope_extdir(int i, int j, int k, int n, int order, amrex::Array4< Real const > const &q, bool edlo, bool edhi, int domlo, int domhi) noexcept