1 #ifndef AMREX_FLUXREG_3D_C_H_
2 #define AMREX_FLUXREG_3D_C_H_
3 #include <AMReX_Config.H>
28 Array4<Real const>
const& flx,
const int fcomp,
const int ncomp,
29 const int dir, Dim3
const& ratio,
const Real mult) noexcept
38 const int i = ic*ratio.x;
39 for (
int n = 0; n < ncomp; ++n) {
40 for (
int kc = lo.z; kc <= hi.z; ++kc) {
41 for (
int koff = 0; koff < ratio.z; ++koff) {
42 const int k = ratio.z*kc + koff;
43 for (
int jc = lo.y; jc <= hi.y; ++jc) {
44 for (
int joff = 0; joff < ratio.y; ++joff) {
45 const int j = ratio.y*jc + joff;
46 reg(ic,jc,kc,n+rcomp) += mult*flx(i,j,k,n+fcomp);
57 const int j = jc*ratio.y;
58 for (
int n = 0; n < ncomp; ++n) {
59 for (
int kc = lo.z; kc <= hi.z; ++kc) {
60 for (
int koff = 0; koff < ratio.z; ++koff) {
61 const int k = ratio.z*kc + koff;
62 for (
int ic = lo.x; ic <= hi.x; ++ic) {
63 for (
int ioff = 0; ioff < ratio.x; ++ioff) {
64 const int i = ratio.x*ic + ioff;
65 reg(ic,jc,kc,n+rcomp) += mult*flx(i,j,k,n+fcomp);
76 const int k = kc*ratio.z;
77 for (
int n = 0; n < ncomp; ++n) {
78 for (
int jc = lo.y; jc <= hi.y; ++jc) {
79 for (
int joff = 0; joff < ratio.y; ++joff) {
80 const int j = ratio.y*jc + joff;
81 for (
int ic = lo.x; ic <= hi.x; ++ic) {
82 for (
int ioff = 0; ioff < ratio.x; ++ioff) {
83 const int i = ratio.x*ic + ioff;
84 reg(ic,jc,kc,n+rcomp) += mult*flx(i,j,k,n+fcomp);
114 Array4<Real const>
const& area,
115 Array4<Real const>
const& flx,
const int fcomp,
const int ncomp,
116 const int dir, Dim3
const& ratio,
const Real mult) noexcept
125 const int i = ic*ratio.x;
126 for (
int n = 0; n < ncomp; ++n) {
127 for (
int kc = lo.z; kc <= hi.z; ++kc) {
128 for (
int koff = 0; koff < ratio.z; ++koff) {
129 const int k = ratio.z*kc + koff;
130 for (
int jc = lo.y; jc <= hi.y; ++jc) {
131 for (
int joff = 0; joff < ratio.y; ++joff) {
132 const int j = ratio.y*jc + joff;
133 reg(ic,jc,kc,n+rcomp) += mult*area(i,j,k)
134 * flx(i,j,k,n+fcomp);
145 const int j = jc*ratio.y;
146 for (
int n = 0; n < ncomp; ++n) {
147 for (
int kc = lo.z; kc <= hi.z; ++kc) {
148 for (
int koff = 0; koff < ratio.z; ++koff) {
149 const int k = ratio.z*kc + koff;
150 for (
int ic = lo.x; ic <= hi.x; ++ic) {
151 for (
int ioff = 0; ioff < ratio.x; ++ioff) {
152 const int i = ratio.x*ic + ioff;
153 reg(ic,jc,kc,n+rcomp) += mult*area(i,j,k)
154 * flx(i,j,k,n+fcomp);
165 const int k = kc*ratio.z;
166 for (
int n = 0; n < ncomp; ++n) {
167 for (
int jc = lo.y; jc <= hi.y; ++jc) {
168 for (
int joff = 0; joff < ratio.y; ++joff) {
169 const int j = ratio.y*jc + joff;
170 for (
int ic = lo.x; ic <= hi.x; ++ic) {
171 for (
int ioff = 0; ioff < ratio.x; ++ioff) {
172 const int i = ratio.x*ic + ioff;
173 reg(ic,jc,kc,n+rcomp) += mult*area(i,j,k)
174 * flx(i,j,k,n+fcomp);
186 Array4<Real const>
const&
f, Array4<Real const>
const& v,
187 const int ncomp,
const Real mult,
const Orientation face) noexcept
193 const int dir = face.coordDir();
197 for (
int n = 0; n < ncomp; ++n) {
198 for (
int k = lo.z; k <= hi.z; ++k) {
199 for (
int j = lo.y; j <= hi.y; ++j) {
200 for (
int i = lo.x; i <= hi.x; ++i) {
201 s(i,j,k,n+scomp) += -mult*
f(i+1,j,k,n)/v(i,j,k);
210 for (
int n = 0; n < ncomp; ++n) {
211 for (
int k = lo.z; k <= hi.z; ++k) {
212 for (
int j = lo.y; j <= hi.y; ++j) {
213 for (
int i = lo.x; i <= hi.x; ++i) {
214 s(i,j,k,n+scomp) += -mult*
f(i,j+1,k,n)/v(i,j,k);
223 for (
int n = 0; n < ncomp; ++n) {
224 for (
int k = lo.z; k <= hi.z; ++k) {
225 for (
int j = lo.y; j <= hi.y; ++j) {
226 for (
int i = lo.x; i <= hi.x; ++i) {
227 s(i,j,k,n+scomp) += -mult*
f(i,j,k+1,n)/v(i,j,k);
235 for (
int n = 0; n < ncomp; ++n) {
236 for (
int k = lo.z; k <= hi.z; ++k) {
237 for (
int j = lo.y; j <= hi.y; ++j) {
238 for (
int i = lo.x; i <= hi.x; ++i) {
239 s(i,j,k,n+scomp) += mult*
f(i,j,k,n)/v(i,j,k);
#define AMREX_GPU_HOST_DEVICE
Definition: AMReX_GpuQualifiers.H:20
static int f(amrex::Real t, N_Vector y_data, N_Vector y_rhs, void *user_data)
Definition: AMReX_SundialsIntegrator.H:44
Definition: AMReX_Amr.cpp:49
AMREX_GPU_HOST_DEVICE void fluxreg_fineadd(Box const &bx, Array4< Real > const ®, const int rcomp, Array4< Real const > const &flx, const int fcomp, const int ncomp, const int, Dim3 const &ratio, const Real mult) noexcept
Add fine grid flux to flux register. Flux array is a fine grid edge based object, Register is a coars...
Definition: AMReX_FluxReg_1D_C.H:26
BoxND< AMREX_SPACEDIM > Box
Definition: AMReX_BaseFwd.H:27
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Dim3 ubound(Array4< T > const &a) noexcept
Definition: AMReX_Array4.H:315
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Dim3 lbound(Array4< T > const &a) noexcept
Definition: AMReX_Array4.H:308
AMREX_GPU_HOST_DEVICE void fluxreg_fineareaadd(Box const &bx, Array4< Real > const ®, const int rcomp, Array4< Real const > const &area, Array4< Real const > const &flx, const int fcomp, const int ncomp, const int, Dim3 const &ratio, const Real mult) noexcept
Add fine grid flux times area to flux register. Flux array is a fine grid edge based object,...
Definition: AMReX_FluxReg_1D_C.H:56
AMREX_GPU_HOST_DEVICE void fluxreg_reflux(Box const &bx, Array4< Real > const &s, const int scomp, Array4< Real const > const &f, Array4< Real const > const &v, const int ncomp, const Real mult, const Orientation face) noexcept
Definition: AMReX_FluxReg_1D_C.H:70