1 #ifndef AMREX_FILFC_2D_C_H_
2 #define AMREX_FILFC_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
24 const auto& domain_lo = domain_box.loVect();
25 const auto& domain_hi = domain_box.hiVect();
26 const int ilo = domain_lo[0];
27 const int jlo = domain_lo[1];
28 const int ihi = domain_hi[0];
29 const int jhi = domain_hi[1];
31 for (
int n = dcomp; n < numcomp+dcomp; ++n)
33 const BCRec& bc = bcr[bcomp+n-dcomp];
38 if ((bc.
lo(0) == BCType::reflect_odd) &&
46 case (BCType::foextrap):
48 q(i,j,0,n) = q(ilo,j,0,n);
51 case (BCType::hoextrap):
55 q(i,j,0,n) = q(ilo,j,0,n);
60 q(i,j,0,n) = (idxType.
nodeCentered(0)) ? Real(2.0)*q(i+1,j,0,n) - q(i+2,j,0,n)
61 : Real(0.5)*(Real(3.)*q(i+1,j,0,n) - q(i+2,j,0,n));
65 case (BCType::reflect_even):
67 q(i,j,0,n) = (idxType.
nodeCentered(0)) ? q(2*ilo-i,j,0,n)
71 case (BCType::reflect_odd):
73 q(i,j,0,n) = (idxType.
nodeCentered(0)) ? -q(2*ilo-i,j,0,n)
74 : -q(2*ilo-i-1,j,0,n);
83 if ((bc.
hi(0) == BCType::reflect_odd) &&
91 case (BCType::foextrap):
93 q(i,j,0,n) = q(ihi,j,0,n);
96 case (BCType::hoextrap):
100 q(i,j,0,n) = q(ihi,j,0,n);
105 q(i,j,0,n) = (idxType.
nodeCentered(0)) ? Real(2.0)*q(i-1,j,0,n) - q(i-2,j,0,n)
106 : Real(0.5)*(Real(3.)*q(i-1,j,0,n) - q(i-2,j,0,n));
110 case (BCType::reflect_even):
112 q(i,j,0,n) = (idxType.
nodeCentered(0)) ? q(2*ihi-i,j,0,n)
113 : q(2*ihi-i+1,j,0,n);
116 case (BCType::reflect_odd):
118 q(i,j,0,n) = (idxType.
nodeCentered(0)) ? -q(2*ihi-i,j,0,n)
119 : -q(2*ihi-i+1,j,0,n);
129 if ((bc.
lo(1) == BCType::reflect_odd) &&
137 case (BCType::foextrap):
139 q(i,j,0,n) = q(i,jlo,0,n);
142 case (BCType::hoextrap):
146 q(i,j,0,n) = q(i,jlo,0,n);
151 q(i,j,0,n) = (idxType.
nodeCentered(1)) ? Real(2.0)*q(i,j+1,0,n) - q(i,j+2,0,n)
152 : Real(0.5)*(Real(3.)*q(i,j+1,0,n) - q(i,j+2,0,n));
156 case (BCType::reflect_even):
158 q(i,j,0,n) = (idxType.
nodeCentered(1)) ? q(i,2*jlo-j,0,n)
159 : q(i,2*jlo-j-1,0,n);
162 case (BCType::reflect_odd):
164 q(i,j,0,n) = (idxType.
nodeCentered(1)) ? -q(i,2*jlo-j,0,n)
165 : -q(i,2*jlo-j-1,0,n);
174 if ((bc.
hi(1) == BCType::reflect_odd) &&
182 case (BCType::foextrap):
184 q(i,j,0,n) = q(i,jhi,0,n);
187 case (BCType::hoextrap):
191 q(i,j,0,n) = q(i,jhi,0,n);
196 q(i,j,0,n) = (idxType.
nodeCentered(1)) ? Real(2.0)*q(i,j-1,0,n) - q(i,j-2,0,n)
197 : Real(0.5)*(Real(3.)*q(i,j-1,0,n) - q(i,j-2,0,n));
201 case (BCType::reflect_even):
203 q(i,j,0,n) = (idxType.
nodeCentered(1)) ? q(i,2*jhi-j,0,n)
204 : q(i,2*jhi-j+1,0,n);
207 case (BCType::reflect_odd):
209 q(i,j,0,n) = (idxType.
nodeCentered(1)) ? -q(i,2*jhi-j,0,n)
210 : -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
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool nodeCentered() const noexcept
True if the IndexTypeND is NODE based in all directions.
Definition: AMReX_IndexType.H:107
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE CellIndex ixType(int dir) const noexcept
Returns the CellIndex in direction dir.
Definition: AMReX_IndexType.H:116
Definition: AMReX_Amr.cpp:49
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_FilFC_1D_C.H:14