1 #ifndef AMREX_FILCC_3D_C_H_
2 #define AMREX_FILCC_3D_C_H_
3 #include <AMReX_Config.H>
15 const int dcomp,
const int numcomp,
16 Box const& domain_box,
const BCRec* bcr,
17 const int bcomp)
const noexcept
23 const auto& domain_lo = domain_box.loVect();
24 const auto& domain_hi = domain_box.hiVect();
25 const int ilo = domain_lo[0];
26 const int jlo = domain_lo[1];
27 const int klo = domain_lo[2];
28 const int ihi = domain_hi[0];
29 const int jhi = domain_hi[1];
30 const int khi = domain_hi[2];
32 for (
int n = dcomp; n < numcomp+dcomp; ++n)
34 const BCRec& bc = bcr[bcomp+n-dcomp];
39 case (BCType::foextrap):
41 q(i,j,k,n) = q(ilo,j,k,n);
44 case (BCType::hoextrap):
48 q(i,j,k,n) = q(ilo,j,k,n);
53 q(i,j,k,n) = Real(0.125)*(Real(15.)*q(i+1,j,k,n) - Real(10.)*q(i+2,j,k,n) + Real(3.)*q(i+3,j,k,n));
57 q(i,j,k,n) = Real(0.5)*(Real(3.)*q(i+1,j,k,n) - q(i+2,j,k,n));
61 case (BCType::hoextrapcc):
63 q(i,j,k,n) = Real(ilo-i)*(q(ilo,j,k,n) - q(ilo+1,j,k,n)) + q(ilo,j,k,n);
66 case (BCType::reflect_even):
68 q(i,j,k,n) = q(2*ilo-i-1,j,k,n);
71 case (BCType::reflect_odd):
73 q(i,j,k,n) = -q(2*ilo-i-1,j,k,n);
82 case (BCType::foextrap):
84 q(i,j,k,n) = q(ihi,j,k,n);
87 case (BCType::hoextrap):
91 q(i,j,k,n) = q(ihi,j,k,n);
96 q(i,j,k,n) = Real(0.125)*(Real(15.)*q(i-1,j,k,n) - Real(10.)*q(i-2,j,k,n) + Real(3.)*q(i-3,j,k,n));
100 q(i,j,k,n) = Real(0.5)*(Real(3.)*q(i-1,j,k,n) - q(i-2,j,k,n));
104 case (BCType::hoextrapcc):
106 q(i,j,k,n) = Real(i-ihi)*(q(ihi,j,k,n) - q(ihi-1,j,k,n)) + q(ihi,j,k,n);
109 case (BCType::reflect_even):
111 q(i,j,k,n) = q(2*ihi-i+1,j,k,n);
114 case (BCType::reflect_odd):
116 q(i,j,k,n) = -q(2*ihi-i+1,j,k,n);
126 case (BCType::foextrap):
128 q(i,j,k,n) = q(i,jlo,k,n);
131 case (BCType::hoextrap):
135 q(i,j,k,n) = q(i,jlo,k,n);
140 q(i,j,k,n) = Real(0.125)*(Real(15.)*q(i,j+1,k,n) - Real(10.)*q(i,j+2,k,n) + Real(3.)*q(i,j+3,k,n));
144 q(i,j,k,n) = Real(0.5)*(Real(3.)*q(i,j+1,k,n) - q(i,j+2,k,n));
148 case (BCType::hoextrapcc):
150 q(i,j,k,n) = Real(jlo-j)*(q(i,jlo,k,n) - q(i,jlo+1,k,n)) + q(i,jlo,k,n);
153 case (BCType::reflect_even):
155 q(i,j,k,n) = q(i,2*jlo-j-1,k,n);
158 case (BCType::reflect_odd):
160 q(i,j,k,n) = -q(i,2*jlo-j-1,k,n);
169 case (BCType::foextrap):
171 q(i,j,k,n) = q(i,jhi,k,n);
174 case (BCType::hoextrap):
178 q(i,j,k,n) = q(i,jhi,k,n);
183 q(i,j,k,n) = Real(0.125)*(Real(15.)*q(i,j-1,k,n) - Real(10.)*q(i,j-2,k,n) + Real(3.)*q(i,j-3,k,n));
187 q(i,j,k,n) = Real(0.5)*(Real(3.)*q(i,j-1,k,n) - q(i,j-2,k,n));
191 case (BCType::hoextrapcc):
193 q(i,j,k,n) = Real(j-jhi)*(q(i,jhi,k,n) - q(i,jhi-1,k,n)) + q(i,jhi,k,n);
196 case (BCType::reflect_even):
198 q(i,j,k,n) = q(i,2*jhi-j+1,k,n);
201 case (BCType::reflect_odd):
203 q(i,j,k,n) = -q(i,2*jhi-j+1,k,n);
213 case (BCType::foextrap):
215 q(i,j,k,n) = q(i,j,klo,n);
218 case (BCType::hoextrap):
222 q(i,j,k,n) = q(i,j,klo,n);
227 q(i,j,k,n) = Real(0.125)*(Real(15.)*q(i,j,k+1,n) - Real(10.)*q(i,j,k+2,n) + Real(3.)*q(i,j,k+3,n));
231 q(i,j,k,n) = Real(0.5)*(Real(3.)*q(i,j,k+1,n) - q(i,j,k+2,n));
235 case (BCType::hoextrapcc):
237 q(i,j,k,n) = Real(klo-k)*(q(i,j,klo,n) - q(i,j,klo+1,n)) + q(i,j,klo,n);
240 case (BCType::reflect_even):
242 q(i,j,k,n) = q(i,j,2*klo-k-1,n);
245 case (BCType::reflect_odd):
247 q(i,j,k,n) = -q(i,j,2*klo-k-1,n);
256 case (BCType::foextrap):
258 q(i,j,k,n) = q(i,j,khi,n);
261 case (BCType::hoextrap):
265 q(i,j,k,n) = q(i,j,khi,n);
270 q(i,j,k,n) = Real(0.125)*(Real(15.)*q(i,j,k-1,n) - Real(10.)*q(i,j,k-2,n) + Real(3.)*q(i,j,k-3,n));
274 q(i,j,k,n) = Real(0.5)*(Real(3.)*q(i,j,k-1,n) - q(i,j,k-2,n));
278 case (BCType::hoextrapcc):
280 q(i,j,k,n) = Real(k-khi)*(q(i,j,khi,n) - q(i,j,khi-1,n)) + q(i,j,khi,n);
283 case (BCType::reflect_even):
285 q(i,j,k,n) = q(i,j,2*khi-k+1,n);
288 case (BCType::reflect_odd):
290 q(i,j,k,n) = -q(i,j,2*khi-k+1,n);
#define AMREX_FORCE_INLINE
Definition: AMReX_Extension.H:119
#define AMREX_GPU_HOST_DEVICE
Definition: AMReX_GpuQualifiers.H:20
Boundary Condition Records. Necessary information and functions for computing boundary conditions.
Definition: AMReX_BCRec.H:17
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const int * hi() const &noexcept
Return high-end boundary data.
Definition: AMReX_BCRec.H:106
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const int * lo() const &noexcept
Return low-end boundary data.
Definition: AMReX_BCRec.H:100
Definition: AMReX_Amr.cpp:49
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const T & max(const T &a, const T &b) noexcept
Definition: AMReX_Algorithm.H:35
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const T & min(const T &a, const T &b) noexcept
Definition: AMReX_Algorithm.H:21
Definition: AMReX_Array4.H:61
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void operator()(const IntVect &iv, Array4< Real > const &q, const int dcomp, const int numcomp, Box const &domain_box, const BCRec *bcr, const int bcomp) const noexcept
Definition: AMReX_FilCC_1D_C.H:14