14 IntVect const& refratio,
int not_covered)
17 for (
auto&
x : tmp) {
x =
Real(0.0); }
20 for (
auto&
x : used) {
x = 0; }
23 auto const face = ori();
24 int const idir = face.coordDir();
25 int const idir1 = 1-
idir;
29 auto const& msk = bmask[face];
30 if (msk.contains(cell_out) && msk(cell_out) == not_covered) {
38 offset_t[idir1] = refratio[idir1];
43 poly_interp_coeff<3>(
Real(-0.5), xx, poly_coef);
45 Real fac = -(sb / (dx[
idir]*dx[
idir])) * bcoeff * poly_coef[0];
46 int const rr1 = refratio[idir1];
47 int const i1 = cell[idir1];
53 if (msk(cell_out-offset_t) == not_covered &&
54 msk(cell_out+offset_t) == not_covered)
56 poly_interp_coeff<3>(xInt, xc, c);
57 cc[0] = cc[1] = cc[2] = 1;
58 }
else if (msk(cell_out+offset_t) == not_covered) {
59 poly_interp_coeff<2>(xInt, &(xc[1]), &(c[1]));
62 poly_interp_coeff<2>(xInt, xc, c);
66 for (
int m = 0; m < 3; ++m) {
67 tmp(-1,m-1) += c[m] * fac;
68 used(-1,m-1) += cc[m];
71 for (
int m = 0; m < 3; ++m) {
72 tmp(1,m-1) += c[m] * fac;
76 for (
int m = 0; m < 3; ++m) {
77 tmp(m-1,-1) += c[m] * fac;
78 used(m-1,-1) += cc[m];
81 for (
int m = 0; m < 3; ++m) {
82 tmp(m-1,1) += c[m] * fac;
89 auto const* ptmp = tmp.
begin();
90 auto const* pused = used.begin();
91 for (
int m = 0; m < 9; ++m) {
103 int* entry_offset,
Real* entry_values,
114 if (fine_mask(i,j,k)) {
116 for (
int m = 1; m < 2*AMREX_SPACEDIM+1; ++m) {
117 stencil(i,j,k)[m] =
Real(0.0);
119 }
else if (nentries_to(i,j,k) > 0) {
120 int const fromoff = offset_from(i,j,k);
123 nentries[fromoff] = nentries_to(i,j,k);
124 int foff = offset_to(i,j,k);
125 entry_offset[fromoff] = foff;
134 if (fine_mask(i,j-1,k)) {
135 stencil(i,j,k)[0] += stencil(i,j,k)[3];
136 stencil(i,j,k)[3] =
Real(0.0);
144 poly_interp_coeff<3>(dyf*
Real(-0.5), yy, cc);
145 for (
int irx = 0; irx < rr[0]; ++irx) {
146 Real bym = by ? by[offset_by(i,j,k)+irx] :
Real(1.0);
147 Real fac = sb*dycinv*dyfinv*bym/
Real(rr[0]);
155 entry_values[foff+irx ] += fac* cc[2];
156 entry_values[foff+irx+rr[0]] += fac*(cc[1]-
Real(1.0));
162 if ( fine_mask(i-1,j,k) ||
165 poly_interp_coeff<2>(xInt, &(xc[1]), &(ct[1]));
166 }
else if ( fine_mask(i+1,j,k) ||
169 poly_interp_coeff<2>(xInt, xc, ct);
171 poly_interp_coeff<3>(xInt, xc, ct);
174 stencil(i,j,k)[0] += (fac*cc[0])*ct[1];
175 stencil(i,j,k)[1] += (fac*cc[0])*ct[0];
176 stencil(i,j,k)[2] += (fac*cc[0])*ct[2];
181 if (fine_mask(i-1,j,k)) {
182 stencil(i,j,k)[0] += stencil(i,j,k)[1];
183 stencil(i,j,k)[1] =
Real(0.0);
191 poly_interp_coeff<3>(dxf*
Real(-0.5), xx, cc);
192 for (
int iry = 0; iry < rr[1]; ++iry) {
193 Real bxm = bx ? bx[offset_bx(i,j,k)+iry] :
Real(1.0);
194 Real fac = sb*dxcinv*dxfinv*bxm/
Real(rr[1]);
202 entry_values[foff++] = fac* cc[2];
203 entry_values[foff++] = fac*(cc[1] -
Real(1.0));
209 if ( fine_mask(i,j-1,k) ||
212 poly_interp_coeff<2>(yInt, &(yc[1]), &(ct[1]));
213 }
else if ( fine_mask(i,j+1,k) ||
216 poly_interp_coeff<2>(yInt, yc, ct);
218 poly_interp_coeff<3>(yInt, yc, ct);
221 stencil(i,j,k)[0] += (fac*cc[0])*ct[1];
222 stencil(i,j,k)[3] += (fac*cc[0])*ct[0];
223 stencil(i,j,k)[4] += (fac*cc[0])*ct[2];
227 if (fine_mask(i+1,j,k)) {
228 stencil(i,j,k)[0] += stencil(i,j,k)[2];
229 stencil(i,j,k)[2] =
Real(0.0);
237 poly_interp_coeff<3>(dxf*
Real(-0.5), xx, cc);
238 for (
int iry = 0; iry < rr[1]; ++iry) {
239 Real bxp = bx ? bx[offset_bx(i+1,j,k)+iry] :
Real(1.0);
240 Real fac = sb*dxcinv*dxfinv*bxp/
Real(rr[1]);
248 entry_values[foff++] = fac*(cc[1] -
Real(1.0));
249 entry_values[foff++] = fac* cc[2];
255 if ( fine_mask(i,j-1,k) ||
258 poly_interp_coeff<2>(yInt, &(yc[1]), &(ct[1]));
259 }
else if ( fine_mask(i,j+1,k) ||
262 poly_interp_coeff<2>(yInt, yc, ct);
264 poly_interp_coeff<3>(yInt, yc, ct);
267 stencil(i,j,k)[0] += (fac*cc[0])*ct[1];
268 stencil(i,j,k)[3] += (fac*cc[0])*ct[0];
269 stencil(i,j,k)[4] += (fac*cc[0])*ct[2];
273 if (fine_mask(i,j+1,k)) {
274 stencil(i,j,k)[0] += stencil(i,j,k)[4];
275 stencil(i,j,k)[4] =
Real(0.0);
283 poly_interp_coeff<3>(dyf*
Real(-0.5), yy, cc);
284 for (
int irx = 0; irx < rr[0]; ++irx) {
285 Real byp = by ? by[offset_by(i,j+1,k)+irx] :
Real(1.0);
286 Real fac = sb*dycinv*dyfinv*byp/
Real(rr[0]);
294 entry_values[foff+irx ] += fac*(cc[1]-
Real(1.0));
295 entry_values[foff+irx+rr[0]] += fac* cc[2];
301 if ( fine_mask(i-1,j,k) ||
304 poly_interp_coeff<2>(xInt, &(xc[1]), &(ct[1]));
305 }
else if ( fine_mask(i+1,j,k) ||
308 poly_interp_coeff<2>(xInt, xc, ct);
310 poly_interp_coeff<3>(xInt, xc, ct);
313 stencil(i,j,k)[0] += (fac*cc[0])*ct[1];
314 stencil(i,j,k)[1] += (fac*cc[0])*ct[0];
315 stencil(i,j,k)[2] += (fac*cc[0])*ct[2];
__device__ void hypmlabeclap_c2f(int i, int j, int k, Array4< GpuArray< Real, 2 *3+1 > > const &stencil, GpuArray< HYPRE_Int, 3 > *civ, HYPRE_Int *nentries, int *entry_offset, Real *entry_values, Array4< int const > const &offset_from, Array4< int const > const &nentries_to, Array4< int const > const &offset_to, GpuArray< Real, 3 > const &dx, Real sb, Array4< int const > const &offset_bx, Array4< int const > const &offset_by, Real const *bx, Real const *by, Array4< int const > const &fine_mask, IntVect const &rr, Array4< int const > const &crse_mask)
Definition AMReX_HypreMLABecLap_1D_K.H:100