1 #ifndef AMREX_FILCC_2D_C_H_
2 #define AMREX_FILCC_2D_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
22 const auto& domain_lo = domain_box.loVect();
23 const auto& domain_hi = domain_box.hiVect();
24 const int ilo = domain_lo[0];
25 const int jlo = domain_lo[1];
26 const int ihi = domain_hi[0];
27 const int jhi = domain_hi[1];
33 for (
int n = dcomp; n < numcomp+dcomp; ++n)
35 const BCRec& bc = bcr[bcomp+n-dcomp];
40 case (BCType::foextrap):
42 q(i,j,0,n) = q(ilo,j,0,n);
45 case (BCType::hoextrap):
49 q(i,j,0,n) = q(ilo,j,0,n);
54 q(i,j,0,n) = Real(0.125)*(Real(15.)*q(i+1,j,0,n) - Real(10.)*q(i+2,j,0,n) + Real(3.)*q(i+3,j,0,n));
58 q(i,j,0,n) = Real(0.5)*(Real(3.)*q(i+1,j,0,n) - q(i+2,j,0,n));
62 case (BCType::hoextrapcc):
64 q(i,j,0,n) = Real(ilo-i)*(q(ilo,j,0,n) - q(ilo+1,j,0,n)) + q(ilo,j,0,n);
67 case (BCType::reflect_even):
69 q(i,j,0,n) = q(2*ilo-i-1,j,0,n);
72 case (BCType::reflect_odd):
74 q(i,j,0,n) = -q(2*ilo-i-1,j,0,n);
83 case (BCType::foextrap):
85 q(i,j,0,n) = q(ihi,j,0,n);
88 case (BCType::hoextrap):
92 q(i,j,0,n) = q(ihi,j,0,n);
97 q(i,j,0,n) = Real(0.125)*(Real(15.)*q(i-1,j,0,n) - Real(10.)*q(i-2,j,0,n) + Real(3.)*q(i-3,j,0,n));
101 q(i,j,0,n) = Real(0.5)*(Real(3.)*q(i-1,j,0,n) - q(i-2,j,0,n));
105 case (BCType::hoextrapcc):
107 q(i,j,0,n) = Real(i-ihi)*(q(ihi,j,0,n) - q(ihi-1,j,0,n)) + q(ihi,j,0,n);
110 case (BCType::reflect_even):
112 q(i,j,0,n) = q(2*ihi-i+1,j,0,n);
115 case (BCType::reflect_odd):
117 q(i,j,0,n) = -q(2*ihi-i+1,j,0,n);
127 case (BCType::foextrap):
129 q(i,j,0,n) = q(i,jlo,0,n);
132 case (BCType::hoextrap):
136 q(i,j,0,n) = q(i,jlo,0,n);
139 else if (jlo+2 <= je)
141 q(i,j,0,n) = Real(0.125)*(Real(15.)*q(i,j+1,0,n) - Real(10.)*q(i,j+2,0,n) + Real(3.)*q(i,j+3,0,n));
145 q(i,j,0,n) = Real(0.5)*(Real(3.)*q(i,j+1,0,n) - q(i,j+2,0,n));
149 case (BCType::hoextrapcc):
151 q(i,j,0,n) = Real(jlo-j)*(q(i,jlo,0,n) - q(i,jlo+1,0,n)) + q(i,jlo,0,n);
154 case (BCType::reflect_even):
156 q(i,j,0,n) = q(i,2*jlo-j-1,0,n);
159 case (BCType::reflect_odd):
161 q(i,j,0,n) = -q(i,2*jlo-j-1,0,n);
170 case (BCType::foextrap):
172 q(i,j,0,n) = q(i,jhi,0,n);
175 case (BCType::hoextrap):
179 q(i,j,0,n) = q(i,jhi,0,n);
182 else if (jhi-2 >= js)
184 q(i,j,0,n) = Real(0.125)*(Real(15.)*q(i,j-1,0,n) - Real(10.)*q(i,j-2,0,n) + Real(3.)*q(i,j-3,0,n));
188 q(i,j,0,n) = Real(0.5)*(Real(3.)*q(i,j-1,0,n) - q(i,j-2,0,n));
192 case (BCType::hoextrapcc):
194 q(i,j,0,n) = Real(j-jhi)*(q(i,jhi,0,n) - q(i,jhi-1,0,n)) + q(i,jhi,0,n);
197 case (BCType::reflect_even):
199 q(i,j,0,n) = q(i,2*jhi-j+1,0,n);
202 case (BCType::reflect_odd):
204 q(i,j,0,n) = -q(i,2*jhi-j+1,0,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