8 #ifndef HYDRO_PLM_GODUNOV_H
9 #define HYDRO_PLM_GODUNOV_H
42 #if (AMREX_SPACEDIM==3)
43 void PredictVelOnZFace (
amrex::Box const& zebox,
int ncomp,
57 const amrex::Real dt,
const amrex::Real dx,
58 amrex::Real& Im, amrex::Real& Ip,
60 const amrex::Real& umac,
62 const int domain_ilo,
const int domain_ihi,
63 const bool is_velocity )
65 using namespace amrex;
67 bool extdir_or_ho_ilo = (bc.
lo(0) == BCType::ext_dir) ||
68 (bc.
lo(0) == BCType::hoextrap);
69 bool extdir_or_ho_ihi = (bc.
hi(0) == BCType::ext_dir) ||
70 (bc.
hi(0) == BCType::hoextrap);
76 if (i == domain_ilo && ((bc.
lo(0) == BCType::ext_dir) ||
77 (bc.
lo(0) == BCType::direction_dependent && umac >= 0.0)) )
81 if ( n==
XVEL && is_velocity )
87 upls = S(i ,j,k,n) + Real(0.5) * (-Real(1.0) - umac * dt/dx) *
92 else if (i == domain_ihi+1 && ((bc.
hi(0) == BCType::ext_dir) ||
93 (bc.
hi(0) == BCType::direction_dependent && umac <= 0.0)) )
97 if ( n==
XVEL && is_velocity )
103 umns = S(i-1,j,k,n) + Real(0.5) * ( Real(1.0) - umac * dt/dx) *
112 upls = S(i ,j,k,n) + Real(0.5) * (-Real(1.0) - umac * dt/dx) *
114 umns = S(i-1,j,k,n) + Real(0.5) * ( Real(1.0) - umac * dt/dx) *
126 const amrex::Real dt,
const amrex::Real dy,
127 amrex::Real& Im, amrex::Real& Ip,
129 const amrex::Real& vmac,
131 const int domain_jlo,
const int domain_jhi,
132 const bool is_velocity )
134 using namespace amrex;
136 bool extdir_or_ho_jlo = (bc.
lo(1) == BCType::ext_dir) ||
137 (bc.
lo(1) == BCType::hoextrap);
138 bool extdir_or_ho_jhi = (bc.
hi(1) == BCType::ext_dir) ||
139 (bc.
hi(1) == BCType::hoextrap);
145 if (j == domain_jlo && ((bc.
lo(1) == BCType::ext_dir) ||
146 (bc.
lo(1) == BCType::direction_dependent && vmac >= 0.0)) )
149 if ( n==
YVEL && is_velocity )
155 vpls = S(i,j ,k,n) + Real(0.5) * (-Real(1.0) - vmac * dt/dy) *
159 else if (j == domain_jhi+1 && ((bc.
hi(1) == BCType::ext_dir) ||
160 (bc.
hi(1) == BCType::direction_dependent && vmac <= 0.0)) )
163 if ( n==
YVEL && is_velocity )
169 vmns = S(i,j-1,k,n) + Real(0.5) * ( Real(1.0) - vmac * dt/dy) *
178 vpls = S(i,j ,k,n) + Real(0.5) * (-Real(1.0) - vmac * dt/dy) *
180 vmns = S(i,j-1,k,n) + Real(0.5) * ( Real(1.0) - vmac * dt/dy) *
189 #if (AMREX_SPACEDIM==3)
192 void PredictStateOnZFace (
const int i,
const int j,
const int k,
const int n,
193 const amrex::Real dt,
const amrex::Real dz,
194 amrex::Real& Im, amrex::Real& Ip,
196 const amrex::Real& wmac,
198 const int domain_klo,
const int domain_khi,
199 const bool is_velocity )
201 using namespace amrex;
203 bool extdir_or_ho_klo = (bc.
lo(2) == BCType::ext_dir) ||
204 (bc.
lo(2) == BCType::hoextrap);
205 bool extdir_or_ho_khi = (bc.
hi(2) == BCType::ext_dir) ||
206 (bc.
hi(2) == BCType::hoextrap);
212 if (k == domain_klo && ((bc.
lo(2) == BCType::ext_dir) ||
213 (bc.
lo(2) == BCType::direction_dependent && wmac >= 0.0)) )
216 if ( n ==
ZVEL && is_velocity )
222 wpls = S(i,j,k ,n) + Real(0.5) * (-Real(1.0) - wmac * dt/dz) *
223 amrex_calc_zslope_extdir(i,j,k ,n,order,S, extdir_or_ho_klo, extdir_or_ho_khi, domain_klo, domain_khi);
226 else if (k == domain_khi+1 && ((bc.
hi(2) == BCType::ext_dir) ||
227 (bc.
hi(2) == BCType::direction_dependent && wmac <= 0.0)) )
230 if ( n ==
ZVEL && is_velocity )
236 wmns = S(i,j,k-1,n) + Real(0.5) * ( Real(1.0) - wmac * dt/dz) *
237 amrex_calc_zslope_extdir(i,j,k-1,n,order,S, extdir_or_ho_klo, extdir_or_ho_khi, domain_klo, domain_khi);
245 wpls = S(i,j,k ,n) + Real(0.5) * (-Real(1.0) - wmac * dt/dz) *
246 amrex_calc_zslope_extdir(i,j,k ,n,order,S, extdir_or_ho_klo, extdir_or_ho_khi, domain_klo, domain_khi);
247 wmns = S(i,j,k-1,n) + Real(0.5) * ( Real(1.0) - wmac * dt/dz) *
248 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:125
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:56
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, amrex::Array4< int const > const &bc_arr={})
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::Array4< int const > const &bc_arr={})
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