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) *
88 amrex_calc_xslope_extdir(i ,j,k,n,order,S, extdir_or_ho_ilo, extdir_or_ho_ihi, domain_ilo, domain_ihi);
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) *
104 amrex_calc_xslope_extdir(i-1,j,k,n,order,S, extdir_or_ho_ilo, extdir_or_ho_ihi, domain_ilo, domain_ihi);
112 upls = S(i ,j,k,n) + Real(0.5) * (-Real(1.0) - umac * dt/dx) *
113 amrex_calc_xslope_extdir(i ,j,k,n,order,S, extdir_or_ho_ilo, extdir_or_ho_ihi, domain_ilo, domain_ihi);
114 umns = S(i-1,j,k,n) + Real(0.5) * ( Real(1.0) - umac * dt/dx) *
115 amrex_calc_xslope_extdir(i-1,j,k,n,order,S, extdir_or_ho_ilo, extdir_or_ho_ihi, domain_ilo, domain_ihi);
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) *
156 amrex_calc_yslope_extdir(i,j ,k,n,order,S, extdir_or_ho_jlo, extdir_or_ho_jhi, domain_jlo, domain_jhi);
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) *
170 amrex_calc_yslope_extdir(i,j-1,k,n,order,S, extdir_or_ho_jlo, extdir_or_ho_jhi, domain_jlo, domain_jhi);
178 vpls = S(i,j ,k,n) + Real(0.5) * (-Real(1.0) - vmac * dt/dy) *
179 amrex_calc_yslope_extdir(i,j ,k,n,order,S, extdir_or_ho_jlo, extdir_or_ho_jhi, domain_jlo, domain_jhi);
180 vmns = S(i,j-1,k,n) + Real(0.5) * ( Real(1.0) - vmac * dt/dy) *
181 amrex_calc_yslope_extdir(i,j-1,k,n,order,S, extdir_or_ho_jlo, extdir_or_ho_jhi, domain_jlo, domain_jhi);
222 wpls = S(i,j,k ,n) + Real(0.5) * (-Real(1.0) - wmac * dt/dz) *
236 wmns = S(i,j,k-1,n) + Real(0.5) * ( Real(1.0) - wmac * dt/dz) *
245 wpls = S(i,j,k ,n) + Real(0.5) * (-Real(1.0) - wmac * dt/dz) *
247 wmns = S(i,j,k-1,n) + Real(0.5) * ( Real(1.0) - wmac * dt/dz) *