38 if ( !bca ) {
return bcr[n]; }
40 int lo[AMREX_SPACEDIM];
41 int hi[AMREX_SPACEDIM];
42 for (
int dir = 0; dir < AMREX_SPACEDIM; dir++) {
43 int index[] = {i,j,k};
45 for (
int dim = 0; dim < AMREX_SPACEDIM; dim++){
46 if (index[dim] < m_domain.
smallEnd(dim)) { index[dim] = m_domain.
smallEnd(dim); }
47 if (index[dim] > m_domain.
bigEnd(dim)) { index[dim] = m_domain.
bigEnd(dim); }
48 if (dim == dir) { index[dim] = m_domain.
smallEnd(dim)-1; }
50 lo[dir] = bca.
contains(index[0], index[1], index[2]) ?
51 bca(index[0], index[1], index[2], n) : 0;
54 index[dir] = m_domain.
bigEnd(dir)+1;
55 hi[dir] = bca.
contains(index[0], index[1], index[2]) ?
56 bca(index[0], index[1], index[2], n) : 0;
78 amrex::Real &lo, amrex::Real &hi,
81 using namespace amrex;
89 if (iv[edge_dir] == domlo)
91 iv[edge_dir] = domlo-1;
92 Real s_ext = s(iv[0],iv[1],iv[2],n);
94 bool is_vel_in_dir = (n == edge_dir);
96 if ( (bclo == BCType::ext_dir) ||
97 (bclo == BCType::direction_dependent && s_ext > 0.0) )
106 else if (bclo == BCType::reflect_odd)
111 else if ( bclo == BCType::foextrap || bclo == BCType::hoextrap ||
112 bclo == BCType::reflect_even ||
113 (bclo == BCType::direction_dependent && s_ext <= 0.0))
135 amrex::Real &lo, amrex::Real &hi,
138 using namespace amrex;
146 if (iv[edge_dir] == domhi+1)
148 iv[edge_dir] = domhi+1;
149 Real s_ext = s(iv[0],iv[1],iv[2],n);
151 bool is_vel_in_dir = (n == edge_dir);
153 if ( (bchi == BCType::ext_dir) ||
154 (bchi == BCType::direction_dependent && s_ext < 0.0) )
163 else if (bchi == BCType::reflect_odd)
168 else if ( bchi == BCType::foextrap || bchi == BCType::hoextrap ||
169 bchi == BCType::reflect_even ||
170 (bchi == BCType::direction_dependent && s_ext >= 0.0))
192 amrex::Real &lo, amrex::Real &hi,
197 using namespace amrex;
205 if (iv[edge_dir] == domlo)
207 iv[edge_dir] = domlo-1;
208 Real s_ext = s(iv[0],iv[1],iv[2],n);
210 bool is_vel_in_dir = is_velocity && (n == edge_dir);
212 if (bclo == BCType::direction_dependent && macvel > 0.0)
217 else if (bclo == BCType::ext_dir)
229 else if (bclo == BCType::reflect_odd)
234 else if ( bclo == BCType::foextrap || bclo == BCType::hoextrap ||
235 bclo == BCType::reflect_even ||
236 (bclo == BCType::direction_dependent && macvel <= 0.0))
258 amrex::Real &lo, amrex::Real &hi,
263 using namespace amrex;
271 if (iv[edge_dir] == domhi+1)
273 iv[edge_dir] = domhi+1;
274 Real s_ext = s(iv[0],iv[1],iv[2],n);
276 bool is_vel_in_dir = is_velocity && (n == edge_dir);
278 if (bchi == BCType::direction_dependent && macvel < 0.0)
283 else if (bchi == BCType::ext_dir)
295 else if (bchi == BCType::reflect_odd)
300 else if ( bchi == BCType::foextrap || bchi == BCType::hoextrap ||
301 bchi == BCType::reflect_even ||
302 (bchi == BCType::direction_dependent && macvel >= 0.0))
#define AMREX_FORCE_INLINE
#define AMREX_GPU_HOST_DEVICE
AMREX_GPU_HOST_DEVICE const IntVectND< dim > & smallEnd() const &noexcept
AMREX_GPU_HOST_DEVICE const IntVectND< dim > & bigEnd() const &noexcept
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:256
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void SetExtrapVelBCsLo(int edge_dir, int i, int j, int k, int n, const amrex::Array4< const amrex::Real > &s, amrex::Real &lo, amrex::Real &hi, int bclo, int domlo)
Boundary condition effects.
Definition: hydro_bcs_K.H:76
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void SetExtrapVelBCsHi(int edge_dir, int i, int j, int k, int n, const amrex::Array4< const amrex::Real > &s, amrex::Real &lo, amrex::Real &hi, int bchi, int domhi)
Boundary condition effects.
Definition: hydro_bcs_K.H:133
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:190
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::BCRec getBC(const int i, const int j, const int k, const int n, const amrex::Box &m_domain, const amrex::BCRec *bcr, amrex::Array4< int const > const &bca)
Definition: hydro_bcs_K.H:34
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool contains(int i, int j, int k) const noexcept