1 #ifndef AMREX_MLNODELAP_3D_K_H_
2 #define AMREX_MLNODELAP_3D_K_H_
3 #include <AMReX_Config.H>
9 Array4<int const>
const& msk,
int fine_flag) noexcept
13 if (msk(i-1,j-1,k-1) == fine_flag &&
14 msk(i ,j-1,k-1) == fine_flag &&
15 msk(i-1,j ,k-1) == fine_flag &&
16 msk(i ,j ,k-1) == fine_flag &&
17 msk(i-1,j-1,k ) == fine_flag &&
18 msk(i ,j-1,k ) == fine_flag &&
19 msk(i-1,j ,k ) == fine_flag &&
20 msk(i ,j ,k ) == fine_flag)
22 phi(i,j,k) = Real(0.0);
32 Array4<Real const>
const&
fine) noexcept
34 Real cl =
fine(2*i ,2*j,2*k )+
fine(2*i ,2*j+1,2*k )+
35 fine(2*i ,2*j,2*k+1)+
fine(2*i ,2*j+1,2*k+1);
36 Real cr =
fine(2*i+1,2*j,2*k )+
fine(2*i+1,2*j+1,2*k )+
37 fine(2*i+1,2*j,2*k+1)+
fine(2*i+1,2*j+1,2*k+1);
38 crse(i,j,k) = Real(0.5)*cl*cr/(cl+cr);
43 Array4<Real const>
const&
fine) noexcept
45 Real cl =
fine(2*i,2*j ,2*k )+
fine(2*i+1,2*j ,2*k )+
46 fine(2*i,2*j ,2*k+1)+
fine(2*i+1,2*j ,2*k+1);
47 Real cr =
fine(2*i,2*j+1,2*k )+
fine(2*i+1,2*j+1,2*k )+
48 fine(2*i,2*j+1,2*k+1)+
fine(2*i+1,2*j+1,2*k+1);
49 crse(i,j,k) = Real(0.5)*cl*cr/(cl+cr);
56 Real cl =
fine(2*i,2*j ,2*k )+
fine(2*i+1,2*j ,2*k )+
57 fine(2*i,2*j+1,2*k )+
fine(2*i+1,2*j+1,2*k );
58 Real cr =
fine(2*i,2*j ,2*k+1)+
fine(2*i+1,2*j ,2*k+1)+
59 fine(2*i,2*j+1,2*k+1)+
fine(2*i+1,2*j+1,2*k+1);
60 crse(i,j,k) = Real(0.5)*cl*cr/(cl+cr);
65 Array4<Real const>
const&
fine,
int idir) noexcept
68 Real cl =
fine(2*i ,2*j,k) +
fine(2*i ,2*j+1,k);
69 Real cr =
fine(2*i+1,2*j,k) +
fine(2*i+1,2*j+1,k);
70 crse(i,j,k) = cl*cr/(cl+cr);
71 }
else if (
idir == 1) {
72 Real cl =
fine(2*i ,j,2*k) +
fine(2*i ,j,2*k+1);
73 Real cr =
fine(2*i+1,j,2*k) +
fine(2*i+1,j,2*k+1);
74 crse(i,j,k) = cl*cr/(cl+cr);
76 Real cl =
fine(i,2*j ,2*k) +
fine(i,2*j ,2*k+1);
77 Real cr =
fine(i,2*j+1,2*k) +
fine(i,2*j+1,2*k+1);
78 crse(i,j,k) = cl*cr/(cl+cr);
95 Real facx = Real(1./36.)*dxinv[0]*dxinv[0];
96 Real facy = Real(1./36.)*dxinv[1]*dxinv[1];
97 Real facz = Real(1./36.)*dxinv[2]*dxinv[2];
98 Real y =
x(i,j,k)*Real(-4.0)*(facx*(sx(i-1,j-1,k-1)+sx(i,j-1,k-1)+sx(i-1,j,k-1)+sx(i,j,k-1)
99 +sx(i-1,j-1,k )+sx(i,j-1,k )+sx(i-1,j,k )+sx(i,j,k ))
100 +facy*(sy(i-1,j-1,k-1)+sy(i,j-1,k-1)+sy(i-1,j,k-1)+sy(i,j,k-1)
101 +sy(i-1,j-1,k )+sy(i,j-1,k )+sy(i-1,j,k )+sy(i,j,k ))
102 +facz*(sz(i-1,j-1,k-1)+sz(i,j-1,k-1)+sz(i-1,j,k-1)+sz(i,j,k-1)
103 +sz(i-1,j-1,k )+sz(i,j-1,k )+sz(i-1,j,k )+sz(i,j,k )));
104 y +=
x(i-1,j-1,k-1)*(facx*sx(i-1,j-1,k-1)
105 +facy*sy(i-1,j-1,k-1)
106 +facz*sz(i-1,j-1,k-1))
107 +
x(i+1,j-1,k-1)*(facx*sx(i ,j-1,k-1)
109 +facz*sz(i ,j-1,k-1))
110 +
x(i-1,j+1,k-1)*(facx*sx(i-1,j ,k-1)
112 +facz*sz(i-1,j ,k-1))
113 +
x(i+1,j+1,k-1)*(facx*sx(i ,j ,k-1)
116 +
x(i-1,j-1,k+1)*(facx*sx(i-1,j-1,k )
118 +facz*sz(i-1,j-1,k ))
119 +
x(i+1,j-1,k+1)*(facx*sx(i ,j-1,k )
122 +
x(i-1,j+1,k+1)*(facx*sx(i-1,j ,k )
125 +
x(i+1,j+1,k+1)*(facx*sx(i ,j ,k )
128 y +=
x(i ,j-1,k-1)*( -facx*(sx(i-1,j-1,k-1)+sx(i,j-1,k-1))
129 +Real(2.0)*facy*(sy(i-1,j-1,k-1)+sy(i,j-1,k-1))
130 +Real(2.0)*facz*(sz(i-1,j-1,k-1)+sz(i,j-1,k-1)))
131 +
x(i ,j+1,k-1)*( -facx*(sx(i-1,j ,k-1)+sx(i,j ,k-1))
132 +Real(2.0)*facy*(sy(i-1,j ,k-1)+sy(i,j ,k-1))
133 +Real(2.0)*facz*(sz(i-1,j ,k-1)+sz(i,j ,k-1)))
134 +
x(i ,j-1,k+1)*( -facx*(sx(i-1,j-1,k )+sx(i,j-1,k ))
135 +Real(2.0)*facy*(sy(i-1,j-1,k )+sy(i,j-1,k ))
136 +Real(2.0)*facz*(sz(i-1,j-1,k )+sz(i,j-1,k )))
137 +
x(i ,j+1,k+1)*( -facx*(sx(i-1,j ,k )+sx(i,j ,k ))
138 +Real(2.0)*facy*(sy(i-1,j ,k )+sy(i,j ,k ))
139 +Real(2.0)*facz*(sz(i-1,j ,k )+sz(i,j ,k )))
140 +
x(i-1,j ,k-1)*( Real(2.0)*facx*(sx(i-1,j-1,k-1)+sx(i-1,j,k-1))
141 -facy*(sy(i-1,j-1,k-1)+sy(i-1,j,k-1))
142 +Real(2.0)*facz*(sz(i-1,j-1,k-1)+sz(i-1,j,k-1)))
143 +
x(i+1,j ,k-1)*( Real(2.0)*facx*(sx(i ,j-1,k-1)+sx(i ,j,k-1))
144 -facy*(sy(i ,j-1,k-1)+sy(i ,j,k-1))
145 +Real(2.0)*facz*(sz(i ,j-1,k-1)+sz(i ,j,k-1)))
146 +
x(i-1,j ,k+1)*( Real(2.0)*facx*(sx(i-1,j-1,k )+sx(i-1,j,k ))
147 -facy*(sy(i-1,j-1,k )+sy(i-1,j,k ))
148 +Real(2.0)*facz*(sz(i-1,j-1,k )+sz(i-1,j,k )))
149 +
x(i+1,j ,k+1)*( Real(2.0)*facx*(sx(i ,j-1,k )+sx(i ,j,k ))
150 -facy*(sy(i ,j-1,k )+sy(i ,j,k ))
151 +Real(2.0)*facz*(sz(i ,j-1,k )+sz(i ,j,k )))
152 +
x(i-1,j-1,k )*( Real(2.0)*facx*(sx(i-1,j-1,k-1)+sx(i-1,j-1,k))
153 +Real(2.0)*facy*(sy(i-1,j-1,k-1)+sy(i-1,j-1,k))
154 -facz*(sz(i-1,j-1,k-1)+sz(i-1,j-1,k)))
155 +
x(i+1,j-1,k )*( Real(2.0)*facx*(sx(i ,j-1,k-1)+sx(i ,j-1,k))
156 +Real(2.0)*facy*(sy(i ,j-1,k-1)+sy(i ,j-1,k))
157 -facz*(sz(i ,j-1,k-1)+sz(i ,j-1,k)))
158 +
x(i-1,j+1,k )*( Real(2.0)*facx*(sx(i-1,j ,k-1)+sx(i-1,j ,k))
159 +Real(2.0)*facy*(sy(i-1,j ,k-1)+sy(i-1,j ,k))
160 -facz*(sz(i-1,j ,k-1)+sz(i-1,j ,k)))
161 +
x(i+1,j+1,k )*( Real(2.0)*facx*(sx(i ,j ,k-1)+sx(i ,j ,k))
162 +Real(2.0)*facy*(sy(i ,j ,k-1)+sy(i ,j ,k))
163 -facz*(sz(i ,j ,k-1)+sz(i ,j ,k)));
164 y += Real(2.0)*
x(i-1,j,k)*( Real(2.0)*facx*(sx(i-1,j-1,k-1)+sx(i-1,j,k-1)+sx(i-1,j-1,k)+sx(i-1,j,k))
165 -facy*(sy(i-1,j-1,k-1)+sy(i-1,j,k-1)+sy(i-1,j-1,k)+sy(i-1,j,k))
166 -facz*(sz(i-1,j-1,k-1)+sz(i-1,j,k-1)+sz(i-1,j-1,k)+sz(i-1,j,k)))
167 + Real(2.0)*
x(i+1,j,k)*( Real(2.0)*facx*(sx(i ,j-1,k-1)+sx(i ,j,k-1)+sx(i ,j-1,k)+sx(i ,j,k))
168 -facy*(sy(i ,j-1,k-1)+sy(i ,j,k-1)+sy(i ,j-1,k)+sy(i ,j,k))
169 -facz*(sz(i ,j-1,k-1)+sz(i ,j,k-1)+sz(i ,j-1,k)+sz(i ,j,k)))
170 + Real(2.0)*
x(i,j-1,k)*( -facx*(sx(i-1,j-1,k-1)+sx(i,j-1,k-1)+sx(i-1,j-1,k)+sx(i,j-1,k))
171 +Real(2.0)*facy*(sy(i-1,j-1,k-1)+sy(i,j-1,k-1)+sy(i-1,j-1,k)+sy(i,j-1,k))
172 -facz*(sz(i-1,j-1,k-1)+sz(i,j-1,k-1)+sz(i-1,j-1,k)+sz(i,j-1,k)))
173 + Real(2.0)*
x(i,j+1,k)*( -facx*(sx(i-1,j ,k-1)+sx(i,j ,k-1)+sx(i-1,j ,k)+sx(i,j ,k))
174 +Real(2.0)*facy*(sy(i-1,j ,k-1)+sy(i,j ,k-1)+sy(i-1,j ,k)+sy(i,j ,k))
175 -facz*(sz(i-1,j ,k-1)+sz(i,j ,k-1)+sz(i-1,j ,k)+sz(i,j ,k)))
176 + Real(2.0)*
x(i,j,k-1)*( -facx*(sx(i-1,j-1,k-1)+sx(i,j-1,k-1)+sx(i-1,j,k-1)+sx(i,j,k-1))
177 -facy*(sy(i-1,j-1,k-1)+sy(i,j-1,k-1)+sy(i-1,j,k-1)+sy(i,j,k-1))
178 +Real(2.0)*facz*(sz(i-1,j-1,k-1)+sz(i,j-1,k-1)+sz(i-1,j,k-1)+sz(i,j,k-1)))
179 + Real(2.0)*
x(i,j,k+1)*( -facx*(sx(i-1,j-1,k )+sx(i,j-1,k )+sx(i-1,j,k )+sx(i,j,k ))
180 -facy*(sy(i-1,j-1,k )+sy(i,j-1,k )+sy(i-1,j,k )+sy(i,j,k ))
181 +Real(2.0)*facz*(sz(i-1,j-1,k )+sz(i,j-1,k )+sz(i-1,j,k )+sz(i,j,k )));
188 Array4<Real const>
const& sig, Array4<int const>
const& msk,
189 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
194 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
195 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
196 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
197 Real fxyz = facx + facy + facz;
198 Real fmx2y2z = -facx + Real(2.0)*facy + Real(2.0)*facz;
199 Real f2xmy2z = Real(2.0)*facx - facy + Real(2.0)*facz;
200 Real f2x2ymz = Real(2.0)*facx + Real(2.0)*facy - facz;
201 Real f4xm2ym2z = Real(4.0)*facx - Real(2.0)*facy - Real(2.0)*facz;
202 Real fm2x4ym2z = -Real(2.0)*facx + Real(4.0)*facy - Real(2.0)*facz;
203 Real fm2xm2y4z = -Real(2.0)*facx - Real(2.0)*facy + Real(4.0)*facz;
204 return x(i,j,k)*Real(-4.0)*fxyz*
205 (sig(i-1,j-1,k-1)+sig(i,j-1,k-1)+sig(i-1,j,k-1)+sig(i,j,k-1)
206 +sig(i-1,j-1,k )+sig(i,j-1,k )+sig(i-1,j,k )+sig(i,j,k ))
207 + fxyz*(
x(i-1,j-1,k-1)*sig(i-1,j-1,k-1)
208 +
x(i+1,j-1,k-1)*sig(i ,j-1,k-1)
209 +
x(i-1,j+1,k-1)*sig(i-1,j ,k-1)
210 +
x(i+1,j+1,k-1)*sig(i ,j ,k-1)
211 +
x(i-1,j-1,k+1)*sig(i-1,j-1,k )
212 +
x(i+1,j-1,k+1)*sig(i ,j-1,k )
213 +
x(i-1,j+1,k+1)*sig(i-1,j ,k )
214 +
x(i+1,j+1,k+1)*sig(i ,j ,k ))
215 + fmx2y2z*(
x(i ,j-1,k-1)*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1))
216 +
x(i ,j+1,k-1)*(sig(i-1,j ,k-1)+sig(i,j ,k-1))
217 +
x(i ,j-1,k+1)*(sig(i-1,j-1,k )+sig(i,j-1,k ))
218 +
x(i ,j+1,k+1)*(sig(i-1,j ,k )+sig(i,j ,k )))
219 + f2xmy2z*(
x(i-1,j ,k-1)*(sig(i-1,j-1,k-1)+sig(i-1,j,k-1))
220 +
x(i+1,j ,k-1)*(sig(i ,j-1,k-1)+sig(i ,j,k-1))
221 +
x(i-1,j ,k+1)*(sig(i-1,j-1,k )+sig(i-1,j,k ))
222 +
x(i+1,j ,k+1)*(sig(i ,j-1,k )+sig(i ,j,k )))
223 + f2x2ymz*(
x(i-1,j-1,k )*(sig(i-1,j-1,k-1)+sig(i-1,j-1,k))
224 +
x(i+1,j-1,k )*(sig(i ,j-1,k-1)+sig(i ,j-1,k))
225 +
x(i-1,j+1,k )*(sig(i-1,j ,k-1)+sig(i-1,j ,k))
226 +
x(i+1,j+1,k )*(sig(i ,j ,k-1)+sig(i ,j ,k)))
227 + f4xm2ym2z*(
x(i-1,j,k)*(sig(i-1,j-1,k-1)+sig(i-1,j,k-1)+sig(i-1,j-1,k)+sig(i-1,j,k))
228 +
x(i+1,j,k)*(sig(i ,j-1,k-1)+sig(i ,j,k-1)+sig(i ,j-1,k)+sig(i ,j,k)))
229 + fm2x4ym2z*(
x(i,j-1,k)*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1)+sig(i-1,j-1,k)+sig(i,j-1,k))
230 +
x(i,j+1,k)*(sig(i-1,j ,k-1)+sig(i,j ,k-1)+sig(i-1,j ,k)+sig(i,j ,k)))
231 + fm2xm2y4z*(
x(i,j,k-1)*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1)+sig(i-1,j,k-1)+sig(i,j,k-1))
232 +
x(i,j,k+1)*(sig(i-1,j-1,k )+sig(i,j-1,k )+sig(i-1,j,k )+sig(i,j,k )));
237 Real
mlndlap_adotx_c (
int i,
int j,
int k, Array4<Real const>
const& x,
238 Real sig, Array4<int const>
const& msk,
239 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
244 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
245 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
246 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
247 Real fxyz = facx + facy + facz;
248 Real fmx2y2z = -facx + Real(2.0)*facy + Real(2.0)*facz;
249 Real f2xmy2z = Real(2.0)*facx - facy + Real(2.0)*facz;
250 Real f2x2ymz = Real(2.0)*facx + Real(2.0)*facy - facz;
251 Real f4xm2ym2z = Real(4.0)*facx - Real(2.0)*facy - Real(2.0)*facz;
252 Real fm2x4ym2z = -Real(2.0)*facx + Real(4.0)*facy - Real(2.0)*facz;
253 Real fm2xm2y4z = -Real(2.0)*facx - Real(2.0)*facy + Real(4.0)*facz;
254 return sig * (
x(i,j,k)*Real(-4.0)*fxyz*Real(8.)
255 + fxyz*(
x(i-1,j-1,k-1)
263 + fmx2y2z*(
x(i ,j-1,k-1)*Real(2.)
264 +
x(i ,j+1,k-1)*Real(2.)
265 +
x(i ,j-1,k+1)*Real(2.)
266 +
x(i ,j+1,k+1)*Real(2.))
267 + f2xmy2z*(
x(i-1,j ,k-1)*Real(2.)
268 +
x(i+1,j ,k-1)*Real(2.)
269 +
x(i-1,j ,k+1)*Real(2.)
270 +
x(i+1,j ,k+1)*Real(2.))
271 + f2x2ymz*(
x(i-1,j-1,k )*Real(2.)
272 +
x(i+1,j-1,k )*Real(2.)
273 +
x(i-1,j+1,k )*Real(2.)
274 +
x(i+1,j+1,k )*Real(2.))
275 + f4xm2ym2z*(
x(i-1,j,k)*Real(4.)
276 +
x(i+1,j,k)*Real(4.))
277 + fm2x4ym2z*(
x(i,j-1,k)*Real(4.)
278 +
x(i,j+1,k)*Real(4.))
279 + fm2xm2y4z*(
x(i,j,k-1)*Real(4.)
280 +
x(i,j,k+1)*Real(4.)));
289 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
290 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
291 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
294 x(i,j,k) =
x(i,j,k)/(Real(-4.0)*(facx*(sx(i-1,j-1,k-1)+sx(i,j-1,k-1)+sx(i-1,j,k-1)+sx(i,j,k-1)
295 +sx(i-1,j-1,k )+sx(i,j-1,k )+sx(i-1,j,k )+sx(i,j,k ))
296 +facy*(sy(i-1,j-1,k-1)+sy(i,j-1,k-1)+sy(i-1,j,k-1)+sy(i,j,k-1)
297 +sy(i-1,j-1,k )+sy(i,j-1,k )+sy(i-1,j,k )+sy(i,j,k ))
298 +facz*(sz(i-1,j-1,k-1)+sz(i,j-1,k-1)+sz(i-1,j,k-1)+sz(i,j,k-1)
299 +sz(i-1,j-1,k )+sz(i,j-1,k )+sz(i-1,j,k )+sz(i,j,k ))));
304 void mlndlap_normalize_aa (
int i,
int j,
int k, Array4<Real>
const& x, Array4<Real const>
const& sig,
305 Array4<int const>
const& msk, GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
307 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
308 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
309 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
310 Real fxyz = facx + facy + facz;
313 x(i,j,k) = x(i,j,k) /
314 (Real(-4.0)*fxyz*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1)+sig(i-1,j,k-1)+sig(i,j,k-1)
315 +sig(i-1,j-1,k )+sig(i,j-1,k )+sig(i-1,j,k )+sig(i,j,k )));
325 Real facx = Real(-4.0 / 36.0)*dxinv[0]*dxinv[0];
326 Real facy = Real(-4.0 / 36.0)*dxinv[1]*dxinv[1];
327 Real facz = Real(-4.0 / 36.0)*dxinv[2]*dxinv[2];
330 sol(i,j,k) = Real(0.0);
332 sol(i,j,k) += Real(2.0/3.0) * (rhs(i,j,k) - Ax)
333 / (facx*(sx(i-1,j-1,k-1)+sx(i,j-1,k-1)+sx(i-1,j,k-1)+sx(i,j,k-1)
334 +sx(i-1,j-1,k )+sx(i,j-1,k )+sx(i-1,j,k )+sx(i,j,k ))
335 +facy*(sy(i-1,j-1,k-1)+sy(i,j-1,k-1)+sy(i-1,j,k-1)+sy(i,j,k-1)
336 +sy(i-1,j-1,k )+sy(i,j-1,k )+sy(i-1,j,k )+sy(i,j,k ))
337 +facz*(sz(i-1,j-1,k-1)+sz(i,j-1,k-1)+sz(i-1,j,k-1)+sz(i,j,k-1)
338 +sz(i-1,j-1,k )+sz(i,j-1,k )+sz(i-1,j,k )+sz(i,j,k )));
348 Real facx = Real(-4.0 / 36.0)*dxinv[0]*dxinv[0];
349 Real facy = Real(-4.0 / 36.0)*dxinv[1]*dxinv[1];
350 Real facz = Real(-4.0 / 36.0)*dxinv[2]*dxinv[2];
355 sol(i,j,k) = Real(0.0);
357 sol(i,j,k) += Real(2.0/3.0) * (rhs(i,j,k) - Ax(i,j,k))
358 / (facx*(sx(i-1,j-1,k-1)+sx(i,j-1,k-1)+sx(i-1,j,k-1)+sx(i,j,k-1)
359 +sx(i-1,j-1,k )+sx(i,j-1,k )+sx(i-1,j,k )+sx(i,j,k ))
360 +facy*(sy(i-1,j-1,k-1)+sy(i,j-1,k-1)+sy(i-1,j,k-1)+sy(i,j,k-1)
361 +sy(i-1,j-1,k )+sy(i,j-1,k )+sy(i-1,j,k )+sy(i,j,k ))
362 +facz*(sz(i-1,j-1,k-1)+sz(i,j-1,k-1)+sz(i-1,j,k-1)+sz(i,j,k-1)
363 +sz(i-1,j-1,k )+sz(i,j-1,k )+sz(i-1,j,k )+sz(i,j,k )));
370 Array4<Real const>
const& rhs, Array4<Real const>
const& sig,
371 Array4<int const>
const& msk, GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
373 Real fxyz = Real(-4.0 / 36.0)*(dxinv[0]*dxinv[0] +
378 sol(i,j,k) = Real(0.0);
380 sol(i,j,k) += Real(2.0/3.0) * (rhs(i,j,k) - Ax)
381 / (fxyz*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1)+sig(i-1,j,k-1)+sig(i,j,k-1)
382 +sig(i-1,j-1,k )+sig(i,j-1,k )+sig(i-1,j,k )+sig(i,j,k )));
387 void mlndlap_jacobi_c (
int i,
int j,
int k, Array4<Real>
const& sol, Real Ax,
388 Array4<Real const>
const& rhs, Real sig,
389 Array4<int const>
const& msk, GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
391 Real fxyz = Real(-4.0 / 36.0)*(dxinv[0]*dxinv[0] +
396 sol(i,j,k) = Real(0.0);
398 sol(i,j,k) += Real(2.0/3.0) * (rhs(i,j,k) - Ax)
399 / (fxyz*Real(8.)*sig);
405 Array4<Real const>
const& rhs, Array4<Real const>
const& sig,
406 Array4<int const>
const& msk, GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
408 Real fxyz = Real(-4.0 / 36.0)*(dxinv[0]*dxinv[0] +
415 sol(i,j,k) = Real(0.0);
417 sol(i,j,k) += Real(2.0/3.0) * (rhs(i,j,k) - Ax(i,j,k))
418 / (fxyz*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1)+sig(i-1,j,k-1)+sig(i,j,k-1)
419 +sig(i-1,j-1,k )+sig(i,j-1,k )+sig(i-1,j,k )+sig(i,j,k )));
425 void mlndlap_jacobi_c (
Box const& bx, Array4<Real>
const& sol, Array4<Real const>
const& Ax,
426 Array4<Real const>
const& rhs, Real sig,
427 Array4<int const>
const& msk, GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
429 Real fxyz = Real(-4.0 / 36.0)*(dxinv[0]*dxinv[0] +
436 sol(i,j,k) = Real(0.0);
438 sol(i,j,k) += Real(2.0/3.0) * (rhs(i,j,k) - Ax(i,j,k))
439 / (fxyz*Real(8.)*sig);
451 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
452 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
453 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
458 sol(i,j,k) = Real(0.0);
460 Real s0 = Real(-4.0)*(facx*(sx(i-1,j-1,k-1)+sx(i,j-1,k-1)+sx(i-1,j,k-1)+sx(i,j,k-1)
461 +sx(i-1,j-1,k )+sx(i,j-1,k )+sx(i-1,j,k )+sx(i,j,k ))
462 +facy*(sy(i-1,j-1,k-1)+sy(i,j-1,k-1)+sy(i-1,j,k-1)+sy(i,j,k-1)
463 +sy(i-1,j-1,k )+sy(i,j-1,k )+sy(i-1,j,k )+sy(i,j,k ))
464 +facz*(sz(i-1,j-1,k-1)+sz(i,j-1,k-1)+sz(i-1,j,k-1)+sz(i,j,k-1)
465 +sz(i-1,j-1,k )+sz(i,j-1,k )+sz(i-1,j,k )+sz(i,j,k )));
466 Real Ax = sol(i,j,k)*s0
467 + sol(i-1,j-1,k-1)*(facx*sx(i-1,j-1,k-1)
468 +facy*sy(i-1,j-1,k-1)
469 +facz*sz(i-1,j-1,k-1))
470 + sol(i+1,j-1,k-1)*(facx*sx(i ,j-1,k-1)
472 +facz*sz(i ,j-1,k-1))
473 + sol(i-1,j+1,k-1)*(facx*sx(i-1,j ,k-1)
475 +facz*sz(i-1,j ,k-1))
476 + sol(i+1,j+1,k-1)*(facx*sx(i ,j ,k-1)
479 + sol(i-1,j-1,k+1)*(facx*sx(i-1,j-1,k )
481 +facz*sz(i-1,j-1,k ))
482 + sol(i+1,j-1,k+1)*(facx*sx(i ,j-1,k )
485 + sol(i-1,j+1,k+1)*(facx*sx(i-1,j ,k )
488 + sol(i+1,j+1,k+1)*(facx*sx(i ,j ,k )
491 +sol(i ,j-1,k-1)*( -facx*(sx(i-1,j-1,k-1)+sx(i,j-1,k-1))
492 +Real(2.0)*facy*(sy(i-1,j-1,k-1)+sy(i,j-1,k-1))
493 +Real(2.0)*facz*(sz(i-1,j-1,k-1)+sz(i,j-1,k-1)))
494 +sol(i ,j+1,k-1)*( -facx*(sx(i-1,j ,k-1)+sx(i,j ,k-1))
495 +Real(2.0)*facy*(sy(i-1,j ,k-1)+sy(i,j ,k-1))
496 +Real(2.0)*facz*(sz(i-1,j ,k-1)+sz(i,j ,k-1)))
497 +sol(i ,j-1,k+1)*( -facx*(sx(i-1,j-1,k )+sx(i,j-1,k ))
498 +Real(2.0)*facy*(sy(i-1,j-1,k )+sy(i,j-1,k ))
499 +Real(2.0)*facz*(sz(i-1,j-1,k )+sz(i,j-1,k )))
500 +sol(i ,j+1,k+1)*( -facx*(sx(i-1,j ,k )+sx(i,j ,k ))
501 +Real(2.0)*facy*(sy(i-1,j ,k )+sy(i,j ,k ))
502 +Real(2.0)*facz*(sz(i-1,j ,k )+sz(i,j ,k )))
503 +sol(i-1,j ,k-1)*( Real(2.0)*facx*(sx(i-1,j-1,k-1)+sx(i-1,j,k-1))
504 -facy*(sy(i-1,j-1,k-1)+sy(i-1,j,k-1))
505 +Real(2.0)*facz*(sz(i-1,j-1,k-1)+sz(i-1,j,k-1)))
506 +sol(i+1,j ,k-1)*( Real(2.0)*facx*(sx(i ,j-1,k-1)+sx(i ,j,k-1))
507 -facy*(sy(i ,j-1,k-1)+sy(i ,j,k-1))
508 +Real(2.0)*facz*(sz(i ,j-1,k-1)+sz(i ,j,k-1)))
509 +sol(i-1,j ,k+1)*( Real(2.0)*facx*(sx(i-1,j-1,k )+sx(i-1,j,k ))
510 -facy*(sy(i-1,j-1,k )+sy(i-1,j,k ))
511 +Real(2.0)*facz*(sz(i-1,j-1,k )+sz(i-1,j,k )))
512 +sol(i+1,j ,k+1)*( Real(2.0)*facx*(sx(i ,j-1,k )+sx(i ,j,k ))
513 -facy*(sy(i ,j-1,k )+sy(i ,j,k ))
514 +Real(2.0)*facz*(sz(i ,j-1,k )+sz(i ,j,k )))
515 +sol(i-1,j-1,k )*( Real(2.0)*facx*(sx(i-1,j-1,k-1)+sx(i-1,j-1,k))
516 +Real(2.0)*facy*(sy(i-1,j-1,k-1)+sy(i-1,j-1,k))
517 -facz*(sz(i-1,j-1,k-1)+sz(i-1,j-1,k)))
518 +sol(i+1,j-1,k )*( Real(2.0)*facx*(sx(i ,j-1,k-1)+sx(i ,j-1,k))
519 +Real(2.0)*facy*(sy(i ,j-1,k-1)+sy(i ,j-1,k))
520 -facz*(sz(i ,j-1,k-1)+sz(i ,j-1,k)))
521 +sol(i-1,j+1,k )*( Real(2.0)*facx*(sx(i-1,j ,k-1)+sx(i-1,j ,k))
522 +Real(2.0)*facy*(sy(i-1,j ,k-1)+sy(i-1,j ,k))
523 -facz*(sz(i-1,j ,k-1)+sz(i-1,j ,k)))
524 +sol(i+1,j+1,k )*( Real(2.0)*facx*(sx(i ,j ,k-1)+sx(i ,j ,k))
525 +Real(2.0)*facy*(sy(i ,j ,k-1)+sy(i ,j ,k))
526 -facz*(sz(i ,j ,k-1)+sz(i ,j ,k)))
527 + Real(2.0)*sol(i-1,j,k)*(Real(2.0)*facx*(sx(i-1,j-1,k-1)+sx(i-1,j,k-1)+sx(i-1,j-1,k)+sx(i-1,j,k))
528 -facy*(sy(i-1,j-1,k-1)+sy(i-1,j,k-1)+sy(i-1,j-1,k)+sy(i-1,j,k))
529 -facz*(sz(i-1,j-1,k-1)+sz(i-1,j,k-1)+sz(i-1,j-1,k)+sz(i-1,j,k)))
530 + Real(2.0)*sol(i+1,j,k)*(Real(2.0)*facx*(sx(i ,j-1,k-1)+sx(i ,j,k-1)+sx(i ,j-1,k)+sx(i ,j,k))
531 -facy*(sy(i ,j-1,k-1)+sy(i ,j,k-1)+sy(i ,j-1,k)+sy(i ,j,k))
532 -facz*(sz(i ,j-1,k-1)+sz(i ,j,k-1)+sz(i ,j-1,k)+sz(i ,j,k)))
533 + Real(2.0)*sol(i,j-1,k)*( -facx*(sx(i-1,j-1,k-1)+sx(i,j-1,k-1)+sx(i-1,j-1,k)+sx(i,j-1,k))
534 +Real(2.0)*facy*(sy(i-1,j-1,k-1)+sy(i,j-1,k-1)+sy(i-1,j-1,k)+sy(i,j-1,k))
535 -facz*(sz(i-1,j-1,k-1)+sz(i,j-1,k-1)+sz(i-1,j-1,k)+sz(i,j-1,k)))
536 + Real(2.0)*sol(i,j+1,k)*( -facx*(sx(i-1,j ,k-1)+sx(i,j ,k-1)+sx(i-1,j ,k)+sx(i,j ,k))
537 +Real(2.0)*facy*(sy(i-1,j ,k-1)+sy(i,j ,k-1)+sy(i-1,j ,k)+sy(i,j ,k))
538 -facz*(sz(i-1,j ,k-1)+sz(i,j ,k-1)+sz(i-1,j ,k)+sz(i,j ,k)))
539 + Real(2.0)*sol(i,j,k-1)*( -facx*(sx(i-1,j-1,k-1)+sx(i,j-1,k-1)+sx(i-1,j,k-1)+sx(i,j,k-1))
540 -facy*(sy(i-1,j-1,k-1)+sy(i,j-1,k-1)+sy(i-1,j,k-1)+sy(i,j,k-1))
541 +Real(2.0)*facz*(sz(i-1,j-1,k-1)+sz(i,j-1,k-1)+sz(i-1,j,k-1)+sz(i,j,k-1)))
542 + Real(2.0)*sol(i,j,k+1)*( -facx*(sx(i-1,j-1,k )+sx(i,j-1,k )+sx(i-1,j,k )+sx(i,j,k ))
543 -facy*(sy(i-1,j-1,k )+sy(i,j-1,k )+sy(i-1,j,k )+sy(i,j,k ))
544 +Real(2.0)*facz*(sz(i-1,j-1,k )+sz(i,j-1,k )+sz(i-1,j,k )+sz(i,j,k )));
546 sol(i,j,k) += (rhs(i,j,k) - Ax) / s0;
553 Array4<Real const>
const& rhs, Array4<Real const>
const& sig,
554 Array4<int const>
const& msk,
555 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
557 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
558 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
559 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
560 Real fxyz = facx + facy + facz;
561 Real fmx2y2z = -facx + Real(2.0)*facy + Real(2.0)*facz;
562 Real f2xmy2z = Real(2.0)*facx - facy + Real(2.0)*facz;
563 Real f2x2ymz = Real(2.0)*facx + Real(2.0)*facy - facz;
564 Real f4xm2ym2z = Real(4.0)*facx - Real(2.0)*facy - Real(2.0)*facz;
565 Real fm2x4ym2z = -Real(2.0)*facx + Real(4.0)*facy - Real(2.0)*facz;
566 Real fm2xm2y4z = -Real(2.0)*facx - Real(2.0)*facy + Real(4.0)*facz;
571 sol(i,j,k) = Real(0.0);
573 Real s0 = Real(-4.0)*fxyz*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1)+sig(i-1,j,k-1)+sig(i,j,k-1)
574 +sig(i-1,j-1,k )+sig(i,j-1,k )+sig(i-1,j,k )+sig(i,j,k ));
575 Real Ax = sol(i,j,k)*s0
576 + fxyz*(sol(i-1,j-1,k-1)*sig(i-1,j-1,k-1)
577 + sol(i+1,j-1,k-1)*sig(i ,j-1,k-1)
578 + sol(i-1,j+1,k-1)*sig(i-1,j ,k-1)
579 + sol(i+1,j+1,k-1)*sig(i ,j ,k-1)
580 + sol(i-1,j-1,k+1)*sig(i-1,j-1,k )
581 + sol(i+1,j-1,k+1)*sig(i ,j-1,k )
582 + sol(i-1,j+1,k+1)*sig(i-1,j ,k )
583 + sol(i+1,j+1,k+1)*sig(i ,j ,k ))
584 + fmx2y2z*(sol(i ,j-1,k-1)*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1))
585 + sol(i ,j+1,k-1)*(sig(i-1,j ,k-1)+sig(i,j ,k-1))
586 + sol(i ,j-1,k+1)*(sig(i-1,j-1,k )+sig(i,j-1,k ))
587 + sol(i ,j+1,k+1)*(sig(i-1,j ,k )+sig(i,j ,k )))
588 + f2xmy2z*(sol(i-1,j ,k-1)*(sig(i-1,j-1,k-1)+sig(i-1,j,k-1))
589 + sol(i+1,j ,k-1)*(sig(i ,j-1,k-1)+sig(i ,j,k-1))
590 + sol(i-1,j ,k+1)*(sig(i-1,j-1,k )+sig(i-1,j,k ))
591 + sol(i+1,j ,k+1)*(sig(i ,j-1,k )+sig(i ,j,k )))
592 + f2x2ymz*(sol(i-1,j-1,k )*(sig(i-1,j-1,k-1)+sig(i-1,j-1,k))
593 + sol(i+1,j-1,k )*(sig(i ,j-1,k-1)+sig(i ,j-1,k))
594 + sol(i-1,j+1,k )*(sig(i-1,j ,k-1)+sig(i-1,j ,k))
595 + sol(i+1,j+1,k )*(sig(i ,j ,k-1)+sig(i ,j ,k)))
596 + f4xm2ym2z*(sol(i-1,j,k)*(sig(i-1,j-1,k-1)+sig(i-1,j,k-1)+sig(i-1,j-1,k)+sig(i-1,j,k))
597 + sol(i+1,j,k)*(sig(i ,j-1,k-1)+sig(i ,j,k-1)+sig(i ,j-1,k)+sig(i ,j,k)))
598 + fm2x4ym2z*(sol(i,j-1,k)*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1)+sig(i-1,j-1,k)+sig(i,j-1,k))
599 + sol(i,j+1,k)*(sig(i-1,j ,k-1)+sig(i,j ,k-1)+sig(i-1,j ,k)+sig(i,j ,k)))
600 + fm2xm2y4z*(sol(i,j,k-1)*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1)+sig(i-1,j,k-1)+sig(i,j,k-1))
601 + sol(i,j,k+1)*(sig(i-1,j-1,k )+sig(i,j-1,k )+sig(i-1,j,k )+sig(i,j,k )));
603 sol(i,j,k) += (rhs(i,j,k) - Ax) / s0;
610 Array4<Real const>
const& rhs, Real sig,
611 Array4<int const>
const& msk,
612 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
614 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
615 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
616 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
617 Real fxyz = facx + facy + facz;
618 Real fmx2y2z = -facx + Real(2.0)*facy + Real(2.0)*facz;
619 Real f2xmy2z = Real(2.0)*facx - facy + Real(2.0)*facz;
620 Real f2x2ymz = Real(2.0)*facx + Real(2.0)*facy - facz;
621 Real f4xm2ym2z = Real(4.0)*facx - Real(2.0)*facy - Real(2.0)*facz;
622 Real fm2x4ym2z = -Real(2.0)*facx + Real(4.0)*facy - Real(2.0)*facz;
623 Real fm2xm2y4z = -Real(2.0)*facx - Real(2.0)*facy + Real(4.0)*facz;
628 sol(i,j,k) = Real(0.0);
630 Real s0 = Real(-4.0)*fxyz*Real(8.);
631 Real Ax = sol(i,j,k)*s0
632 + fxyz*(sol(i-1,j-1,k-1)
640 + fmx2y2z*(sol(i ,j-1,k-1)*Real(2.)
641 + sol(i ,j+1,k-1)*Real(2.)
642 + sol(i ,j-1,k+1)*Real(2.)
643 + sol(i ,j+1,k+1)*Real(2.))
644 + f2xmy2z*(sol(i-1,j ,k-1)*Real(2.)
645 + sol(i+1,j ,k-1)*Real(2.)
646 + sol(i-1,j ,k+1)*Real(2.)
647 + sol(i+1,j ,k+1)*Real(2.))
648 + f2x2ymz*(sol(i-1,j-1,k )*Real(2.)
649 + sol(i+1,j-1,k )*Real(2.)
650 + sol(i-1,j+1,k )*Real(2.)
651 + sol(i+1,j+1,k )*Real(2.))
652 + f4xm2ym2z*(sol(i-1,j,k)*Real(4.)
653 + sol(i+1,j,k)*Real(4.))
654 + fm2x4ym2z*(sol(i,j-1,k)*Real(4.)
655 + sol(i,j+1,k)*Real(4.))
656 + fm2xm2y4z*(sol(i,j,k-1)*Real(4.)
657 + sol(i,j,k+1)*Real(4.));
659 sol(i,j,k) += (rhs(i,j,k) - Ax*sig) / (s0*sig);
665 void tridiagonal_solve (Array1D<Real,0,31>& a_ls, Array1D<Real,0,31>& b_ls, Array1D<Real,0,31>& c_ls,
666 Array1D<Real,0,31>& r_ls, Array1D<Real,0,31>& u_ls, Array1D<Real,0,31>& gam,
670 u_ls(0) = r_ls(0) / bet;
672 for (
int i = 1; i <= ilen - 1; i++) {
673 gam(i) = c_ls(i-1) / bet;
674 bet = b_ls(i) - a_ls(i)*gam(i);
676 u_ls(i) = (r_ls(i)-a_ls(i)*u_ls(i-1)) / bet;
678 for (
int i = ilen-2; i >= 0; i--) {
679 u_ls(i) = u_ls(i) - gam(i+1)*u_ls(i+1);
685 Array4<Real const>
const& rhs, Array4<Real const>
const& sig,
686 Array4<int const>
const& msk,
687 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
689 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
690 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
691 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
692 Real fxyz = facx + facy + facz;
693 Real fmx2y2z = -facx + Real(2.0)*facy + Real(2.0)*facz;
694 Real f2xmy2z = Real(2.0)*facx - facy + Real(2.0)*facz;
695 Real f2x2ymz = Real(2.0)*facx + Real(2.0)*facy - facz;
696 Real f4xm2ym2z = Real(4.0)*facx - Real(2.0)*facy - Real(2.0)*facz;
697 Real fm2x4ym2z = -Real(2.0)*facx + Real(4.0)*facy - Real(2.0)*facz;
698 Real fm2xm2y4z = -Real(2.0)*facx - Real(2.0)*facy + Real(4.0)*facz;
706 if ( (dxinv[0] <= dxinv[2]) && (dxinv[1] <= dxinv[2]) ) {
708 ilen = hi.z - lo.z + 1;
710 if ( (dxinv[0] <= dxinv[1]) && (dxinv[2] <= dxinv[1]) ) {
712 ilen = hi.y - lo.y + 1;
714 if ( (dxinv[1] <= dxinv[0]) && (dxinv[2] <= dxinv[0]) ) {
716 ilen = hi.x - lo.x + 1;
720 amrex::Abort(
"mlndlap_gauss_seidel_with_line_solve_aa is hard-wired to be no longer than 32");
723 Array1D<Real,0,31> a_ls,b_ls,c_ls,u_ls,r_ls,gam;
728 for (
int j = lo.y; j <= hi.y; ++j)
730 for (
int i = lo.x; i <= hi.x; ++i)
732 for (
int k = lo.z; k <= hi.z; ++k)
736 a_ls(k-lo.z) = Real(0.);
737 b_ls(k-lo.z) = Real(1.);
738 c_ls(k-lo.z) = Real(0.);
739 u_ls(k-lo.z) = Real(0.);
740 r_ls(k-lo.z) = Real(0.);
744 Real s0 = Real(-4.0)*fxyz*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1)+sig(i-1,j,k-1)+sig(i,j,k-1)
745 + sig(i-1,j-1,k )+sig(i,j-1,k )+sig(i-1,j,k )+sig(i,j,k ));
747 Real Ax = fxyz*(sol(i-1,j-1,k-1)*sig(i-1,j-1,k-1)
748 + sol(i+1,j-1,k-1)*sig(i ,j-1,k-1)
749 + sol(i-1,j+1,k-1)*sig(i-1,j ,k-1)
750 + sol(i+1,j+1,k-1)*sig(i ,j ,k-1)
751 + sol(i-1,j-1,k+1)*sig(i-1,j-1,k )
752 + sol(i+1,j-1,k+1)*sig(i ,j-1,k )
753 + sol(i-1,j+1,k+1)*sig(i-1,j ,k )
754 + sol(i+1,j+1,k+1)*sig(i ,j ,k ))
755 + fmx2y2z*(sol(i ,j-1,k-1)*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1))
756 + sol(i ,j+1,k-1)*(sig(i-1,j ,k-1)+sig(i,j ,k-1))
757 + sol(i ,j-1,k+1)*(sig(i-1,j-1,k )+sig(i,j-1,k ))
758 + sol(i ,j+1,k+1)*(sig(i-1,j ,k )+sig(i,j ,k )))
759 + f2xmy2z*(sol(i-1,j ,k-1)*(sig(i-1,j-1,k-1)+sig(i-1,j,k-1))
760 + sol(i+1,j ,k-1)*(sig(i ,j-1,k-1)+sig(i ,j,k-1))
761 + sol(i-1,j ,k+1)*(sig(i-1,j-1,k )+sig(i-1,j,k ))
762 + sol(i+1,j ,k+1)*(sig(i ,j-1,k )+sig(i ,j,k )))
763 + f2x2ymz*(sol(i-1,j-1,k )*(sig(i-1,j-1,k-1)+sig(i-1,j-1,k))
764 + sol(i+1,j-1,k )*(sig(i ,j-1,k-1)+sig(i ,j-1,k))
765 + sol(i-1,j+1,k )*(sig(i-1,j ,k-1)+sig(i-1,j ,k))
766 + sol(i+1,j+1,k )*(sig(i ,j ,k-1)+sig(i ,j ,k)))
767 + f4xm2ym2z*(sol(i-1,j,k)*(sig(i-1,j-1,k-1)+sig(i-1,j,k-1)+sig(i-1,j-1,k)+sig(i-1,j,k))
768 + sol(i+1,j,k)*(sig(i ,j-1,k-1)+sig(i ,j,k-1)+sig(i ,j-1,k)+sig(i ,j,k)))
769 + fm2x4ym2z*(sol(i,j-1,k)*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1)+sig(i-1,j-1,k)+sig(i,j-1,k))
770 + sol(i,j+1,k)*(sig(i-1,j ,k-1)+sig(i,j ,k-1)+sig(i-1,j ,k)+sig(i,j ,k)));
772 a_ls(k-lo.z) = fm2xm2y4z*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1)+sig(i-1,j,k-1)+sig(i,j,k-1));
774 c_ls(k-lo.z) = fm2xm2y4z*(sig(i-1,j-1,k )+sig(i,j-1,k )+sig(i-1,j,k )+sig(i,j,k ));
775 u_ls(k-lo.z) = Real(0.);
776 r_ls(k-lo.z) = rhs(i,j,k) - Ax;
781 for (
int k = lo.z; k <= hi.z; ++k)
783 sol(i,j,k) = u_ls(k-lo.z);
790 for (
int k = lo.z; k <= hi.z; ++k)
792 for (
int i = lo.x; i <= hi.x; ++i)
794 for (
int j = lo.y; j <= hi.y; ++j)
797 a_ls(j-lo.y) = Real(0.);
798 b_ls(j-lo.y) = Real(1.);
799 c_ls(j-lo.y) = Real(0.);
800 u_ls(j-lo.y) = Real(0.);
801 r_ls(j-lo.y) = Real(0.);
805 Real s0 = Real(-4.0)*fxyz*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1)+sig(i-1,j,k-1)+sig(i,j,k-1)
806 + sig(i-1,j-1,k )+sig(i,j-1,k )+sig(i-1,j,k )+sig(i,j,k ));
808 Real Ax = fxyz*(sol(i-1,j-1,k-1)*sig(i-1,j-1,k-1)
809 + sol(i+1,j-1,k-1)*sig(i ,j-1,k-1)
810 + sol(i-1,j+1,k-1)*sig(i-1,j ,k-1)
811 + sol(i+1,j+1,k-1)*sig(i ,j ,k-1)
812 + sol(i-1,j-1,k+1)*sig(i-1,j-1,k )
813 + sol(i+1,j-1,k+1)*sig(i ,j-1,k )
814 + sol(i-1,j+1,k+1)*sig(i-1,j ,k )
815 + sol(i+1,j+1,k+1)*sig(i ,j ,k ))
816 + fmx2y2z*(sol(i ,j-1,k-1)*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1))
817 + sol(i ,j+1,k-1)*(sig(i-1,j ,k-1)+sig(i,j ,k-1))
818 + sol(i ,j-1,k+1)*(sig(i-1,j-1,k )+sig(i,j-1,k ))
819 + sol(i ,j+1,k+1)*(sig(i-1,j ,k )+sig(i,j ,k )))
820 + f2xmy2z*(sol(i-1,j ,k-1)*(sig(i-1,j-1,k-1)+sig(i-1,j,k-1))
821 + sol(i+1,j ,k-1)*(sig(i ,j-1,k-1)+sig(i ,j,k-1))
822 + sol(i-1,j ,k+1)*(sig(i-1,j-1,k )+sig(i-1,j,k ))
823 + sol(i+1,j ,k+1)*(sig(i ,j-1,k )+sig(i ,j,k )))
824 + f2x2ymz*(sol(i-1,j-1,k )*(sig(i-1,j-1,k-1)+sig(i-1,j-1,k))
825 + sol(i+1,j-1,k )*(sig(i ,j-1,k-1)+sig(i ,j-1,k))
826 + sol(i-1,j+1,k )*(sig(i-1,j ,k-1)+sig(i-1,j ,k))
827 + sol(i+1,j+1,k )*(sig(i ,j ,k-1)+sig(i ,j ,k)))
828 + f4xm2ym2z*(sol(i-1,j,k)*(sig(i-1,j-1,k-1)+sig(i-1,j,k-1)+sig(i-1,j-1,k)+sig(i-1,j,k))
829 + sol(i+1,j,k)*(sig(i ,j-1,k-1)+sig(i ,j,k-1)+sig(i ,j-1,k)+sig(i ,j,k)))
830 + fm2xm2y4z*(sol(i,j,k-1)*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1)+sig(i-1,j,k-1)+sig(i,j,k-1))
831 + sol(i,j,k+1)*(sig(i-1,j-1,k )+sig(i,j-1,k )+sig(i-1,j,k )+sig(i,j,k )));
833 a_ls(j-lo.y) = fm2x4ym2z*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1)+sig(i-1,j-1,k)+sig(i,j-1,k));
835 c_ls(j-lo.y) = fm2x4ym2z*(sig(i-1,j ,k-1)+sig(i,j ,k-1)+sig(i-1,j ,k)+sig(i,j ,k));
836 u_ls(j-lo.y) = Real(0.);
837 r_ls(j-lo.y) = rhs(i,j,k) - Ax;
843 for (
int j = lo.y; j <= hi.y; ++j)
845 sol(i,j,k) = u_ls(j-lo.y);
852 for (
int j = lo.y; j <= hi.y; ++j)
854 for (
int k = lo.z; k <= hi.z; ++k)
856 for (
int i = lo.x; i <= hi.x; ++i)
860 a_ls(i-lo.x) = Real(0.);
861 b_ls(i-lo.x) = Real(1.);
862 c_ls(i-lo.x) = Real(0.);
863 u_ls(i-lo.x) = Real(0.);
864 r_ls(i-lo.x) = Real(0.);
868 Real s0 = Real(-4.0)*fxyz*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1)+sig(i-1,j,k-1)+sig(i,j,k-1)
869 + sig(i-1,j-1,k )+sig(i,j-1,k )+sig(i-1,j,k )+sig(i,j,k ));
871 Real Ax = fxyz*(sol(i-1,j-1,k-1)*sig(i-1,j-1,k-1)
872 + sol(i+1,j-1,k-1)*sig(i ,j-1,k-1)
873 + sol(i-1,j+1,k-1)*sig(i-1,j ,k-1)
874 + sol(i+1,j+1,k-1)*sig(i ,j ,k-1)
875 + sol(i-1,j-1,k+1)*sig(i-1,j-1,k )
876 + sol(i+1,j-1,k+1)*sig(i ,j-1,k )
877 + sol(i-1,j+1,k+1)*sig(i-1,j ,k )
878 + sol(i+1,j+1,k+1)*sig(i ,j ,k ))
879 + fmx2y2z*(sol(i ,j-1,k-1)*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1))
880 + sol(i ,j+1,k-1)*(sig(i-1,j ,k-1)+sig(i,j ,k-1))
881 + sol(i ,j-1,k+1)*(sig(i-1,j-1,k )+sig(i,j-1,k ))
882 + sol(i ,j+1,k+1)*(sig(i-1,j ,k )+sig(i,j ,k )))
883 + f2xmy2z*(sol(i-1,j ,k-1)*(sig(i-1,j-1,k-1)+sig(i-1,j,k-1))
884 + sol(i+1,j ,k-1)*(sig(i ,j-1,k-1)+sig(i ,j,k-1))
885 + sol(i-1,j ,k+1)*(sig(i-1,j-1,k )+sig(i-1,j,k ))
886 + sol(i+1,j ,k+1)*(sig(i ,j-1,k )+sig(i ,j,k )))
887 + f2x2ymz*(sol(i-1,j-1,k )*(sig(i-1,j-1,k-1)+sig(i-1,j-1,k))
888 + sol(i+1,j-1,k )*(sig(i ,j-1,k-1)+sig(i ,j-1,k))
889 + sol(i-1,j+1,k )*(sig(i-1,j ,k-1)+sig(i-1,j ,k))
890 + sol(i+1,j+1,k )*(sig(i ,j ,k-1)+sig(i ,j ,k)))
891 + fm2x4ym2z*(sol(i,j-1,k)*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1)+sig(i-1,j-1,k)+sig(i,j-1,k))
892 + sol(i,j+1,k)*(sig(i-1,j ,k-1)+sig(i,j ,k-1)+sig(i-1,j ,k)+sig(i,j ,k)))
893 + fm2xm2y4z*(sol(i,j,k-1)*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1)+sig(i-1,j,k-1)+sig(i,j,k-1))
894 + sol(i,j,k+1)*(sig(i-1,j-1,k )+sig(i,j-1,k )+sig(i-1,j,k )+sig(i,j,k )));
896 a_ls(i-lo.x) = f4xm2ym2z*(sig(i-1,j-1,k-1)+sig(i-1,j,k-1)+sig(i-1,j-1,k)+sig(i-1,j,k));
898 c_ls(i-lo.x) = f4xm2ym2z*(sig(i ,j-1,k-1)+sig(i ,j,k-1)+sig(i ,j-1,k)+sig(i ,j,k));
899 u_ls(i-lo.x) = Real(0.);
900 r_ls(i-lo.x) = rhs(i,j,k) - Ax;
905 for (
int i = lo.x; i <= hi.x; ++i)
907 sol(i,j,k) = u_ls(i-lo.x);
914 amrex::Abort(
"mlndlap_gauss_seidel_with_line_solve_aa is wrong direction.");
924 int i,
int j,
int k,
int ic,
int jc,
int kc) noexcept
926 Real w1 = sig(i-1,j-1,k-1) + sig(i-1,j,k-1) + sig(i-1,j-1,k) + sig(i-1,j,k);
927 Real w2 = sig(i ,j-1,k-1) + sig(i ,j,k-1) + sig(i ,j-1,k) + sig(i ,j,k);
928 return (w1*
crse(ic,jc,kc)+w2*
crse(ic+1,jc,kc))/(w1+w2);
933 int i,
int j,
int k,
int ic,
int jc,
int kc) noexcept
935 Real w1 = sig(i-1,j-1,k-1) + sig(i,j-1,k-1) + sig(i-1,j-1,k) + sig(i,j-1,k);
936 Real w2 = sig(i-1,j ,k-1) + sig(i,j ,k-1) + sig(i-1,j ,k) + sig(i,j ,k);
937 return (w1*
crse(ic,jc,kc)+w2*
crse(ic,jc+1,kc))/(w1+w2);
942 int i,
int j,
int k,
int ic,
int jc,
int kc) noexcept
944 Real w1 = sig(i-1,j-1,k-1) + sig(i,j-1,k-1) + sig(i-1,j,k-1) + sig(i,j,k-1);
945 Real w2 = sig(i-1,j-1,k ) + sig(i,j-1,k ) + sig(i-1,j,k ) + sig(i,j,k );
946 return (w1*
crse(ic,jc,kc)+w2*
crse(ic,jc,kc+1))/(w1+w2);
951 int i,
int j,
int k,
int ic,
int jc,
int kc) noexcept
953 Real w1 = sig(i-1,j-1,k-1) + sig(i-1,j,k-1) + sig(i-1,j-1,k) + sig(i-1,j,k);
954 Real w2 = sig(i ,j-1,k-1) + sig(i ,j,k-1) + sig(i ,j-1,k) + sig(i ,j,k);
955 Real w3 = sig(i-1,j-1,k-1) + sig(i,j-1,k-1) + sig(i-1,j-1,k) + sig(i,j-1,k);
956 Real w4 = sig(i-1,j ,k-1) + sig(i,j ,k-1) + sig(i-1,j ,k) + sig(i,j ,k);
965 int i,
int j,
int k,
int ic,
int jc,
int kc) noexcept
967 Real w1 = sig(i-1,j-1,k-1) + sig(i-1,j,k-1) + sig(i-1,j-1,k) + sig(i-1,j,k);
968 Real w2 = sig(i ,j-1,k-1) + sig(i ,j,k-1) + sig(i ,j-1,k) + sig(i ,j,k);
969 Real w3 = sig(i-1,j-1,k-1) + sig(i,j-1,k-1) + sig(i-1,j,k-1) + sig(i,j,k-1);
970 Real w4 = sig(i-1,j-1,k ) + sig(i,j-1,k ) + sig(i-1,j,k ) + sig(i,j,k );
979 int i,
int j,
int k,
int ic,
int jc,
int kc) noexcept
981 Real w1 = sig(i-1,j-1,k-1) + sig(i,j-1,k-1) + sig(i-1,j-1,k) + sig(i,j-1,k);
982 Real w2 = sig(i-1,j ,k-1) + sig(i,j ,k-1) + sig(i-1,j ,k) + sig(i,j ,k);
983 Real w3 = sig(i-1,j-1,k-1) + sig(i,j-1,k-1) + sig(i-1,j,k-1) + sig(i,j,k-1);
984 Real w4 = sig(i-1,j-1,k ) + sig(i,j-1,k ) + sig(i-1,j,k ) + sig(i,j,k );
993 Array4<Real const>
const&
crse,
994 Array4<int const>
const& msk) noexcept
1000 bool i_is_odd = (ic*2 != i);
1001 bool j_is_odd = (jc*2 != j);
1002 bool k_is_odd = (kc*2 != k);
1003 if (i_is_odd && j_is_odd && k_is_odd) {
1005 fine(i,j,k) += Real(0.125) *
1006 (
crse(ic,jc ,kc ) +
crse(ic+1,jc ,kc ) +
1007 crse(ic,jc+1,kc ) +
crse(ic+1,jc+1,kc ) +
1008 crse(ic,jc ,kc+1) +
crse(ic+1,jc ,kc+1) +
1009 crse(ic,jc+1,kc+1) +
crse(ic+1,jc+1,kc+1));
1010 }
else if (j_is_odd && k_is_odd) {
1012 fine(i,j,k) += Real(0.25) *
1013 (
crse(ic,jc,kc ) +
crse(ic,jc+1,kc ) +
1014 crse(ic,jc,kc+1) +
crse(ic,jc+1,kc+1));
1015 }
else if (i_is_odd && k_is_odd) {
1017 fine(i,j,k) += Real(0.25) *
1018 (
crse(ic,jc,kc ) +
crse(ic+1,jc,kc ) +
1019 crse(ic,jc,kc+1) +
crse(ic+1,jc,kc+1));
1020 }
else if (i_is_odd && j_is_odd) {
1022 fine(i,j,k) += Real(0.25) *
1023 (
crse(ic,jc ,kc) +
crse(ic+1,jc ,kc) +
1024 crse(ic,jc+1,kc) +
crse(ic+1,jc+1,kc));
1025 }
else if (i_is_odd) {
1027 fine(i,j,k) += Real(0.5)*(
crse(ic,jc,kc)+
crse(ic+1,jc,kc));
1028 }
else if (j_is_odd) {
1030 fine(i,j,k) += Real(0.5)*(
crse(ic,jc,kc)+
crse(ic,jc+1,kc));
1031 }
else if (k_is_odd) {
1033 fine(i,j,k) += Real(0.5)*(
crse(ic,jc,kc)+
crse(ic,jc,kc+1));
1043 Array4<Real const>
const&
crse, Array4<Real const>
const& sig,
1044 Array4<int const>
const& msk) noexcept
1050 bool i_is_odd = (ic*2 != i);
1051 bool j_is_odd = (jc*2 != j);
1052 bool k_is_odd = (kc*2 != k);
1053 if (i_is_odd && j_is_odd && k_is_odd) {
1055 Real w1 = sig(i-1,j-1,k-1) + sig(i-1,j,k-1) + sig(i-1,j-1,k) + sig(i-1,j,k);
1056 Real w2 = sig(i ,j-1,k-1) + sig(i ,j,k-1) + sig(i ,j-1,k) + sig(i ,j,k);
1057 Real w3 = sig(i-1,j-1,k-1) + sig(i,j-1,k-1) + sig(i-1,j-1,k) + sig(i,j-1,k);
1058 Real w4 = sig(i-1,j ,k-1) + sig(i,j ,k-1) + sig(i-1,j ,k) + sig(i,j ,k);
1059 Real w5 = sig(i-1,j-1,k-1) + sig(i,j-1,k-1) + sig(i-1,j,k-1) + sig(i,j,k-1);
1060 Real w6 = sig(i-1,j-1,k ) + sig(i,j-1,k ) + sig(i-1,j,k ) + sig(i,j,k );
1067 / (w1+w2+w3+w4+w5+w6);
1068 }
else if (j_is_odd && k_is_odd) {
1071 }
else if (i_is_odd && k_is_odd) {
1074 }
else if (i_is_odd && j_is_odd) {
1077 }
else if (i_is_odd) {
1080 }
else if (j_is_odd) {
1083 }
else if (k_is_odd) {
1095 Array4<Real const>
const&
crse, Array4<Real const>
const& sig,
1096 Array4<int const>
const& msk,
int idir) noexcept
1104 bool i_is_odd = (ic*2 != i);
1105 bool j_is_odd = (jc*2 != j);
1107 if (i_is_odd && j_is_odd) {
1110 }
else if (i_is_odd) {
1113 }
else if (j_is_odd) {
1121 }
else if (
idir ==1 ){
1126 bool i_is_odd = (ic*2 != i);
1127 bool k_is_odd = (kc*2 != k);
1129 if (i_is_odd && k_is_odd) {
1132 }
else if (i_is_odd) {
1135 }
else if (k_is_odd) {
1143 }
else if (
idir == 0 ) {
1148 bool j_is_odd = (jc*2 != j);
1149 bool k_is_odd = (kc*2 != k);
1151 if (j_is_odd && k_is_odd) {
1154 }
else if (j_is_odd) {
1157 }
else if (k_is_odd) {
1166 amrex::Abort(
"mlndlap_semi_interpolation semi direction wrong semi-direction. ");
1174 int i,
int j,
int k,
int ic,
int jc,
int kc) noexcept
1176 Real w1 = sigx(i-1,j-1,k-1) + sigx(i-1,j,k-1) + sigx(i-1,j-1,k) + sigx(i-1,j,k);
1177 Real w2 = sigx(i ,j-1,k-1) + sigx(i ,j,k-1) + sigx(i ,j-1,k) + sigx(i ,j,k);
1178 Real w3 = sigy(i-1,j-1,k-1) + sigy(i,j-1,k-1) + sigy(i-1,j-1,k) + sigy(i,j-1,k);
1179 Real w4 = sigy(i-1,j ,k-1) + sigy(i,j ,k-1) + sigy(i-1,j ,k) + sigy(i,j ,k);
1189 int i,
int j,
int k,
int ic,
int jc,
int kc) noexcept
1191 Real w1 = sigx(i-1,j-1,k-1) + sigx(i-1,j,k-1) + sigx(i-1,j-1,k) + sigx(i-1,j,k);
1192 Real w2 = sigx(i ,j-1,k-1) + sigx(i ,j,k-1) + sigx(i ,j-1,k) + sigx(i ,j,k);
1193 Real w3 = sigz(i-1,j-1,k-1) + sigz(i,j-1,k-1) + sigz(i-1,j,k-1) + sigz(i,j,k-1);
1194 Real w4 = sigz(i-1,j-1,k ) + sigz(i,j-1,k ) + sigz(i-1,j,k ) + sigz(i,j,k );
1204 int i,
int j,
int k,
int ic,
int jc,
int kc) noexcept
1206 Real w1 = sigy(i-1,j-1,k-1) + sigy(i,j-1,k-1) + sigy(i-1,j-1,k) + sigy(i,j-1,k);
1207 Real w2 = sigy(i-1,j ,k-1) + sigy(i,j ,k-1) + sigy(i-1,j ,k) + sigy(i,j ,k);
1208 Real w3 = sigz(i-1,j-1,k-1) + sigz(i,j-1,k-1) + sigz(i-1,j,k-1) + sigz(i,j,k-1);
1209 Real w4 = sigz(i-1,j-1,k ) + sigz(i,j-1,k ) + sigz(i-1,j,k ) + sigz(i,j,k );
1226 bool i_is_odd = (ic*2 != i);
1227 bool j_is_odd = (jc*2 != j);
1228 bool k_is_odd = (kc*2 != k);
1229 if (i_is_odd && j_is_odd && k_is_odd) {
1231 Real w1 = sigx(i-1,j-1,k-1) + sigx(i-1,j,k-1) + sigx(i-1,j-1,k) + sigx(i-1,j,k);
1232 Real w2 = sigx(i ,j-1,k-1) + sigx(i ,j,k-1) + sigx(i ,j-1,k) + sigx(i ,j,k);
1233 Real w3 = sigy(i-1,j-1,k-1) + sigy(i,j-1,k-1) + sigy(i-1,j-1,k) + sigy(i,j-1,k);
1234 Real w4 = sigy(i-1,j ,k-1) + sigy(i,j ,k-1) + sigy(i-1,j ,k) + sigy(i,j ,k);
1235 Real w5 = sigz(i-1,j-1,k-1) + sigz(i,j-1,k-1) + sigz(i-1,j,k-1) + sigz(i,j,k-1);
1236 Real w6 = sigz(i-1,j-1,k ) + sigz(i,j-1,k ) + sigz(i-1,j,k ) + sigz(i,j,k );
1237 fine(i,j,k) += (w1 *
ha_interp_face_yz(
crse,sigy,sigz,i-1,j ,k ,ic ,jc ,kc ) +
1243 / (w1+w2+w3+w4+w5+w6);
1244 }
else if (j_is_odd && k_is_odd) {
1246 fine(i,j,k) +=
ha_interp_face_yz(
crse,sigy,sigz,i,j,k,ic,jc,kc);
1247 }
else if (i_is_odd && k_is_odd) {
1249 fine(i,j,k) +=
ha_interp_face_xz(
crse,sigx,sigz,i,j,k,ic,jc,kc);
1250 }
else if (i_is_odd && j_is_odd) {
1252 fine(i,j,k) +=
ha_interp_face_xy(
crse,sigx,sigy,i,j,k,ic,jc,kc);
1253 }
else if (i_is_odd) {
1256 }
else if (j_is_odd) {
1259 }
else if (k_is_odd) {
1274 void mlndlap_divu (
int i,
int j,
int k, Array4<Real>
const& rhs, Array4<Real const>
const& vel,
1275 Array4<int const>
const& msk,
1276 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
1277 Box const& nodal_domain,
1278 GpuArray<LinOpBCType, AMREX_SPACEDIM>
const& bclo,
1279 GpuArray<LinOpBCType, AMREX_SPACEDIM>
const& bchi) noexcept
1281 Real facx = Real(0.25)*dxinv[0];
1282 Real facy = Real(0.25)*dxinv[1];
1283 Real facz = Real(0.25)*dxinv[2];
1289 rhs(i,j,k) = Real(0.0);
1292 Real zero_ilo = Real(1.0);
1293 Real zero_ihi = Real(1.0);
1294 Real zero_jlo = Real(1.0);
1295 Real zero_jhi = Real(1.0);
1296 Real zero_klo = Real(1.0);
1297 Real zero_khi = Real(1.0);
1301 if ((bclo[0] == LinOpBCType::Neumann || bclo[0] == LinOpBCType::inflow)
1304 zero_ilo = Real(0.0);
1306 if ((bchi[0] == LinOpBCType::Neumann || bchi[0] == LinOpBCType::inflow)
1309 zero_ihi = Real(0.0);
1311 if ((bclo[1] == LinOpBCType::Neumann || bclo[1] == LinOpBCType::inflow)
1314 zero_jlo = Real(0.0);
1316 if ((bchi[1] == LinOpBCType::Neumann || bchi[1] == LinOpBCType::inflow)
1319 zero_jhi = Real(0.0);
1321 if ((bclo[2] == LinOpBCType::Neumann || bclo[2] == LinOpBCType::inflow)
1324 zero_klo = Real(0.0);
1326 if ((bchi[2] == LinOpBCType::Neumann || bchi[2] == LinOpBCType::inflow)
1329 zero_khi = Real(0.0);
1332 rhs(i,j,k) = facx*(-vel(i-1,j-1,k-1,0)*zero_jlo*zero_klo+vel(i,j-1,k-1,0)*zero_jlo*zero_klo
1333 -vel(i-1,j ,k-1,0)*zero_jhi*zero_klo+vel(i,j ,k-1,0)*zero_jhi*zero_klo
1334 -vel(i-1,j-1,k ,0)*zero_jlo*zero_khi+vel(i,j-1,k ,0)*zero_jlo*zero_khi
1335 -vel(i-1,j ,k ,0)*zero_jhi*zero_khi+vel(i,j ,k ,0)*zero_jhi*zero_khi)
1337 + facy*(-vel(i-1,j-1,k-1,1)*zero_ilo*zero_klo-vel(i,j-1,k-1,1)*zero_ihi*zero_klo
1338 +vel(i-1,j ,k-1,1)*zero_ilo*zero_klo+vel(i,j ,k-1,1)*zero_ihi*zero_klo
1339 -vel(i-1,j-1,k ,1)*zero_ilo*zero_khi-vel(i,j-1,k ,1)*zero_ihi*zero_khi
1340 +vel(i-1,j ,k ,1)*zero_ilo*zero_khi+vel(i,j ,k ,1)*zero_ihi*zero_khi)
1342 + facz*(-vel(i-1,j-1,k-1,2)*zero_ilo*zero_jlo-vel(i,j-1,k-1,2)*zero_ihi*zero_jlo
1343 -vel(i-1,j ,k-1,2)*zero_ilo*zero_jhi-vel(i,j ,k-1,2)*zero_ihi*zero_jhi
1344 +vel(i-1,j-1,k ,2)*zero_ilo*zero_jlo+vel(i,j-1,k ,2)*zero_ihi*zero_jlo
1345 +vel(i-1,j ,k ,2)*zero_ilo*zero_jhi+vel(i,j ,k ,2)*zero_ihi*zero_jhi);
1350 Real
mlndlap_rhcc (
int i,
int j,
int k, Array4<Real const>
const& rhcc,
1351 Array4<int const>
const& msk) noexcept
1357 r = Real(0.125) * (rhcc(i-1,j-1,k-1)+rhcc(i,j-1,k-1)+rhcc(i-1,j,k-1)+rhcc(i,j,k-1) +
1358 rhcc(i-1,j-1,k )+rhcc(i,j-1,k )+rhcc(i-1,j,k )+rhcc(i,j,k ));
1364 void mlndlap_mknewu (
int i,
int j,
int k, Array4<Real>
const& u, Array4<Real const>
const& p,
1365 Array4<Real const>
const& sig, GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
1367 Real facx = Real(0.25)*dxinv[0];
1368 Real facy = Real(0.25)*dxinv[1];
1369 Real facz = Real(0.25)*dxinv[2];
1370 u(i,j,k,0) -= sig(i,j,k)*facx
1371 * (-p(i,j,k )+p(i+1,j,k )-p(i,j+1,k )+p(i+1,j+1,k )
1372 -p(i,j,k+1)+p(i+1,j,k+1)-p(i,j+1,k+1)+p(i+1,j+1,k+1));
1373 u(i,j,k,1) -= sig(i,j,k)*facy
1374 * (-p(i,j,k )-p(i+1,j,k )+p(i,j+1,k )+p(i+1,j+1,k )
1375 -p(i,j,k+1)-p(i+1,j,k+1)+p(i,j+1,k+1)+p(i+1,j+1,k+1));
1376 u(i,j,k,2) -= sig(i,j,k)*facz
1377 * (-p(i,j,k )-p(i+1,j,k )-p(i,j+1,k )-p(i+1,j+1,k )
1378 +p(i,j,k+1)+p(i+1,j,k+1)+p(i,j+1,k+1)+p(i+1,j+1,k+1));
1382 void mlndlap_mknewu_c (
int i,
int j,
int k, Array4<Real>
const& u, Array4<Real const>
const& p,
1383 Real sig, GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
1385 Real facx = Real(0.25)*dxinv[0];
1386 Real facy = Real(0.25)*dxinv[1];
1387 Real facz = Real(0.25)*dxinv[2];
1388 u(i,j,k,0) -= sig*facx
1389 * (-p(i,j,k )+p(i+1,j,k )-p(i,j+1,k )+p(i+1,j+1,k )
1390 -p(i,j,k+1)+p(i+1,j,k+1)-p(i,j+1,k+1)+p(i+1,j+1,k+1));
1391 u(i,j,k,1) -= sig*facy
1392 * (-p(i,j,k )-p(i+1,j,k )+p(i,j+1,k )+p(i+1,j+1,k )
1393 -p(i,j,k+1)-p(i+1,j,k+1)+p(i,j+1,k+1)+p(i+1,j+1,k+1));
1394 u(i,j,k,2) -= sig*facz
1395 * (-p(i,j,k )-p(i+1,j,k )-p(i,j+1,k )-p(i+1,j+1,k )
1396 +p(i,j,k+1)+p(i+1,j,k+1)+p(i,j+1,k+1)+p(i+1,j+1,k+1));
1403 Real Df = Real(0.0);
1404 if (velbx.contains(ii-1,jj-1,kk-1)) {
1405 Df += -facx*vel(ii-1,jj-1,kk-1,0) - facy*vel(ii-1,jj-1,kk-1,1) - facz*vel(ii-1,jj-1,kk-1,2);
1407 if (velbx.contains(ii,jj-1,kk-1)) {
1408 Df += facx*vel(ii,jj-1,kk-1,0) - facy*vel(ii,jj-1,kk-1,1) - facz*vel(ii,jj-1,kk-1,2);
1410 if (velbx.contains(ii-1,jj,kk-1)) {
1411 Df += -facx*vel(ii-1,jj,kk-1,0) + facy*vel(ii-1,jj,kk-1,1) - facz*vel(ii-1,jj,kk-1,2);
1413 if (velbx.contains(ii,jj,kk-1)) {
1414 Df += facx*vel(ii,jj,kk-1,0) + facy*vel(ii,jj,kk-1,1) - facz*vel(ii,jj,kk-1,2);
1416 if (velbx.contains(ii-1,jj-1,kk)) {
1417 Df += -facx*vel(ii-1,jj-1,kk,0) - facy*vel(ii-1,jj-1,kk,1) + facz*vel(ii-1,jj-1,kk,2);
1419 if (velbx.contains(ii,jj-1,kk)) {
1420 Df += facx*vel(ii,jj-1,kk,0) - facy*vel(ii,jj-1,kk,1) + facz*vel(ii,jj-1,kk,2);
1422 if (velbx.contains(ii-1,jj,kk)) {
1423 Df += -facx*vel(ii-1,jj,kk,0) + facy*vel(ii-1,jj,kk,1) + facz*vel(ii-1,jj,kk,2);
1425 if (velbx.contains(ii,jj,kk)) {
1426 Df += facx*vel(ii,jj,kk,0) + facy*vel(ii,jj,kk,1) + facz*vel(ii,jj,kk,2);
1438 const int ii = rr*i;
1439 const int jj = rr*j;
1440 const int kk = rr*k;
1441 if (msk(ii,jj,kk)) {
1442 const Real facx = Real(0.25)*dxinv[0];
1443 const Real facy = Real(0.25)*dxinv[1];
1444 const Real facz = Real(0.25)*dxinv[2];
1446 Real Df = Real(0.0);
1448 const int ilo =
amrex::max(ii-rr+1, fvbx.smallEnd(0));
1449 const int ihi =
amrex::min(ii+rr-1, fvbx.bigEnd (0));
1450 const int jlo =
amrex::max(jj-rr+1, fvbx.smallEnd(1));
1451 const int jhi =
amrex::min(jj+rr-1, fvbx.bigEnd (1));
1452 const int klo =
amrex::max(kk-rr+1, fvbx.smallEnd(2));
1453 const int khi =
amrex::min(kk+rr-1, fvbx.bigEnd (2));
1455 for (
int koff = klo; koff <= khi; ++koff) {
1456 for (
int joff = jlo; joff <= jhi; ++joff) {
1457 for (
int ioff = ilo; ioff <= ihi; ++ioff) {
1461 if (fvbx.strictly_contains(ioff,joff,koff)) {
1462 Df +=
scale * frhs(ioff,joff,koff);
1468 rhs(i,j,k) = Df * (Real(1.0)/
static_cast<Real
>(rr*rr*rr*rr*rr*rr));
1470 rhs(i,j,k) = Real(0.0);
1477 Array4<Real>
const& rhs, Array4<Real const>
const& cc,
1478 Array4<int const>
const& msk) noexcept
1480 const int ii = rr*i;
1481 const int jj = rr*j;
1482 const int kk = rr*k;
1483 if (msk(ii,jj,kk)) {
1484 Real tmp = Real(0.0);
1486 const int ilo =
amrex::max(ii-rr , ccbx.smallEnd(0));
1487 const int ihi =
amrex::min(ii+rr-1, ccbx.bigEnd (0));
1488 const int jlo =
amrex::max(jj-rr , ccbx.smallEnd(1));
1489 const int jhi =
amrex::min(jj+rr-1, ccbx.bigEnd (1));
1490 const int klo =
amrex::max(kk-rr , ccbx.smallEnd(2));
1491 const int khi =
amrex::min(kk+rr-1, ccbx.bigEnd (2));
1493 for (
int koff = klo; koff <= khi; ++koff) {
1494 for (
int joff = jlo; joff <= jhi; ++joff) {
1495 for (
int ioff = ilo; ioff <= ihi; ++ioff) {
1496 Real
scale = (
static_cast<Real
>(rr)-
std::abs(
static_cast<Real
>(ioff-ii)+Real(0.5)))
1497 * (
static_cast<Real
>(rr)-
std::abs(
static_cast<Real
>(joff-jj)+Real(0.5)))
1498 * (
static_cast<Real
>(rr)-
std::abs(
static_cast<Real
>(koff-kk)+Real(0.5)));
1499 tmp += cc(ioff,joff,koff) *
scale;
1502 rhs(i,j,k) += tmp * (Real(1.0)/Real(rr*rr*rr*rr*rr*rr));
1511 Real val = Real(1.0);
1516 if ((i == ndlo.x && ( bclo[0] == LinOpBCType::Neumann ||
1517 bclo[0] == LinOpBCType::inflow)) ||
1518 (i == ndhi.x && ( bchi[0] == LinOpBCType::Neumann ||
1519 bchi[0] == LinOpBCType::inflow))) {
1523 if ((j == ndlo.y && ( bclo[1] == LinOpBCType::Neumann ||
1524 bclo[1] == LinOpBCType::inflow)) ||
1525 (j == ndhi.y && ( bchi[1] == LinOpBCType::Neumann ||
1526 bchi[1] == LinOpBCType::inflow))) {
1530 if ((k == ndlo.z && ( bclo[2] == LinOpBCType::Neumann ||
1531 bclo[2] == LinOpBCType::inflow)) ||
1532 (k == ndhi.z && ( bchi[2] == LinOpBCType::Neumann ||
1533 bchi[2] == LinOpBCType::inflow))) {
1546 Box const& ccdom_p,
Box const& veldom,
Box const& nddom,
1550 using namespace nodelap_detail;
1553 Real facx = Real(0.25) * dxinv[0];
1554 Real facy = Real(0.25) * dxinv[1];
1555 Real facz = Real(0.25) * dxinv[2];
1556 Real tmp = fc(i,j,k);
1561 if (ccmsk(i-1,j-1,k-1) ==
crse_cell && veldom.contains(i-1,j-1,k-1)) {
1562 tmp += -facx*vel(i-1,j-1,k-1,0) - facy*vel(i-1,j-1,k-1,1) - facz*vel(i-1,j-1,k-1,2);
1563 if (rhcc && ccdom_p.contains(i-1,j-1,k-1)) {
1564 tmp += Real(0.125) * rhcc(i-1,j-1,k-1);
1568 if (ccmsk(i,j-1,k-1) ==
crse_cell && veldom.contains(i,j-1,k-1)) {
1569 tmp += facx*vel(i,j-1,k-1,0) - facy*vel(i,j-1,k-1,1) - facz*vel(i,j-1,k-1,2);
1570 if (rhcc && ccdom_p.contains(i,j-1,k-1)) {
1571 tmp += Real(0.125) * rhcc(i,j-1,k-1);
1575 if (ccmsk(i-1,j,k-1) ==
crse_cell && veldom.contains(i-1,j,k-1)) {
1576 tmp += -facx*vel(i-1,j,k-1,0) + facy*vel(i-1,j,k-1,1) - facz*vel(i-1,j,k-1,2);
1577 if (rhcc && ccdom_p.contains(i-1,j,k-1)) {
1578 tmp += Real(0.125) * rhcc(i-1,j,k-1);
1582 if (ccmsk(i,j,k-1) ==
crse_cell && veldom.contains(i,j,k-1)) {
1583 tmp += facx*vel(i,j,k-1,0) + facy*vel(i,j,k-1,1) - facz*vel(i,j,k-1,2);
1584 if (rhcc && ccdom_p.contains(i,j,k-1)) {
1585 tmp += Real(0.125) * rhcc(i,j,k-1);
1589 if (ccmsk(i-1,j-1,k) ==
crse_cell && veldom.contains(i-1,j-1,k)) {
1590 tmp += -facx*vel(i-1,j-1,k,0) - facy*vel(i-1,j-1,k,1) + facz*vel(i-1,j-1,k,2);
1591 if (rhcc && ccdom_p.contains(i-1,j-1,k)) {
1592 tmp += Real(0.125) * rhcc(i-1,j-1,k);
1596 if (ccmsk(i,j-1,k) ==
crse_cell && veldom.contains(i,j-1,k)) {
1597 tmp += facx*vel(i,j-1,k,0) - facy*vel(i,j-1,k,1) + facz*vel(i,j-1,k,2);
1598 if (rhcc && ccdom_p.contains(i,j-1,k)) {
1599 tmp += Real(0.125) * rhcc(i,j-1,k);
1603 if (ccmsk(i-1,j,k) ==
crse_cell && veldom.contains(i-1,j,k)) {
1604 tmp += -facx*vel(i-1,j,k,0) + facy*vel(i-1,j,k,1) + facz*vel(i-1,j,k,2);
1605 if (rhcc && ccdom_p.contains(i-1,j,k)) {
1606 tmp += Real(0.125) * rhcc(i-1,j,k);
1610 if (ccmsk(i,j,k) ==
crse_cell && veldom.contains(i,j,k)) {
1611 tmp += facx*vel(i,j,k,0) + facy*vel(i,j,k,1) + facz*vel(i,j,k,2);
1612 if (rhcc && ccdom_p.contains(i,j,k)) {
1613 tmp += Real(0.125) * rhcc(i,j,k);
1617 rhs(i,j,k) = tmp *
neumann_scale(i, j, k, nddom, bclo, bchi);
1627 Array4<Real const>
const& rhs, Array4<int const>
const& msk,
1628 Box const& nddom, GpuArray<LinOpBCType,AMREX_SPACEDIM>
const& bclo,
1629 GpuArray<LinOpBCType,AMREX_SPACEDIM>
const& bchi,
1630 bool neumann_doubling) noexcept
1632 if ( msk(i-1,j-1,k-1) == 0 ||
1633 msk(i ,j-1,k-1) == 0 ||
1634 msk(i-1,j ,k-1) == 0 ||
1635 msk(i ,j ,k-1) == 0 ||
1636 msk(i-1,j-1,k ) == 0 ||
1637 msk(i ,j-1,k ) == 0 ||
1638 msk(i-1,j ,k ) == 0 ||
1639 msk(i ,j ,k ) == 0 )
1641 Real fac = Real(1.0);
1642 if (neumann_doubling) {
1645 if ((i == ndlo.x && ( bclo[0] == LinOpBCType::Neumann ||
1646 bclo[0] == LinOpBCType::inflow)) ||
1647 (i == ndhi.x && ( bchi[0] == LinOpBCType::Neumann ||
1648 bchi[0] == LinOpBCType::inflow))) {
1651 if ((j == ndlo.y && ( bclo[1] == LinOpBCType::Neumann ||
1652 bclo[1] == LinOpBCType::inflow)) ||
1653 (j == ndhi.y && ( bchi[1] == LinOpBCType::Neumann ||
1654 bchi[1] == LinOpBCType::inflow))) {
1657 if ((k == ndlo.z && ( bclo[2] == LinOpBCType::Neumann ||
1658 bclo[2] == LinOpBCType::inflow)) ||
1659 (k == ndhi.z && ( bchi[2] == LinOpBCType::Neumann ||
1660 bchi[2] == LinOpBCType::inflow))) {
1664 resid(i,j,k) = (rhs(i,j,k) - resid(i,j,k)) * fac;
1666 resid(i,j,k) = Real(0.);
1674 template <
typename P,
typename S>
1677 int i,
int j,
int k, Real facx, Real facy, Real facz,
1680 Real Ax = Real(0.0);
1681 if (pred(i-1,j-1,k-1)) {
1682 Ax += sig(i-1,j-1,k-1)*(facx*(Real(4.)*(phi(i-1,j ,k )-phi(i ,j ,k ))
1683 +Real(2.)*(phi(i-1,j-1,k )-phi(i ,j-1,k ))
1684 +Real(2.)*(phi(i-1,j ,k-1)-phi(i ,j ,k-1))
1685 + (phi(i-1,j-1,k-1)-phi(i ,j-1,k-1)))
1686 + facy*(Real(4.)*(phi(i ,j-1,k )-phi(i ,j ,k ))
1687 +Real(2.)*(phi(i-1,j-1,k )-phi(i-1,j ,k ))
1688 +Real(2.)*(phi(i ,j-1,k-1)-phi(i ,j ,k-1))
1689 + (phi(i-1,j-1,k-1)-phi(i-1,j ,k-1)))
1690 + facz*(Real(4.)*(phi(i ,j ,k-1)-phi(i ,j ,k ))
1691 +Real(2.)*(phi(i-1,j ,k-1)-phi(i-1,j ,k ))
1692 +Real(2.)*(phi(i ,j-1,k-1)-phi(i ,j-1,k ))
1693 + (phi(i-1,j-1,k-1)-phi(i-1,j-1,k ))));
1695 if (pred(i,j-1,k-1)) {
1696 Ax += sig(i,j-1,k-1)*(facx*(Real(4.)*(phi(i+1,j ,k )-phi(i ,j ,k ))
1697 +Real(2.)*(phi(i+1,j-1,k )-phi(i ,j-1,k ))
1698 +Real(2.)*(phi(i+1,j ,k-1)-phi(i ,j ,k-1))
1699 + (phi(i+1,j-1,k-1)-phi(i ,j-1,k-1)))
1700 + facy*(Real(4.)*(phi(i ,j-1,k )-phi(i ,j ,k ))
1701 +Real(2.)*(phi(i+1,j-1,k )-phi(i+1,j ,k ))
1702 +Real(2.)*(phi(i ,j-1,k-1)-phi(i ,j ,k-1))
1703 + (phi(i+1,j-1,k-1)-phi(i+1,j ,k-1)))
1704 + facz*(Real(4.)*(phi(i ,j ,k-1)-phi(i ,j ,k ))
1705 +Real(2.)*(phi(i+1,j ,k-1)-phi(i+1,j ,k ))
1706 +Real(2.)*(phi(i ,j-1,k-1)-phi(i ,j-1,k ))
1707 + (phi(i+1,j-1,k-1)-phi(i+1,j-1,k ))));
1709 if (pred(i-1,j,k-1)) {
1710 Ax += sig(i-1,j,k-1)*(facx*(Real(4.)*(phi(i-1,j ,k )-phi(i ,j ,k ))
1711 +Real(2.)*(phi(i-1,j+1,k )-phi(i ,j+1,k ))
1712 +Real(2.)*(phi(i-1,j ,k-1)-phi(i ,j ,k-1))
1713 + (phi(i-1,j+1,k-1)-phi(i ,j+1,k-1)))
1714 + facy*(Real(4.)*(phi(i ,j+1,k )-phi(i ,j ,k ))
1715 +Real(2.)*(phi(i-1,j+1,k )-phi(i-1,j ,k ))
1716 +Real(2.)*(phi(i ,j+1,k-1)-phi(i ,j ,k-1))
1717 + (phi(i-1,j+1,k-1)-phi(i-1,j ,k-1)))
1718 + facz*(Real(4.)*(phi(i ,j ,k-1)-phi(i ,j ,k ))
1719 +Real(2.)*(phi(i-1,j ,k-1)-phi(i-1,j ,k ))
1720 +Real(2.)*(phi(i ,j+1,k-1)-phi(i ,j+1,k ))
1721 + (phi(i-1,j+1,k-1)-phi(i-1,j+1,k ))));
1723 if (pred(i,j,k-1)) {
1724 Ax += sig(i,j,k-1)*(facx*(Real(4.)*(phi(i+1,j ,k )-phi(i ,j ,k ))
1725 +Real(2.)*(phi(i+1,j+1,k )-phi(i ,j+1,k ))
1726 +Real(2.)*(phi(i+1,j ,k-1)-phi(i ,j ,k-1))
1727 + (phi(i+1,j+1,k-1)-phi(i ,j+1,k-1)))
1728 + facy*(Real(4.)*(phi(i ,j+1,k )-phi(i ,j ,k ))
1729 +Real(2.)*(phi(i+1,j+1,k )-phi(i+1,j ,k ))
1730 +Real(2.)*(phi(i ,j+1,k-1)-phi(i ,j ,k-1))
1731 + (phi(i+1,j+1,k-1)-phi(i+1,j ,k-1)))
1732 + facz*(Real(4.)*(phi(i ,j ,k-1)-phi(i ,j ,k ))
1733 +Real(2.)*(phi(i+1,j ,k-1)-phi(i+1,j ,k ))
1734 +Real(2.)*(phi(i ,j+1,k-1)-phi(i ,j+1,k ))
1735 + (phi(i+1,j+1,k-1)-phi(i+1,j+1,k ))));
1737 if (pred(i-1,j-1,k)) {
1738 Ax += sig(i-1,j-1,k)*(facx*(Real(4.)*(phi(i-1,j ,k )-phi(i ,j ,k ))
1739 +Real(2.)*(phi(i-1,j-1,k )-phi(i ,j-1,k ))
1740 +Real(2.)*(phi(i-1,j ,k+1)-phi(i ,j ,k+1))
1741 + (phi(i-1,j-1,k+1)-phi(i ,j-1,k+1)))
1742 + facy*(Real(4.)*(phi(i ,j-1,k )-phi(i ,j ,k ))
1743 +Real(2.)*(phi(i-1,j-1,k )-phi(i-1,j ,k ))
1744 +Real(2.)*(phi(i ,j-1,k+1)-phi(i ,j ,k+1))
1745 + (phi(i-1,j-1,k+1)-phi(i-1,j ,k+1)))
1746 + facz*(Real(4.)*(phi(i ,j ,k+1)-phi(i ,j ,k ))
1747 +Real(2.)*(phi(i-1,j ,k+1)-phi(i-1,j ,k ))
1748 +Real(2.)*(phi(i ,j-1,k+1)-phi(i ,j-1,k ))
1749 + (phi(i-1,j-1,k+1)-phi(i-1,j-1,k ))));
1751 if (pred(i,j-1,k)) {
1752 Ax += sig(i,j-1,k)*(facx*(Real(4.)*(phi(i+1,j ,k )-phi(i ,j ,k ))
1753 +Real(2.)*(phi(i+1,j-1,k )-phi(i ,j-1,k ))
1754 +Real(2.)*(phi(i+1,j ,k+1)-phi(i ,j ,k+1))
1755 + (phi(i+1,j-1,k+1)-phi(i ,j-1,k+1)))
1756 + facy*(Real(4.)*(phi(i ,j-1,k )-phi(i ,j ,k ))
1757 +Real(2.)*(phi(i+1,j-1,k )-phi(i+1,j ,k ))
1758 +Real(2.)*(phi(i ,j-1,k+1)-phi(i ,j ,k+1))
1759 + (phi(i+1,j-1,k+1)-phi(i+1,j ,k+1)))
1760 + facz*(Real(4.)*(phi(i ,j ,k+1)-phi(i ,j ,k ))
1761 +Real(2.)*(phi(i+1,j ,k+1)-phi(i+1,j ,k ))
1762 +Real(2.)*(phi(i ,j-1,k+1)-phi(i ,j-1,k ))
1763 + (phi(i+1,j-1,k+1)-phi(i+1,j-1,k ))));
1765 if (pred(i-1,j,k)) {
1766 Ax += sig(i-1,j,k)*(facx*(Real(4.)*(phi(i-1,j ,k )-phi(i ,j ,k ))
1767 +Real(2.)*(phi(i-1,j+1,k )-phi(i ,j+1,k ))
1768 +Real(2.)*(phi(i-1,j ,k+1)-phi(i ,j ,k+1))
1769 + (phi(i-1,j+1,k+1)-phi(i ,j+1,k+1)))
1770 + facy*(Real(4.)*(phi(i ,j+1,k )-phi(i ,j ,k ))
1771 +Real(2.)*(phi(i-1,j+1,k )-phi(i-1,j ,k ))
1772 +Real(2.)*(phi(i ,j+1,k+1)-phi(i ,j ,k+1))
1773 + (phi(i-1,j+1,k+1)-phi(i-1,j ,k+1)))
1774 + facz*(Real(4.)*(phi(i ,j ,k+1)-phi(i ,j ,k ))
1775 +Real(2.)*(phi(i-1,j ,k+1)-phi(i-1,j ,k ))
1776 +Real(2.)*(phi(i ,j+1,k+1)-phi(i ,j+1,k ))
1777 + (phi(i-1,j+1,k+1)-phi(i-1,j+1,k ))));
1780 Ax += sig(i,j,k)*(facx*(Real(4.)*(phi(i+1,j ,k )-phi(i ,j ,k ))
1781 +Real(2.)*(phi(i+1,j+1,k )-phi(i ,j+1,k ))
1782 +Real(2.)*(phi(i+1,j ,k+1)-phi(i ,j ,k+1))
1783 + (phi(i+1,j+1,k+1)-phi(i ,j+1,k+1)))
1784 + facy*(Real(4.)*(phi(i ,j+1,k )-phi(i ,j ,k ))
1785 +Real(2.)*(phi(i+1,j+1,k )-phi(i+1,j ,k ))
1786 +Real(2.)*(phi(i ,j+1,k+1)-phi(i ,j ,k+1))
1787 + (phi(i+1,j+1,k+1)-phi(i+1,j ,k+1)))
1788 + facz*(Real(4.)*(phi(i ,j ,k+1)-phi(i ,j ,k ))
1789 +Real(2.)*(phi(i+1,j ,k+1)-phi(i+1,j ,k ))
1790 +Real(2.)*(phi(i ,j+1,k+1)-phi(i ,j+1,k ))
1791 + (phi(i+1,j+1,k+1)-phi(i+1,j+1,k ))));
1796 template <
int rr,
typename S>
1799 int i,
int j,
int k,
Box const& ndbx,
Box const& ccbx,
1806 const int ii = rr*i;
1807 const int jj = rr*j;
1808 const int kk = rr*k;
1809 if (msk(ii,jj,kk)) {
1810 Real facx = Real(1./36.)*dxinv[0]*dxinv[0];
1811 Real facy = Real(1./36.)*dxinv[1]*dxinv[1];
1812 Real facz = Real(1./36.)*dxinv[2]*dxinv[2];
1814 auto is_fine = [&ccbx] (
int ix,
int iy,
int iz) ->
bool {
1815 return ccbx.contains(
ix,
iy,
iz);
1818 Real Df = Real(0.0);
1820 const int ilo =
amrex::max(ii-rr+1, ndbx.smallEnd(0));
1821 const int ihi =
amrex::min(ii+rr-1, ndbx.bigEnd (0));
1822 const int jlo =
amrex::max(jj-rr+1, ndbx.smallEnd(1));
1823 const int jhi =
amrex::min(jj+rr-1, ndbx.bigEnd (1));
1824 const int klo =
amrex::max(kk-rr+1, ndbx.smallEnd(2));
1825 const int khi =
amrex::min(kk+rr-1, ndbx.bigEnd (2));
1827 for (
int koff = klo; koff <= khi; ++koff) {
1828 for (
int joff = jlo; joff <= jhi; ++joff) {
1829 for (
int ioff = ilo; ioff <= ihi; ++ioff) {
1833 if (ndbx.strictly_contains(ioff,joff,koff)) {
1834 Df +=
scale * (rhs(ioff,joff,koff)-res(ioff,joff,koff));
1837 (is_fine, sig, ioff, joff, koff, facx, facy, facz, phi);
1841 f(i,j,k) = Df * (Real(1.0)/
static_cast<Real
>(rr*rr*rr*rr*rr*rr));
1843 f(i,j,k) = Real(0.0);
1855 mlndlap_Ax_fine_contrib_doit<rr>
1856 ([&sig] (
int ix,
int iy,
int iz) -> Real
const& {
return sig(
ix,
iy,
iz); },
1857 i,j,k,ndbx,ccbx,
f,res,rhs,phi,msk,dxinv);
1868 mlndlap_Ax_fine_contrib_doit<rr>
1869 ([=] (
int,
int,
int) -> Real {
return sig; },
1870 i,j,k,ndbx,ccbx,
f,res,rhs,phi,msk,dxinv);
1880 Box const& ccdom_p,
Box const& nddom,
1883 bool neumann_doubling) noexcept
1885 using namespace nodelap_detail;
1888 Real facx = Real(1./36.)*dxinv[0]*dxinv[0];
1889 Real facy = Real(1./36.)*dxinv[1]*dxinv[1];
1890 Real facz = Real(1./36.)*dxinv[2]*dxinv[2];
1894 return ccdom_p.contains(
ix,
iy,
iz)
1897 [&sig] (
int ix,
int iy,
int iz) -> Real
const&
1901 i, j, k, facx, facy, facz, phi);
1903 Real
const ns = (neumann_doubling) ?
neumann_scale(i,j,k,nddom,bclo,bchi) : Real(1.0);
1904 res(i,j,k) = rhs(i,j,k) - Ax*ns;
1915 Box const& ccdom_p,
Box const& nddom,
1918 bool neumann_doubling) noexcept
1920 using namespace nodelap_detail;
1923 Real facx = Real(1./36.)*dxinv[0]*dxinv[0];
1924 Real facy = Real(1./36.)*dxinv[1]*dxinv[1];
1925 Real facz = Real(1./36.)*dxinv[2]*dxinv[2];
1929 return ccdom_p.contains(
ix,
iy,
iz)
1936 i, j, k, facx, facy, facz, phi);
1938 Real
const ns = (neumann_doubling) ?
neumann_scale(i,j,k,nddom,bclo,bchi) : Real(1.0);
1939 res(i,j,k) = rhs(i,j,k) - Ax*ns;
1947 namespace nodelap_detail {
1966 using namespace nodelap_detail;
1968 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
1969 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
1970 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
1971 Real fxyz = facx + facy + facz;
1972 Real fmx2y2z = -facx + Real(2.0)*facy + Real(2.0)*facz;
1973 Real f2xmy2z = Real(2.0)*facx - facy + Real(2.0)*facz;
1974 Real f2x2ymz = Real(2.0)*facx + Real(2.0)*facy - facz;
1975 Real f4xm2ym2z = Real(4.0)*facx - Real(2.0)*facy - Real(2.0)*facz;
1976 Real fm2x4ym2z = -Real(2.0)*facx + Real(4.0)*facy - Real(2.0)*facz;
1977 Real fm2xm2y4z = -Real(2.0)*facx - Real(2.0)*facy + Real(4.0)*facz;
1982 sten(i,j,k,
ist_p00) = f4xm2ym2z * (sig(i,j-1,k-1)+sig(i,j,k-1)+sig(i,j-1,k)+sig(i,j,k));
1986 sten(i,j,k,
ist_0p0) = fm2x4ym2z * (sig(i-1,j,k-1)+sig(i,j,k-1)+sig(i-1,j,k)+sig(i,j,k));
1990 sten(i,j,k,
ist_00p) = fm2xm2y4z * (sig(i-1,j-1,k)+sig(i,j-1,k)+sig(i-1,j,k)+sig(i,j,k));
1994 sten(i,j,k,
ist_pp0) = f2x2ymz * (sig(i,j,k-1)+sig(i,j,k));
2000 sten(i,j,k,
ist_p0p) = f2xmy2z * (sig(i,j-1,k)+sig(i,j,k));
2006 sten(i,j,k,
ist_0pp) = fmx2y2z * (sig(i-1,j,k)+sig(i,j,k));
2012 sten(i,j,k,
ist_ppp) = fxyz * sig(i,j,k);
2026 using namespace nodelap_detail;
2041 sten(i,j,k,
ist_inv) = Real(1.0) /
2059 Array4<Real const>
const& fsten) noexcept
2061 using namespace nodelap_detail;
2063 auto interp_from_mmm_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2094 auto interp_from_pmm_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2124 auto interp_from_mpm_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2154 auto interp_from_ppm_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2184 auto interp_from_mmp_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2214 auto interp_from_pmp_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2244 auto interp_from_mpp_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2274 auto interp_from_ppp_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2304 auto interp_from_0mm_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2313 Real wmm =
std::abs(fsten(i_ ,j_-1,k_-1,
ist_0pp)) * (Real(1.) + w1m + w2m);
2314 Real wpm =
std::abs(fsten(i_ ,j_ ,k_-1,
ist_0pp)) * (Real(1.) + w1p + w2m);
2315 Real wmp =
std::abs(fsten(i_ ,j_-1,k_ ,
ist_0pp)) * (Real(1.) + w1m + w2p);
2316 Real wpp =
std::abs(fsten(i_ ,j_ ,k_ ,
ist_0pp)) * (Real(1.) + w1p + w2p);
2317 return wmm / (wmm+wpm+wmp+wpp+
eps);
2320 auto interp_from_0mp_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2329 Real wmm =
std::abs(fsten(i_ ,j_-1,k_-1,
ist_0pp)) * (Real(1.) + w1m + w2m);
2330 Real wpm =
std::abs(fsten(i_ ,j_ ,k_-1,
ist_0pp)) * (Real(1.) + w1p + w2m);
2331 Real wmp =
std::abs(fsten(i_ ,j_-1,k_ ,
ist_0pp)) * (Real(1.) + w1m + w2p);
2332 Real wpp =
std::abs(fsten(i_ ,j_ ,k_ ,
ist_0pp)) * (Real(1.) + w1p + w2p);
2333 return wmp / (wmm+wpm+wmp+wpp+
eps);
2336 auto interp_from_0pm_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2345 Real wmm =
std::abs(fsten(i_ ,j_-1,k_-1,
ist_0pp)) * (Real(1.) + w1m + w2m);
2346 Real wpm =
std::abs(fsten(i_ ,j_ ,k_-1,
ist_0pp)) * (Real(1.) + w1p + w2m);
2347 Real wmp =
std::abs(fsten(i_ ,j_-1,k_ ,
ist_0pp)) * (Real(1.) + w1m + w2p);
2348 Real wpp =
std::abs(fsten(i_ ,j_ ,k_ ,
ist_0pp)) * (Real(1.) + w1p + w2p);
2349 return wpm / (wmm+wpm+wmp+wpp+
eps);
2352 auto interp_from_0pp_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2361 Real wmm =
std::abs(fsten(i_ ,j_-1,k_-1,
ist_0pp)) * (Real(1.) + w1m + w2m);
2362 Real wpm =
std::abs(fsten(i_ ,j_ ,k_-1,
ist_0pp)) * (Real(1.) + w1p + w2m);
2363 Real wmp =
std::abs(fsten(i_ ,j_-1,k_ ,
ist_0pp)) * (Real(1.) + w1m + w2p);
2364 Real wpp =
std::abs(fsten(i_ ,j_ ,k_ ,
ist_0pp)) * (Real(1.) + w1p + w2p);
2365 return wpp / (wmm+wpm+wmp+wpp+
eps);
2368 auto interp_from_m0m_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2377 Real wmm =
std::abs(fsten(i_-1,j_ ,k_-1,
ist_p0p)) * (Real(1.) + w1m + w2m);
2378 Real wpm =
std::abs(fsten(i_ ,j_ ,k_-1,
ist_p0p)) * (Real(1.) + w1p + w2m);
2379 Real wmp =
std::abs(fsten(i_-1,j_ ,k_ ,
ist_p0p)) * (Real(1.) + w1m + w2p);
2380 Real wpp =
std::abs(fsten(i_ ,j_ ,k_ ,
ist_p0p)) * (Real(1.) + w1p + w2p);
2381 return wmm / (wmm+wpm+wmp+wpp+
eps);
2384 auto interp_from_p0m_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2393 Real wmm =
std::abs(fsten(i_-1,j_ ,k_-1,
ist_p0p)) * (Real(1.) + w1m + w2m);
2394 Real wpm =
std::abs(fsten(i_ ,j_ ,k_-1,
ist_p0p)) * (Real(1.) + w1p + w2m);
2395 Real wmp =
std::abs(fsten(i_-1,j_ ,k_ ,
ist_p0p)) * (Real(1.) + w1m + w2p);
2396 Real wpp =
std::abs(fsten(i_ ,j_ ,k_ ,
ist_p0p)) * (Real(1.) + w1p + w2p);
2397 return wpm / (wmm+wpm+wmp+wpp+
eps);
2400 auto interp_from_m0p_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2409 Real wmm =
std::abs(fsten(i_-1,j_ ,k_-1,
ist_p0p)) * (Real(1.) + w1m + w2m);
2410 Real wpm =
std::abs(fsten(i_ ,j_ ,k_-1,
ist_p0p)) * (Real(1.) + w1p + w2m);
2411 Real wmp =
std::abs(fsten(i_-1,j_ ,k_ ,
ist_p0p)) * (Real(1.) + w1m + w2p);
2412 Real wpp =
std::abs(fsten(i_ ,j_ ,k_ ,
ist_p0p)) * (Real(1.) + w1p + w2p);
2413 return wmp / (wmm+wpm+wmp+wpp+
eps);
2416 auto interp_from_p0p_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2425 Real wmm =
std::abs(fsten(i_-1,j_ ,k_-1,
ist_p0p)) * (Real(1.) + w1m + w2m);
2426 Real wpm =
std::abs(fsten(i_ ,j_ ,k_-1,
ist_p0p)) * (Real(1.) + w1p + w2m);
2427 Real wmp =
std::abs(fsten(i_-1,j_ ,k_ ,
ist_p0p)) * (Real(1.) + w1m + w2p);
2428 Real wpp =
std::abs(fsten(i_ ,j_ ,k_ ,
ist_p0p)) * (Real(1.) + w1p + w2p);
2429 return wpp / (wmm+wpm+wmp+wpp+
eps);
2432 auto interp_from_mm0_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2441 Real wmm =
std::abs(fsten(i_-1,j_-1,k_ ,
ist_pp0)) * (Real(1.) + w1m + w2m);
2442 Real wpm =
std::abs(fsten(i_ ,j_-1,k_ ,
ist_pp0)) * (Real(1.) + w1p + w2m);
2443 Real wmp =
std::abs(fsten(i_-1,j_ ,k_ ,
ist_pp0)) * (Real(1.) + w1m + w2p);
2444 Real wpp =
std::abs(fsten(i_ ,j_ ,k_ ,
ist_pp0)) * (Real(1.) + w1p + w2p);
2445 return wmm / (wmm+wpm+wmp+wpp+
eps);
2448 auto interp_from_mp0_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2457 Real wmm =
std::abs(fsten(i_-1,j_-1,k_ ,
ist_pp0)) * (Real(1.) + w1m + w2m);
2458 Real wpm =
std::abs(fsten(i_ ,j_-1,k_ ,
ist_pp0)) * (Real(1.) + w1p + w2m);
2459 Real wmp =
std::abs(fsten(i_-1,j_ ,k_ ,
ist_pp0)) * (Real(1.) + w1m + w2p);
2460 Real wpp =
std::abs(fsten(i_ ,j_ ,k_ ,
ist_pp0)) * (Real(1.) + w1p + w2p);
2461 return wmp / (wmm+wpm+wmp+wpp+
eps);
2464 auto interp_from_pm0_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2473 Real wmm =
std::abs(fsten(i_-1,j_-1,k_ ,
ist_pp0)) * (Real(1.) + w1m + w2m);
2474 Real wpm =
std::abs(fsten(i_ ,j_-1,k_ ,
ist_pp0)) * (Real(1.) + w1p + w2m);
2475 Real wmp =
std::abs(fsten(i_-1,j_ ,k_ ,
ist_pp0)) * (Real(1.) + w1m + w2p);
2476 Real wpp =
std::abs(fsten(i_ ,j_ ,k_ ,
ist_pp0)) * (Real(1.) + w1p + w2p);
2477 return wpm / (wmm+wpm+wmp+wpp+
eps);
2480 auto interp_from_pp0_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2489 Real wmm =
std::abs(fsten(i_-1,j_-1,k_ ,
ist_pp0)) * (Real(1.) + w1m + w2m);
2490 Real wpm =
std::abs(fsten(i_ ,j_-1,k_ ,
ist_pp0)) * (Real(1.) + w1p + w2m);
2491 Real wmp =
std::abs(fsten(i_-1,j_ ,k_ ,
ist_pp0)) * (Real(1.) + w1m + w2p);
2492 Real wpp =
std::abs(fsten(i_ ,j_ ,k_ ,
ist_pp0)) * (Real(1.) + w1p + w2p);
2493 return wpp / (wmm+wpm+wmp+wpp+
eps);
2496 auto interp_from_00m_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2499 if (w1 == Real(0.) && w2 == Real(0.)) {
2502 return w1 / (w1+w2);
2506 auto interp_from_00p_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2509 if (w1 == Real(0.) && w2 == Real(0.)) {
2512 return w2 / (w1+w2);
2516 auto interp_from_0m0_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2519 if (w1 == Real(0.) && w2 == Real(0.)) {
2522 return w1 / (w1+w2);
2526 auto interp_from_0p0_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2529 if (w1 == Real(0.) && w2 == Real(0.)) {
2532 return w2 / (w1+w2);
2536 auto interp_from_m00_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2539 if (w1 == Real(0.) && w2 == Real(0.)) {
2542 return w1 / (w1+w2);
2546 auto interp_from_p00_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2549 if (w1 == Real(0.) && w2 == Real(0.)) {
2552 return w2 / (w1+w2);
2556 auto Ammm = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2557 return fsten(i_-1,j_-1,k_-1,
ist_ppp);
2561 auto A0mm = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2562 return fsten(i_ ,j_-1,k_-1,
ist_0pp);
2565 auto Apmm = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2566 return fsten(i_ ,j_-1,k_-1,
ist_ppp);
2569 auto Am0m = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2570 return fsten(i_-1,j_ ,k_-1,
ist_p0p);
2573 auto A00m = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2574 return fsten(i_ ,j_ ,k_-1,
ist_00p);
2577 auto Ap0m = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2578 return fsten(i_ ,j_ ,k_-1,
ist_p0p);
2581 auto Ampm = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2582 return fsten(i_-1,j_ ,k_-1,
ist_ppp);
2585 auto A0pm = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2586 return fsten(i_ ,j_ ,k_-1,
ist_0pp);
2589 auto Appm = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2590 return fsten(i_ ,j_ ,k_-1,
ist_ppp);
2593 auto Amm0 = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2594 return fsten(i_-1,j_-1,k_ ,
ist_pp0);
2597 auto A0m0 = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2598 return fsten(i_ ,j_-1,k_ ,
ist_0p0);
2601 auto Apm0 = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2602 return fsten(i_ ,j_-1,k_ ,
ist_pp0);
2605 auto Am00 = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2606 return fsten(i_-1,j_ ,k_ ,
ist_p00);
2609 auto A000 = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2610 return fsten(i_ ,j_ ,k_ ,
ist_000);
2613 auto Ap00 = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2614 return fsten(i_ ,j_ ,k_ ,
ist_p00);
2617 auto Amp0 = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2618 return fsten(i_-1,j_ ,k_ ,
ist_pp0);
2621 auto A0p0 = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2622 return fsten(i_ ,j_ ,k_ ,
ist_0p0);
2625 auto App0 = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2626 return fsten(i_ ,j_ ,k_ ,
ist_pp0);
2629 auto Ammp = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2630 return fsten(i_-1,j_-1,k_ ,
ist_ppp);
2633 auto A0mp = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2634 return fsten(i_ ,j_-1,k_ ,
ist_0pp);
2637 auto Apmp = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2638 return fsten(i_ ,j_-1,k_ ,
ist_ppp);
2641 auto Am0p = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2642 return fsten(i_-1,j_ ,k_ ,
ist_p0p);
2645 auto A00p = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2646 return fsten(i_ ,j_ ,k_ ,
ist_00p);
2649 auto Ap0p = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2650 return fsten(i_ ,j_ ,k_ ,
ist_p0p);
2653 auto Ampp = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2654 return fsten(i_-1,j_ ,k_ ,
ist_ppp);
2657 auto A0pp = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2658 return fsten(i_ ,j_ ,k_ ,
ist_0pp);
2661 auto Appp = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2662 return fsten(i_ ,j_ ,k_ ,
ist_ppp);
2665 auto restrict_from_mmm_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
2696 auto restrict_from_0mm_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
2705 Real wmm =
std::abs(fsten(ii_,jj_-2,kk_-2,
ist_0pp)) * (Real(1.) + w1m + w2m);
2706 Real wpm =
std::abs(fsten(ii_,jj_-1,kk_-2,
ist_0pp)) * (Real(1.) + w1p + w2m);
2707 Real wmp =
std::abs(fsten(ii_,jj_-2,kk_-1,
ist_0pp)) * (Real(1.) + w1m + w2p);
2708 Real wpp =
std::abs(fsten(ii_,jj_-1,kk_-1,
ist_0pp)) * (Real(1.) + w1p + w2p);
2709 return wpp / (wmm+wpm+wmp+wpp+
eps);
2712 auto restrict_from_pmm_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
2742 auto restrict_from_m0m_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
2751 Real wmm =
std::abs(fsten(ii_-2,jj_,kk_-2,
ist_p0p)) * (Real(1.) + w1m + w2m);
2752 Real wpm =
std::abs(fsten(ii_-1,jj_,kk_-2,
ist_p0p)) * (Real(1.) + w1p + w2m);
2753 Real wmp =
std::abs(fsten(ii_-2,jj_,kk_-1,
ist_p0p)) * (Real(1.) + w1m + w2p);
2754 Real wpp =
std::abs(fsten(ii_-1,jj_,kk_-1,
ist_p0p)) * (Real(1.) + w1p + w2p);
2755 return wpp / (wmm+wpm+wmp+wpp+
eps);
2758 auto restrict_from_00m_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
2761 if (w1 == Real(0.) && w2 == Real(0.)) {
2764 return w2 / (w1+w2);
2768 auto restrict_from_p0m_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
2777 Real wmm =
std::abs(fsten(ii_ ,jj_,kk_-2,
ist_p0p)) * (Real(1.) + w1m + w2m);
2778 Real wpm =
std::abs(fsten(ii_+1,jj_,kk_-2,
ist_p0p)) * (Real(1.) + w1p + w2m);
2779 Real wmp =
std::abs(fsten(ii_ ,jj_,kk_-1,
ist_p0p)) * (Real(1.) + w1m + w2p);
2780 Real wpp =
std::abs(fsten(ii_+1,jj_,kk_-1,
ist_p0p)) * (Real(1.) + w1p + w2p);
2781 return wmp / (wmm+wpm+wmp+wpp+
eps);
2784 auto restrict_from_mpm_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
2814 auto restrict_from_0pm_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
2823 Real wmm =
std::abs(fsten(ii_,jj_ ,kk_-2,
ist_0pp)) * (Real(1.) + w1m + w2m);
2824 Real wpm =
std::abs(fsten(ii_,jj_+1,kk_-2,
ist_0pp)) * (Real(1.) + w1p + w2m);
2825 Real wmp =
std::abs(fsten(ii_,jj_ ,kk_-1,
ist_0pp)) * (Real(1.) + w1m + w2p);
2826 Real wpp =
std::abs(fsten(ii_,jj_+1,kk_-1,
ist_0pp)) * (Real(1.) + w1p + w2p);
2827 return wmp / (wmm+wpm+wmp+wpp+
eps);
2830 auto restrict_from_ppm_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
2860 auto restrict_from_mm0_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
2869 Real wmm =
std::abs(fsten(ii_-2,jj_-2,kk_,
ist_pp0)) * (Real(1.) + w1m + w2m);
2870 Real wpm =
std::abs(fsten(ii_-1,jj_-2,kk_,
ist_pp0)) * (Real(1.) + w1p + w2m);
2871 Real wmp =
std::abs(fsten(ii_-2,jj_-1,kk_,
ist_pp0)) * (Real(1.) + w1m + w2p);
2872 Real wpp =
std::abs(fsten(ii_-1,jj_-1,kk_,
ist_pp0)) * (Real(1.) + w1p + w2p);
2873 return wpp / (wmm+wpm+wmp+wpp+
eps);
2876 auto restrict_from_0m0_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
2879 if (w1 == Real(0.) && w2 == Real(0.)) {
2882 return w2 / (w1+w2);
2886 auto restrict_from_pm0_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
2895 Real wmm =
std::abs(fsten(ii_ ,jj_-2,kk_,
ist_pp0)) * (Real(1.) + w1m + w2m);
2896 Real wpm =
std::abs(fsten(ii_+1,jj_-2,kk_,
ist_pp0)) * (Real(1.) + w1p + w2m);
2897 Real wmp =
std::abs(fsten(ii_ ,jj_-1,kk_,
ist_pp0)) * (Real(1.) + w1m + w2p);
2898 Real wpp =
std::abs(fsten(ii_+1,jj_-1,kk_,
ist_pp0)) * (Real(1.) + w1p + w2p);
2899 return wmp / (wmm+wpm+wmp+wpp+
eps);
2902 auto restrict_from_m00_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
2905 if (w1 == Real(0.) && w2 == Real(0.)) {
2908 return w2 / (w1+w2);
2912 auto restrict_from_000_to = [] (
int ,
int ,
int ) -> Real {
2916 auto restrict_from_p00_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
2919 if (w1 == Real(0.) && w2 == Real(0.)) {
2922 return w1 / (w1+w2);
2926 auto restrict_from_mp0_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
2935 Real wmm =
std::abs(fsten(ii_-2,jj_ ,kk_,
ist_pp0)) * (Real(1.) + w1m + w2m);
2936 Real wpm =
std::abs(fsten(ii_-1,jj_ ,kk_,
ist_pp0)) * (Real(1.) + w1p + w2m);
2937 Real wmp =
std::abs(fsten(ii_-2,jj_+1,kk_,
ist_pp0)) * (Real(1.) + w1m + w2p);
2938 Real wpp =
std::abs(fsten(ii_-1,jj_+1,kk_,
ist_pp0)) * (Real(1.) + w1p + w2p);
2939 return wpm / (wmm+wpm+wmp+wpp+
eps);
2942 auto restrict_from_0p0_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
2945 if (w1 == Real(0.) && w2 == Real(0.)) {
2948 return w1 / (w1+w2);
2952 auto restrict_from_pp0_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
2961 Real wmm =
std::abs(fsten(ii_ ,jj_ ,kk_,
ist_pp0)) * (Real(1.) + w1m + w2m);
2962 Real wpm =
std::abs(fsten(ii_+1,jj_ ,kk_,
ist_pp0)) * (Real(1.) + w1p + w2m);
2963 Real wmp =
std::abs(fsten(ii_ ,jj_+1,kk_,
ist_pp0)) * (Real(1.) + w1m + w2p);
2964 Real wpp =
std::abs(fsten(ii_+1,jj_+1,kk_,
ist_pp0)) * (Real(1.) + w1p + w2p);
2965 return wmm / (wmm+wpm+wmp+wpp+
eps);
2968 auto restrict_from_mmp_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
2998 auto restrict_from_0mp_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3007 Real wmm =
std::abs(fsten(ii_,jj_-2,kk_ ,
ist_0pp)) * (Real(1.) + w1m + w2m);
3008 Real wpm =
std::abs(fsten(ii_,jj_-1,kk_ ,
ist_0pp)) * (Real(1.) + w1p + w2m);
3009 Real wmp =
std::abs(fsten(ii_,jj_-2,kk_+1,
ist_0pp)) * (Real(1.) + w1m + w2p);
3010 Real wpp =
std::abs(fsten(ii_,jj_-1,kk_+1,
ist_0pp)) * (Real(1.) + w1p + w2p);
3011 return wpm / (wmm+wpm+wmp+wpp+
eps);
3014 auto restrict_from_pmp_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3044 auto restrict_from_m0p_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3053 Real wmm =
std::abs(fsten(ii_-2,jj_,kk_ ,
ist_p0p)) * (Real(1.) + w1m + w2m);
3054 Real wpm =
std::abs(fsten(ii_-1,jj_,kk_ ,
ist_p0p)) * (Real(1.) + w1p + w2m);
3055 Real wmp =
std::abs(fsten(ii_-2,jj_,kk_+1,
ist_p0p)) * (Real(1.) + w1m + w2p);
3056 Real wpp =
std::abs(fsten(ii_-1,jj_,kk_+1,
ist_p0p)) * (Real(1.) + w1p + w2p);
3057 return wpm / (wmm+wpm+wmp+wpp+
eps);
3060 auto restrict_from_00p_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3063 if (w1 == Real(0.) && w2 == Real(0.)) {
3066 return w1 / (w1+w2);
3070 auto restrict_from_p0p_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3079 Real wmm =
std::abs(fsten(ii_ ,jj_,kk_ ,
ist_p0p)) * (Real(1.) + w1m + w2m);
3080 Real wpm =
std::abs(fsten(ii_+1,jj_,kk_ ,
ist_p0p)) * (Real(1.) + w1p + w2m);
3081 Real wmp =
std::abs(fsten(ii_ ,jj_,kk_+1,
ist_p0p)) * (Real(1.) + w1m + w2p);
3082 Real wpp =
std::abs(fsten(ii_+1,jj_,kk_+1,
ist_p0p)) * (Real(1.) + w1p + w2p);
3083 return wmm / (wmm+wpm+wmp+wpp+
eps);
3086 auto restrict_from_mpp_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3116 auto restrict_from_0pp_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3125 Real wmm =
std::abs(fsten(ii_,jj_ ,kk_ ,
ist_0pp)) * (Real(1.) + w1m + w2m);
3126 Real wpm =
std::abs(fsten(ii_,jj_+1,kk_ ,
ist_0pp)) * (Real(1.) + w1p + w2m);
3127 Real wmp =
std::abs(fsten(ii_,jj_ ,kk_+1,
ist_0pp)) * (Real(1.) + w1m + w2p);
3128 Real wpp =
std::abs(fsten(ii_,jj_+1,kk_+1,
ist_0pp)) * (Real(1.) + w1p + w2p);
3129 return wmm / (wmm+wpm+wmp+wpp+
eps);
3132 auto restrict_from_ppp_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3165 Array3D<Real,-1,1,-1,1,-1,1> p;
3166 Array3D<Real,-1,1,-1,1,-1,1> ap;
3167 Real cs1, cs2, cs3, cs4;
3173 p(-1,-1,-1) = interp_from_ppp_to(iii+1,jjj-1,kkk-1);
3174 p( 0,-1,-1) = interp_from_0pp_to(iii+2,jjj-1,kkk-1);
3175 p(-1, 0,-1) = interp_from_p0p_to(iii+1,jjj ,kkk-1);
3176 p( 0, 0,-1) = interp_from_00p_to(iii+2,jjj ,kkk-1);
3177 p(-1,+1,-1) = interp_from_pmp_to(iii+1,jjj+1,kkk-1);
3178 p( 0,+1,-1) = interp_from_0mp_to(iii+2,jjj+1,kkk-1);
3179 p(-1,-1, 0) = interp_from_pp0_to(iii+1,jjj-1,kkk );
3180 p( 0,-1, 0) = interp_from_0p0_to(iii+2,jjj-1,kkk );
3181 p(-1, 0, 0) = interp_from_p00_to(iii+1,jjj ,kkk );
3182 p( 0, 0, 0) = Real(1.);
3183 p(-1,+1, 0) = interp_from_pm0_to(iii+1,jjj+1,kkk );
3184 p( 0,+1, 0) = interp_from_0m0_to(iii+2,jjj+1,kkk );
3185 p(-1,-1,+1) = interp_from_ppm_to(iii+1,jjj-1,kkk+1);
3186 p( 0,-1,+1) = interp_from_0pm_to(iii+2,jjj-1,kkk+1);
3187 p(-1, 0,+1) = interp_from_p0m_to(iii+1,jjj ,kkk+1);
3188 p( 0, 0,+1) = interp_from_00m_to(iii+2,jjj ,kkk+1);
3189 p(-1,+1,+1) = interp_from_pmm_to(iii+1,jjj+1,kkk+1);
3190 p( 0,+1,+1) = interp_from_0mm_to(iii+2,jjj+1,kkk+1);
3192 Ap00(iii,jjj-1,kkk-1) * p(-1,-1,-1)
3193 + App0(iii,jjj-1,kkk-1) * p(-1, 0,-1)
3194 + Ap0p(iii,jjj-1,kkk-1) * p(-1,-1, 0)
3195 + Appp(iii,jjj-1,kkk-1) * p(-1, 0, 0);
3197 A000(iii+1,jjj-1,kkk-1) * p(-1,-1,-1)
3198 + Ap00(iii+1,jjj-1,kkk-1) * p( 0,-1,-1)
3199 + A0p0(iii+1,jjj-1,kkk-1) * p(-1, 0,-1)
3200 + App0(iii+1,jjj-1,kkk-1) * p( 0, 0,-1)
3201 + A00p(iii+1,jjj-1,kkk-1) * p(-1,-1, 0)
3202 + Ap0p(iii+1,jjj-1,kkk-1) * p( 0,-1, 0)
3203 + A0pp(iii+1,jjj-1,kkk-1) * p(-1, 0, 0)
3204 + Appp(iii+1,jjj-1,kkk-1) * p( 0, 0, 0);
3206 Apm0(iii,jjj,kkk-1) * p(-1,-1,-1)
3207 + Ap00(iii,jjj,kkk-1) * p(-1, 0,-1)
3208 + App0(iii,jjj,kkk-1) * p(-1,+1,-1)
3209 + Apmp(iii,jjj,kkk-1) * p(-1,-1, 0)
3210 + Ap0p(iii,jjj,kkk-1) * p(-1, 0, 0)
3211 + Appp(iii,jjj,kkk-1) * p(-1,+1, 0);
3213 A0m0(iii+1,jjj,kkk-1) * p(-1,-1,-1)
3214 + Apm0(iii+1,jjj,kkk-1) * p( 0,-1,-1)
3215 + A000(iii+1,jjj,kkk-1) * p(-1, 0,-1)
3216 + Ap00(iii+1,jjj,kkk-1) * p( 0, 0,-1)
3217 + A0p0(iii+1,jjj,kkk-1) * p(-1,+1,-1)
3218 + App0(iii+1,jjj,kkk-1) * p( 0,+1,-1)
3219 + A0mp(iii+1,jjj,kkk-1) * p(-1,-1, 0)
3220 + Apmp(iii+1,jjj,kkk-1) * p( 0,-1, 0)
3221 + A00p(iii+1,jjj,kkk-1) * p(-1, 0, 0)
3222 + Ap0p(iii+1,jjj,kkk-1) * p( 0, 0, 0)
3223 + A0pp(iii+1,jjj,kkk-1) * p(-1,+1, 0)
3224 + Appp(iii+1,jjj,kkk-1) * p( 0,+1, 0);
3226 Apm0(iii,jjj+1,kkk-1) * p(-1, 0,-1)
3227 + Ap00(iii,jjj+1,kkk-1) * p(-1,+1,-1)
3228 + Apmp(iii,jjj+1,kkk-1) * p(-1, 0, 0)
3229 + Ap0p(iii,jjj+1,kkk-1) * p(-1,+1, 0);
3231 A0m0(iii+1,jjj+1,kkk-1) * p(-1, 0,-1)
3232 + Apm0(iii+1,jjj+1,kkk-1) * p( 0, 0,-1)
3233 + A000(iii+1,jjj+1,kkk-1) * p(-1,+1,-1)
3234 + Ap00(iii+1,jjj+1,kkk-1) * p( 0,+1,-1)
3235 + A0mp(iii+1,jjj+1,kkk-1) * p(-1, 0, 0)
3236 + Apmp(iii+1,jjj+1,kkk-1) * p( 0, 0, 0)
3237 + A00p(iii+1,jjj+1,kkk-1) * p(-1,+1, 0)
3238 + Ap0p(iii+1,jjj+1,kkk-1) * p( 0,+1, 0);
3240 Ap0m(iii,jjj-1,kkk) * p(-1,-1,-1)
3241 + Appm(iii,jjj-1,kkk) * p(-1, 0,-1)
3242 + Ap00(iii,jjj-1,kkk) * p(-1,-1, 0)
3243 + App0(iii,jjj-1,kkk) * p(-1, 0, 0)
3244 + Ap0p(iii,jjj-1,kkk) * p(-1,-1,+1)
3245 + Appp(iii,jjj-1,kkk) * p(-1, 0,+1);
3247 A00m(iii+1,jjj-1,kkk) * p(-1,-1,-1)
3248 + Ap0m(iii+1,jjj-1,kkk) * p( 0,-1,-1)
3249 + A0pm(iii+1,jjj-1,kkk) * p(-1, 0,-1)
3250 + Appm(iii+1,jjj-1,kkk) * p( 0, 0,-1)
3251 + A000(iii+1,jjj-1,kkk) * p(-1,-1, 0)
3252 + Ap00(iii+1,jjj-1,kkk) * p( 0,-1, 0)
3253 + A0p0(iii+1,jjj-1,kkk) * p(-1, 0, 0)
3254 + App0(iii+1,jjj-1,kkk) * p( 0, 0, 0)
3255 + A00p(iii+1,jjj-1,kkk) * p(-1,-1,+1)
3256 + Ap0p(iii+1,jjj-1,kkk) * p( 0,-1,+1)
3257 + A0pp(iii+1,jjj-1,kkk) * p(-1, 0,+1)
3258 + Appp(iii+1,jjj-1,kkk) * p( 0, 0,+1);
3260 Apmm(iii,jjj,kkk) * p(-1,-1,-1)
3261 + Ap0m(iii,jjj,kkk) * p(-1, 0,-1)
3262 + Appm(iii,jjj,kkk) * p(-1,+1,-1)
3263 + Apm0(iii,jjj,kkk) * p(-1,-1, 0)
3264 + Ap00(iii,jjj,kkk) * p(-1, 0, 0)
3265 + App0(iii,jjj,kkk) * p(-1,+1, 0)
3266 + Apmp(iii,jjj,kkk) * p(-1,-1,+1)
3267 + Ap0p(iii,jjj,kkk) * p(-1, 0,+1)
3268 + Appp(iii,jjj,kkk) * p(-1,+1,+1);
3270 A0mm(iii+1,jjj,kkk) * p(-1,-1,-1)
3271 + Apmm(iii+1,jjj,kkk) * p( 0,-1,-1)
3272 + A00m(iii+1,jjj,kkk) * p(-1, 0,-1)
3273 + Ap0m(iii+1,jjj,kkk) * p( 0, 0,-1)
3274 + A0pm(iii+1,jjj,kkk) * p(-1,+1,-1)
3275 + Appm(iii+1,jjj,kkk) * p( 0,+1,-1)
3276 + A0m0(iii+1,jjj,kkk) * p(-1,-1, 0)
3277 + Apm0(iii+1,jjj,kkk) * p( 0,-1, 0)
3278 + A000(iii+1,jjj,kkk) * p(-1, 0, 0)
3279 + Ap00(iii+1,jjj,kkk) * p( 0, 0, 0)
3280 + A0p0(iii+1,jjj,kkk) * p(-1,+1, 0)
3281 + App0(iii+1,jjj,kkk) * p( 0,+1, 0)
3282 + A0mp(iii+1,jjj,kkk) * p(-1,-1,+1)
3283 + Apmp(iii+1,jjj,kkk) * p( 0,-1,+1)
3284 + A00p(iii+1,jjj,kkk) * p(-1, 0,+1)
3285 + Ap0p(iii+1,jjj,kkk) * p( 0, 0,+1)
3286 + A0pp(iii+1,jjj,kkk) * p(-1,+1,+1)
3287 + Appp(iii+1,jjj,kkk) * p( 0,+1,+1);
3289 Apmm(iii,jjj+1,kkk) * p(-1, 0,-1)
3290 + Ap0m(iii,jjj+1,kkk) * p(-1,+1,-1)
3291 + Apm0(iii,jjj+1,kkk) * p(-1, 0, 0)
3292 + Ap00(iii,jjj+1,kkk) * p(-1,+1, 0)
3293 + Apmp(iii,jjj+1,kkk) * p(-1, 0,+1)
3294 + Ap0p(iii,jjj+1,kkk) * p(-1,+1,+1);
3296 A0mm(iii+1,jjj+1,kkk) * p(-1, 0,-1)
3297 + Apmm(iii+1,jjj+1,kkk) * p( 0, 0,-1)
3298 + A00m(iii+1,jjj+1,kkk) * p(-1,+1,-1)
3299 + Ap0m(iii+1,jjj+1,kkk) * p( 0,+1,-1)
3300 + A0m0(iii+1,jjj+1,kkk) * p(-1, 0, 0)
3301 + Apm0(iii+1,jjj+1,kkk) * p( 0, 0, 0)
3302 + A000(iii+1,jjj+1,kkk) * p(-1,+1, 0)
3303 + Ap00(iii+1,jjj+1,kkk) * p( 0,+1, 0)
3304 + A0mp(iii+1,jjj+1,kkk) * p(-1, 0,+1)
3305 + Apmp(iii+1,jjj+1,kkk) * p( 0, 0,+1)
3306 + A00p(iii+1,jjj+1,kkk) * p(-1,+1,+1)
3307 + Ap0p(iii+1,jjj+1,kkk) * p( 0,+1,+1);
3309 Ap0m(iii,jjj-1,kkk+1) * p(-1,-1, 0)
3310 + Appm(iii,jjj-1,kkk+1) * p(-1, 0, 0)
3311 + Ap00(iii,jjj-1,kkk+1) * p(-1,-1,+1)
3312 + App0(iii,jjj-1,kkk+1) * p(-1, 0,+1);
3314 A00m(iii+1,jjj-1,kkk+1) * p(-1,-1, 0)
3315 + Ap0m(iii+1,jjj-1,kkk+1) * p( 0,-1, 0)
3316 + A0pm(iii+1,jjj-1,kkk+1) * p(-1, 0, 0)
3317 + Appm(iii+1,jjj-1,kkk+1) * p( 0, 0, 0)
3318 + A000(iii+1,jjj-1,kkk+1) * p(-1,-1,+1)
3319 + Ap00(iii+1,jjj-1,kkk+1) * p( 0,-1,+1)
3320 + A0p0(iii+1,jjj-1,kkk+1) * p(-1, 0,+1)
3321 + App0(iii+1,jjj-1,kkk+1) * p( 0, 0,+1);
3323 Apmm(iii,jjj,kkk+1) * p(-1,-1, 0)
3324 + Ap0m(iii,jjj,kkk+1) * p(-1, 0, 0)
3325 + Appm(iii,jjj,kkk+1) * p(-1,+1, 0)
3326 + Apm0(iii,jjj,kkk+1) * p(-1,-1,+1)
3327 + Ap00(iii,jjj,kkk+1) * p(-1, 0,+1)
3328 + App0(iii,jjj,kkk+1) * p(-1,+1,+1);
3330 A0mm(iii+1,jjj,kkk+1) * p(-1,-1, 0)
3331 + Apmm(iii+1,jjj,kkk+1) * p( 0,-1, 0)
3332 + A00m(iii+1,jjj,kkk+1) * p(-1, 0, 0)
3333 + Ap0m(iii+1,jjj,kkk+1) * p( 0, 0, 0)
3334 + A0pm(iii+1,jjj,kkk+1) * p(-1,+1, 0)
3335 + Appm(iii+1,jjj,kkk+1) * p( 0,+1, 0)
3336 + A0m0(iii+1,jjj,kkk+1) * p(-1,-1,+1)
3337 + Apm0(iii+1,jjj,kkk+1) * p( 0,-1,+1)
3338 + A000(iii+1,jjj,kkk+1) * p(-1, 0,+1)
3339 + Ap00(iii+1,jjj,kkk+1) * p( 0, 0,+1)
3340 + A0p0(iii+1,jjj,kkk+1) * p(-1,+1,+1)
3341 + App0(iii+1,jjj,kkk+1) * p( 0,+1,+1);
3343 Apmm(iii,jjj+1,kkk+1) * p(-1, 0, 0)
3344 + Ap0m(iii,jjj+1,kkk+1) * p(-1,+1, 0)
3345 + Apm0(iii,jjj+1,kkk+1) * p(-1, 0,+1)
3346 + Ap00(iii,jjj+1,kkk+1) * p(-1,+1,+1);
3348 A0mm(iii+1,jjj+1,kkk+1) * p(-1, 0, 0)
3349 + Apmm(iii+1,jjj+1,kkk+1) * p( 0, 0, 0)
3350 + A00m(iii+1,jjj+1,kkk+1) * p(-1,+1, 0)
3351 + Ap0m(iii+1,jjj+1,kkk+1) * p( 0,+1, 0)
3352 + A0m0(iii+1,jjj+1,kkk+1) * p(-1, 0,+1)
3353 + Apm0(iii+1,jjj+1,kkk+1) * p( 0, 0,+1)
3354 + A000(iii+1,jjj+1,kkk+1) * p(-1,+1,+1)
3355 + Ap00(iii+1,jjj+1,kkk+1) * p( 0,+1,+1);
3356 csten(i,j,k,
ist_p00) = Real(0.125) *
3357 ( restrict_from_0mm_to(iii,jjj,kkk) * ap( 0,-1,-1)
3358 + restrict_from_pmm_to(iii,jjj,kkk) * ap(+1,-1,-1)
3359 + restrict_from_00m_to(iii,jjj,kkk) * ap( 0, 0,-1)
3360 + restrict_from_p0m_to(iii,jjj,kkk) * ap(+1, 0,-1)
3361 + restrict_from_0pm_to(iii,jjj,kkk) * ap( 0,+1,-1)
3362 + restrict_from_ppm_to(iii,jjj,kkk) * ap(+1,+1,-1)
3363 + restrict_from_0m0_to(iii,jjj,kkk) * ap( 0,-1, 0)
3364 + restrict_from_pm0_to(iii,jjj,kkk) * ap(+1,-1, 0)
3365 + restrict_from_000_to(iii,jjj,kkk) * ap( 0, 0, 0)
3366 + restrict_from_p00_to(iii,jjj,kkk) * ap(+1, 0, 0)
3367 + restrict_from_0p0_to(iii,jjj,kkk) * ap( 0,+1, 0)
3368 + restrict_from_pp0_to(iii,jjj,kkk) * ap(+1,+1, 0)
3369 + restrict_from_0mp_to(iii,jjj,kkk) * ap( 0,-1,+1)
3370 + restrict_from_pmp_to(iii,jjj,kkk) * ap(+1,-1,+1)
3371 + restrict_from_00p_to(iii,jjj,kkk) * ap( 0, 0,+1)
3372 + restrict_from_p0p_to(iii,jjj,kkk) * ap(+1, 0,+1)
3373 + restrict_from_0pp_to(iii,jjj,kkk) * ap( 0,+1,+1)
3374 + restrict_from_ppp_to(iii,jjj,kkk) * ap(+1,+1,+1));
3380 p(-1,-1,-1) = interp_from_ppp_to(iii-1,jjj+1,kkk-1);
3381 p( 0,-1,-1) = interp_from_0pp_to(iii ,jjj+1,kkk-1);
3382 p(+1,-1,-1) = interp_from_mpp_to(iii+1,jjj+1,kkk-1);
3383 p(-1, 0,-1) = interp_from_p0p_to(iii-1,jjj+2,kkk-1);
3384 p( 0, 0,-1) = interp_from_00p_to(iii ,jjj+2,kkk-1);
3385 p(+1, 0,-1) = interp_from_m0p_to(iii+1,jjj+2,kkk-1);
3386 p(-1,-1, 0) = interp_from_pp0_to(iii-1,jjj+1,kkk );
3387 p( 0,-1, 0) = interp_from_0p0_to(iii ,jjj+1,kkk );
3388 p(+1,-1, 0) = interp_from_mp0_to(iii+1,jjj+1,kkk );
3389 p(-1, 0, 0) = interp_from_p00_to(iii-1,jjj+2,kkk );
3390 p( 0, 0, 0) = Real(1.);
3391 p(+1, 0, 0) = interp_from_m00_to(iii+1,jjj+2,kkk );
3392 p(-1,-1,+1) = interp_from_ppm_to(iii-1,jjj+1,kkk+1);
3393 p( 0,-1,+1) = interp_from_0pm_to(iii ,jjj+1,kkk+1);
3394 p(+1,-1,+1) = interp_from_mpm_to(iii+1,jjj+1,kkk+1);
3395 p(-1, 0,+1) = interp_from_p0m_to(iii-1,jjj+2,kkk+1);
3396 p( 0, 0,+1) = interp_from_00m_to(iii ,jjj+2,kkk+1);
3397 p(+1, 0,+1) = interp_from_m0m_to(iii+1,jjj+2,kkk+1);
3399 A0p0(iii-1,jjj,kkk-1) * p(-1,-1,-1)
3400 + App0(iii-1,jjj,kkk-1) * p( 0,-1,-1)
3401 + A0pp(iii-1,jjj,kkk-1) * p(-1,-1, 0)
3402 + Appp(iii-1,jjj,kkk-1) * p( 0,-1, 0);
3404 Amp0(iii,jjj,kkk-1) * p(-1,-1,-1)
3405 + A0p0(iii,jjj,kkk-1) * p( 0,-1,-1)
3406 + App0(iii,jjj,kkk-1) * p(+1,-1,-1)
3407 + Ampp(iii,jjj,kkk-1) * p(-1,-1, 0)
3408 + A0pp(iii,jjj,kkk-1) * p( 0,-1, 0)
3409 + Appp(iii,jjj,kkk-1) * p(+1,-1, 0);
3411 Amp0(iii+1,jjj,kkk-1) * p( 0,-1,-1)
3412 + A0p0(iii+1,jjj,kkk-1) * p(+1,-1,-1)
3413 + Ampp(iii+1,jjj,kkk-1) * p( 0,-1, 0)
3414 + A0pp(iii+1,jjj,kkk-1) * p(+1,-1, 0);
3416 A000(iii-1,jjj+1,kkk-1) * p(-1,-1,-1)
3417 + Ap00(iii-1,jjj+1,kkk-1) * p( 0,-1,-1)
3418 + A0p0(iii-1,jjj+1,kkk-1) * p(-1, 0,-1)
3419 + App0(iii-1,jjj+1,kkk-1) * p( 0, 0,-1)
3420 + A00p(iii-1,jjj+1,kkk-1) * p(-1,-1, 0)
3421 + Ap0p(iii-1,jjj+1,kkk-1) * p( 0,-1, 0)
3422 + A0pp(iii-1,jjj+1,kkk-1) * p(-1, 0, 0)
3423 + Appp(iii-1,jjj+1,kkk-1) * p( 0, 0, 0);
3425 Am00(iii,jjj+1,kkk-1) * p(-1,-1,-1)
3426 + A000(iii,jjj+1,kkk-1) * p( 0,-1,-1)
3427 + Ap00(iii,jjj+1,kkk-1) * p(+1,-1,-1)
3428 + Amp0(iii,jjj+1,kkk-1) * p(-1, 0,-1)
3429 + A0p0(iii,jjj+1,kkk-1) * p( 0, 0,-1)
3430 + App0(iii,jjj+1,kkk-1) * p(+1, 0,-1)
3431 + Am0p(iii,jjj+1,kkk-1) * p(-1,-1, 0)
3432 + A00p(iii,jjj+1,kkk-1) * p( 0,-1, 0)
3433 + Ap0p(iii,jjj+1,kkk-1) * p(+1,-1, 0)
3434 + Ampp(iii,jjj+1,kkk-1) * p(-1, 0, 0)
3435 + A0pp(iii,jjj+1,kkk-1) * p( 0, 0, 0)
3436 + Appp(iii,jjj+1,kkk-1) * p(+1, 0, 0);
3438 Am00(iii+1,jjj+1,kkk-1) * p( 0,-1,-1)
3439 + A000(iii+1,jjj+1,kkk-1) * p(+1,-1,-1)
3440 + Amp0(iii+1,jjj+1,kkk-1) * p( 0, 0,-1)
3441 + A0p0(iii+1,jjj+1,kkk-1) * p(+1, 0,-1)
3442 + Am0p(iii+1,jjj+1,kkk-1) * p( 0,-1, 0)
3443 + A00p(iii+1,jjj+1,kkk-1) * p(+1,-1, 0)
3444 + Ampp(iii+1,jjj+1,kkk-1) * p( 0, 0, 0)
3445 + A0pp(iii+1,jjj+1,kkk-1) * p(+1, 0, 0);
3447 A0pm(iii-1,jjj,kkk) * p(-1,-1,-1)
3448 + Appm(iii-1,jjj,kkk) * p( 0,-1,-1)
3449 + A0p0(iii-1,jjj,kkk) * p(-1,-1, 0)
3450 + App0(iii-1,jjj,kkk) * p( 0,-1, 0)
3451 + A0pp(iii-1,jjj,kkk) * p(-1,-1,+1)
3452 + Appp(iii-1,jjj,kkk) * p( 0,-1,+1);
3454 Ampm(iii,jjj,kkk) * p(-1,-1,-1)
3455 + A0pm(iii,jjj,kkk) * p( 0,-1,-1)
3456 + Appm(iii,jjj,kkk) * p(+1,-1,-1)
3457 + Amp0(iii,jjj,kkk) * p(-1,-1, 0)
3458 + A0p0(iii,jjj,kkk) * p( 0,-1, 0)
3459 + App0(iii,jjj,kkk) * p(+1,-1, 0)
3460 + Ampp(iii,jjj,kkk) * p(-1,-1,+1)
3461 + A0pp(iii,jjj,kkk) * p( 0,-1,+1)
3462 + Appp(iii,jjj,kkk) * p(+1,-1,+1);
3464 Ampm(iii+1,jjj,kkk) * p( 0,-1,-1)
3465 + A0pm(iii+1,jjj,kkk) * p(+1,-1,-1)
3466 + Amp0(iii+1,jjj,kkk) * p( 0,-1, 0)
3467 + A0p0(iii+1,jjj,kkk) * p(+1,-1, 0)
3468 + Ampp(iii+1,jjj,kkk) * p( 0,-1,+1)
3469 + A0pp(iii+1,jjj,kkk) * p(+1,-1,+1);
3471 A00m(iii-1,jjj+1,kkk) * p(-1,-1,-1)
3472 + Ap0m(iii-1,jjj+1,kkk) * p( 0,-1,-1)
3473 + A0pm(iii-1,jjj+1,kkk) * p(-1, 0,-1)
3474 + Appm(iii-1,jjj+1,kkk) * p( 0, 0,-1)
3475 + A000(iii-1,jjj+1,kkk) * p(-1,-1, 0)
3476 + Ap00(iii-1,jjj+1,kkk) * p( 0,-1, 0)
3477 + A0p0(iii-1,jjj+1,kkk) * p(-1, 0, 0)
3478 + App0(iii-1,jjj+1,kkk) * p( 0, 0, 0)
3479 + A00p(iii-1,jjj+1,kkk) * p(-1,-1,+1)
3480 + Ap0p(iii-1,jjj+1,kkk) * p( 0,-1,+1)
3481 + A0pp(iii-1,jjj+1,kkk) * p(-1, 0,+1)
3482 + Appp(iii-1,jjj+1,kkk) * p( 0, 0,+1);
3484 Am0m(iii,jjj+1,kkk) * p(-1,-1,-1)
3485 + A00m(iii,jjj+1,kkk) * p( 0,-1,-1)
3486 + Ap0m(iii,jjj+1,kkk) * p(+1,-1,-1)
3487 + Ampm(iii,jjj+1,kkk) * p(-1, 0,-1)
3488 + A0pm(iii,jjj+1,kkk) * p( 0, 0,-1)
3489 + Appm(iii,jjj+1,kkk) * p(+1, 0,-1)
3490 + Am00(iii,jjj+1,kkk) * p(-1,-1, 0)
3491 + A000(iii,jjj+1,kkk) * p( 0,-1, 0)
3492 + Ap00(iii,jjj+1,kkk) * p(+1,-1, 0)
3493 + Amp0(iii,jjj+1,kkk) * p(-1, 0, 0)
3494 + A0p0(iii,jjj+1,kkk) * p( 0, 0, 0)
3495 + App0(iii,jjj+1,kkk) * p(+1, 0, 0)
3496 + Am0p(iii,jjj+1,kkk) * p(-1,-1,+1)
3497 + A00p(iii,jjj+1,kkk) * p( 0,-1,+1)
3498 + Ap0p(iii,jjj+1,kkk) * p(+1,-1,+1)
3499 + Ampp(iii,jjj+1,kkk) * p(-1, 0,+1)
3500 + A0pp(iii,jjj+1,kkk) * p( 0, 0,+1)
3501 + Appp(iii,jjj+1,kkk) * p(+1, 0,+1);
3503 Am0m(iii+1,jjj+1,kkk) * p( 0,-1,-1)
3504 + A00m(iii+1,jjj+1,kkk) * p(+1,-1,-1)
3505 + Ampm(iii+1,jjj+1,kkk) * p( 0, 0,-1)
3506 + A0pm(iii+1,jjj+1,kkk) * p(+1, 0,-1)
3507 + Am00(iii+1,jjj+1,kkk) * p( 0,-1, 0)
3508 + A000(iii+1,jjj+1,kkk) * p(+1,-1, 0)
3509 + Amp0(iii+1,jjj+1,kkk) * p( 0, 0, 0)
3510 + A0p0(iii+1,jjj+1,kkk) * p(+1, 0, 0)
3511 + Am0p(iii+1,jjj+1,kkk) * p( 0,-1,+1)
3512 + A00p(iii+1,jjj+1,kkk) * p(+1,-1,+1)
3513 + Ampp(iii+1,jjj+1,kkk) * p( 0, 0,+1)
3514 + A0pp(iii+1,jjj+1,kkk) * p(+1, 0,+1);
3516 A0pm(iii-1,jjj,kkk+1) * p(-1,-1, 0)
3517 + Appm(iii-1,jjj,kkk+1) * p( 0,-1, 0)
3518 + A0p0(iii-1,jjj,kkk+1) * p(-1,-1,+1)
3519 + App0(iii-1,jjj,kkk+1) * p( 0,-1,+1);
3521 Ampm(iii,jjj,kkk+1) * p(-1,-1, 0)
3522 + A0pm(iii,jjj,kkk+1) * p( 0,-1, 0)
3523 + Appm(iii,jjj,kkk+1) * p(+1,-1, 0)
3524 + Amp0(iii,jjj,kkk+1) * p(-1,-1,+1)
3525 + A0p0(iii,jjj,kkk+1) * p( 0,-1,+1)
3526 + App0(iii,jjj,kkk+1) * p(+1,-1,+1);
3528 Ampm(iii+1,jjj,kkk+1) * p( 0,-1, 0)
3529 + A0pm(iii+1,jjj,kkk+1) * p(+1,-1, 0)
3530 + Amp0(iii+1,jjj,kkk+1) * p( 0,-1,+1)
3531 + A0p0(iii+1,jjj,kkk+1) * p(+1,-1,+1);
3533 A00m(iii-1,jjj+1,kkk+1) * p(-1,-1, 0)
3534 + Ap0m(iii-1,jjj+1,kkk+1) * p( 0,-1, 0)
3535 + A0pm(iii-1,jjj+1,kkk+1) * p(-1, 0, 0)
3536 + Appm(iii-1,jjj+1,kkk+1) * p( 0, 0, 0)
3537 + A000(iii-1,jjj+1,kkk+1) * p(-1,-1,+1)
3538 + Ap00(iii-1,jjj+1,kkk+1) * p( 0,-1,+1)
3539 + A0p0(iii-1,jjj+1,kkk+1) * p(-1, 0,+1)
3540 + App0(iii-1,jjj+1,kkk+1) * p( 0, 0,+1);
3542 Am0m(iii,jjj+1,kkk+1) * p(-1,-1, 0)
3543 + A00m(iii,jjj+1,kkk+1) * p( 0,-1, 0)
3544 + Ap0m(iii,jjj+1,kkk+1) * p(+1,-1, 0)
3545 + Ampm(iii,jjj+1,kkk+1) * p(-1, 0, 0)
3546 + A0pm(iii,jjj+1,kkk+1) * p( 0, 0, 0)
3547 + Appm(iii,jjj+1,kkk+1) * p(+1, 0, 0)
3548 + Am00(iii,jjj+1,kkk+1) * p(-1,-1,+1)
3549 + A000(iii,jjj+1,kkk+1) * p( 0,-1,+1)
3550 + Ap00(iii,jjj+1,kkk+1) * p(+1,-1,+1)
3551 + Amp0(iii,jjj+1,kkk+1) * p(-1, 0,+1)
3552 + A0p0(iii,jjj+1,kkk+1) * p( 0, 0,+1)
3553 + App0(iii,jjj+1,kkk+1) * p(+1, 0,+1);
3555 Am0m(iii+1,jjj+1,kkk+1) * p( 0,-1, 0)
3556 + A00m(iii+1,jjj+1,kkk+1) * p(+1,-1, 0)
3557 + Ampm(iii+1,jjj+1,kkk+1) * p( 0, 0, 0)
3558 + A0pm(iii+1,jjj+1,kkk+1) * p(+1, 0, 0)
3559 + Am00(iii+1,jjj+1,kkk+1) * p( 0,-1,+1)
3560 + A000(iii+1,jjj+1,kkk+1) * p(+1,-1,+1)
3561 + Amp0(iii+1,jjj+1,kkk+1) * p( 0, 0,+1)
3562 + A0p0(iii+1,jjj+1,kkk+1) * p(+1, 0,+1);
3563 csten(i,j,k,
ist_0p0) = Real(0.125) *
3564 ( restrict_from_m0m_to(iii,jjj,kkk) * ap(-1, 0,-1)
3565 + restrict_from_00m_to(iii,jjj,kkk) * ap( 0, 0,-1)
3566 + restrict_from_p0m_to(iii,jjj,kkk) * ap(+1, 0,-1)
3567 + restrict_from_mpm_to(iii,jjj,kkk) * ap(-1,+1,-1)
3568 + restrict_from_0pm_to(iii,jjj,kkk) * ap( 0,+1,-1)
3569 + restrict_from_ppm_to(iii,jjj,kkk) * ap(+1,+1,-1)
3570 + restrict_from_m00_to(iii,jjj,kkk) * ap(-1, 0, 0)
3571 + restrict_from_000_to(iii,jjj,kkk) * ap( 0, 0, 0)
3572 + restrict_from_p00_to(iii,jjj,kkk) * ap(+1, 0, 0)
3573 + restrict_from_mp0_to(iii,jjj,kkk) * ap(-1,+1, 0)
3574 + restrict_from_0p0_to(iii,jjj,kkk) * ap( 0,+1, 0)
3575 + restrict_from_pp0_to(iii,jjj,kkk) * ap(+1,+1, 0)
3576 + restrict_from_m0p_to(iii,jjj,kkk) * ap(-1, 0,+1)
3577 + restrict_from_00p_to(iii,jjj,kkk) * ap( 0, 0,+1)
3578 + restrict_from_p0p_to(iii,jjj,kkk) * ap(+1, 0,+1)
3579 + restrict_from_mpp_to(iii,jjj,kkk) * ap(-1,+1,+1)
3580 + restrict_from_0pp_to(iii,jjj,kkk) * ap( 0,+1,+1)
3581 + restrict_from_ppp_to(iii,jjj,kkk) * ap(+1,+1,+1));
3587 p(-1,-1,-1) = interp_from_ppp_to(iii-1,jjj-1,kkk+1);
3588 p( 0,-1,-1) = interp_from_0pp_to(iii ,jjj-1,kkk+1);
3589 p(+1,-1,-1) = interp_from_mpp_to(iii+1,jjj-1,kkk+1);
3590 p(-1, 0,-1) = interp_from_p0p_to(iii-1,jjj ,kkk+1);
3591 p( 0, 0,-1) = interp_from_00p_to(iii ,jjj ,kkk+1);
3592 p(+1, 0,-1) = interp_from_m0p_to(iii+1,jjj ,kkk+1);
3593 p(-1,+1,-1) = interp_from_pmp_to(iii-1,jjj+1,kkk+1);
3594 p( 0,+1,-1) = interp_from_0mp_to(iii ,jjj+1,kkk+1);
3595 p(+1,+1,-1) = interp_from_mmp_to(iii+1,jjj+1,kkk+1);
3596 p(-1,-1, 0) = interp_from_pp0_to(iii-1,jjj-1,kkk+2);
3597 p( 0,-1, 0) = interp_from_0p0_to(iii ,jjj-1,kkk+2);
3598 p(+1,-1, 0) = interp_from_mp0_to(iii+1,jjj-1,kkk+2);
3599 p(-1, 0, 0) = interp_from_p00_to(iii-1,jjj ,kkk+2);
3600 p( 0, 0, 0) = Real(1.);
3601 p(+1, 0, 0) = interp_from_m00_to(iii+1,jjj ,kkk+2);
3602 p(-1,+1, 0) = interp_from_pm0_to(iii-1,jjj+1,kkk+2);
3603 p( 0,+1, 0) = interp_from_0m0_to(iii ,jjj+1,kkk+2);
3604 p(+1,+1, 0) = interp_from_mm0_to(iii+1,jjj+1,kkk+2);
3606 A00p(iii-1,jjj-1,kkk) * p(-1,-1,-1)
3607 + Ap0p(iii-1,jjj-1,kkk) * p( 0,-1,-1)
3608 + A0pp(iii-1,jjj-1,kkk) * p(-1, 0,-1)
3609 + Appp(iii-1,jjj-1,kkk) * p( 0, 0,-1);
3611 Am0p(iii,jjj-1,kkk) * p(-1,-1,-1)
3612 + A00p(iii,jjj-1,kkk) * p( 0,-1,-1)
3613 + Ap0p(iii,jjj-1,kkk) * p(+1,-1,-1)
3614 + Ampp(iii,jjj-1,kkk) * p(-1, 0,-1)
3615 + A0pp(iii,jjj-1,kkk) * p( 0, 0,-1)
3616 + Appp(iii,jjj-1,kkk) * p(+1, 0,-1);
3618 Am0p(iii+1,jjj-1,kkk) * p( 0,-1,-1)
3619 + A00p(iii+1,jjj-1,kkk) * p(+1,-1,-1)
3620 + Ampp(iii+1,jjj-1,kkk) * p( 0, 0,-1)
3621 + A0pp(iii+1,jjj-1,kkk) * p(+1, 0,-1);
3623 A0mp(iii-1,jjj,kkk) * p(-1,-1,-1)
3624 + Apmp(iii-1,jjj,kkk) * p( 0,-1,-1)
3625 + A00p(iii-1,jjj,kkk) * p(-1, 0,-1)
3626 + Ap0p(iii-1,jjj,kkk) * p( 0, 0,-1)
3627 + A0pp(iii-1,jjj,kkk) * p(-1,+1,-1)
3628 + Appp(iii-1,jjj,kkk) * p( 0,+1,-1);
3630 Ammp(iii,jjj,kkk) * p(-1,-1,-1)
3631 + A0mp(iii,jjj,kkk) * p( 0,-1,-1)
3632 + Apmp(iii,jjj,kkk) * p(+1,-1,-1)
3633 + Am0p(iii,jjj,kkk) * p(-1, 0,-1)
3634 + A00p(iii,jjj,kkk) * p( 0, 0,-1)
3635 + Ap0p(iii,jjj,kkk) * p(+1, 0,-1)
3636 + Ampp(iii,jjj,kkk) * p(-1,+1,-1)
3637 + A0pp(iii,jjj,kkk) * p( 0,+1,-1)
3638 + Appp(iii,jjj,kkk) * p(+1,+1,-1);
3640 Ammp(iii+1,jjj,kkk) * p( 0,-1,-1)
3641 + A0mp(iii+1,jjj,kkk) * p(+1,-1,-1)
3642 + Am0p(iii+1,jjj,kkk) * p( 0, 0,-1)
3643 + A00p(iii+1,jjj,kkk) * p(+1, 0,-1)
3644 + Ampp(iii+1,jjj,kkk) * p( 0,+1,-1)
3645 + A0pp(iii+1,jjj,kkk) * p(+1,+1,-1);
3647 A0mp(iii-1,jjj+1,kkk) * p(-1, 0,-1)
3648 + Apmp(iii-1,jjj+1,kkk) * p( 0, 0,-1)
3649 + A00p(iii-1,jjj+1,kkk) * p(-1,+1,-1)
3650 + Ap0p(iii-1,jjj+1,kkk) * p( 0,+1,-1);
3652 Ammp(iii,jjj+1,kkk) * p(-1, 0,-1)
3653 + A0mp(iii,jjj+1,kkk) * p( 0, 0,-1)
3654 + Apmp(iii,jjj+1,kkk) * p(+1, 0,-1)
3655 + Am0p(iii,jjj+1,kkk) * p(-1,+1,-1)
3656 + A00p(iii,jjj+1,kkk) * p( 0,+1,-1)
3657 + Ap0p(iii,jjj+1,kkk) * p(+1,+1,-1);
3659 Ammp(iii+1,jjj+1,kkk) * p( 0, 0,-1)
3660 + A0mp(iii+1,jjj+1,kkk) * p(+1, 0,-1)
3661 + Am0p(iii+1,jjj+1,kkk) * p( 0,+1,-1)
3662 + A00p(iii+1,jjj+1,kkk) * p(+1,+1,-1);
3664 A000(iii-1,jjj-1,kkk+1) * p(-1,-1,-1)
3665 + Ap00(iii-1,jjj-1,kkk+1) * p( 0,-1,-1)
3666 + A0p0(iii-1,jjj-1,kkk+1) * p(-1, 0,-1)
3667 + App0(iii-1,jjj-1,kkk+1) * p( 0, 0,-1)
3668 + A00p(iii-1,jjj-1,kkk+1) * p(-1,-1, 0)
3669 + Ap0p(iii-1,jjj-1,kkk+1) * p( 0,-1, 0)
3670 + A0pp(iii-1,jjj-1,kkk+1) * p(-1, 0, 0)
3671 + Appp(iii-1,jjj-1,kkk+1) * p( 0, 0, 0);
3673 Am00(iii,jjj-1,kkk+1) * p(-1,-1,-1)
3674 + A000(iii,jjj-1,kkk+1) * p( 0,-1,-1)
3675 + Ap00(iii,jjj-1,kkk+1) * p(+1,-1,-1)
3676 + Amp0(iii,jjj-1,kkk+1) * p(-1, 0,-1)
3677 + A0p0(iii,jjj-1,kkk+1) * p( 0, 0,-1)
3678 + App0(iii,jjj-1,kkk+1) * p(+1, 0,-1)
3679 + Am0p(iii,jjj-1,kkk+1) * p(-1,-1, 0)
3680 + A00p(iii,jjj-1,kkk+1) * p( 0,-1, 0)
3681 + Ap0p(iii,jjj-1,kkk+1) * p(+1,-1, 0)
3682 + Ampp(iii,jjj-1,kkk+1) * p(-1, 0, 0)
3683 + A0pp(iii,jjj-1,kkk+1) * p( 0, 0, 0)
3684 + Appp(iii,jjj-1,kkk+1) * p(+1, 0, 0);
3686 Am00(iii+1,jjj-1,kkk+1) * p( 0,-1,-1)
3687 + A000(iii+1,jjj-1,kkk+1) * p(+1,-1,-1)
3688 + Amp0(iii+1,jjj-1,kkk+1) * p( 0, 0,-1)
3689 + A0p0(iii+1,jjj-1,kkk+1) * p(+1, 0,-1)
3690 + Am0p(iii+1,jjj-1,kkk+1) * p( 0,-1, 0)
3691 + A00p(iii+1,jjj-1,kkk+1) * p(+1,-1, 0)
3692 + Ampp(iii+1,jjj-1,kkk+1) * p( 0, 0, 0)
3693 + A0pp(iii+1,jjj-1,kkk+1) * p(+1, 0, 0);
3695 A0m0(iii-1,jjj,kkk+1) * p(-1,-1,-1)
3696 + Apm0(iii-1,jjj,kkk+1) * p( 0,-1,-1)
3697 + A000(iii-1,jjj,kkk+1) * p(-1, 0,-1)
3698 + Ap00(iii-1,jjj,kkk+1) * p( 0, 0,-1)
3699 + A0p0(iii-1,jjj,kkk+1) * p(-1,+1,-1)
3700 + App0(iii-1,jjj,kkk+1) * p( 0,+1,-1)
3701 + A0mp(iii-1,jjj,kkk+1) * p(-1,-1, 0)
3702 + Apmp(iii-1,jjj,kkk+1) * p( 0,-1, 0)
3703 + A00p(iii-1,jjj,kkk+1) * p(-1, 0, 0)
3704 + Ap0p(iii-1,jjj,kkk+1) * p( 0, 0, 0)
3705 + A0pp(iii-1,jjj,kkk+1) * p(-1,+1, 0)
3706 + Appp(iii-1,jjj,kkk+1) * p( 0,+1, 0);
3708 Amm0(iii,jjj,kkk+1) * p(-1,-1,-1)
3709 + A0m0(iii,jjj,kkk+1) * p( 0,-1,-1)
3710 + Apm0(iii,jjj,kkk+1) * p(+1,-1,-1)
3711 + Am00(iii,jjj,kkk+1) * p(-1, 0,-1)
3712 + A000(iii,jjj,kkk+1) * p( 0, 0,-1)
3713 + Ap00(iii,jjj,kkk+1) * p(+1, 0,-1)
3714 + Amp0(iii,jjj,kkk+1) * p(-1,+1,-1)
3715 + A0p0(iii,jjj,kkk+1) * p( 0,+1,-1)
3716 + App0(iii,jjj,kkk+1) * p(+1,+1,-1)
3717 + Ammp(iii,jjj,kkk+1) * p(-1,-1, 0)
3718 + A0mp(iii,jjj,kkk+1) * p( 0,-1, 0)
3719 + Apmp(iii,jjj,kkk+1) * p(+1,-1, 0)
3720 + Am0p(iii,jjj,kkk+1) * p(-1, 0, 0)
3721 + A00p(iii,jjj,kkk+1) * p( 0, 0, 0)
3722 + Ap0p(iii,jjj,kkk+1) * p(+1, 0, 0)
3723 + Ampp(iii,jjj,kkk+1) * p(-1,+1, 0)
3724 + A0pp(iii,jjj,kkk+1) * p( 0,+1, 0)
3725 + Appp(iii,jjj,kkk+1) * p(+1,+1, 0);
3727 Amm0(iii+1,jjj,kkk+1) * p( 0,-1,-1)
3728 + A0m0(iii+1,jjj,kkk+1) * p(+1,-1,-1)
3729 + Am00(iii+1,jjj,kkk+1) * p( 0, 0,-1)
3730 + A000(iii+1,jjj,kkk+1) * p(+1, 0,-1)
3731 + Amp0(iii+1,jjj,kkk+1) * p( 0,+1,-1)
3732 + A0p0(iii+1,jjj,kkk+1) * p(+1,+1,-1)
3733 + Ammp(iii+1,jjj,kkk+1) * p( 0,-1, 0)
3734 + A0mp(iii+1,jjj,kkk+1) * p(+1,-1, 0)
3735 + Am0p(iii+1,jjj,kkk+1) * p( 0, 0, 0)
3736 + A00p(iii+1,jjj,kkk+1) * p(+1, 0, 0)
3737 + Ampp(iii+1,jjj,kkk+1) * p( 0,+1, 0)
3738 + A0pp(iii+1,jjj,kkk+1) * p(+1,+1, 0);
3740 A0m0(iii-1,jjj+1,kkk+1) * p(-1, 0,-1)
3741 + Apm0(iii-1,jjj+1,kkk+1) * p( 0, 0,-1)
3742 + A000(iii-1,jjj+1,kkk+1) * p(-1,+1,-1)
3743 + Ap00(iii-1,jjj+1,kkk+1) * p( 0,+1,-1)
3744 + A0mp(iii-1,jjj+1,kkk+1) * p(-1, 0, 0)
3745 + Apmp(iii-1,jjj+1,kkk+1) * p( 0, 0, 0)
3746 + A00p(iii-1,jjj+1,kkk+1) * p(-1,+1, 0)
3747 + Ap0p(iii-1,jjj+1,kkk+1) * p( 0,+1, 0);
3749 Amm0(iii,jjj+1,kkk+1) * p(-1, 0,-1)
3750 + A0m0(iii,jjj+1,kkk+1) * p( 0, 0,-1)
3751 + Apm0(iii,jjj+1,kkk+1) * p(+1, 0,-1)
3752 + Am00(iii,jjj+1,kkk+1) * p(-1,+1,-1)
3753 + A000(iii,jjj+1,kkk+1) * p( 0,+1,-1)
3754 + Ap00(iii,jjj+1,kkk+1) * p(+1,+1,-1)
3755 + Ammp(iii,jjj+1,kkk+1) * p(-1, 0, 0)
3756 + A0mp(iii,jjj+1,kkk+1) * p( 0, 0, 0)
3757 + Apmp(iii,jjj+1,kkk+1) * p(+1, 0, 0)
3758 + Am0p(iii,jjj+1,kkk+1) * p(-1,+1, 0)
3759 + A00p(iii,jjj+1,kkk+1) * p( 0,+1, 0)
3760 + Ap0p(iii,jjj+1,kkk+1) * p(+1,+1, 0);
3762 Amm0(iii+1,jjj+1,kkk+1) * p( 0, 0,-1)
3763 + A0m0(iii+1,jjj+1,kkk+1) * p(+1, 0,-1)
3764 + Am00(iii+1,jjj+1,kkk+1) * p( 0,+1,-1)
3765 + A000(iii+1,jjj+1,kkk+1) * p(+1,+1,-1)
3766 + Ammp(iii+1,jjj+1,kkk+1) * p( 0, 0, 0)
3767 + A0mp(iii+1,jjj+1,kkk+1) * p(+1, 0, 0)
3768 + Am0p(iii+1,jjj+1,kkk+1) * p( 0,+1, 0)
3769 + A00p(iii+1,jjj+1,kkk+1) * p(+1,+1, 0);
3770 csten(i,j,k,
ist_00p) = Real(0.125) *
3771 ( restrict_from_mm0_to(iii,jjj,kkk) * ap(-1,-1, 0)
3772 + restrict_from_0m0_to(iii,jjj,kkk) * ap( 0,-1, 0)
3773 + restrict_from_pm0_to(iii,jjj,kkk) * ap(+1,-1, 0)
3774 + restrict_from_m00_to(iii,jjj,kkk) * ap(-1, 0, 0)
3775 + restrict_from_000_to(iii,jjj,kkk) * ap( 0, 0, 0)
3776 + restrict_from_p00_to(iii,jjj,kkk) * ap(+1, 0, 0)
3777 + restrict_from_mp0_to(iii,jjj,kkk) * ap(-1,+1, 0)
3778 + restrict_from_0p0_to(iii,jjj,kkk) * ap( 0,+1, 0)
3779 + restrict_from_pp0_to(iii,jjj,kkk) * ap(+1,+1, 0)
3780 + restrict_from_mmp_to(iii,jjj,kkk) * ap(-1,-1,+1)
3781 + restrict_from_0mp_to(iii,jjj,kkk) * ap( 0,-1,+1)
3782 + restrict_from_pmp_to(iii,jjj,kkk) * ap(+1,-1,+1)
3783 + restrict_from_m0p_to(iii,jjj,kkk) * ap(-1, 0,+1)
3784 + restrict_from_00p_to(iii,jjj,kkk) * ap( 0, 0,+1)
3785 + restrict_from_p0p_to(iii,jjj,kkk) * ap(+1, 0,+1)
3786 + restrict_from_mpp_to(iii,jjj,kkk) * ap(-1,+1,+1)
3787 + restrict_from_0pp_to(iii,jjj,kkk) * ap( 0,+1,+1)
3788 + restrict_from_ppp_to(iii,jjj,kkk) * ap(+1,+1,+1));
3794 p(-1,-1,-1) = interp_from_ppp_to(iii+1,jjj+1,kkk-1);
3795 p( 0,-1,-1) = interp_from_0pp_to(iii+2,jjj+1,kkk-1);
3796 p(-1, 0,-1) = interp_from_p0p_to(iii+1,jjj+2,kkk-1);
3797 p( 0, 0,-1) = interp_from_00p_to(iii+2,jjj+2,kkk-1);
3798 p(-1,-1, 0) = interp_from_pp0_to(iii+1,jjj+1,kkk );
3799 p( 0,-1, 0) = interp_from_0p0_to(iii+2,jjj+1,kkk );
3800 p(-1, 0, 0) = interp_from_p00_to(iii+1,jjj+2,kkk );
3801 p( 0, 0, 0) = Real(1.);
3802 p(-1,-1,+1) = interp_from_ppm_to(iii+1,jjj+1,kkk+1);
3803 p( 0,-1,+1) = interp_from_0pm_to(iii+2,jjj+1,kkk+1);
3804 p(-1, 0,+1) = interp_from_p0m_to(iii+1,jjj+2,kkk+1);
3805 p( 0, 0,+1) = interp_from_00m_to(iii+2,jjj+2,kkk+1);
3807 App0(iii,jjj,kkk-1) * p(-1,-1,-1)
3808 + Appp(iii,jjj,kkk-1) * p(-1,-1, 0);
3810 A0p0(iii+1,jjj,kkk-1) * p(-1,-1,-1)
3811 + App0(iii+1,jjj,kkk-1) * p( 0,-1,-1)
3812 + A0pp(iii+1,jjj,kkk-1) * p(-1,-1, 0)
3813 + Appp(iii+1,jjj,kkk-1) * p( 0,-1, 0);
3815 Ap00(iii,jjj+1,kkk-1) * p(-1,-1,-1)
3816 + App0(iii,jjj+1,kkk-1) * p(-1, 0,-1)
3817 + Ap0p(iii,jjj+1,kkk-1) * p(-1,-1, 0)
3818 + Appp(iii,jjj+1,kkk-1) * p(-1, 0, 0);
3820 A000(iii+1,jjj+1,kkk-1) * p(-1,-1,-1)
3821 + Ap00(iii+1,jjj+1,kkk-1) * p( 0,-1,-1)
3822 + A0p0(iii+1,jjj+1,kkk-1) * p(-1, 0,-1)
3823 + App0(iii+1,jjj+1,kkk-1) * p( 0, 0,-1)
3824 + A00p(iii+1,jjj+1,kkk-1) * p(-1,-1, 0)
3825 + Ap0p(iii+1,jjj+1,kkk-1) * p( 0,-1, 0)
3826 + A0pp(iii+1,jjj+1,kkk-1) * p(-1, 0, 0)
3827 + Appp(iii+1,jjj+1,kkk-1) * p( 0, 0, 0);
3829 Appm(iii,jjj,kkk) * p(-1,-1,-1)
3830 + App0(iii,jjj,kkk) * p(-1,-1, 0)
3831 + Appp(iii,jjj,kkk) * p(-1,-1,+1);
3833 A0pm(iii+1,jjj,kkk) * p(-1,-1,-1)
3834 + Appm(iii+1,jjj,kkk) * p( 0,-1,-1)
3835 + A0p0(iii+1,jjj,kkk) * p(-1,-1, 0)
3836 + App0(iii+1,jjj,kkk) * p( 0,-1, 0)
3837 + A0pp(iii+1,jjj,kkk) * p(-1,-1,+1)
3838 + Appp(iii+1,jjj,kkk) * p( 0,-1,+1);
3840 Ap0m(iii,jjj+1,kkk) * p(-1,-1,-1)
3841 + Appm(iii,jjj+1,kkk) * p(-1, 0,-1)
3842 + Ap00(iii,jjj+1,kkk) * p(-1,-1, 0)
3843 + App0(iii,jjj+1,kkk) * p(-1, 0, 0)
3844 + Ap0p(iii,jjj+1,kkk) * p(-1,-1,+1)
3845 + Appp(iii,jjj+1,kkk) * p(-1, 0,+1);
3847 A00m(iii+1,jjj+1,kkk) * p(-1,-1,-1)
3848 + Ap0m(iii+1,jjj+1,kkk) * p( 0,-1,-1)
3849 + A0pm(iii+1,jjj+1,kkk) * p(-1, 0,-1)
3850 + Appm(iii+1,jjj+1,kkk) * p( 0, 0,-1)
3851 + A000(iii+1,jjj+1,kkk) * p(-1,-1, 0)
3852 + Ap00(iii+1,jjj+1,kkk) * p( 0,-1, 0)
3853 + A0p0(iii+1,jjj+1,kkk) * p(-1, 0, 0)
3854 + App0(iii+1,jjj+1,kkk) * p( 0, 0, 0)
3855 + A00p(iii+1,jjj+1,kkk) * p(-1,-1,+1)
3856 + Ap0p(iii+1,jjj+1,kkk) * p( 0,-1,+1)
3857 + A0pp(iii+1,jjj+1,kkk) * p(-1, 0,+1)
3858 + Appp(iii+1,jjj+1,kkk) * p( 0, 0,+1);
3860 Appm(iii,jjj,kkk+1) * p(-1,-1, 0)
3861 + App0(iii,jjj,kkk+1) * p(-1,-1,+1);
3863 A0pm(iii+1,jjj,kkk+1) * p(-1,-1, 0)
3864 + Appm(iii+1,jjj,kkk+1) * p( 0,-1, 0)
3865 + A0p0(iii+1,jjj,kkk+1) * p(-1,-1,+1)
3866 + App0(iii+1,jjj,kkk+1) * p( 0,-1,+1);
3868 Ap0m(iii,jjj+1,kkk+1) * p(-1,-1, 0)
3869 + Appm(iii,jjj+1,kkk+1) * p(-1, 0, 0)
3870 + Ap00(iii,jjj+1,kkk+1) * p(-1,-1,+1)
3871 + App0(iii,jjj+1,kkk+1) * p(-1, 0,+1);
3873 A00m(iii+1,jjj+1,kkk+1) * p(-1,-1, 0)
3874 + Ap0m(iii+1,jjj+1,kkk+1) * p( 0,-1, 0)
3875 + A0pm(iii+1,jjj+1,kkk+1) * p(-1, 0, 0)
3876 + Appm(iii+1,jjj+1,kkk+1) * p( 0, 0, 0)
3877 + A000(iii+1,jjj+1,kkk+1) * p(-1,-1,+1)
3878 + Ap00(iii+1,jjj+1,kkk+1) * p( 0,-1,+1)
3879 + A0p0(iii+1,jjj+1,kkk+1) * p(-1, 0,+1)
3880 + App0(iii+1,jjj+1,kkk+1) * p( 0, 0,+1);
3882 ( restrict_from_00m_to(iii,jjj,kkk) * ap( 0, 0,-1)
3883 + restrict_from_p0m_to(iii,jjj,kkk) * ap(+1, 0,-1)
3884 + restrict_from_0pm_to(iii,jjj,kkk) * ap( 0,+1,-1)
3885 + restrict_from_ppm_to(iii,jjj,kkk) * ap(+1,+1,-1)
3886 + restrict_from_000_to(iii,jjj,kkk) * ap( 0, 0, 0)
3887 + restrict_from_p00_to(iii,jjj,kkk) * ap(+1, 0, 0)
3888 + restrict_from_0p0_to(iii,jjj,kkk) * ap( 0,+1, 0)
3889 + restrict_from_pp0_to(iii,jjj,kkk) * ap(+1,+1, 0)
3890 + restrict_from_00p_to(iii,jjj,kkk) * ap( 0, 0,+1)
3891 + restrict_from_p0p_to(iii,jjj,kkk) * ap(+1, 0,+1)
3892 + restrict_from_0pp_to(iii,jjj,kkk) * ap( 0,+1,+1)
3893 + restrict_from_ppp_to(iii,jjj,kkk) * ap(+1,+1,+1));
3899 p( 0,-1,-1) = interp_from_0pp_to(iii-2,jjj+1,kkk-1);
3900 p(+1,-1,-1) = interp_from_mpp_to(iii-1,jjj+1,kkk-1);
3901 p( 0, 0,-1) = interp_from_00p_to(iii-2,jjj+2,kkk-1);
3902 p(+1, 0,-1) = interp_from_m0p_to(iii-1,jjj+2,kkk-1);
3903 p( 0,-1, 0) = interp_from_0p0_to(iii-2,jjj+1,kkk );
3904 p(+1,-1, 0) = interp_from_mp0_to(iii-1,jjj+1,kkk );
3905 p( 0, 0, 0) = Real(1.);
3906 p(+1, 0, 0) = interp_from_m00_to(iii-1,jjj+2,kkk );
3907 p( 0,-1,+1) = interp_from_0pm_to(iii-2,jjj+1,kkk+1);
3908 p(+1,-1,+1) = interp_from_mpm_to(iii-1,jjj+1,kkk+1);
3909 p( 0, 0,+1) = interp_from_00m_to(iii-2,jjj+2,kkk+1);
3910 p(+1, 0,+1) = interp_from_m0m_to(iii-1,jjj+2,kkk+1);
3912 Amp0(iii-1,jjj,kkk-1) * p( 0,-1,-1)
3913 + A0p0(iii-1,jjj,kkk-1) * p(+1,-1,-1)
3914 + Ampp(iii-1,jjj,kkk-1) * p( 0,-1, 0)
3915 + A0pp(iii-1,jjj,kkk-1) * p(+1,-1, 0);
3917 Amp0(iii,jjj,kkk-1) * p(+1,-1,-1)
3918 + Ampp(iii,jjj,kkk-1) * p(+1,-1, 0);
3920 Am00(iii-1,jjj+1,kkk-1) * p( 0,-1,-1)
3921 + A000(iii-1,jjj+1,kkk-1) * p(+1,-1,-1)
3922 + Amp0(iii-1,jjj+1,kkk-1) * p( 0, 0,-1)
3923 + A0p0(iii-1,jjj+1,kkk-1) * p(+1, 0,-1)
3924 + Am0p(iii-1,jjj+1,kkk-1) * p( 0,-1, 0)
3925 + A00p(iii-1,jjj+1,kkk-1) * p(+1,-1, 0)
3926 + Ampp(iii-1,jjj+1,kkk-1) * p( 0, 0, 0)
3927 + A0pp(iii-1,jjj+1,kkk-1) * p(+1, 0, 0);
3929 Am00(iii,jjj+1,kkk-1) * p(+1,-1,-1)
3930 + Amp0(iii,jjj+1,kkk-1) * p(+1, 0,-1)
3931 + Am0p(iii,jjj+1,kkk-1) * p(+1,-1, 0)
3932 + Ampp(iii,jjj+1,kkk-1) * p(+1, 0, 0);
3934 Ampm(iii-1,jjj,kkk) * p( 0,-1,-1)
3935 + A0pm(iii-1,jjj,kkk) * p(+1,-1,-1)
3936 + Amp0(iii-1,jjj,kkk) * p( 0,-1, 0)
3937 + A0p0(iii-1,jjj,kkk) * p(+1,-1, 0)
3938 + Ampp(iii-1,jjj,kkk) * p( 0,-1,+1)
3939 + A0pp(iii-1,jjj,kkk) * p(+1,-1,+1);
3941 Ampm(iii,jjj,kkk) * p(+1,-1,-1)
3942 + Amp0(iii,jjj,kkk) * p(+1,-1, 0)
3943 + Ampp(iii,jjj,kkk) * p(+1,-1,+1);
3945 Am0m(iii-1,jjj+1,kkk) * p( 0,-1,-1)
3946 + A00m(iii-1,jjj+1,kkk) * p(+1,-1,-1)
3947 + Ampm(iii-1,jjj+1,kkk) * p( 0, 0,-1)
3948 + A0pm(iii-1,jjj+1,kkk) * p(+1, 0,-1)
3949 + Am00(iii-1,jjj+1,kkk) * p( 0,-1, 0)
3950 + A000(iii-1,jjj+1,kkk) * p(+1,-1, 0)
3951 + Amp0(iii-1,jjj+1,kkk) * p( 0, 0, 0)
3952 + A0p0(iii-1,jjj+1,kkk) * p(+1, 0, 0)
3953 + Am0p(iii-1,jjj+1,kkk) * p( 0,-1,+1)
3954 + A00p(iii-1,jjj+1,kkk) * p(+1,-1,+1)
3955 + Ampp(iii-1,jjj+1,kkk) * p( 0, 0,+1)
3956 + A0pp(iii-1,jjj+1,kkk) * p(+1, 0,+1);
3958 Am0m(iii,jjj+1,kkk) * p(+1,-1,-1)
3959 + Ampm(iii,jjj+1,kkk) * p(+1, 0,-1)
3960 + Am00(iii,jjj+1,kkk) * p(+1,-1, 0)
3961 + Amp0(iii,jjj+1,kkk) * p(+1, 0, 0)
3962 + Am0p(iii,jjj+1,kkk) * p(+1,-1,+1)
3963 + Ampp(iii,jjj+1,kkk) * p(+1, 0,+1);
3965 Ampm(iii-1,jjj,kkk+1) * p( 0,-1, 0)
3966 + A0pm(iii-1,jjj,kkk+1) * p(+1,-1, 0)
3967 + Amp0(iii-1,jjj,kkk+1) * p( 0,-1,+1)
3968 + A0p0(iii-1,jjj,kkk+1) * p(+1,-1,+1);
3970 Ampm(iii,jjj,kkk+1) * p(+1,-1, 0)
3971 + Amp0(iii,jjj,kkk+1) * p(+1,-1,+1);
3973 Am0m(iii-1,jjj+1,kkk+1) * p( 0,-1, 0)
3974 + A00m(iii-1,jjj+1,kkk+1) * p(+1,-1, 0)
3975 + Ampm(iii-1,jjj+1,kkk+1) * p( 0, 0, 0)
3976 + A0pm(iii-1,jjj+1,kkk+1) * p(+1, 0, 0)
3977 + Am00(iii-1,jjj+1,kkk+1) * p( 0,-1,+1)
3978 + A000(iii-1,jjj+1,kkk+1) * p(+1,-1,+1)
3979 + Amp0(iii-1,jjj+1,kkk+1) * p( 0, 0,+1)
3980 + A0p0(iii-1,jjj+1,kkk+1) * p(+1, 0,+1);
3982 Am0m(iii,jjj+1,kkk+1) * p(+1,-1, 0)
3983 + Ampm(iii,jjj+1,kkk+1) * p(+1, 0, 0)
3984 + Am00(iii,jjj+1,kkk+1) * p(+1,-1,+1)
3985 + Amp0(iii,jjj+1,kkk+1) * p(+1, 0,+1);
3987 ( restrict_from_m0m_to(iii,jjj,kkk) * ap(-1, 0,-1)
3988 + restrict_from_00m_to(iii,jjj,kkk) * ap( 0, 0,-1)
3989 + restrict_from_mpm_to(iii,jjj,kkk) * ap(-1,+1,-1)
3990 + restrict_from_0pm_to(iii,jjj,kkk) * ap( 0,+1,-1)
3991 + restrict_from_m00_to(iii,jjj,kkk) * ap(-1, 0, 0)
3992 + restrict_from_000_to(iii,jjj,kkk) * ap( 0, 0, 0)
3993 + restrict_from_mp0_to(iii,jjj,kkk) * ap(-1,+1, 0)
3994 + restrict_from_0p0_to(iii,jjj,kkk) * ap( 0,+1, 0)
3995 + restrict_from_m0p_to(iii,jjj,kkk) * ap(-1, 0,+1)
3996 + restrict_from_00p_to(iii,jjj,kkk) * ap( 0, 0,+1)
3997 + restrict_from_mpp_to(iii,jjj,kkk) * ap(-1,+1,+1)
3998 + restrict_from_0pp_to(iii,jjj,kkk) * ap( 0,+1,+1));
4000 csten(i,j,k,
ist_pp0) = Real(0.5)*(cs1 + cs2);
4006 p(-1,-1,-1) = interp_from_ppp_to(iii+1,jjj-1,kkk+1);
4007 p( 0,-1,-1) = interp_from_0pp_to(iii+2,jjj-1,kkk+1);
4008 p(-1, 0,-1) = interp_from_p0p_to(iii+1,jjj ,kkk+1);
4009 p( 0, 0,-1) = interp_from_00p_to(iii+2,jjj ,kkk+1);
4010 p(-1,+1,-1) = interp_from_pmp_to(iii+1,jjj+1,kkk+1);
4011 p( 0,+1,-1) = interp_from_0mp_to(iii+2,jjj+1,kkk+1);
4012 p(-1,-1, 0) = interp_from_pp0_to(iii+1,jjj-1,kkk+2);
4013 p( 0,-1, 0) = interp_from_0p0_to(iii+2,jjj-1,kkk+2);
4014 p(-1, 0, 0) = interp_from_p00_to(iii+1,jjj ,kkk+2);
4015 p( 0, 0, 0) = Real(1.);
4016 p(-1,+1, 0) = interp_from_pm0_to(iii+1,jjj+1,kkk+2);
4017 p( 0,+1, 0) = interp_from_0m0_to(iii+2,jjj+1,kkk+2);
4019 Ap0p(iii,jjj-1,kkk) * p(-1,-1,-1)
4020 + Appp(iii,jjj-1,kkk) * p(-1, 0,-1);
4022 A00p(iii+1,jjj-1,kkk) * p(-1,-1,-1)
4023 + Ap0p(iii+1,jjj-1,kkk) * p( 0,-1,-1)
4024 + A0pp(iii+1,jjj-1,kkk) * p(-1, 0,-1)
4025 + Appp(iii+1,jjj-1,kkk) * p( 0, 0,-1);
4027 Apmp(iii,jjj,kkk) * p(-1,-1,-1)
4028 + Ap0p(iii,jjj,kkk) * p(-1, 0,-1)
4029 + Appp(iii,jjj,kkk) * p(-1,+1,-1);
4031 A0mp(iii+1,jjj,kkk) * p(-1,-1,-1)
4032 + Apmp(iii+1,jjj,kkk) * p( 0,-1,-1)
4033 + A00p(iii+1,jjj,kkk) * p(-1, 0,-1)
4034 + Ap0p(iii+1,jjj,kkk) * p( 0, 0,-1)
4035 + A0pp(iii+1,jjj,kkk) * p(-1,+1,-1)
4036 + Appp(iii+1,jjj,kkk) * p( 0,+1,-1);
4038 Apmp(iii,jjj+1,kkk) * p(-1, 0,-1)
4039 + Ap0p(iii,jjj+1,kkk) * p(-1,+1,-1);
4041 A0mp(iii+1,jjj+1,kkk) * p(-1, 0,-1)
4042 + Apmp(iii+1,jjj+1,kkk) * p( 0, 0,-1)
4043 + A00p(iii+1,jjj+1,kkk) * p(-1,+1,-1)
4044 + Ap0p(iii+1,jjj+1,kkk) * p( 0,+1,-1);
4046 Ap00(iii,jjj-1,kkk+1) * p(-1,-1,-1)
4047 + App0(iii,jjj-1,kkk+1) * p(-1, 0,-1)
4048 + Ap0p(iii,jjj-1,kkk+1) * p(-1,-1, 0)
4049 + Appp(iii,jjj-1,kkk+1) * p(-1, 0, 0);
4051 A000(iii+1,jjj-1,kkk+1) * p(-1,-1,-1)
4052 + Ap00(iii+1,jjj-1,kkk+1) * p( 0,-1,-1)
4053 + A0p0(iii+1,jjj-1,kkk+1) * p(-1, 0,-1)
4054 + App0(iii+1,jjj-1,kkk+1) * p( 0, 0,-1)
4055 + A00p(iii+1,jjj-1,kkk+1) * p(-1,-1, 0)
4056 + Ap0p(iii+1,jjj-1,kkk+1) * p( 0,-1, 0)
4057 + A0pp(iii+1,jjj-1,kkk+1) * p(-1, 0, 0)
4058 + Appp(iii+1,jjj-1,kkk+1) * p( 0, 0, 0);
4060 Apm0(iii,jjj,kkk+1) * p(-1,-1,-1)
4061 + Ap00(iii,jjj,kkk+1) * p(-1, 0,-1)
4062 + App0(iii,jjj,kkk+1) * p(-1,+1,-1)
4063 + Apmp(iii,jjj,kkk+1) * p(-1,-1, 0)
4064 + Ap0p(iii,jjj,kkk+1) * p(-1, 0, 0)
4065 + Appp(iii,jjj,kkk+1) * p(-1,+1, 0);
4067 A0m0(iii+1,jjj,kkk+1) * p(-1,-1,-1)
4068 + Apm0(iii+1,jjj,kkk+1) * p( 0,-1,-1)
4069 + A000(iii+1,jjj,kkk+1) * p(-1, 0,-1)
4070 + Ap00(iii+1,jjj,kkk+1) * p( 0, 0,-1)
4071 + A0p0(iii+1,jjj,kkk+1) * p(-1,+1,-1)
4072 + App0(iii+1,jjj,kkk+1) * p( 0,+1,-1)
4073 + A0mp(iii+1,jjj,kkk+1) * p(-1,-1, 0)
4074 + Apmp(iii+1,jjj,kkk+1) * p( 0,-1, 0)
4075 + A00p(iii+1,jjj,kkk+1) * p(-1, 0, 0)
4076 + Ap0p(iii+1,jjj,kkk+1) * p( 0, 0, 0)
4077 + A0pp(iii+1,jjj,kkk+1) * p(-1,+1, 0)
4078 + Appp(iii+1,jjj,kkk+1) * p( 0,+1, 0);
4080 Apm0(iii,jjj+1,kkk+1) * p(-1, 0,-1)
4081 + Ap00(iii,jjj+1,kkk+1) * p(-1,+1,-1)
4082 + Apmp(iii,jjj+1,kkk+1) * p(-1, 0, 0)
4083 + Ap0p(iii,jjj+1,kkk+1) * p(-1,+1, 0);
4085 A0m0(iii+1,jjj+1,kkk+1) * p(-1, 0,-1)
4086 + Apm0(iii+1,jjj+1,kkk+1) * p( 0, 0,-1)
4087 + A000(iii+1,jjj+1,kkk+1) * p(-1,+1,-1)
4088 + Ap00(iii+1,jjj+1,kkk+1) * p( 0,+1,-1)
4089 + A0mp(iii+1,jjj+1,kkk+1) * p(-1, 0, 0)
4090 + Apmp(iii+1,jjj+1,kkk+1) * p( 0, 0, 0)
4091 + A00p(iii+1,jjj+1,kkk+1) * p(-1,+1, 0)
4092 + Ap0p(iii+1,jjj+1,kkk+1) * p( 0,+1, 0);
4094 ( restrict_from_0m0_to(iii,jjj,kkk) * ap( 0,-1, 0)
4095 + restrict_from_pm0_to(iii,jjj,kkk) * ap(+1,-1, 0)
4096 + restrict_from_000_to(iii,jjj,kkk) * ap( 0, 0, 0)
4097 + restrict_from_p00_to(iii,jjj,kkk) * ap(+1, 0, 0)
4098 + restrict_from_0p0_to(iii,jjj,kkk) * ap( 0,+1, 0)
4099 + restrict_from_pp0_to(iii,jjj,kkk) * ap(+1,+1, 0)
4100 + restrict_from_0mp_to(iii,jjj,kkk) * ap( 0,-1,+1)
4101 + restrict_from_pmp_to(iii,jjj,kkk) * ap(+1,-1,+1)
4102 + restrict_from_00p_to(iii,jjj,kkk) * ap( 0, 0,+1)
4103 + restrict_from_p0p_to(iii,jjj,kkk) * ap(+1, 0,+1)
4104 + restrict_from_0pp_to(iii,jjj,kkk) * ap( 0,+1,+1)
4105 + restrict_from_ppp_to(iii,jjj,kkk) * ap(+1,+1,+1));
4111 p( 0,-1,-1) = interp_from_0pp_to(iii-2,jjj-1,kkk+1);
4112 p(+1,-1,-1) = interp_from_mpp_to(iii-1,jjj-1,kkk+1);
4113 p( 0, 0,-1) = interp_from_00p_to(iii-2,jjj ,kkk+1);
4114 p(+1, 0,-1) = interp_from_m0p_to(iii-1,jjj ,kkk+1);
4115 p( 0,+1,-1) = interp_from_0mp_to(iii-2,jjj+1,kkk+1);
4116 p(+1,+1,-1) = interp_from_mmp_to(iii-1,jjj+1,kkk+1);
4117 p( 0,-1, 0) = interp_from_0p0_to(iii-2,jjj-1,kkk+2);
4118 p(+1,-1, 0) = interp_from_mp0_to(iii-1,jjj-1,kkk+2);
4119 p( 0, 0, 0) = Real(1.);
4120 p(+1, 0, 0) = interp_from_m00_to(iii-1,jjj ,kkk+2);
4121 p( 0,+1, 0) = interp_from_0m0_to(iii-2,jjj+1,kkk+2);
4122 p(+1,+1, 0) = interp_from_mm0_to(iii-1,jjj+1,kkk+2);
4125 Am0p(iii-1,jjj-1,kkk) * p( 0,-1,-1)
4126 + A00p(iii-1,jjj-1,kkk) * p(+1,-1,-1)
4127 + Ampp(iii-1,jjj-1,kkk) * p( 0, 0,-1)
4128 + A0pp(iii-1,jjj-1,kkk) * p(+1, 0,-1);
4130 Am0p(iii,jjj-1,kkk) * p(+1,-1,-1)
4131 + Ampp(iii,jjj-1,kkk) * p(+1, 0,-1);
4133 Ammp(iii-1,jjj,kkk) * p( 0,-1,-1)
4134 + A0mp(iii-1,jjj,kkk) * p(+1,-1,-1)
4135 + Am0p(iii-1,jjj,kkk) * p( 0, 0,-1)
4136 + A00p(iii-1,jjj,kkk) * p(+1, 0,-1)
4137 + Ampp(iii-1,jjj,kkk) * p( 0,+1,-1)
4138 + A0pp(iii-1,jjj,kkk) * p(+1,+1,-1);
4140 Ammp(iii,jjj,kkk) * p(+1,-1,-1)
4141 + Am0p(iii,jjj,kkk) * p(+1, 0,-1)
4142 + Ampp(iii,jjj,kkk) * p(+1,+1,-1);
4144 Ammp(iii-1,jjj+1,kkk) * p( 0, 0,-1)
4145 + A0mp(iii-1,jjj+1,kkk) * p(+1, 0,-1)
4146 + Am0p(iii-1,jjj+1,kkk) * p( 0,+1,-1)
4147 + A00p(iii-1,jjj+1,kkk) * p(+1,+1,-1);
4149 Ammp(iii,jjj+1,kkk) * p(+1, 0,-1)
4150 + Am0p(iii,jjj+1,kkk) * p(+1,+1,-1);
4152 Am00(iii-1,jjj-1,kkk+1) * p( 0,-1,-1)
4153 + A000(iii-1,jjj-1,kkk+1) * p(+1,-1,-1)
4154 + Amp0(iii-1,jjj-1,kkk+1) * p( 0, 0,-1)
4155 + A0p0(iii-1,jjj-1,kkk+1) * p(+1, 0,-1)
4156 + Am0p(iii-1,jjj-1,kkk+1) * p( 0,-1, 0)
4157 + A00p(iii-1,jjj-1,kkk+1) * p(+1,-1, 0)
4158 + Ampp(iii-1,jjj-1,kkk+1) * p( 0, 0, 0)
4159 + A0pp(iii-1,jjj-1,kkk+1) * p(+1, 0, 0);
4161 Am00(iii,jjj-1,kkk+1) * p(+1,-1,-1)
4162 + Amp0(iii,jjj-1,kkk+1) * p(+1, 0,-1)
4163 + Am0p(iii,jjj-1,kkk+1) * p(+1,-1, 0)
4164 + Ampp(iii,jjj-1,kkk+1) * p(+1, 0, 0);
4166 Amm0(iii-1,jjj,kkk+1) * p( 0,-1,-1)
4167 + A0m0(iii-1,jjj,kkk+1) * p(+1,-1,-1)
4168 + Am00(iii-1,jjj,kkk+1) * p( 0, 0,-1)
4169 + A000(iii-1,jjj,kkk+1) * p(+1, 0,-1)
4170 + Amp0(iii-1,jjj,kkk+1) * p( 0,+1,-1)
4171 + A0p0(iii-1,jjj,kkk+1) * p(+1,+1,-1)
4172 + Ammp(iii-1,jjj,kkk+1) * p( 0,-1, 0)
4173 + A0mp(iii-1,jjj,kkk+1) * p(+1,-1, 0)
4174 + Am0p(iii-1,jjj,kkk+1) * p( 0, 0, 0)
4175 + A00p(iii-1,jjj,kkk+1) * p(+1, 0, 0)
4176 + Ampp(iii-1,jjj,kkk+1) * p( 0,+1, 0)
4177 + A0pp(iii-1,jjj,kkk+1) * p(+1,+1, 0);
4179 Amm0(iii,jjj,kkk+1) * p(+1,-1,-1)
4180 + Am00(iii,jjj,kkk+1) * p(+1, 0,-1)
4181 + Amp0(iii,jjj,kkk+1) * p(+1,+1,-1)
4182 + Ammp(iii,jjj,kkk+1) * p(+1,-1, 0)
4183 + Am0p(iii,jjj,kkk+1) * p(+1, 0, 0)
4184 + Ampp(iii,jjj,kkk+1) * p(+1,+1, 0);
4186 Amm0(iii-1,jjj+1,kkk+1) * p( 0, 0,-1)
4187 + A0m0(iii-1,jjj+1,kkk+1) * p(+1, 0,-1)
4188 + Am00(iii-1,jjj+1,kkk+1) * p( 0,+1,-1)
4189 + A000(iii-1,jjj+1,kkk+1) * p(+1,+1,-1)
4190 + Ammp(iii-1,jjj+1,kkk+1) * p( 0, 0, 0)
4191 + A0mp(iii-1,jjj+1,kkk+1) * p(+1, 0, 0)
4192 + Am0p(iii-1,jjj+1,kkk+1) * p( 0,+1, 0)
4193 + A00p(iii-1,jjj+1,kkk+1) * p(+1,+1, 0);
4195 Amm0(iii,jjj+1,kkk+1) * p(+1, 0,-1)
4196 + Am00(iii,jjj+1,kkk+1) * p(+1,+1,-1)
4197 + Ammp(iii,jjj+1,kkk+1) * p(+1, 0, 0)
4198 + Am0p(iii,jjj+1,kkk+1) * p(+1,+1, 0);
4200 ( restrict_from_mm0_to(iii,jjj,kkk) * ap(-1,-1, 0)
4201 + restrict_from_0m0_to(iii,jjj,kkk) * ap( 0,-1, 0)
4202 + restrict_from_m00_to(iii,jjj,kkk) * ap(-1, 0, 0)
4203 + restrict_from_000_to(iii,jjj,kkk) * ap( 0, 0, 0)
4204 + restrict_from_mp0_to(iii,jjj,kkk) * ap(-1,+1, 0)
4205 + restrict_from_0p0_to(iii,jjj,kkk) * ap( 0,+1, 0)
4206 + restrict_from_mmp_to(iii,jjj,kkk) * ap(-1,-1,+1)
4207 + restrict_from_0mp_to(iii,jjj,kkk) * ap( 0,-1,+1)
4208 + restrict_from_m0p_to(iii,jjj,kkk) * ap(-1, 0,+1)
4209 + restrict_from_00p_to(iii,jjj,kkk) * ap( 0, 0,+1)
4210 + restrict_from_mpp_to(iii,jjj,kkk) * ap(-1,+1,+1)
4211 + restrict_from_0pp_to(iii,jjj,kkk) * ap( 0,+1,+1));
4213 csten(i,j,k,
ist_p0p) = Real(0.5)*(cs1+cs2);
4219 p(-1,-1,-1) = interp_from_ppp_to(iii-1,jjj+1,kkk+1);
4220 p( 0,-1,-1) = interp_from_0pp_to(iii ,jjj+1,kkk+1);
4221 p(+1,-1,-1) = interp_from_mpp_to(iii+1,jjj+1,kkk+1);
4222 p(-1, 0,-1) = interp_from_p0p_to(iii-1,jjj+2,kkk+1);
4223 p( 0, 0,-1) = interp_from_00p_to(iii ,jjj+2,kkk+1);
4224 p(+1, 0,-1) = interp_from_m0p_to(iii+1,jjj+2,kkk+1);
4225 p(-1,-1, 0) = interp_from_pp0_to(iii-1,jjj+1,kkk+2);
4226 p( 0,-1, 0) = interp_from_0p0_to(iii ,jjj+1,kkk+2);
4227 p(+1,-1, 0) = interp_from_mp0_to(iii+1,jjj+1,kkk+2);
4228 p(-1, 0, 0) = interp_from_p00_to(iii-1,jjj+2,kkk+2);
4229 p( 0, 0, 0) = Real(1.);
4230 p(+1, 0, 0) = interp_from_m00_to(iii+1,jjj+2,kkk+2);
4232 A0pp(iii-1,jjj,kkk) * p(-1,-1,-1)
4233 + Appp(iii-1,jjj,kkk) * p( 0,-1,-1);
4235 Ampp(iii,jjj,kkk) * p(-1,-1,-1)
4236 + A0pp(iii,jjj,kkk) * p( 0,-1,-1)
4237 + Appp(iii,jjj,kkk) * p(+1,-1,-1);
4239 Ampp(iii+1,jjj,kkk) * p( 0,-1,-1)
4240 + A0pp(iii+1,jjj,kkk) * p(+1,-1,-1);
4242 A00p(iii-1,jjj+1,kkk) * p(-1,-1,-1)
4243 + Ap0p(iii-1,jjj+1,kkk) * p( 0,-1,-1)
4244 + A0pp(iii-1,jjj+1,kkk) * p(-1, 0,-1)
4245 + Appp(iii-1,jjj+1,kkk) * p( 0, 0,-1);
4247 Am0p(iii,jjj+1,kkk) * p(-1,-1,-1)
4248 + A00p(iii,jjj+1,kkk) * p( 0,-1,-1)
4249 + Ap0p(iii,jjj+1,kkk) * p(+1,-1,-1)
4250 + Ampp(iii,jjj+1,kkk) * p(-1, 0,-1)
4251 + A0pp(iii,jjj+1,kkk) * p( 0, 0,-1)
4252 + Appp(iii,jjj+1,kkk) * p(+1, 0,-1);
4254 Am0p(iii+1,jjj+1,kkk) * p( 0,-1,-1)
4255 + A00p(iii+1,jjj+1,kkk) * p(+1,-1,-1)
4256 + Ampp(iii+1,jjj+1,kkk) * p( 0, 0,-1)
4257 + A0pp(iii+1,jjj+1,kkk) * p(+1, 0,-1);
4259 A0p0(iii-1,jjj,kkk+1) * p(-1,-1,-1)
4260 + App0(iii-1,jjj,kkk+1) * p( 0,-1,-1)
4261 + A0pp(iii-1,jjj,kkk+1) * p(-1,-1, 0)
4262 + Appp(iii-1,jjj,kkk+1) * p( 0,-1, 0);
4264 Amp0(iii,jjj,kkk+1) * p(-1,-1,-1)
4265 + A0p0(iii,jjj,kkk+1) * p( 0,-1,-1)
4266 + App0(iii,jjj,kkk+1) * p(+1,-1,-1)
4267 + Ampp(iii,jjj,kkk+1) * p(-1,-1, 0)
4268 + A0pp(iii,jjj,kkk+1) * p( 0,-1, 0)
4269 + Appp(iii,jjj,kkk+1) * p(+1,-1, 0);
4271 Amp0(iii+1,jjj,kkk+1) * p( 0,-1,-1)
4272 + A0p0(iii+1,jjj,kkk+1) * p(+1,-1,-1)
4273 + Ampp(iii+1,jjj,kkk+1) * p( 0,-1, 0)
4274 + A0pp(iii+1,jjj,kkk+1) * p(+1,-1, 0);
4276 A000(iii-1,jjj+1,kkk+1) * p(-1,-1,-1)
4277 + Ap00(iii-1,jjj+1,kkk+1) * p( 0,-1,-1)
4278 + A0p0(iii-1,jjj+1,kkk+1) * p(-1, 0,-1)
4279 + App0(iii-1,jjj+1,kkk+1) * p( 0, 0,-1)
4280 + A00p(iii-1,jjj+1,kkk+1) * p(-1,-1, 0)
4281 + Ap0p(iii-1,jjj+1,kkk+1) * p( 0,-1, 0)
4282 + A0pp(iii-1,jjj+1,kkk+1) * p(-1, 0, 0)
4283 + Appp(iii-1,jjj+1,kkk+1) * p( 0, 0, 0);
4285 Am00(iii,jjj+1,kkk+1) * p(-1,-1,-1)
4286 + A000(iii,jjj+1,kkk+1) * p( 0,-1,-1)
4287 + Ap00(iii,jjj+1,kkk+1) * p(+1,-1,-1)
4288 + Amp0(iii,jjj+1,kkk+1) * p(-1, 0,-1)
4289 + A0p0(iii,jjj+1,kkk+1) * p( 0, 0,-1)
4290 + App0(iii,jjj+1,kkk+1) * p(+1, 0,-1)
4291 + Am0p(iii,jjj+1,kkk+1) * p(-1,-1, 0)
4292 + A00p(iii,jjj+1,kkk+1) * p( 0,-1, 0)
4293 + Ap0p(iii,jjj+1,kkk+1) * p(+1,-1, 0)
4294 + Ampp(iii,jjj+1,kkk+1) * p(-1, 0, 0)
4295 + A0pp(iii,jjj+1,kkk+1) * p( 0, 0, 0)
4296 + Appp(iii,jjj+1,kkk+1) * p(+1, 0, 0);
4298 Am00(iii+1,jjj+1,kkk+1) * p( 0,-1,-1)
4299 + A000(iii+1,jjj+1,kkk+1) * p(+1,-1,-1)
4300 + Amp0(iii+1,jjj+1,kkk+1) * p( 0, 0,-1)
4301 + A0p0(iii+1,jjj+1,kkk+1) * p(+1, 0,-1)
4302 + Am0p(iii+1,jjj+1,kkk+1) * p( 0,-1, 0)
4303 + A00p(iii+1,jjj+1,kkk+1) * p(+1,-1, 0)
4304 + Ampp(iii+1,jjj+1,kkk+1) * p( 0, 0, 0)
4305 + A0pp(iii+1,jjj+1,kkk+1) * p(+1, 0, 0);
4307 ( restrict_from_m00_to(iii,jjj,kkk) * ap(-1, 0, 0)
4308 + restrict_from_000_to(iii,jjj,kkk) * ap( 0, 0, 0)
4309 + restrict_from_p00_to(iii,jjj,kkk) * ap(+1, 0, 0)
4310 + restrict_from_mp0_to(iii,jjj,kkk) * ap(-1,+1, 0)
4311 + restrict_from_0p0_to(iii,jjj,kkk) * ap( 0,+1, 0)
4312 + restrict_from_pp0_to(iii,jjj,kkk) * ap(+1,+1, 0)
4313 + restrict_from_m0p_to(iii,jjj,kkk) * ap(-1, 0,+1)
4314 + restrict_from_00p_to(iii,jjj,kkk) * ap( 0, 0,+1)
4315 + restrict_from_p0p_to(iii,jjj,kkk) * ap(+1, 0,+1)
4316 + restrict_from_mpp_to(iii,jjj,kkk) * ap(-1,+1,+1)
4317 + restrict_from_0pp_to(iii,jjj,kkk) * ap( 0,+1,+1)
4318 + restrict_from_ppp_to(iii,jjj,kkk) * ap(+1,+1,+1));
4324 p(-1, 0,-1) = interp_from_p0p_to(iii-1,jjj-2,kkk+1);
4325 p( 0, 0,-1) = interp_from_00p_to(iii ,jjj-2,kkk+1);
4326 p(+1, 0,-1) = interp_from_m0p_to(iii+1,jjj-2,kkk+1);
4327 p(-1,+1,-1) = interp_from_pmp_to(iii-1,jjj-1,kkk+1);
4328 p( 0,+1,-1) = interp_from_0mp_to(iii ,jjj-1,kkk+1);
4329 p(+1,+1,-1) = interp_from_mmp_to(iii+1,jjj-1,kkk+1);
4330 p(-1, 0, 0) = interp_from_p00_to(iii-1,jjj-2,kkk+2);
4331 p( 0, 0, 0) = Real(1.);
4332 p(+1, 0, 0) = interp_from_m00_to(iii+1,jjj-2,kkk+2);
4333 p(-1,+1, 0) = interp_from_pm0_to(iii-1,jjj-1,kkk+2);
4334 p( 0,+1, 0) = interp_from_0m0_to(iii ,jjj-1,kkk+2);
4335 p(+1,+1, 0) = interp_from_mm0_to(iii+1,jjj-1,kkk+2);
4337 A0mp(iii-1,jjj-1,kkk) * p(-1, 0,-1)
4338 + Apmp(iii-1,jjj-1,kkk) * p( 0, 0,-1)
4339 + A00p(iii-1,jjj-1,kkk) * p(-1,+1,-1)
4340 + Ap0p(iii-1,jjj-1,kkk) * p( 0,+1,-1);
4342 Ammp(iii,jjj-1,kkk) * p(-1, 0,-1)
4343 + A0mp(iii,jjj-1,kkk) * p( 0, 0,-1)
4344 + Apmp(iii,jjj-1,kkk) * p(+1, 0,-1)
4345 + Am0p(iii,jjj-1,kkk) * p(-1,+1,-1)
4346 + A00p(iii,jjj-1,kkk) * p( 0,+1,-1)
4347 + Ap0p(iii,jjj-1,kkk) * p(+1,+1,-1);
4349 Ammp(iii+1,jjj-1,kkk) * p( 0, 0,-1)
4350 + A0mp(iii+1,jjj-1,kkk) * p(+1, 0,-1)
4351 + Am0p(iii+1,jjj-1,kkk) * p( 0,+1,-1)
4352 + A00p(iii+1,jjj-1,kkk) * p(+1,+1,-1);
4354 A0mp(iii-1,jjj,kkk) * p(-1,+1,-1)
4355 + Apmp(iii-1,jjj,kkk) * p( 0,+1,-1);
4357 Ammp(iii,jjj,kkk) * p(-1,+1,-1)
4358 + A0mp(iii,jjj,kkk) * p( 0,+1,-1)
4359 + Apmp(iii,jjj,kkk) * p(+1,+1,-1);
4361 Ammp(iii+1,jjj,kkk) * p( 0,+1,-1)
4362 + A0mp(iii+1,jjj,kkk) * p(+1,+1,-1);
4364 A0m0(iii-1,jjj-1,kkk+1) * p(-1, 0,-1)
4365 + Apm0(iii-1,jjj-1,kkk+1) * p( 0, 0,-1)
4366 + A000(iii-1,jjj-1,kkk+1) * p(-1,+1,-1)
4367 + Ap00(iii-1,jjj-1,kkk+1) * p( 0,+1,-1)
4368 + A0mp(iii-1,jjj-1,kkk+1) * p(-1, 0, 0)
4369 + Apmp(iii-1,jjj-1,kkk+1) * p( 0, 0, 0)
4370 + A00p(iii-1,jjj-1,kkk+1) * p(-1,+1, 0)
4371 + Ap0p(iii-1,jjj-1,kkk+1) * p( 0,+1, 0);
4373 Amm0(iii,jjj-1,kkk+1) * p(-1, 0,-1)
4374 + A0m0(iii,jjj-1,kkk+1) * p( 0, 0,-1)
4375 + Apm0(iii,jjj-1,kkk+1) * p(+1, 0,-1)
4376 + Am00(iii,jjj-1,kkk+1) * p(-1,+1,-1)
4377 + A000(iii,jjj-1,kkk+1) * p( 0,+1,-1)
4378 + Ap00(iii,jjj-1,kkk+1) * p(+1,+1,-1)
4379 + Ammp(iii,jjj-1,kkk+1) * p(-1, 0, 0)
4380 + A0mp(iii,jjj-1,kkk+1) * p( 0, 0, 0)
4381 + Apmp(iii,jjj-1,kkk+1) * p(+1, 0, 0)
4382 + Am0p(iii,jjj-1,kkk+1) * p(-1,+1, 0)
4383 + A00p(iii,jjj-1,kkk+1) * p( 0,+1, 0)
4384 + Ap0p(iii,jjj-1,kkk+1) * p(+1,+1, 0);
4386 Amm0(iii+1,jjj-1,kkk+1) * p( 0, 0,-1)
4387 + A0m0(iii+1,jjj-1,kkk+1) * p(+1, 0,-1)
4388 + Am00(iii+1,jjj-1,kkk+1) * p( 0,+1,-1)
4389 + A000(iii+1,jjj-1,kkk+1) * p(+1,+1,-1)
4390 + Ammp(iii+1,jjj-1,kkk+1) * p( 0, 0, 0)
4391 + A0mp(iii+1,jjj-1,kkk+1) * p(+1, 0, 0)
4392 + Am0p(iii+1,jjj-1,kkk+1) * p( 0,+1, 0)
4393 + A00p(iii+1,jjj-1,kkk+1) * p(+1,+1, 0);
4395 A0m0(iii-1,jjj,kkk+1) * p(-1,+1,-1)
4396 + Apm0(iii-1,jjj,kkk+1) * p( 0,+1,-1)
4397 + A0mp(iii-1,jjj,kkk+1) * p(-1,+1, 0)
4398 + Apmp(iii-1,jjj,kkk+1) * p( 0,+1, 0);
4400 Amm0(iii,jjj,kkk+1) * p(-1,+1,-1)
4401 + A0m0(iii,jjj,kkk+1) * p( 0,+1,-1)
4402 + Apm0(iii,jjj,kkk+1) * p(+1,+1,-1)
4403 + Ammp(iii,jjj,kkk+1) * p(-1,+1, 0)
4404 + A0mp(iii,jjj,kkk+1) * p( 0,+1, 0)
4405 + Apmp(iii,jjj,kkk+1) * p(+1,+1, 0);
4407 Amm0(iii+1,jjj,kkk+1) * p( 0,+1,-1)
4408 + A0m0(iii+1,jjj,kkk+1) * p(+1,+1,-1)
4409 + Ammp(iii+1,jjj,kkk+1) * p( 0,+1, 0)
4410 + A0mp(iii+1,jjj,kkk+1) * p(+1,+1, 0);
4412 ( restrict_from_mm0_to(iii,jjj,kkk) * ap(-1,-1, 0)
4413 + restrict_from_0m0_to(iii,jjj,kkk) * ap( 0,-1, 0)
4414 + restrict_from_pm0_to(iii,jjj,kkk) * ap(+1,-1, 0)
4415 + restrict_from_m00_to(iii,jjj,kkk) * ap(-1, 0, 0)
4416 + restrict_from_000_to(iii,jjj,kkk) * ap( 0, 0, 0)
4417 + restrict_from_p00_to(iii,jjj,kkk) * ap(+1, 0, 0)
4418 + restrict_from_mmp_to(iii,jjj,kkk) * ap(-1,-1,+1)
4419 + restrict_from_0mp_to(iii,jjj,kkk) * ap( 0,-1,+1)
4420 + restrict_from_pmp_to(iii,jjj,kkk) * ap(+1,-1,+1)
4421 + restrict_from_m0p_to(iii,jjj,kkk) * ap(-1, 0,+1)
4422 + restrict_from_00p_to(iii,jjj,kkk) * ap( 0, 0,+1)
4423 + restrict_from_p0p_to(iii,jjj,kkk) * ap(+1, 0,+1));
4425 csten(i,j,k,
ist_0pp) = Real(0.5)*(cs1+cs2);
4431 p(-1,-1,-1) = interp_from_ppp_to(iii+1,jjj+1,kkk+1);
4432 p( 0,-1,-1) = interp_from_0pp_to(iii+2,jjj+1,kkk+1);
4433 p(-1, 0,-1) = interp_from_p0p_to(iii+1,jjj+2,kkk+1);
4434 p( 0, 0,-1) = interp_from_00p_to(iii+2,jjj+2,kkk+1);
4435 p(-1,-1, 0) = interp_from_pp0_to(iii+1,jjj+1,kkk+2);
4436 p( 0,-1, 0) = interp_from_0p0_to(iii+2,jjj+1,kkk+2);
4437 p(-1, 0, 0) = interp_from_p00_to(iii+1,jjj+2,kkk+2);
4438 p( 0, 0, 0) = Real(1.);
4440 Appp(iii,jjj,kkk) * p(-1,-1,-1);
4442 A0pp(iii+1,jjj,kkk) * p(-1,-1,-1)
4443 + Appp(iii+1,jjj,kkk) * p( 0,-1,-1);
4445 Ap0p(iii,jjj+1,kkk) * p(-1,-1,-1)
4446 + Appp(iii,jjj+1,kkk) * p(-1, 0,-1);
4448 A00p(iii+1,jjj+1,kkk) * p(-1,-1,-1)
4449 + Ap0p(iii+1,jjj+1,kkk) * p( 0,-1,-1)
4450 + A0pp(iii+1,jjj+1,kkk) * p(-1, 0,-1)
4451 + Appp(iii+1,jjj+1,kkk) * p( 0, 0,-1);
4453 App0(iii,jjj,kkk+1) * p(-1,-1,-1)
4454 + Appp(iii,jjj,kkk+1) * p(-1,-1, 0);
4456 A0p0(iii+1,jjj,kkk+1) * p(-1,-1,-1)
4457 + App0(iii+1,jjj,kkk+1) * p( 0,-1,-1)
4458 + A0pp(iii+1,jjj,kkk+1) * p(-1,-1, 0)
4459 + Appp(iii+1,jjj,kkk+1) * p( 0,-1, 0);
4461 Ap00(iii,jjj+1,kkk+1) * p(-1,-1,-1)
4462 + App0(iii,jjj+1,kkk+1) * p(-1, 0,-1)
4463 + Ap0p(iii,jjj+1,kkk+1) * p(-1,-1, 0)
4464 + Appp(iii,jjj+1,kkk+1) * p(-1, 0, 0);
4466 A000(iii+1,jjj+1,kkk+1) * p(-1,-1,-1)
4467 + Ap00(iii+1,jjj+1,kkk+1) * p( 0,-1,-1)
4468 + A0p0(iii+1,jjj+1,kkk+1) * p(-1, 0,-1)
4469 + App0(iii+1,jjj+1,kkk+1) * p( 0, 0,-1)
4470 + A00p(iii+1,jjj+1,kkk+1) * p(-1,-1, 0)
4471 + Ap0p(iii+1,jjj+1,kkk+1) * p( 0,-1, 0)
4472 + A0pp(iii+1,jjj+1,kkk+1) * p(-1, 0, 0)
4473 + Appp(iii+1,jjj+1,kkk+1) * p( 0, 0, 0);
4475 ( restrict_from_000_to(iii,jjj,kkk) * ap( 0, 0, 0)
4476 + restrict_from_p00_to(iii,jjj,kkk) * ap(+1, 0, 0)
4477 + restrict_from_0p0_to(iii,jjj,kkk) * ap( 0,+1, 0)
4478 + restrict_from_pp0_to(iii,jjj,kkk) * ap(+1,+1, 0)
4479 + restrict_from_00p_to(iii,jjj,kkk) * ap( 0, 0,+1)
4480 + restrict_from_p0p_to(iii,jjj,kkk) * ap(+1, 0,+1)
4481 + restrict_from_0pp_to(iii,jjj,kkk) * ap( 0,+1,+1)
4482 + restrict_from_ppp_to(iii,jjj,kkk) * ap(+1,+1,+1));
4488 p( 0,-1,-1) = interp_from_0pp_to(iii-2,jjj+1,kkk+1);
4489 p(+1,-1,-1) = interp_from_mpp_to(iii-1,jjj+1,kkk+1);
4490 p( 0, 0,-1) = interp_from_00p_to(iii-2,jjj+2,kkk+1);
4491 p(+1, 0,-1) = interp_from_m0p_to(iii-1,jjj+2,kkk+1);
4492 p( 0,-1, 0) = interp_from_0p0_to(iii-2,jjj+1,kkk+2);
4493 p(+1,-1, 0) = interp_from_mp0_to(iii-1,jjj+1,kkk+2);
4494 p( 0, 0, 0) = Real(1.);
4495 p(+1, 0, 0) = interp_from_m00_to(iii-1,jjj+2,kkk+2);
4497 Ampp(iii-1,jjj,kkk) * p( 0,-1,-1)
4498 + A0pp(iii-1,jjj,kkk) * p(+1,-1,-1);
4500 Ampp(iii,jjj,kkk) * p(+1,-1,-1);
4502 Am0p(iii-1,jjj+1,kkk) * p( 0,-1,-1)
4503 + A00p(iii-1,jjj+1,kkk) * p(+1,-1,-1)
4504 + Ampp(iii-1,jjj+1,kkk) * p( 0, 0,-1)
4505 + A0pp(iii-1,jjj+1,kkk) * p(+1, 0,-1);
4507 Am0p(iii,jjj+1,kkk) * p(+1,-1,-1)
4508 + Ampp(iii,jjj+1,kkk) * p(+1, 0,-1);
4510 Amp0(iii-1,jjj,kkk+1) * p( 0,-1,-1)
4511 + A0p0(iii-1,jjj,kkk+1) * p(+1,-1,-1)
4512 + Ampp(iii-1,jjj,kkk+1) * p( 0,-1, 0)
4513 + A0pp(iii-1,jjj,kkk+1) * p(+1,-1, 0);
4515 Amp0(iii,jjj,kkk+1) * p(+1,-1,-1)
4516 + Ampp(iii,jjj,kkk+1) * p(+1,-1, 0);
4518 Am00(iii-1,jjj+1,kkk+1) * p( 0,-1,-1)
4519 + A000(iii-1,jjj+1,kkk+1) * p(+1,-1,-1)
4520 + Amp0(iii-1,jjj+1,kkk+1) * p( 0, 0,-1)
4521 + A0p0(iii-1,jjj+1,kkk+1) * p(+1, 0,-1)
4522 + Am0p(iii-1,jjj+1,kkk+1) * p( 0,-1, 0)
4523 + A00p(iii-1,jjj+1,kkk+1) * p(+1,-1, 0)
4524 + Ampp(iii-1,jjj+1,kkk+1) * p( 0, 0, 0)
4525 + A0pp(iii-1,jjj+1,kkk+1) * p(+1, 0, 0);
4527 Am00(iii,jjj+1,kkk+1) * p(+1,-1,-1)
4528 + Amp0(iii,jjj+1,kkk+1) * p(+1, 0,-1)
4529 + Am0p(iii,jjj+1,kkk+1) * p(+1,-1, 0)
4530 + Ampp(iii,jjj+1,kkk+1) * p(+1, 0, 0);
4532 ( restrict_from_m00_to(iii,jjj,kkk) * ap(-1, 0, 0)
4533 + restrict_from_000_to(iii,jjj,kkk) * ap( 0, 0, 0)
4534 + restrict_from_mp0_to(iii,jjj,kkk) * ap(-1,+1, 0)
4535 + restrict_from_0p0_to(iii,jjj,kkk) * ap( 0,+1, 0)
4536 + restrict_from_m0p_to(iii,jjj,kkk) * ap(-1, 0,+1)
4537 + restrict_from_00p_to(iii,jjj,kkk) * ap( 0, 0,+1)
4538 + restrict_from_mpp_to(iii,jjj,kkk) * ap(-1,+1,+1)
4539 + restrict_from_0pp_to(iii,jjj,kkk) * ap( 0,+1,+1));
4545 p(-1, 0,-1) = interp_from_p0p_to(iii+1,jjj-2,kkk+1);
4546 p( 0, 0,-1) = interp_from_00p_to(iii+2,jjj-2,kkk+1);
4547 p(-1,+1,-1) = interp_from_pmp_to(iii+1,jjj-1,kkk+1);
4548 p( 0,+1,-1) = interp_from_0mp_to(iii+2,jjj-1,kkk+1);
4549 p(-1, 0, 0) = interp_from_p00_to(iii+1,jjj-2,kkk+2);
4550 p( 0, 0, 0) = Real(1.);
4551 p(-1,+1, 0) = interp_from_pm0_to(iii+1,jjj-1,kkk+2);
4552 p( 0,+1, 0) = interp_from_0m0_to(iii+2,jjj-1,kkk+2);
4554 Apmp(iii,jjj-1,kkk) * p(-1, 0,-1)
4555 + Ap0p(iii,jjj-1,kkk) * p(-1,+1,-1);
4557 A0mp(iii+1,jjj-1,kkk) * p(-1, 0,-1)
4558 + Apmp(iii+1,jjj-1,kkk) * p( 0, 0,-1)
4559 + A00p(iii+1,jjj-1,kkk) * p(-1,+1,-1)
4560 + Ap0p(iii+1,jjj-1,kkk) * p( 0,+1,-1);
4562 Apmp(iii,jjj,kkk) * p(-1,+1,-1);
4564 A0mp(iii+1,jjj,kkk) * p(-1,+1,-1)
4565 + Apmp(iii+1,jjj,kkk) * p( 0,+1,-1);
4567 Apm0(iii,jjj-1,kkk+1) * p(-1, 0,-1)
4568 + Ap00(iii,jjj-1,kkk+1) * p(-1,+1,-1)
4569 + Apmp(iii,jjj-1,kkk+1) * p(-1, 0, 0)
4570 + Ap0p(iii,jjj-1,kkk+1) * p(-1,+1, 0);
4572 A0m0(iii+1,jjj-1,kkk+1) * p(-1, 0,-1)
4573 + Apm0(iii+1,jjj-1,kkk+1) * p( 0, 0,-1)
4574 + A000(iii+1,jjj-1,kkk+1) * p(-1,+1,-1)
4575 + Ap00(iii+1,jjj-1,kkk+1) * p( 0,+1,-1)
4576 + A0mp(iii+1,jjj-1,kkk+1) * p(-1, 0, 0)
4577 + Apmp(iii+1,jjj-1,kkk+1) * p( 0, 0, 0)
4578 + A00p(iii+1,jjj-1,kkk+1) * p(-1,+1, 0)
4579 + Ap0p(iii+1,jjj-1,kkk+1) * p( 0,+1, 0);
4581 Apm0(iii,jjj,kkk+1) * p(-1,+1,-1)
4582 + Apmp(iii,jjj,kkk+1) * p(-1,+1, 0);
4584 A0m0(iii+1,jjj,kkk+1) * p(-1,+1,-1)
4585 + Apm0(iii+1,jjj,kkk+1) * p( 0,+1,-1)
4586 + A0mp(iii+1,jjj,kkk+1) * p(-1,+1, 0)
4587 + Apmp(iii+1,jjj,kkk+1) * p( 0,+1, 0);
4589 ( restrict_from_0m0_to(iii,jjj,kkk) * ap( 0,-1, 0)
4590 + restrict_from_pm0_to(iii,jjj,kkk) * ap(+1,-1, 0)
4591 + restrict_from_000_to(iii,jjj,kkk) * ap( 0, 0, 0)
4592 + restrict_from_p00_to(iii,jjj,kkk) * ap(+1, 0, 0)
4593 + restrict_from_0mp_to(iii,jjj,kkk) * ap( 0,-1,+1)
4594 + restrict_from_pmp_to(iii,jjj,kkk) * ap(+1,-1,+1)
4595 + restrict_from_00p_to(iii,jjj,kkk) * ap( 0, 0,+1)
4596 + restrict_from_p0p_to(iii,jjj,kkk) * ap(+1, 0,+1));
4602 p( 0, 0,-1) = interp_from_00p_to(iii-2,jjj-2,kkk+1);
4603 p(+1, 0,-1) = interp_from_m0p_to(iii-1,jjj-2,kkk+1);
4604 p( 0,+1,-1) = interp_from_0mp_to(iii-2,jjj-1,kkk+1);
4605 p(+1,+1,-1) = interp_from_mmp_to(iii-1,jjj-1,kkk+1);
4606 p( 0, 0, 0) = Real(1.);
4607 p(+1, 0, 0) = interp_from_m00_to(iii-1,jjj-2,kkk+2);
4608 p( 0,+1, 0) = interp_from_0m0_to(iii-2,jjj-1,kkk+2);
4609 p(+1,+1, 0) = interp_from_mm0_to(iii-1,jjj-1,kkk+2);
4611 Ammp(iii-1,jjj-1,kkk) * p( 0, 0,-1)
4612 + A0mp(iii-1,jjj-1,kkk) * p(+1, 0,-1)
4613 + Am0p(iii-1,jjj-1,kkk) * p( 0,+1,-1)
4614 + A00p(iii-1,jjj-1,kkk) * p(+1,+1,-1);
4616 Ammp(iii,jjj-1,kkk) * p(+1, 0,-1)
4617 + Am0p(iii,jjj-1,kkk) * p(+1,+1,-1);
4619 Ammp(iii-1,jjj,kkk) * p( 0,+1,-1)
4620 + A0mp(iii-1,jjj,kkk) * p(+1,+1,-1);
4622 Ammp(iii,jjj,kkk) * p(+1,+1,-1);
4624 Amm0(iii-1,jjj-1,kkk+1) * p( 0, 0,-1)
4625 + A0m0(iii-1,jjj-1,kkk+1) * p(+1, 0,-1)
4626 + Am00(iii-1,jjj-1,kkk+1) * p( 0,+1,-1)
4627 + A000(iii-1,jjj-1,kkk+1) * p(+1,+1,-1)
4628 + Ammp(iii-1,jjj-1,kkk+1) * p( 0, 0, 0)
4629 + A0mp(iii-1,jjj-1,kkk+1) * p(+1, 0, 0)
4630 + Am0p(iii-1,jjj-1,kkk+1) * p( 0,+1, 0)
4631 + A00p(iii-1,jjj-1,kkk+1) * p(+1,+1, 0);
4633 Amm0(iii,jjj-1,kkk+1) * p(+1, 0,-1)
4634 + Am00(iii,jjj-1,kkk+1) * p(+1,+1,-1)
4635 + Ammp(iii,jjj-1,kkk+1) * p(+1, 0, 0)
4636 + Am0p(iii,jjj-1,kkk+1) * p(+1,+1, 0);
4638 Amm0(iii-1,jjj,kkk+1) * p( 0,+1,-1)
4639 + A0m0(iii-1,jjj,kkk+1) * p(+1,+1,-1)
4640 + Ammp(iii-1,jjj,kkk+1) * p( 0,+1, 0)
4641 + A0mp(iii-1,jjj,kkk+1) * p(+1,+1, 0);
4643 Amm0(iii,jjj,kkk+1) * p(+1,+1,-1)
4644 + Ammp(iii,jjj,kkk+1) * p(+1,+1, 0);
4646 ( restrict_from_mm0_to(iii,jjj,kkk) * ap(-1,-1, 0)
4647 + restrict_from_0m0_to(iii,jjj,kkk) * ap( 0,-1, 0)
4648 + restrict_from_m00_to(iii,jjj,kkk) * ap(-1, 0, 0)
4649 + restrict_from_000_to(iii,jjj,kkk) * ap( 0, 0, 0)
4650 + restrict_from_mmp_to(iii,jjj,kkk) * ap(-1,-1,+1)
4651 + restrict_from_0mp_to(iii,jjj,kkk) * ap( 0,-1,+1)
4652 + restrict_from_m0p_to(iii,jjj,kkk) * ap(-1, 0,+1)
4653 + restrict_from_00p_to(iii,jjj,kkk) * ap( 0, 0,+1));
4655 csten(i,j,k,
ist_ppp) = Real(0.25)*(cs1+cs2+cs3+cs4);
4660 Array4<Real const>
const& sten) noexcept
4662 using namespace nodelap_detail;
4664 return x(i ,j ,k ) * sten(i ,j ,k ,
ist_000)
4666 +
x(i-1,j ,k ) * sten(i-1,j ,k ,
ist_p00)
4667 +
x(i+1,j ,k ) * sten(i ,j ,k ,
ist_p00)
4669 +
x(i ,j-1,k ) * sten(i ,j-1,k ,
ist_0p0)
4670 +
x(i ,j+1,k ) * sten(i ,j ,k ,
ist_0p0)
4672 +
x(i ,j ,k-1) * sten(i ,j ,k-1,
ist_00p)
4673 +
x(i ,j ,k+1) * sten(i ,j ,k ,
ist_00p)
4675 +
x(i-1,j-1,k ) * sten(i-1,j-1,k ,
ist_pp0)
4676 +
x(i+1,j-1,k ) * sten(i ,j-1,k ,
ist_pp0)
4677 +
x(i-1,j+1,k ) * sten(i-1,j ,k ,
ist_pp0)
4678 +
x(i+1,j+1,k ) * sten(i ,j ,k ,
ist_pp0)
4680 +
x(i-1,j ,k-1) * sten(i-1,j ,k-1,
ist_p0p)
4681 +
x(i+1,j ,k-1) * sten(i ,j ,k-1,
ist_p0p)
4682 +
x(i-1,j ,k+1) * sten(i-1,j ,k ,
ist_p0p)
4683 +
x(i+1,j ,k+1) * sten(i ,j ,k ,
ist_p0p)
4685 +
x(i ,j-1,k-1) * sten(i ,j-1,k-1,
ist_0pp)
4686 +
x(i ,j+1,k-1) * sten(i ,j ,k-1,
ist_0pp)
4687 +
x(i ,j-1,k+1) * sten(i ,j-1,k ,
ist_0pp)
4688 +
x(i ,j+1,k+1) * sten(i ,j ,k ,
ist_0pp)
4690 +
x(i-1,j-1,k-1) * sten(i-1,j-1,k-1,
ist_ppp)
4691 +
x(i+1,j-1,k-1) * sten(i ,j-1,k-1,
ist_ppp)
4692 +
x(i-1,j+1,k-1) * sten(i-1,j ,k-1,
ist_ppp)
4693 +
x(i+1,j+1,k-1) * sten(i ,j ,k-1,
ist_ppp)
4694 +
x(i-1,j-1,k+1) * sten(i-1,j-1,k ,
ist_ppp)
4695 +
x(i+1,j-1,k+1) * sten(i ,j-1,k ,
ist_ppp)
4696 +
x(i-1,j+1,k+1) * sten(i-1,j ,k ,
ist_ppp)
4697 +
x(i+1,j+1,k+1) * sten(i ,j ,k ,
ist_ppp);
4702 Array4<Real const>
const& sten, Array4<int const>
const& msk) noexcept
4713 Array4<Real const>
const& rhs,
4714 Array4<Real const>
const& sten,
4715 Array4<int const>
const& msk) noexcept
4717 using namespace nodelap_detail;
4720 sol(i,j,k) = Real(0.0);
4721 }
else if (sten(i,j,k,
ist_000) != Real(0.0)) {
4723 sol(i,j,k) += (rhs(i,j,k) - Ax) / sten(i,j,k,
ist_000);
4729 Array4<Real const>
const& rhs,
4730 Array4<Real const>
const& sten,
4731 Array4<int const>
const& msk) noexcept
4741 Array4<Real const>
const&
crse, Array4<Real const>
const& sten,
4742 Array4<int const>
const& msk) noexcept
4744 using namespace nodelap_detail;
4746 if (!msk(i,j,k) && sten(i,j,k,
ist_000) != Real(0.0)) {
4750 bool ieven = ic*2 == i;
4751 bool jeven = jc*2 == j;
4752 bool keven = kc*2 == k;
4754 if (ieven && jeven && keven) {
4755 fv =
crse(ic,jc,kc);
4756 }
else if (ieven && jeven) {
4759 if (w1 == Real(0.0) && w2 == Real(0.0)) {
4760 fv = Real(0.5)*(
crse(ic,jc,kc)+
crse(ic,jc,kc+1));
4762 fv = (w1*
crse(ic,jc,kc) + w2*
crse(ic,jc,kc+1)) / (w1+w2);
4764 }
else if (ieven && keven) {
4767 if (w1 == Real(0.0) && w2 == Real(0.0)) {
4768 fv = Real(0.5)*(
crse(ic,jc,kc)+
crse(ic,jc+1,kc));
4770 fv = (w1*
crse(ic,jc,kc) + w2*
crse(ic,jc+1,kc)) / (w1+w2);
4772 }
else if (jeven && keven) {
4775 if (w1 == Real(0.0) && w2 == Real(0.0)) {
4776 fv = Real(0.5)*(
crse(ic,jc,kc)+
crse(ic+1,jc,kc));
4778 fv = (w1*
crse(ic,jc,kc) + w2*
crse(ic+1,jc,kc)) / (w1+w2);
4789 Real wmm =
std::abs(sten(i,j-1,k-1,
ist_0pp)) * (Real(1.0) + w1m + w2m);
4790 Real wpm =
std::abs(sten(i,j ,k-1,
ist_0pp)) * (Real(1.0) + w1p + w2m);
4791 Real wmp =
std::abs(sten(i,j-1,k ,
ist_0pp)) * (Real(1.0) + w1m + w2p);
4793 fv = (wmm*
crse(ic,jc,kc) + wpm*
crse(ic,jc+1,kc)
4794 + wmp*
crse(ic,jc,kc+1) + wpp*
crse(ic,jc+1,kc+1))
4795 / (wmm+wpm+wmp+wpp+
eps);
4805 Real wmm =
std::abs(sten(i-1,j,k-1,
ist_p0p)) * (Real(1.0) + w1m + w2m);
4806 Real wpm =
std::abs(sten(i ,j,k-1,
ist_p0p)) * (Real(1.0) + w1p + w2m);
4807 Real wmp =
std::abs(sten(i-1,j,k ,
ist_p0p)) * (Real(1.0) + w1m + w2p);
4809 fv = (wmm*
crse(ic,jc,kc) + wpm*
crse(ic+1,jc,kc)
4810 + wmp*
crse(ic,jc,kc+1) + wpp*
crse(ic+1,jc,kc+1))
4811 / (wmm+wpm+wmp+wpp+
eps);
4821 Real wmm =
std::abs(sten(i-1,j-1,k,
ist_pp0)) * (Real(1.0) + w1m + w2m);
4822 Real wpm =
std::abs(sten(i ,j-1,k,
ist_pp0)) * (Real(1.0) + w1p + w2m);
4823 Real wmp =
std::abs(sten(i-1,j ,k,
ist_pp0)) * (Real(1.0) + w1m + w2p);
4825 fv = (wmm*
crse(ic,jc,kc) + wpm*
crse(ic+1,jc,kc)
4826 + wmp*
crse(ic,jc+1,kc) + wpp*
crse(ic+1,jc+1,kc))
4827 / (wmm+wpm+wmp+wpp+
eps);
4829 Real wmmm = Real(1.0);
4830 Real wpmm = Real(1.0);
4831 Real wmpm = Real(1.0);
4832 Real wppm = Real(1.0);
4833 Real wmmp = Real(1.0);
4834 Real wpmp = Real(1.0);
4835 Real wmpp = Real(1.0);
4836 Real wppp = Real(1.0);
4978 fv = (wmmm*
crse(ic,jc ,kc ) + wpmm*
crse(ic+1,jc ,kc )
4979 + wmpm*
crse(ic,jc+1,kc ) + wppm*
crse(ic+1,jc+1,kc )
4980 + wmmp*
crse(ic,jc ,kc+1) + wpmp*
crse(ic+1,jc ,kc+1)
4981 + wmpp*
crse(ic,jc+1,kc+1) + wppp*
crse(ic+1,jc+1,kc+1))
4982 / (wmmm + wpmm + wmpm + wppm + wmmp + wpmp + wmpp + wppp +
eps);
4991 Array4<Real const>
const&
fine, Array4<Real const>
const& sten,
4992 Array4<int const>
const& msk) noexcept
4994 using namespace nodelap_detail;
4999 if (msk(ii,jj,kk)) {
5000 crse(i,j,k) = Real(0.0);
5003 Real cv =
fine(ii,jj,kk);
5012 if (sten_lo == Real(0.0) && sten_hi == Real(0.0)) {
5013 cv += Real(0.5)*
fine(ii-1,jj,kk);
5015 cv +=
fine(ii-1,jj,kk) * sten_hi / (sten_lo + sten_hi);
5025 if (sten_lo == Real(0.0) && sten_hi == Real(0.0)) {
5026 cv += Real(0.5)*
fine(ii+1,jj,kk);
5028 cv +=
fine(ii+1,jj,kk) * sten_lo / (sten_lo + sten_hi);
5038 if (sten_lo == Real(0.0) && sten_hi == Real(0.0)) {
5039 cv += Real(0.5)*
fine(ii,jj-1,kk);
5041 cv +=
fine(ii,jj-1,kk) * sten_hi / (sten_lo + sten_hi);
5051 if (sten_lo == Real(0.0) && sten_hi == Real(0.0)) {
5052 cv += Real(0.5)*
fine(ii,jj+1,kk);
5054 cv +=
fine(ii,jj+1,kk) * sten_lo / (sten_lo + sten_hi);
5064 if (sten_lo == Real(0.0) && sten_hi == Real(0.0)) {
5065 cv += Real(0.5)*
fine(ii,jj,kk-1);
5067 cv +=
fine(ii,jj,kk-1)*sten_hi / (sten_lo + sten_hi);
5077 if (sten_lo == Real(0.0) && sten_hi == Real(0.0)) {
5078 cv += Real(0.5)*
fine(ii,jj,kk+1);
5080 cv +=
fine(ii,jj,kk+1)*sten_lo / (sten_lo + sten_hi);
5100 Real wmm =
std::abs(sten(ii-2,jj-2,kk,
ist_pp0)) * (Real(1.0) + w1m + w2m);
5101 Real wpm =
std::abs(sten(ii-1,jj-2,kk,
ist_pp0)) * (Real(1.0) + w1p + w2m);
5102 Real wmp =
std::abs(sten(ii-2,jj-1,kk,
ist_pp0)) * (Real(1.0) + w1m + w2p);
5103 Real wpp =
std::abs(sten(ii-1,jj-1,kk,
ist_pp0)) * (Real(1.0) + w1p + w2p);
5104 cv +=
fine(ii-1,jj-1,kk)*wpp/(wmm+wpm+wmp+wpp+
eps);
5126 cv +=
fine(ii+1,jj-1,kk)*wmp/(wmm+wpm+wmp+wpp+
eps);
5148 cv +=
fine(ii-1,jj+1,kk)*wpm/(wmm+wpm+wmp+wpp+
eps);
5170 cv +=
fine(ii+1,jj+1,kk)*wmm/(wmm+wpm+wmp+wpp+
eps);
5193 cv +=
fine(ii-1,jj,kk-1)*wpp/(wmm+wpm+wmp+wpp+
eps);
5215 cv +=
fine(ii+1,jj,kk-1)*wmp/(wmm+wpm+wmp+wpp+
eps);
5237 cv +=
fine(ii-1,jj,kk+1)*wpm/(wmm+wpm+wmp+wpp+
eps);
5259 cv +=
fine(ii+1,jj,kk+1)*wmm/(wmm+wpm+wmp+wpp+
eps);
5282 cv +=
fine(ii,jj-1,kk-1)*wpp/(wmm+wpm+wmp+wpp+
eps);
5304 cv +=
fine(ii,jj+1,kk-1)*wmp/(wmm+wpm+wmp+wpp+
eps);
5326 cv +=
fine(ii,jj-1,kk+1)*wpm/(wmm+wpm+wmp+wpp+
eps);
5348 cv +=
fine(ii,jj+1,kk+1)*wmm/(wmm+wpm+wmp+wpp+
eps);
5354 Real wmmm = Real(1.0)
5380 cv += wmmm*
fine(ii+1,jj+1,kk+1)*sten(ii+1,jj+1,kk+1,
ist_inv);
5382 Real wpmm = Real(1.0)
5408 cv += wpmm*
fine(ii-1,jj+1,kk+1)*sten(ii-1,jj+1,kk+1,
ist_inv);
5410 Real wmpm = Real(1.0)
5436 cv += wmpm*
fine(ii+1,jj-1,kk+1)*sten(ii+1,jj-1,kk+1,
ist_inv);
5438 Real wppm = Real(1.0)
5464 cv += wppm*
fine(ii-1,jj-1,kk+1)*sten(ii-1,jj-1,kk+1,
ist_inv);
5466 Real wmmp = Real(1.0)
5492 cv += wmmp*
fine(ii+1,jj+1,kk-1)*sten(ii+1,jj+1,kk-1,
ist_inv);
5494 Real wpmp = Real(1.0)
5520 cv += wpmp*
fine(ii-1,jj+1,kk-1)*sten(ii-1,jj+1,kk-1,
ist_inv);
5522 Real wmpp = Real(1.0)
5548 cv += wmpp*
fine(ii+1,jj-1,kk-1)*sten(ii+1,jj-1,kk-1,
ist_inv);
5550 Real wppp = Real(1.0)
5576 cv += wppp*
fine(ii-1,jj-1,kk-1)*sten(ii-1,jj-1,kk-1,
ist_inv);
5578 crse(i,j,k) = cv * Real(0.125);
5584 namespace nodelap_detail {
5586 constexpr
int i_S_x = 0;
5587 constexpr
int i_S_y = 1;
5588 constexpr
int i_S_z = 2;
5589 constexpr
int i_S_x2 = 3;
5590 constexpr
int i_S_y2 = 4;
5591 constexpr
int i_S_z2 = 5;
5605 constexpr
int n_Sintg = 19;
5607 constexpr
int i_c_xmym = 0;
5608 constexpr
int i_c_xmyb = 1;
5609 constexpr
int i_c_xmyp = 2;
5610 constexpr
int i_c_xbym = 3;
5611 constexpr
int i_c_xbyb = 4;
5612 constexpr
int i_c_xbyp = 5;
5613 constexpr
int i_c_xpym = 6;
5614 constexpr
int i_c_xpyb = 7;
5615 constexpr
int i_c_xpyp = 8;
5616 constexpr
int i_c_xmzm = 9;
5617 constexpr
int i_c_xmzb = 10;
5618 constexpr
int i_c_xmzp = 11;
5619 constexpr
int i_c_xbzm = 12;
5620 constexpr
int i_c_xbzb = 13;
5621 constexpr
int i_c_xbzp = 14;
5622 constexpr
int i_c_xpzm = 15;
5623 constexpr
int i_c_xpzb = 16;
5624 constexpr
int i_c_xpzp = 17;
5625 constexpr
int i_c_ymzm = 18;
5626 constexpr
int i_c_ymzb = 19;
5627 constexpr
int i_c_ymzp = 20;
5628 constexpr
int i_c_ybzm = 21;
5629 constexpr
int i_c_ybzb = 22;
5630 constexpr
int i_c_ybzp = 23;
5631 constexpr
int i_c_ypzm = 24;
5632 constexpr
int i_c_ypzb = 25;
5633 constexpr
int i_c_ypzp = 26;
5634 constexpr
int n_conn = 27;
5636 constexpr
int i_B_x = 0;
5637 constexpr
int i_B_y = 1;
5638 constexpr
int i_B_z = 2;
5648 void mlndlap_set_connection (
int i,
int j,
int k, Array4<Real>
const& conn,
5649 Array4<Real const>
const& intg, Array4<Real const>
const& vol,
5650 Array4<EBCellFlag const>
const& flag) noexcept
5652 using namespace nodelap_detail;
5654 if (flag(i,j,k).isCovered()) {
5655 for (
int n = 0; n < n_conn; ++n) { conn(i,j,k,n) = Real(0.); }
5656 }
else if (flag(i,j,k).isRegular() || vol(i,j,k) >=
almostone) {
5657 for (
int n = 0; n < n_conn; ++n) { conn(i,j,k,n) = Real(1.); }
5660 conn(i,j,k,i_c_xmym) = Real(0.5625)*vol(i,j,k)
5661 + Real(2.25)*(-intg(i,j,k,
i_S_x ) - intg(i,j,k,
i_S_y)
5667 conn(i,j,k,i_c_xmyb) = Real(1.125)*vol(i,j,k)
5672 conn(i,j,k,i_c_xmyp) = Real(0.5625)*vol(i,j,k)
5673 + Real(2.25)*(-intg(i,j,k,
i_S_x ) + intg(i,j,k,
i_S_y)
5679 conn(i,j,k,i_c_xbym) = Real(1.125)*vol(i,j,k)
5684 conn(i,j,k,i_c_xbyb) = Real(2.25)*vol(i,j,k)
5689 conn(i,j,k,i_c_xbyp) = Real(1.125)*vol(i,j,k)
5694 conn(i,j,k,i_c_xpym) = Real(0.5625)*vol(i,j,k)
5695 + Real(2.25)*( intg(i,j,k,
i_S_x ) - intg(i,j,k,
i_S_y)
5701 conn(i,j,k,i_c_xpyb) = Real(1.125)*vol(i,j,k)
5706 conn(i,j,k,i_c_xpyp) = Real(0.5625)*vol(i,j,k)
5707 + Real(2.25)*( intg(i,j,k,
i_S_x ) + intg(i,j,k,
i_S_y)
5713 conn(i,j,k,i_c_xmzm) = Real(0.5625)*vol(i,j,k)
5714 + Real(2.25)*(-intg(i,j,k,
i_S_x) - intg(i,j,k,
i_S_z)
5720 conn(i,j,k,i_c_xmzb) = Real(1.125)*vol(i,j,k)
5725 conn(i,j,k,i_c_xmzp) = Real(0.5625)*vol(i,j,k)
5726 + Real(2.25)*(-intg(i,j,k,
i_S_x ) + intg(i,j,k,
i_S_z)
5732 conn(i,j,k,i_c_xbzm) = Real(1.125)*vol(i,j,k)
5737 conn(i,j,k,i_c_xbzb) = Real(2.25)*vol(i,j,k)
5742 conn(i,j,k,i_c_xbzp) = Real(1.125)*vol(i,j,k)
5747 conn(i,j,k,i_c_xpzm) = Real(0.5625)*vol(i,j,k)
5748 + Real(2.25)*( intg(i,j,k,
i_S_x ) - intg(i,j,k,
i_S_z)
5754 conn(i,j,k,i_c_xpzb) = Real(1.125)*vol(i,j,k)
5759 conn(i,j,k,i_c_xpzp) = Real(0.5625)*vol(i,j,k)
5760 + Real(2.25)*( intg(i,j,k,
i_S_x ) + intg(i,j,k,
i_S_z)
5766 conn(i,j,k,i_c_ymzm) = Real(0.5625)*vol(i,j,k)
5767 + Real(2.25)*(-intg(i,j,k,
i_S_y) - intg(i,j,k,
i_S_z)
5773 conn(i,j,k,i_c_ymzb) = Real(1.125)*vol(i,j,k)
5778 conn(i,j,k,i_c_ymzp) = Real(0.5625)*vol(i,j,k)
5779 + Real(2.25)*(-intg(i,j,k,
i_S_y ) + intg(i,j,k,
i_S_z)
5785 conn(i,j,k,i_c_ybzm) = Real(1.125)*vol(i,j,k)
5790 conn(i,j,k,i_c_ybzb) = Real(2.25)*vol(i,j,k)
5795 conn(i,j,k,i_c_ybzp) = Real(1.125)*vol(i,j,k)
5800 conn(i,j,k,i_c_ypzm) = Real(0.5625)*vol(i,j,k)
5801 + Real(2.25)*( intg(i,j,k,
i_S_y ) - intg(i,j,k,
i_S_z)
5807 conn(i,j,k,i_c_ypzb) = Real(1.125)*vol(i,j,k)
5812 conn(i,j,k,i_c_ypzp) = Real(0.5625)*vol(i,j,k)
5813 + Real(2.25)*( intg(i,j,k,
i_S_y ) + intg(i,j,k,
i_S_z)
5821 void mlndlap_set_stencil_eb (
int i,
int j,
int k, Array4<Real>
const& sten,
5822 Array4<Real const>
const& sig, Array4<Real const>
const& conn,
5823 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
5825 using namespace nodelap_detail;
5827 Real facx = Real(1./36.)*dxinv[0]*dxinv[0];
5828 Real facy = Real(1./36.)*dxinv[1]*dxinv[1];
5829 Real facz = Real(1./36.)*dxinv[2]*dxinv[2];
5833 sig(i,j ,k )*(Real(4.)*facx*conn(i,j ,k ,i_c_ymzm) - Real(2.)*facy*conn(i,j ,k ,i_c_xbzm) - Real(2.)*facz*conn(i,j ,k ,i_c_xbym) ) +
5834 sig(i,j-1,k )*(Real(4.)*facx*conn(i,j-1,k ,i_c_ypzm) - Real(2.)*facy*conn(i,j-1,k ,i_c_xbzm) - Real(2.)*facz*conn(i,j-1,k ,i_c_xbyp) ) +
5835 sig(i,j ,k-1)*(Real(4.)*facx*conn(i,j ,k-1,i_c_ymzp) - Real(2.)*facy*conn(i,j ,k-1,i_c_xbzp) - Real(2.)*facz*conn(i,j ,k-1,i_c_xbym) ) +
5836 sig(i,j-1,k-1)*(Real(4.)*facx*conn(i,j-1,k-1,i_c_ypzp) - Real(2.)*facy*conn(i,j-1,k-1,i_c_xbzp) - Real(2.)*facz*conn(i,j-1,k-1,i_c_xbyp) ) );
5840 sig(i ,j,k )*(Real(-2.)*facx*conn(i ,j,k ,i_c_ybzm) + Real(4.)*facy*conn(i ,j,k ,i_c_xmzm) - Real(2.)*facz*conn(i ,j,k ,i_c_xmyb) ) +
5841 sig(i-1,j,k )*(Real(-2.)*facx*conn(i-1,j,k ,i_c_ybzm) + Real(4.)*facy*conn(i-1,j,k ,i_c_xpzm) - Real(2.)*facz*conn(i-1,j,k ,i_c_xpyb) ) +
5842 sig(i ,j,k-1)*(Real(-2.)*facx*conn(i ,j,k-1,i_c_ybzp) + Real(4.)*facy*conn(i ,j,k-1,i_c_xmzp) - Real(2.)*facz*conn(i ,j,k-1,i_c_xmyb) ) +
5843 sig(i-1,j,k-1)*(Real(-2.)*facx*conn(i-1,j,k-1,i_c_ybzp) + Real(4.)*facy*conn(i-1,j,k-1,i_c_xpzp) - Real(2.)*facz*conn(i-1,j,k-1,i_c_xpyb) ) );
5847 sig(i ,j ,k)*(Real(-2.)*facx*conn(i ,j ,k,i_c_ymzb) - Real(2.)*facy*conn(i ,j ,k,i_c_xmzb) + Real(4.)*facz*conn(i ,j ,k,i_c_xmym) ) +
5848 sig(i-1,j ,k)*(Real(-2.)*facx*conn(i-1,j ,k,i_c_ymzb) - Real(2.)*facy*conn(i-1,j ,k,i_c_xpzb) + Real(4.)*facz*conn(i-1,j ,k,i_c_xpym) ) +
5849 sig(i ,j-1,k)*(Real(-2.)*facx*conn(i ,j-1,k,i_c_ypzb) - Real(2.)*facy*conn(i ,j-1,k,i_c_xmzb) + Real(4.)*facz*conn(i ,j-1,k,i_c_xmyp) ) +
5850 sig(i-1,j-1,k)*(Real(-2.)*facx*conn(i-1,j-1,k,i_c_ypzb) - Real(2.)*facy*conn(i-1,j-1,k,i_c_xpzb) + Real(4.)*facz*conn(i-1,j-1,k,i_c_xpyp) ) );
5854 sig(i,j,k )*(Real(2.)*facx*conn(i,j,k ,i_c_ybzm) + Real(2.)*facy*conn(i,j,k ,i_c_xbzm) - facz*conn(i,j,k ,i_c_xbyb) ) +
5855 sig(i,j,k-1)*(Real(2.)*facx*conn(i,j,k-1,i_c_ybzp) + Real(2.)*facy*conn(i,j,k-1,i_c_xbzp) - facz*conn(i,j,k-1,i_c_xbyb) ) );
5859 sig(i,j,k )*(Real(2.)*facx*conn(i,j,k ,i_c_ymzb) - facy*conn(i,j,k ,i_c_xbzb) + Real(2.)*facz*conn(i,j,k ,i_c_xbym) ) +
5860 sig(i,j-1,k)*(Real(2.)*facx*conn(i,j-1,k,i_c_ypzb) - facy*conn(i,j-1,k,i_c_xbzb) + Real(2.)*facz*conn(i,j-1,k,i_c_xbyp) ) );
5864 sig(i ,j,k)*(-facx*conn(i ,j,k,i_c_ybzb) + Real(2.)*facy*conn(i ,j,k,i_c_xmzb) + Real(2.)*facz*conn(i ,j,k,i_c_xmyb) ) +
5865 sig(i-1,j,k)*(-facx*conn(i-1,j,k,i_c_ybzb) + Real(2.)*facy*conn(i-1,j,k,i_c_xpzb) + Real(2.)*facz*conn(i-1,j,k,i_c_xpyb) ) );
5868 sten(i,j,k,
ist_ppp) = sig(i,j,k) * (facx*conn(i,j,k,i_c_ybzb) + facy*conn(i,j,k,i_c_xbzb) + facz*conn(i,j,k,i_c_xbyb) );
5872 void mlndlap_divu_eb (
int i,
int j,
int k, Array4<Real>
const& rhs, Array4<Real const>
const& vel,
5873 Array4<Real const>
const& vfrac, Array4<Real const>
const& intg,
5874 Array4<int const>
const& msk, GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
5875 Box const& nodal_domain,
5876 GpuArray<LinOpBCType, AMREX_SPACEDIM>
const& bclo,
5877 GpuArray<LinOpBCType, AMREX_SPACEDIM>
const& bchi) noexcept
5879 using namespace nodelap_detail;
5881 Real facx = Real(0.25)*dxinv[0];
5882 Real facy = Real(0.25)*dxinv[1];
5883 Real facz = Real(0.25)*dxinv[2];
5890 Real zero_ilo = Real(1.0);
5891 Real zero_ihi = Real(1.0);
5892 Real zero_jlo = Real(1.0);
5893 Real zero_jhi = Real(1.0);
5894 Real zero_klo = Real(1.0);
5895 Real zero_khi = Real(1.0);
5899 if ((bclo[0] == LinOpBCType::Neumann || bclo[0] == LinOpBCType::inflow)
5902 zero_ilo = Real(0.0);
5904 if ((bchi[0] == LinOpBCType::Neumann || bchi[0] == LinOpBCType::inflow)
5907 zero_ihi = Real(0.0);
5909 if ((bclo[1] == LinOpBCType::Neumann || bclo[1] == LinOpBCType::inflow)
5912 zero_jlo = Real(0.0);
5914 if ((bchi[1] == LinOpBCType::Neumann || bchi[1] == LinOpBCType::inflow)
5917 zero_jhi = Real(0.0);
5919 if ((bclo[2] == LinOpBCType::Neumann || bclo[2] == LinOpBCType::inflow)
5922 zero_klo = Real(0.0);
5924 if ((bchi[2] == LinOpBCType::Neumann || bchi[2] == LinOpBCType::inflow)
5927 zero_khi = Real(0.0);
5931 vel(i-1,j-1,k ,0)*( -vfrac(i-1,j-1,k )
5932 -Real(2.)*intg(i-1,j-1,k ,
i_S_y)
5933 +Real(2.)*intg(i-1,j-1,k ,
i_S_z)
5934 +Real(4.)*intg(i-1,j-1,k ,
i_S_y_z))*zero_jlo*zero_khi
5935 +vel(i ,j-1,k ,0)*( vfrac(i ,j-1,k )
5936 +Real(2.)*intg(i ,j-1,k ,
i_S_y)
5937 -Real(2.)*intg(i ,j-1,k ,
i_S_z)
5938 -Real(4.)*intg(i ,j-1,k ,
i_S_y_z))*zero_jlo*zero_khi
5939 +vel(i-1,j ,k ,0)*( -vfrac(i-1,j ,k )
5940 +Real(2.)*intg(i-1,j ,k ,
i_S_y)
5941 +Real(2.)*intg(i-1,j ,k ,
i_S_z)
5942 -Real(4.)*intg(i-1,j ,k ,
i_S_y_z))*zero_jhi*zero_khi
5943 +vel(i ,j ,k ,0)*( vfrac(i ,j ,k )
5944 -Real(2.)*intg(i ,j ,k ,
i_S_y)
5945 -Real(2.)*intg(i ,j ,k ,
i_S_z)
5946 +Real(4.)*intg(i ,j ,k ,
i_S_y_z))*zero_jhi*zero_khi
5947 +vel(i-1,j-1,k-1,0)*( -vfrac(i-1,j-1,k-1)
5948 -Real(2.)*intg(i-1,j-1,k-1,
i_S_y)
5949 -Real(2.)*intg(i-1,j-1,k-1,
i_S_z)
5950 -Real(4.)*intg(i-1,j-1,k-1,
i_S_y_z))*zero_jlo*zero_klo
5951 +vel(i ,j-1,k-1,0)*( vfrac(i ,j-1,k-1)
5952 +Real(2.)*intg(i ,j-1,k-1,
i_S_y)
5953 +Real(2.)*intg(i ,j-1,k-1,
i_S_z)
5954 +Real(4.)*intg(i ,j-1,k-1,
i_S_y_z))*zero_jlo*zero_klo
5955 +vel(i-1,j ,k-1,0)*( -vfrac(i-1,j ,k-1)
5956 +Real(2.)*intg(i-1,j ,k-1,
i_S_y)
5957 -Real(2.)*intg(i-1,j ,k-1,
i_S_z)
5958 +Real(4.)*intg(i-1,j ,k-1,
i_S_y_z))*zero_jhi*zero_klo
5959 +vel(i ,j ,k-1,0)*( vfrac(i ,j ,k-1)
5960 -Real(2.)*intg(i ,j ,k-1,
i_S_y)
5961 +Real(2.)*intg(i ,j ,k-1,
i_S_z)
5962 -Real(4.)*intg(i ,j ,k-1,
i_S_y_z))*zero_jhi*zero_klo )
5964 vel(i-1,j-1,k ,1)*( -vfrac(i-1,j-1,k )
5965 -Real(2.)*intg(i-1,j-1,k ,
i_S_x)
5966 +Real(2.)*intg(i-1,j-1,k ,
i_S_z)
5967 +Real(4.)*intg(i-1,j-1,k ,
i_S_x_z))*zero_ilo*zero_khi
5968 +vel(i ,j-1,k ,1)*( -vfrac(i ,j-1,k )
5969 +Real(2.)*intg(i ,j-1,k ,
i_S_x)
5970 +Real(2.)*intg(i ,j-1,k ,
i_S_z)
5971 -Real(4.)*intg(i ,j-1,k ,
i_S_x_z))*zero_ihi*zero_khi
5972 +vel(i-1,j ,k ,1)*( vfrac(i-1,j ,k )
5973 +Real(2.)*intg(i-1,j ,k ,
i_S_x)
5974 -Real(2.)*intg(i-1,j ,k ,
i_S_z)
5975 -Real(4.)*intg(i-1,j ,k ,
i_S_x_z))*zero_ilo*zero_khi
5976 +vel(i ,j ,k ,1)*( vfrac(i ,j ,k )
5977 -Real(2.)*intg(i ,j ,k ,
i_S_x)
5978 -Real(2.)*intg(i ,j ,k ,
i_S_z)
5979 +Real(4.)*intg(i ,j ,k ,
i_S_x_z))*zero_ihi*zero_khi
5980 +vel(i-1,j-1,k-1,1)*( -vfrac(i-1,j-1,k-1)
5981 -Real(2.)*intg(i-1,j-1,k-1,
i_S_x)
5982 -Real(2.)*intg(i-1,j-1,k-1,
i_S_z)
5983 -Real(4.)*intg(i-1,j-1,k-1,
i_S_x_z))*zero_ilo*zero_klo
5984 +vel(i ,j-1,k-1,1)*( -vfrac(i ,j-1,k-1)
5985 +Real(2.)*intg(i ,j-1,k-1,
i_S_x)
5986 -Real(2.)*intg(i ,j-1,k-1,
i_S_z)
5987 +Real(4.)*intg(i ,j-1,k-1,
i_S_x_z))*zero_ihi*zero_klo
5988 +vel(i-1,j ,k-1,1)*( vfrac(i-1,j ,k-1)
5989 +Real(2.)*intg(i-1,j ,k-1,
i_S_x)
5990 +Real(2.)*intg(i-1,j ,k-1,
i_S_z)
5991 +Real(4.)*intg(i-1,j ,k-1,
i_S_x_z))*zero_ilo*zero_klo
5992 +vel(i ,j ,k-1,1)*( vfrac(i ,j ,k-1)
5993 -Real(2.)*intg(i ,j ,k-1,
i_S_x)
5994 +Real(2.)*intg(i ,j ,k-1,
i_S_z)
5995 -Real(4.)*intg(i ,j ,k-1,
i_S_x_z))*zero_ihi*zero_klo )
5997 vel(i-1,j-1,k ,2)*( vfrac(i-1,j-1,k )
5998 +Real(2.)*intg(i-1,j-1,k ,
i_S_x)
5999 +Real(2.)*intg(i-1,j-1,k ,
i_S_y)
6000 +Real(4.)*intg(i-1,j-1,k ,
i_S_x_y))*zero_ilo*zero_jlo
6001 +vel(i ,j-1,k ,2)*( vfrac(i ,j-1,k )
6002 -Real(2.)*intg(i ,j-1,k ,
i_S_x)
6003 +Real(2.)*intg(i ,j-1,k ,
i_S_y)
6004 -Real(4.)*intg(i ,j-1,k ,
i_S_x_y))*zero_ihi*zero_jlo
6005 +vel(i-1,j ,k ,2)*( vfrac(i-1,j ,k )
6006 +Real(2.)*intg(i-1,j ,k ,
i_S_x)
6007 -Real(2.)*intg(i-1,j ,k ,
i_S_y)
6008 -Real(4.)*intg(i-1,j ,k ,
i_S_x_y))*zero_ilo*zero_jhi
6009 +vel(i ,j ,k ,2)*( vfrac(i ,j ,k )
6010 -Real(2.)*intg(i ,j ,k ,
i_S_x)
6011 -Real(2.)*intg(i ,j ,k ,
i_S_y)
6012 +Real(4.)*intg(i ,j ,k ,
i_S_x_y))*zero_ihi*zero_jhi
6013 +vel(i-1,j-1,k-1,2)*( -vfrac(i-1,j-1,k-1)
6014 -Real(2.)*intg(i-1,j-1,k-1,
i_S_x)
6015 -Real(2.)*intg(i-1,j-1,k-1,
i_S_y)
6016 -Real(4.)*intg(i-1,j-1,k-1,
i_S_x_y))*zero_ilo*zero_jlo
6017 +vel(i ,j-1,k-1,2)*( -vfrac(i ,j-1,k-1)
6018 +Real(2.)*intg(i ,j-1,k-1,
i_S_x)
6019 -Real(2.)*intg(i ,j-1,k-1,
i_S_y)
6020 +Real(4.)*intg(i ,j-1,k-1,
i_S_x_y))*zero_ihi*zero_jlo
6021 +vel(i-1,j ,k-1,2)*( -vfrac(i-1,j ,k-1)
6022 -Real(2.)*intg(i-1,j ,k-1,
i_S_x)
6023 +Real(2.)*intg(i-1,j ,k-1,
i_S_y)
6024 +Real(4.)*intg(i-1,j ,k-1,
i_S_x_y))*zero_ilo*zero_jhi
6025 +vel(i ,j ,k-1,2)*( -vfrac(i ,j ,k-1)
6026 +Real(2.)*intg(i ,j ,k-1,
i_S_x)
6027 +Real(2.)*intg(i ,j ,k-1,
i_S_y)
6028 -Real(4.)*intg(i ,j ,k-1,
i_S_x_y))*zero_ihi*zero_jhi );
6030 rhs(i,j,k) = Real(0.);
6035 void add_eb_flow_contribution (
int i,
int j,
int k, Array4<Real>
const& rhs,
6036 Array4<int const>
const& msk, GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
6037 Array4<Real const>
const& bareaarr,
6038 Array4<Real const>
const& sintg,
6039 Array4<Real const>
const& eb_vel_dot_n) noexcept
6041 using namespace nodelap_detail;
6043 Real fac_eb = Real(0.125) * dxinv[0];
6046 rhs(i,j,k) += fac_eb*(
6047 eb_vel_dot_n(i-1,j-1,k )*( bareaarr(i-1,j-1,k)
6048 +Real(2.)*sintg(i-1,j-1,k ,
i_B_x)
6049 +Real(2.)*sintg(i-1,j-1,k ,
i_B_y)
6050 +Real(4.)*sintg(i-1,j-1,k ,
i_B_x_y)
6051 -Real(2.)*sintg(i-1,j-1,k ,
i_B_z)
6052 -Real(4.)*sintg(i-1,j-1,k ,
i_B_y_z)
6053 -Real(4.)*sintg(i-1,j-1,k ,
i_B_x_z)
6054 -Real(8.)*sintg(i-1,j-1,k ,
i_B_xyz))
6055 +eb_vel_dot_n(i ,j-1,k )*( bareaarr(i ,j-1,k)
6056 -Real(2.)*sintg(i ,j-1,k ,
i_B_x)
6057 +Real(2.)*sintg(i ,j-1,k ,
i_B_y)
6058 -Real(4.)*sintg(i ,j-1,k ,
i_B_x_y)
6059 -Real(2.)*sintg(i ,j-1,k ,
i_B_z)
6060 -Real(4.)*sintg(i ,j-1,k ,
i_B_y_z)
6061 +Real(4.)*sintg(i ,j-1,k ,
i_B_x_z)
6062 +Real(8.)*sintg(i ,j-1,k ,
i_B_xyz))
6063 +eb_vel_dot_n(i-1,j ,k )*( bareaarr(i-1,j ,k)
6064 +Real(2.)*sintg(i-1,j ,k ,
i_B_x)
6065 -Real(2.)*sintg(i-1,j ,k ,
i_B_y)
6066 -Real(4.)*sintg(i-1,j ,k ,
i_B_x_y)
6067 -Real(2.)*sintg(i-1,j ,k ,
i_B_z)
6068 +Real(4.)*sintg(i-1,j ,k ,
i_B_y_z)
6069 -Real(4.)*sintg(i-1,j ,k ,
i_B_x_z)
6070 +Real(8.)*sintg(i-1,j ,k ,
i_B_xyz))
6071 +eb_vel_dot_n(i ,j ,k )*( bareaarr(i ,j ,k)
6072 -Real(2.)*sintg(i ,j ,k ,
i_B_x)
6073 -Real(2.)*sintg(i ,j ,k ,
i_B_y)
6074 +Real(4.)*sintg(i ,j ,k ,
i_B_x_y)
6075 -Real(2.)*sintg(i ,j ,k ,
i_B_z)
6076 +Real(4.)*sintg(i ,j ,k ,
i_B_y_z)
6077 +Real(4.)*sintg(i ,j ,k ,
i_B_x_z)
6078 -Real(8.)*sintg(i ,j ,k ,
i_B_xyz))
6079 +eb_vel_dot_n(i-1,j-1,k-1)*( bareaarr(i-1,j-1,k-1)
6080 +Real(2.)*sintg(i-1,j-1,k-1,
i_B_x)
6081 +Real(2.)*sintg(i-1,j-1,k-1,
i_B_y)
6082 +Real(4.)*sintg(i-1,j-1,k-1,
i_B_x_y)
6083 +Real(2.)*sintg(i-1,j-1,k-1,
i_B_z)
6084 +Real(4.)*sintg(i-1,j-1,k-1,
i_B_y_z)
6085 +Real(4.)*sintg(i-1,j-1,k-1,
i_B_x_z)
6086 +Real(8.)*sintg(i-1,j-1,k-1,
i_B_xyz))
6087 +eb_vel_dot_n(i ,j-1,k-1)*( bareaarr(i ,j-1,k-1)
6088 -Real(2.)*sintg(i ,j-1,k-1,
i_B_x)
6089 +Real(2.)*sintg(i ,j-1,k-1,
i_B_y)
6090 -Real(4.)*sintg(i ,j-1,k-1,
i_B_x_y)
6091 +Real(2.)*sintg(i ,j-1,k-1,
i_B_z)
6092 +Real(4.)*sintg(i ,j-1,k-1,
i_B_y_z)
6093 -Real(4.)*sintg(i ,j-1,k-1,
i_B_x_z)
6094 -Real(8.)*sintg(i ,j-1,k-1,
i_B_xyz))
6095 +eb_vel_dot_n(i-1,j ,k-1)*( bareaarr(i-1,j ,k-1)
6096 +Real(2.)*sintg(i-1,j ,k-1,
i_B_x)
6097 -Real(2.)*sintg(i-1,j ,k-1,
i_B_y)
6098 -Real(4.)*sintg(i-1,j ,k-1,
i_B_x_y)
6099 +Real(2.)*sintg(i-1,j ,k-1,
i_B_z)
6100 -Real(4.)*sintg(i-1,j ,k-1,
i_B_y_z)
6101 +Real(4.)*sintg(i-1,j ,k-1,
i_B_x_z)
6102 -Real(8.)*sintg(i-1,j ,k-1,
i_B_xyz))
6103 +eb_vel_dot_n(i ,j ,k-1)*( bareaarr(i ,j ,k-1)
6104 -Real(2.)*sintg(i ,j ,k-1,
i_B_x)
6105 -Real(2.)*sintg(i ,j ,k-1,
i_B_y)
6106 +Real(4.)*sintg(i ,j ,k-1,
i_B_x_y)
6107 +Real(2.)*sintg(i ,j ,k-1,
i_B_z)
6108 -Real(4.)*sintg(i ,j ,k-1,
i_B_y_z)
6109 -Real(4.)*sintg(i ,j ,k-1,
i_B_x_z)
6110 +Real(8.)*sintg(i ,j ,k-1,
i_B_xyz)));
6115 void mlndlap_mknewu_eb (
int i,
int j,
int k, Array4<Real>
const& u, Array4<Real const>
const& p,
6116 Array4<Real const>
const& sig, Array4<Real const>
const& vfrac,
6117 Array4<Real const>
const& intg, GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
6119 using namespace nodelap_detail;
6121 if (vfrac(i,j,k) == Real(0.)) {
6122 u(i,j,k,0) = u(i,j,k,1) = u(i,j,k,2) = Real(0.);
6124 Real dpdx = Real(0.25)*(-p(i,j,k )+p(i+1,j,k )-p(i,j+1,k )+p(i+1,j+1,k )
6125 -p(i,j,k+1)+p(i+1,j,k+1)-p(i,j+1,k+1)+p(i+1,j+1,k+1));
6126 Real dpdy = Real(0.25)*(-p(i,j,k )-p(i+1,j,k )+p(i,j+1,k )+p(i+1,j+1,k )
6127 -p(i,j,k+1)-p(i+1,j,k+1)+p(i,j+1,k+1)+p(i+1,j+1,k+1));
6128 Real dpdz = Real(0.25)*(-p(i,j,k )-p(i+1,j,k )-p(i,j+1,k )-p(i+1,j+1,k )
6129 +p(i,j,k+1)+p(i+1,j,k+1)+p(i,j+1,k+1)+p(i+1,j+1,k+1));
6131 Real dpp_xy = (p(i+1,j+1,k+1) - p(i,j+1,k+1) - p(i+1,j,k+1) + p(i,j,k+1)
6132 +p(i+1,j+1,k ) - p(i,j+1,k ) - p(i+1,j,k ) + p(i,j,k ) ) / vfrac(i,j,k);
6134 Real dpp_xz = (p(i+1,j+1,k+1) - p(i,j+1,k+1) + p(i+1,j,k+1) - p(i,j,k+1)
6135 -p(i+1,j+1,k ) + p(i,j+1,k ) - p(i+1,j,k ) + p(i,j,k ) ) / vfrac(i,j,k);
6137 Real dpp_yz = (p(i+1,j+1,k+1) + p(i,j+1,k+1) - p(i+1,j,k+1) - p(i,j,k+1)
6138 -p(i+1,j+1,k ) - p(i,j+1,k ) + p(i+1,j,k ) + p(i,j,k ) ) / vfrac(i,j,k);
6140 Real dpp_xyz = (p(i+1,j+1,k+1) - p(i,j+1,k+1) - p(i+1,j,k+1) + p(i,j,k+1)
6141 -p(i+1,j+1,k ) + p(i,j+1,k ) + p(i+1,j,k ) - p(i,j,k ) ) / vfrac(i,j,k);
6143 u(i,j,k,0) -= sig(i,j,k)*dxinv[0]*(dpdx + Real(0.5)*intg(i,j,k,
i_S_y )*dpp_xy +
6144 Real(0.5)*intg(i,j,k,
i_S_z )*dpp_xz +
6145 intg(i,j,k,
i_S_y_z)*dpp_xyz );
6146 u(i,j,k,1) -= sig(i,j,k)*dxinv[1]*(dpdy + Real(0.5)*intg(i,j,k,
i_S_x )*dpp_xy +
6147 Real(0.5)*intg(i,j,k,
i_S_z )*dpp_yz +
6148 intg(i,j,k,
i_S_x_z)*dpp_xyz );
6149 u(i,j,k,2) -= sig(i,j,k)*dxinv[2]*(dpdz + Real(0.5)*intg(i,j,k,
i_S_x )*dpp_xz +
6150 Real(0.5)*intg(i,j,k,
i_S_y )*dpp_yz +
6151 intg(i,j,k,
i_S_x_y)*dpp_xyz );
6156 void mlndlap_mknewu_eb_c (
int i,
int j,
int k, Array4<Real>
const& u, Array4<Real const>
const& p,
6157 Real sig, Array4<Real const>
const& vfrac,
6158 Array4<Real const>
const& intg, GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
6160 using namespace nodelap_detail;
6162 if (vfrac(i,j,k) == Real(0.)) {
6163 u(i,j,k,0) = u(i,j,k,1) = u(i,j,k,2) = Real(0.);
6165 Real dpdx = Real(0.25)*(-p(i,j,k )+p(i+1,j,k )-p(i,j+1,k )+p(i+1,j+1,k )
6166 -p(i,j,k+1)+p(i+1,j,k+1)-p(i,j+1,k+1)+p(i+1,j+1,k+1));
6167 Real dpdy = Real(0.25)*(-p(i,j,k )-p(i+1,j,k )+p(i,j+1,k )+p(i+1,j+1,k )
6168 -p(i,j,k+1)-p(i+1,j,k+1)+p(i,j+1,k+1)+p(i+1,j+1,k+1));
6169 Real dpdz = Real(0.25)*(-p(i,j,k )-p(i+1,j,k )-p(i,j+1,k )-p(i+1,j+1,k )
6170 +p(i,j,k+1)+p(i+1,j,k+1)+p(i,j+1,k+1)+p(i+1,j+1,k+1));
6172 Real dpp_xy = (p(i+1,j+1,k+1) - p(i,j+1,k+1) - p(i+1,j,k+1) + p(i,j,k+1)
6173 +p(i+1,j+1,k ) - p(i,j+1,k ) - p(i+1,j,k ) + p(i,j,k ) ) / vfrac(i,j,k);
6175 Real dpp_xz = (p(i+1,j+1,k+1) - p(i,j+1,k+1) + p(i+1,j,k+1) - p(i,j,k+1)
6176 -p(i+1,j+1,k ) + p(i,j+1,k ) - p(i+1,j,k ) + p(i,j,k ) ) / vfrac(i,j,k);
6178 Real dpp_yz = (p(i+1,j+1,k+1) + p(i,j+1,k+1) - p(i+1,j,k+1) - p(i,j,k+1)
6179 -p(i+1,j+1,k ) - p(i,j+1,k ) + p(i+1,j,k ) + p(i,j,k ) ) / vfrac(i,j,k);
6181 Real dpp_xyz = (p(i+1,j+1,k+1) - p(i,j+1,k+1) - p(i+1,j,k+1) + p(i,j,k+1)
6182 -p(i+1,j+1,k ) + p(i,j+1,k ) + p(i+1,j,k ) - p(i,j,k ) ) / vfrac(i,j,k);
6184 u(i,j,k,0) -= sig*dxinv[0]*(dpdx + Real(0.5)*intg(i,j,k,
i_S_y )*dpp_xy +
6185 Real(0.5)*intg(i,j,k,
i_S_z )*dpp_xz +
6186 intg(i,j,k,
i_S_y_z)*dpp_xyz );
6187 u(i,j,k,1) -= sig*dxinv[1]*(dpdy + Real(0.5)*intg(i,j,k,
i_S_x )*dpp_xy +
6188 Real(0.5)*intg(i,j,k,
i_S_z )*dpp_yz +
6189 intg(i,j,k,
i_S_x_z)*dpp_xyz );
6190 u(i,j,k,2) -= sig*dxinv[2]*(dpdz + Real(0.5)*intg(i,j,k,
i_S_x )*dpp_xz +
6191 Real(0.5)*intg(i,j,k,
i_S_y )*dpp_yz +
6192 intg(i,j,k,
i_S_x_y)*dpp_xyz );
6197 Real mlndlap_rhcc_eb (
int i,
int j,
int k, Array4<Real const>
const& rhcc,
6198 Array4<Real const>
const& vfrac, Array4<Real const>
const& intg,
6199 Array4<int const>
const& msk) noexcept
6201 using namespace nodelap_detail;
6206 ( Real(0.125) * vfrac(i ,j ,k )
6207 + Real(0.25) * (-intg(i ,j ,k ,
i_S_x)
6208 -intg(i ,j ,k ,
i_S_y)
6209 -intg(i ,j ,k ,
i_S_z))
6210 + Real(0.5) * ( intg(i ,j ,k ,
i_S_x_y)
6216 ( Real(0.125) * vfrac(i-1,j ,k )
6217 + Real(0.25) * ( intg(i-1,j ,k ,
i_S_x)
6218 -intg(i-1,j ,k ,
i_S_y)
6219 -intg(i-1,j ,k ,
i_S_z))
6220 + Real(0.5) * ( -intg(i-1,j ,k ,
i_S_x_y)
6226 ( Real(0.125) * vfrac(i ,j-1,k )
6227 + Real(0.25) * (-intg(i ,j-1,k ,
i_S_x)
6228 +intg(i ,j-1,k ,
i_S_y)
6229 -intg(i ,j-1,k ,
i_S_z))
6230 + Real(0.5) * ( -intg(i ,j-1,k ,
i_S_x_y)
6235 + rhcc(i-1,j-1,k ) *
6236 ( Real(0.125) * vfrac(i-1,j-1,k )
6237 + Real(0.25) * ( intg(i-1,j-1,k ,
i_S_x)
6238 +intg(i-1,j-1,k ,
i_S_y)
6239 -intg(i-1,j-1,k ,
i_S_z))
6240 + Real(0.5) * ( intg(i-1,j-1,k ,
i_S_x_y)
6243 + ( -intg(i-1,j-1,k ,
i_S_xyz)))
6246 ( Real(0.125) * vfrac(i ,j ,k-1)
6247 + Real(0.25) * (-intg(i ,j ,k-1,
i_S_x)
6248 -intg(i ,j ,k-1,
i_S_y)
6249 +intg(i ,j ,k-1,
i_S_z))
6250 + Real(0.5) * ( intg(i ,j ,k-1,
i_S_x_y)
6255 + rhcc(i-1,j ,k-1) *
6256 ( Real(0.125) * vfrac(i-1,j ,k-1)
6257 + Real(0.25) * ( intg(i-1,j ,k-1,
i_S_x)
6258 -intg(i-1,j ,k-1,
i_S_y)
6259 +intg(i-1,j ,k-1,
i_S_z))
6260 + Real(0.5) * ( -intg(i-1,j ,k-1,
i_S_x_y)
6263 + ( -intg(i-1,j ,k-1,
i_S_xyz)))
6265 + rhcc(i ,j-1,k-1) *
6266 ( Real(0.125) * vfrac(i ,j-1,k-1)
6267 + Real(0.25) * (-intg(i ,j-1,k-1,
i_S_x)
6268 +intg(i ,j-1,k-1,
i_S_y)
6269 +intg(i ,j-1,k-1,
i_S_z))
6270 + Real(0.5) * ( -intg(i ,j-1,k-1,
i_S_x_y)
6273 + ( -intg(i ,j-1,k-1,
i_S_xyz)))
6275 + rhcc(i-1,j-1,k-1) *
6276 ( Real(0.125) * vfrac(i-1,j-1,k-1)
6277 + Real(0.25) * ( intg(i-1,j-1,k-1,
i_S_x)
6278 +intg(i-1,j-1,k-1,
i_S_y)
6279 +intg(i-1,j-1,k-1,
i_S_z))
6280 + Real(0.5) * ( intg(i-1,j-1,k-1,
i_S_x_y)
6283 + ( intg(i-1,j-1,k-1,
i_S_xyz)));
6291 #if defined(AMREX_USE_HYPRE)
6293 template <
typename HypreInt,
typename AtomicInt>
6294 void mlndlap_fillijmat_sten_cpu (
Box const& ndbx,
6295 Array4<AtomicInt const>
const& gid,
6296 Array4<int const>
const& lid,
6297 HypreInt* ncols, HypreInt* cols,
6299 Array4<Real const>
const& sten) noexcept
6311 HypreInt nelems = 0;
6314 if (lid(i,j,k) >= 0)
6316 cols[nelems] = gid(i,j,k);
6317 mat[nelems] = sten(i,j,k,
ist_000);
6321 if (gid(i-1,j-1,k-1) < gidmax) {
6322 cols[nelems] = gid(i-1,j-1,k-1);
6323 mat[nelems] = sten(i-1,j-1,k-1,
ist_ppp);
6327 if (gid(i,j-1,k-1) < gidmax) {
6328 cols[nelems] = gid(i,j-1,k-1);
6329 mat[nelems] = sten(i,j-1,k-1,
ist_0pp);
6333 if (gid(i+1,j-1,k-1) < gidmax) {
6334 cols[nelems] = gid(i+1,j-1,k-1);
6335 mat[nelems] = sten(i,j-1,k-1,
ist_ppp);
6339 if (gid(i-1,j,k-1) < gidmax) {
6340 cols[nelems] = gid(i-1,j,k-1);
6341 mat[nelems] = sten(i-1,j,k-1,
ist_p0p);
6345 if (gid(i,j,k-1) < gidmax) {
6346 cols[nelems] = gid(i,j,k-1);
6347 mat[nelems] = sten(i,j,k-1,
ist_00p);
6351 if (gid(i+1,j,k-1) < gidmax) {
6352 cols[nelems] = gid(i+1,j,k-1);
6353 mat[nelems] = sten(i,j,k-1,
ist_p0p);
6357 if (gid(i-1,j+1,k-1) < gidmax) {
6358 cols[nelems] = gid(i-1,j+1,k-1);
6359 mat[nelems] = sten(i-1,j,k-1,
ist_ppp);
6363 if (gid(i,j+1,k-1) < gidmax) {
6364 cols[nelems] = gid(i,j+1,k-1);
6365 mat[nelems] = sten(i,j,k-1,
ist_0pp);
6369 if (gid(i+1,j+1,k-1) < gidmax) {
6370 cols[nelems] = gid(i+1,j+1,k-1);
6371 mat[nelems] = sten(i,j,k-1,
ist_ppp);
6375 if (gid(i-1,j-1,k) < gidmax) {
6376 cols[nelems] = gid(i-1,j-1,k);
6377 mat[nelems] = sten(i-1,j-1,k,
ist_pp0);
6381 if (gid(i,j-1,k) < gidmax) {
6382 cols[nelems] = gid(i,j-1,k);
6383 mat[nelems] = sten(i,j-1,k,
ist_0p0);
6387 if (gid(i+1,j-1,k) < gidmax) {
6388 cols[nelems] = gid(i+1,j-1,k);
6389 mat[nelems] = sten(i,j-1,k,
ist_pp0);
6393 if (gid(i-1,j,k) < gidmax) {
6394 cols[nelems] = gid(i-1,j,k);
6395 mat[nelems] = sten(i-1,j,k,
ist_p00);
6399 if (gid(i+1,j,k) < gidmax) {
6400 cols[nelems] = gid(i+1,j,k);
6401 mat[nelems] = sten(i,j,k,
ist_p00);
6405 if (gid(i-1,j+1,k) < gidmax) {
6406 cols[nelems] = gid(i-1,j+1,k);
6407 mat[nelems] = sten(i-1,j,k,
ist_pp0);
6411 if (gid(i,j+1,k) < gidmax) {
6412 cols[nelems] = gid(i,j+1,k);
6413 mat[nelems] = sten(i,j,k,
ist_0p0);
6417 if (gid(i+1,j+1,k) < gidmax) {
6418 cols[nelems] = gid(i+1,j+1,k);
6419 mat[nelems] = sten(i,j,k,
ist_pp0);
6423 if (gid(i-1,j-1,k+1) < gidmax) {
6424 cols[nelems] = gid(i-1,j-1,k+1);
6425 mat[nelems] = sten(i-1,j-1,k,
ist_ppp);
6429 if (gid(i,j-1,k+1) < gidmax) {
6430 cols[nelems] = gid(i,j-1,k+1);
6431 mat[nelems] = sten(i,j-1,k,
ist_0pp);
6435 if (gid(i+1,j-1,k+1) < gidmax) {
6436 cols[nelems] = gid(i+1,j-1,k+1);
6437 mat[nelems] = sten(i,j-1,k,
ist_ppp);
6441 if (gid(i-1,j,k+1) < gidmax) {
6442 cols[nelems] = gid(i-1,j,k+1);
6443 mat[nelems] = sten(i-1,j,k,
ist_p0p);
6447 if (gid(i,j,k+1) < gidmax) {
6448 cols[nelems] = gid(i,j,k+1);
6449 mat[nelems] = sten(i,j,k,
ist_00p);
6453 if (gid(i+1,j,k+1) < gidmax) {
6454 cols[nelems] = gid(i+1,j,k+1);
6455 mat[nelems] = sten(i,j,k,
ist_p0p);
6459 if (gid(i-1,j+1,k+1) < gidmax) {
6460 cols[nelems] = gid(i-1,j+1,k+1);
6461 mat[nelems] = sten(i-1,j,k,
ist_ppp);
6465 if (gid(i,j+1,k+1) < gidmax) {
6466 cols[nelems] = gid(i,j+1,k+1);
6467 mat[nelems] = sten(i,j,k,
ist_0pp);
6471 if (gid(i+1,j+1,k+1) < gidmax) {
6472 cols[nelems] = gid(i+1,j+1,k+1);
6473 mat[nelems] = sten(i,j,k,
ist_ppp);
6477 ncols[lid(i,j,k)] = nelems - nelems_old;
6482 template <
typename HypreInt,
typename AtomicInt>
6483 void mlndlap_fillijmat_aa_cpu (
Box const& ndbx,
6484 Array4<AtomicInt const>
const& gid,
6485 Array4<int const>
const& lid,
6486 HypreInt* ncols, HypreInt* cols,
6488 Array4<Real const>
const& sig,
6489 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
6490 Box const& ccdom) noexcept
6492 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
6493 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
6494 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
6495 Real fxyz = facx + facy + facz;
6496 Real fmx2y2z = -facx + Real(2.0)*facy + Real(2.0)*facz;
6497 Real f2xmy2z = Real(2.0)*facx - facy + Real(2.0)*facz;
6498 Real f2x2ymz = Real(2.0)*facx + Real(2.0)*facy - facz;
6499 Real f4xm2ym2z = Real(4.0)*facx - Real(2.0)*facy - Real(2.0)*facz;
6500 Real fm2x4ym2z = -Real(2.0)*facx + Real(4.0)*facy - Real(2.0)*facz;
6501 Real fm2xm2y4z = -Real(2.0)*facx - Real(2.0)*facy + Real(4.0)*facz;
6506 HypreInt nelems = 0;
6509 if (lid(i,j,k) >= 0)
6511 HypreInt nelems_old = nelems;
6512 cols[nelems_old] = gid(i,j,k);
6516 if (nddom.contains(i-1,j-1,k-1)) {
6517 Real tmp = sig(i-1,j-1,k-1) * fxyz;
6519 if ( gid(i-1,j-1,k-1) < gidmax) {
6520 cols[nelems] = gid(i-1,j-1,k-1);
6526 if (nddom.contains(i,j-1,k-1)) {
6527 Real tmp = Real(0.);
6528 if (ccdom.contains(i-1,j-1,k-1)) {
6529 tmp += sig(i-1,j-1,k-1) * fmx2y2z;
6531 if (ccdom.contains(i,j-1,k-1)) {
6532 tmp += sig(i,j-1,k-1) * fmx2y2z;
6535 if (gid(i,j-1,k-1) < gidmax) {
6536 cols[nelems] = gid(i,j-1,k-1);
6542 if (nddom.contains(i+1,j-1,k-1)) {
6543 Real tmp = sig(i ,j-1,k-1) * fxyz;
6545 if (gid(i+1,j-1,k-1) < gidmax) {
6546 cols[nelems] = gid(i+1,j-1,k-1);
6552 if (nddom.contains(i-1,j,k-1)) {
6553 Real tmp = Real(0.);
6554 if (ccdom.contains(i-1,j-1,k-1)) {
6555 tmp += sig(i-1,j-1,k-1) * f2xmy2z;
6557 if (ccdom.contains(i-1,j,k-1)) {
6558 tmp += sig(i-1,j,k-1) * f2xmy2z;
6561 if (gid(i-1,j,k-1) < gidmax) {
6562 cols[nelems] = gid(i-1,j,k-1);
6568 if (nddom.contains(i,j,k-1) && fm2xm2y4z != Real(0.0)) {
6569 Real tmp = Real(0.);
6570 if (ccdom.contains(i-1,j-1,k-1)) {
6571 tmp += sig(i-1,j-1,k-1) * fm2xm2y4z;
6573 if (ccdom.contains(i,j-1,k-1)) {
6574 tmp += sig(i,j-1,k-1) * fm2xm2y4z;
6576 if (ccdom.contains(i-1,j,k-1)) {
6577 tmp += sig(i-1,j,k-1) * fm2xm2y4z;
6579 if (ccdom.contains(i,j,k-1)) {
6580 tmp += sig(i,j,k-1) * fm2xm2y4z;
6583 if (gid(i,j,k-1) < gidmax) {
6584 cols[nelems] = gid(i,j,k-1);
6590 if (nddom.contains(i+1,j,k-1)) {
6591 Real tmp = Real(0.);
6592 if (ccdom.contains(i ,j-1,k-1)) {
6593 tmp += sig(i ,j-1,k-1) * f2xmy2z;
6595 if (ccdom.contains(i ,j,k-1)) {
6596 tmp += sig(i ,j,k-1) * f2xmy2z;
6599 if (gid(i+1,j,k-1) < gidmax) {
6600 cols[nelems] = gid(i+1,j,k-1);
6606 if (nddom.contains(i-1,j+1,k-1)) {
6607 Real tmp = sig(i-1,j ,k-1) * fxyz;
6609 if (gid(i-1,j+1,k-1) < gidmax) {
6610 cols[nelems] = gid(i-1,j+1,k-1);
6616 if (nddom.contains(i,j+1,k-1)) {
6617 Real tmp = Real(0.);
6618 if (ccdom.contains(i-1,j ,k-1)) {
6619 tmp += sig(i-1,j ,k-1) * fmx2y2z;
6621 if (ccdom.contains(i,j ,k-1)) {
6622 tmp += sig(i,j ,k-1) * fmx2y2z;
6625 if (gid(i,j+1,k-1) < gidmax) {
6626 cols[nelems] = gid(i,j+1,k-1);
6632 if (nddom.contains(i+1,j+1,k-1)) {
6633 Real tmp = sig(i ,j ,k-1) * fxyz;
6635 if (gid(i+1,j+1,k-1) < gidmax) {
6636 cols[nelems] = gid(i+1,j+1,k-1);
6642 if (nddom.contains(i-1,j-1,k)) {
6643 Real tmp = Real(0.);
6644 if (ccdom.contains(i-1,j-1,k-1)) {
6645 tmp += sig(i-1,j-1,k-1) * f2x2ymz;
6647 if (ccdom.contains(i-1,j-1,k)) {
6648 tmp += sig(i-1,j-1,k) * f2x2ymz;
6651 if (gid(i-1,j-1,k) < gidmax) {
6652 cols[nelems] = gid(i-1,j-1,k);
6658 if (nddom.contains(i,j-1,k) && fm2x4ym2z != Real(0.0)) {
6659 Real tmp = Real(0.);
6660 if (ccdom.contains(i-1,j-1,k-1)) {
6661 tmp += sig(i-1,j-1,k-1) * fm2x4ym2z;
6663 if (ccdom.contains(i,j-1,k-1)) {
6664 tmp += sig(i,j-1,k-1) * fm2x4ym2z;
6666 if (ccdom.contains(i-1,j-1,k)) {
6667 tmp += sig(i-1,j-1,k) * fm2x4ym2z;
6669 if (ccdom.contains(i,j-1,k)) {
6670 tmp += sig(i,j-1,k) * fm2x4ym2z;
6673 if (gid(i,j-1,k) < gidmax) {
6674 cols[nelems] = gid(i,j-1,k);
6680 if (nddom.contains(i+1,j-1,k)) {
6681 Real tmp = Real(0.);
6682 if (ccdom.contains(i ,j-1,k-1)) {
6683 tmp += sig(i ,j-1,k-1) * f2x2ymz;
6685 if (ccdom.contains(i ,j-1,k)) {
6686 tmp += sig(i ,j-1,k) * f2x2ymz;
6689 if (gid(i+1,j-1,k) < gidmax) {
6690 cols[nelems] = gid(i+1,j-1,k);
6696 if (nddom.contains(i-1,j,k) && f4xm2ym2z != Real(0.0)) {
6697 Real tmp = Real(0.);
6698 if (ccdom.contains(i-1,j-1,k-1)) {
6699 tmp += sig(i-1,j-1,k-1) * f4xm2ym2z;
6701 if (ccdom.contains(i-1,j,k-1)) {
6702 tmp += sig(i-1,j,k-1) * f4xm2ym2z;
6704 if (ccdom.contains(i-1,j-1,k)) {
6705 tmp += sig(i-1,j-1,k) * f4xm2ym2z;
6707 if (ccdom.contains(i-1,j,k)) {
6708 tmp += sig(i-1,j,k) * f4xm2ym2z;
6711 if (gid(i-1,j,k) < gidmax) {
6712 cols[nelems] = gid(i-1,j,k);
6718 if (nddom.contains(i+1,j,k) && f4xm2ym2z != Real(0.0)) {
6719 Real tmp = Real(0.);
6720 if (ccdom.contains(i ,j-1,k-1)) {
6721 tmp += sig(i ,j-1,k-1) * f4xm2ym2z;
6723 if (ccdom.contains(i ,j,k-1)) {
6724 tmp += sig(i ,j,k-1) * f4xm2ym2z;
6726 if (ccdom.contains(i ,j-1,k)) {
6727 tmp += sig(i ,j-1,k) * f4xm2ym2z;
6729 if (ccdom.contains(i ,j,k)) {
6730 tmp += sig(i ,j,k) * f4xm2ym2z;
6733 if (gid(i+1,j,k) < gidmax) {
6734 cols[nelems] = gid(i+1,j,k);
6740 if (nddom.contains(i-1,j+1,k)) {
6741 Real tmp = Real(0.);
6742 if (ccdom.contains(i-1,j ,k-1)) {
6743 tmp += sig(i-1,j ,k-1) * f2x2ymz;
6745 if (ccdom.contains(i-1,j ,k)) {
6746 tmp += sig(i-1,j ,k) * f2x2ymz;
6749 if (gid(i-1,j+1,k) < gidmax) {
6750 cols[nelems] = gid(i-1,j+1,k);
6756 if (nddom.contains(i,j+1,k) && fm2x4ym2z != Real(0.0)) {
6757 Real tmp = Real(0.);
6758 if (ccdom.contains(i-1,j ,k-1)) {
6759 tmp += sig(i-1,j ,k-1) * fm2x4ym2z;
6761 if (ccdom.contains(i,j ,k-1)) {
6762 tmp += sig(i,j ,k-1) * fm2x4ym2z;
6764 if (ccdom.contains(i-1,j ,k)) {
6765 tmp += sig(i-1,j ,k) * fm2x4ym2z;
6767 if (ccdom.contains(i,j ,k)) {
6768 tmp += sig(i,j ,k) * fm2x4ym2z;
6771 if (gid(i,j+1,k) < gidmax) {
6772 cols[nelems] = gid(i,j+1,k);
6778 if (nddom.contains(i+1,j+1,k)) {
6779 Real tmp = Real(0.);
6780 if (ccdom.contains(i ,j ,k-1)) {
6781 tmp += sig(i ,j ,k-1) * f2x2ymz;
6783 if (ccdom.contains(i ,j ,k)) {
6784 tmp += sig(i ,j ,k) * f2x2ymz;
6787 if (gid(i+1,j+1,k) < gidmax) {
6788 cols[nelems] = gid(i+1,j+1,k);
6794 if (nddom.contains(i-1,j-1,k+1)) {
6795 Real tmp = sig(i-1,j-1,k ) * fxyz;
6797 if (gid(i-1,j-1,k+1) < gidmax) {
6798 cols[nelems] = gid(i-1,j-1,k+1);
6804 if (nddom.contains(i,j-1,k+1)) {
6805 Real tmp = Real(0.);
6806 if (ccdom.contains(i-1,j-1,k )) {
6807 tmp += sig(i-1,j-1,k ) * fmx2y2z;
6809 if (ccdom.contains(i,j-1,k )) {
6810 tmp += sig(i,j-1,k ) * fmx2y2z;
6813 if (gid(i,j-1,k+1) < gidmax) {
6814 cols[nelems] = gid(i,j-1,k+1);
6820 if (nddom.contains(i+1,j-1,k+1)) {
6821 Real tmp = sig(i ,j-1,k ) * fxyz;
6823 if (gid(i+1,j-1,k+1) < gidmax) {
6824 cols[nelems] = gid(i+1,j-1,k+1);
6830 if (nddom.contains(i-1,j,k+1)) {
6831 Real tmp = Real(0.);
6832 if (ccdom.contains(i-1,j-1,k )) {
6833 tmp += sig(i-1,j-1,k ) * f2xmy2z;
6835 if (ccdom.contains(i-1,j,k )) {
6836 tmp += sig(i-1,j,k ) * f2xmy2z;
6839 if (gid(i-1,j,k+1) < gidmax) {
6840 cols[nelems] = gid(i-1,j,k+1);
6846 if (nddom.contains(i,j,k+1) && fm2xm2y4z != Real(0.0)) {
6847 Real tmp = Real(0.);
6848 if (ccdom.contains(i-1,j-1,k )) {
6849 tmp += sig(i-1,j-1,k ) * fm2xm2y4z;
6851 if (ccdom.contains(i,j-1,k )) {
6852 tmp += sig(i,j-1,k ) * fm2xm2y4z;
6854 if (ccdom.contains(i-1,j,k )) {
6855 tmp += sig(i-1,j,k ) * fm2xm2y4z;
6857 if (ccdom.contains(i,j,k )) {
6858 tmp += sig(i,j,k ) * fm2xm2y4z;
6861 if (gid(i,j,k+1) < gidmax) {
6862 cols[nelems] = gid(i,j,k+1);
6868 if (nddom.contains(i+1,j,k+1)) {
6869 Real tmp = Real(0.);
6870 if (ccdom.contains(i ,j-1,k )) {
6871 tmp += sig(i ,j-1,k ) * f2xmy2z;
6873 if (ccdom.contains(i ,j,k )) {
6874 tmp += sig(i ,j,k ) * f2xmy2z;
6877 if (gid(i+1,j,k+1) < gidmax) {
6878 cols[nelems] = gid(i+1,j,k+1);
6884 if (nddom.contains(i-1,j+1,k+1)) {
6885 Real tmp = sig(i-1,j ,k ) * fxyz;
6887 if (gid(i-1,j+1,k+1) < gidmax) {
6888 cols[nelems] = gid(i-1,j+1,k+1);
6894 if (nddom.contains(i,j+1,k+1)) {
6895 Real tmp = Real(0.);
6896 if (ccdom.contains(i-1,j ,k )) {
6897 tmp += sig(i-1,j ,k ) * fmx2y2z;
6899 if (ccdom.contains(i,j ,k )) {
6900 tmp += sig(i,j ,k ) * fmx2y2z;
6903 if (gid(i,j+1,k+1) < gidmax) {
6904 cols[nelems] = gid(i,j+1,k+1);
6910 if (nddom.contains(i+1,j+1,k+1)) {
6911 Real tmp = sig(i ,j ,k ) * fxyz;
6913 if (gid(i+1,j+1,k+1) < gidmax) {
6914 cols[nelems] = gid(i+1,j+1,k+1);
6920 mat[nelems_old] = m0;
6921 ncols[lid(i,j,k)] = nelems - nelems_old;
6926 template <
typename HypreInt,
typename AtomicInt>
6927 void mlndlap_fillijmat_ha_cpu (
Box const& ndbx,
6928 Array4<AtomicInt const>
const& gid,
6929 Array4<int const>
const& lid,
6930 HypreInt* ncols, HypreInt* cols,
6932 Array4<Real const>
const& sx,
6933 Array4<Real const>
const& sy,
6934 Array4<Real const>
const& sz,
6935 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
6936 Box const& ccdom) noexcept
6938 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
6939 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
6940 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
6945 HypreInt nelems = 0;
6948 if (lid(i,j,k) >= 0)
6950 HypreInt nelems_old = nelems;
6951 cols[nelems_old] = gid(i,j,k);
6955 if (nddom.contains(i-1,j-1,k-1)) {
6956 Real tmp = sx(i-1,j-1,k-1) * facx
6957 + sy(i-1,j-1,k-1) * facy
6958 + sz(i-1,j-1,k-1) * facz;
6960 if ( gid(i-1,j-1,k-1) < gidmax) {
6961 cols[nelems] = gid(i-1,j-1,k-1);
6967 if (nddom.contains(i,j-1,k-1)) {
6968 Real tmp = Real(0.);
6969 if (ccdom.contains(i-1,j-1,k-1)) {
6970 tmp += - sx(i-1,j-1,k-1) * facx
6971 + sy(i-1,j-1,k-1) * facy * Real(2.0)
6972 + sz(i-1,j-1,k-1) * facz * Real(2.0);
6974 if (ccdom.contains(i,j-1,k-1)) {
6975 tmp += - sx(i,j-1,k-1) * facx
6976 + sy(i,j-1,k-1) * facy * Real(2.0)
6977 + sz(i,j-1,k-1) * facz * Real(2.0);
6980 if (gid(i,j-1,k-1) < gidmax) {
6981 cols[nelems] = gid(i,j-1,k-1);
6987 if (nddom.contains(i+1,j-1,k-1)) {
6988 Real tmp = sx(i ,j-1,k-1) * facx
6989 + sy(i ,j-1,k-1) * facy
6990 + sz(i ,j-1,k-1) * facz;
6992 if (gid(i+1,j-1,k-1) < gidmax) {
6993 cols[nelems] = gid(i+1,j-1,k-1);
6999 if (nddom.contains(i-1,j,k-1)) {
7000 Real tmp = Real(0.);
7001 if (ccdom.contains(i-1,j-1,k-1)) {
7002 tmp += sx(i-1,j-1,k-1) * facx * Real(2.0)
7003 - sy(i-1,j-1,k-1) * facy
7004 + sz(i-1,j-1,k-1) * facz * Real(2.0);
7006 if (ccdom.contains(i-1,j,k-1)) {
7007 tmp += sx(i-1,j,k-1) * facx * Real(2.0)
7008 - sy(i-1,j,k-1) * facy
7009 + sz(i-1,j,k-1) * facz * Real(2.0);
7012 if (gid(i-1,j,k-1) < gidmax) {
7013 cols[nelems] = gid(i-1,j,k-1);
7019 if (nddom.contains(i,j,k-1)) {
7020 Real tmp = Real(0.);
7021 if (ccdom.contains(i-1,j-1,k-1)) {
7022 tmp += - sx(i-1,j-1,k-1) * facx * Real(2.0)
7023 - sy(i-1,j-1,k-1) * facy * Real(2.0)
7024 + sz(i-1,j-1,k-1) * facz * Real(4.0);
7026 if (ccdom.contains(i,j-1,k-1)) {
7027 tmp += - sx(i,j-1,k-1) * facx * Real(2.0)
7028 - sy(i,j-1,k-1) * facy * Real(2.0)
7029 + sz(i,j-1,k-1) * facz * Real(4.0);
7032 if (ccdom.contains(i-1,j,k-1)) {
7033 tmp += - sx(i-1,j,k-1) * facx * Real(2.0)
7034 - sy(i-1,j,k-1) * facy * Real(2.0)
7035 + sz(i-1,j,k-1) * facz * Real(4.0);
7037 if (ccdom.contains(i,j,k-1)) {
7038 tmp += - sx(i,j,k-1) * facx * Real(2.0)
7039 - sy(i,j,k-1) * facy * Real(2.0)
7040 + sz(i,j,k-1) * facz * Real(4.0);
7043 if (gid(i,j,k-1) < gidmax && tmp != Real(0.0)) {
7044 cols[nelems] = gid(i,j,k-1);
7050 if (nddom.contains(i+1,j,k-1)) {
7051 Real tmp = Real(0.);
7052 if (ccdom.contains(i ,j-1,k-1)) {
7053 tmp += sx(i ,j-1,k-1) * facx * Real(2.0)
7054 - sy(i ,j-1,k-1) * facy
7055 + sz(i ,j-1,k-1) * facz * Real(2.0);
7057 if (ccdom.contains(i ,j,k-1)) {
7058 tmp += sx(i ,j,k-1) * facx * Real(2.0)
7059 - sy(i ,j,k-1) * facy
7060 + sz(i ,j,k-1) * facz * Real(2.0);
7063 if (gid(i+1,j,k-1) < gidmax) {
7064 cols[nelems] = gid(i+1,j,k-1);
7070 if (nddom.contains(i-1,j+1,k-1)) {
7071 Real tmp = sx(i-1,j ,k-1) * facx
7072 + sy(i-1,j ,k-1) * facy
7073 + sz(i-1,j ,k-1) * facz;
7075 if (gid(i-1,j+1,k-1) < gidmax) {
7076 cols[nelems] = gid(i-1,j+1,k-1);
7082 if (nddom.contains(i,j+1,k-1)) {
7083 Real tmp = Real(0.);
7084 if (ccdom.contains(i-1,j ,k-1)) {
7085 tmp += - sx(i-1,j ,k-1) * facx
7086 + sy(i-1,j ,k-1) * facy * Real(2.0)
7087 + sz(i-1,j ,k-1) * facz * Real(2.0);
7089 if (ccdom.contains(i,j ,k-1)) {
7090 tmp += - sx(i,j ,k-1) * facx
7091 + sy(i,j ,k-1) * facy * Real(2.0)
7092 + sz(i,j ,k-1) * facz * Real(2.0);
7095 if (gid(i,j+1,k-1) < gidmax) {
7096 cols[nelems] = gid(i,j+1,k-1);
7102 if (nddom.contains(i+1,j+1,k-1)) {
7103 Real tmp = sx(i ,j ,k-1) * facx
7104 + sy(i ,j ,k-1) * facy
7105 + sz(i ,j ,k-1) * facz;
7107 if (gid(i+1,j+1,k-1) < gidmax) {
7108 cols[nelems] = gid(i+1,j+1,k-1);
7114 if (nddom.contains(i-1,j-1,k)) {
7115 Real tmp = Real(0.);
7116 if (ccdom.contains(i-1,j-1,k-1)) {
7117 tmp += sx(i-1,j-1,k-1) * facx * Real(2.0)
7118 + sy(i-1,j-1,k-1) * facy * Real(2.0)
7119 - sz(i-1,j-1,k-1) * facz;
7121 if (ccdom.contains(i-1,j-1,k)) {
7122 tmp += sx(i-1,j-1,k) * facx * Real(2.0)
7123 + sy(i-1,j-1,k) * facy * Real(2.0)
7124 - sz(i-1,j-1,k) * facz;
7127 if (gid(i-1,j-1,k) < gidmax) {
7128 cols[nelems] = gid(i-1,j-1,k);
7134 if (nddom.contains(i,j-1,k)) {
7135 Real tmp = Real(0.);
7136 if (ccdom.contains(i-1,j-1,k-1)) {
7137 tmp += - sx(i-1,j-1,k-1) * facx * Real(2.0)
7138 + sy(i-1,j-1,k-1) * facy * Real(4.0)
7139 - sz(i-1,j-1,k-1) * facz * Real(2.0);
7141 if (ccdom.contains(i,j-1,k-1)) {
7142 tmp += - sx(i,j-1,k-1) * facx * Real(2.0)
7143 + sy(i,j-1,k-1) * facy * Real(4.0)
7144 - sz(i,j-1,k-1) * facz * Real(2.0);
7146 if (ccdom.contains(i-1,j-1,k)) {
7147 tmp += - sx(i-1,j-1,k) * facx * Real(2.0)
7148 + sy(i-1,j-1,k) * facy * Real(4.0)
7149 - sz(i-1,j-1,k) * facz * Real(2.0);
7151 if (ccdom.contains(i,j-1,k)) {
7152 tmp += - sx(i,j-1,k) * facx * Real(2.0)
7153 + sy(i,j-1,k) * facy * Real(4.0)
7154 - sz(i,j-1,k) * facz * Real(2.0);
7157 if (gid(i,j-1,k) < gidmax && tmp != Real(0.0)) {
7158 cols[nelems] = gid(i,j-1,k);
7164 if (nddom.contains(i+1,j-1,k)) {
7165 Real tmp = Real(0.);
7166 if (ccdom.contains(i ,j-1,k-1)) {
7167 tmp += sx(i ,j-1,k-1) * facx * Real(2.0)
7168 + sy(i ,j-1,k-1) * facy * Real(2.0)
7169 - sz(i ,j-1,k-1) * facz;
7171 if (ccdom.contains(i ,j-1,k)) {
7172 tmp += sx(i ,j-1,k) * facx * Real(2.0)
7173 + sy(i ,j-1,k) * facy * Real(2.0)
7174 - sz(i ,j-1,k) * facz;
7177 if (gid(i+1,j-1,k) < gidmax) {
7178 cols[nelems] = gid(i+1,j-1,k);
7184 if (nddom.contains(i-1,j,k)) {
7185 Real tmp = Real(0.);
7186 if (ccdom.contains(i-1,j-1,k-1)) {
7187 tmp += sx(i-1,j-1,k-1) * facx * Real(4.0)
7188 - sy(i-1,j-1,k-1) * facy * Real(2.0)
7189 - sz(i-1,j-1,k-1) * facz * Real(2.0);
7191 if (ccdom.contains(i-1,j,k-1)) {
7192 tmp += sx(i-1,j,k-1) * facx * Real(4.0)
7193 - sy(i-1,j,k-1) * facy * Real(2.0)
7194 - sz(i-1,j,k-1) * facz * Real(2.0);
7196 if (ccdom.contains(i-1,j-1,k)) {
7197 tmp += sx(i-1,j-1,k) * facx * Real(4.0)
7198 - sy(i-1,j-1,k) * facy * Real(2.0)
7199 - sz(i-1,j-1,k) * facz * Real(2.0);
7201 if (ccdom.contains(i-1,j,k)) {
7202 tmp += sx(i-1,j,k) * facx * Real(4.0)
7203 - sy(i-1,j,k) * facy * Real(2.0)
7204 - sz(i-1,j,k) * facz * Real(2.0);
7207 if (gid(i-1,j,k) < gidmax && tmp != Real(0.0)) {
7208 cols[nelems] = gid(i-1,j,k);
7214 if (nddom.contains(i+1,j,k)) {
7215 Real tmp = Real(0.);
7216 if (ccdom.contains(i ,j-1,k-1)) {
7217 tmp += sx(i ,j-1,k-1) * facx * Real(4.0)
7218 - sy(i ,j-1,k-1) * facy * Real(2.0)
7219 - sz(i ,j-1,k-1) * facz * Real(2.0);
7221 if (ccdom.contains(i ,j,k-1)) {
7222 tmp += sx(i ,j,k-1) * facx * Real(4.0)
7223 - sy(i ,j,k-1) * facy * Real(2.0)
7224 - sz(i ,j,k-1) * facz * Real(2.0);
7226 if (ccdom.contains(i ,j-1,k)) {
7227 tmp += sx(i ,j-1,k) * facx * Real(4.0)
7228 - sy(i ,j-1,k) * facy * Real(2.0)
7229 - sz(i ,j-1,k) * facz * Real(2.0);
7231 if (ccdom.contains(i ,j,k)) {
7232 tmp += sx(i ,j,k) * facx * Real(4.0)
7233 - sy(i ,j,k) * facy * Real(2.0)
7234 - sz(i ,j,k) * facz * Real(2.0);
7237 if (gid(i+1,j,k) < gidmax && tmp != Real(0.0)) {
7238 cols[nelems] = gid(i+1,j,k);
7244 if (nddom.contains(i-1,j+1,k)) {
7245 Real tmp = Real(0.);
7246 if (ccdom.contains(i-1,j ,k-1)) {
7247 tmp += sx(i-1,j ,k-1) * facx * Real(2.0)
7248 + sy(i-1,j ,k-1) * facy * Real(2.0)
7249 - sz(i-1,j ,k-1) * facz;
7251 if (ccdom.contains(i-1,j ,k)) {
7252 tmp += sx(i-1,j ,k) * facx * Real(2.0)
7253 + sy(i-1,j ,k) * facy * Real(2.0)
7254 - sz(i-1,j ,k) * facz;
7257 if (gid(i-1,j+1,k) < gidmax) {
7258 cols[nelems] = gid(i-1,j+1,k);
7264 if (nddom.contains(i,j+1,k)) {
7265 Real tmp = Real(0.);
7266 if (ccdom.contains(i-1,j ,k-1)) {
7267 tmp += - sx(i-1,j ,k-1) * facx * Real(2.0)
7268 + sy(i-1,j ,k-1) * facy * Real(4.0)
7269 - sz(i-1,j ,k-1) * facz * Real(2.0);
7271 if (ccdom.contains(i,j ,k-1)) {
7272 tmp += - sx(i,j ,k-1) * facx * Real(2.0)
7273 + sy(i,j ,k-1) * facy * Real(4.0)
7274 - sz(i,j ,k-1) * facz * Real(2.0);
7276 if (ccdom.contains(i-1,j ,k)) {
7277 tmp += - sx(i-1,j ,k) * facx * Real(2.0)
7278 + sy(i-1,j ,k) * facy * Real(4.0)
7279 - sz(i-1,j ,k) * facz * Real(2.0);
7281 if (ccdom.contains(i,j ,k)) {
7282 tmp += - sx(i,j ,k) * facx * Real(2.0)
7283 + sy(i,j ,k) * facy * Real(4.0)
7284 - sz(i,j ,k) * facz * Real(2.0);
7287 if (gid(i,j+1,k) < gidmax && tmp != Real(0.0)) {
7288 cols[nelems] = gid(i,j+1,k);
7294 if (nddom.contains(i+1,j+1,k)) {
7295 Real tmp = Real(0.);
7296 if (ccdom.contains(i ,j ,k-1)) {
7297 tmp += sx(i ,j ,k-1) * facx * Real(2.0)
7298 + sy(i ,j ,k-1) * facy * Real(2.0)
7299 - sz(i ,j ,k-1) * facz;
7301 if (ccdom.contains(i ,j ,k)) {
7302 tmp += sx(i ,j ,k) * facx * Real(2.0)
7303 + sy(i ,j ,k) * facy * Real(2.0)
7304 - sz(i ,j ,k) * facz;
7307 if (gid(i+1,j+1,k) < gidmax) {
7308 cols[nelems] = gid(i+1,j+1,k);
7314 if (nddom.contains(i-1,j-1,k+1)) {
7315 Real tmp = sx(i-1,j-1,k ) * facx
7316 + sy(i-1,j-1,k ) * facy
7317 + sz(i-1,j-1,k ) * facz;
7319 if (gid(i-1,j-1,k+1) < gidmax) {
7320 cols[nelems] = gid(i-1,j-1,k+1);
7326 if (nddom.contains(i,j-1,k+1)) {
7327 Real tmp = Real(0.);
7328 if (ccdom.contains(i-1,j-1,k )) {
7329 tmp += - sx(i-1,j-1,k ) * facx
7330 + sy(i-1,j-1,k ) * facy * Real(2.0)
7331 + sz(i-1,j-1,k ) * facz * Real(2.0);
7333 if (ccdom.contains(i,j-1,k )) {
7334 tmp += - sx(i,j-1,k ) * facx
7335 + sy(i,j-1,k ) * facy * Real(2.0)
7336 + sz(i,j-1,k ) * facz * Real(2.0);
7339 if (gid(i,j-1,k+1) < gidmax) {
7340 cols[nelems] = gid(i,j-1,k+1);
7346 if (nddom.contains(i+1,j-1,k+1)) {
7347 Real tmp = sx(i ,j-1,k ) * facx
7348 + sy(i ,j-1,k ) * facy
7349 + sz(i ,j-1,k ) * facz;
7351 if (gid(i+1,j-1,k+1) < gidmax) {
7352 cols[nelems] = gid(i+1,j-1,k+1);
7358 if (nddom.contains(i-1,j,k+1)) {
7359 Real tmp = Real(0.);
7360 if (ccdom.contains(i-1,j-1,k )) {
7361 tmp += sx(i-1,j-1,k ) * facx * Real(2.0)
7362 - sy(i-1,j-1,k ) * facy
7363 + sz(i-1,j-1,k ) * facz * Real(2.0);
7365 if (ccdom.contains(i-1,j,k )) {
7366 tmp += sx(i-1,j,k ) * facx * Real(2.0)
7367 - sy(i-1,j,k ) * facy
7368 + sz(i-1,j,k ) * facz * Real(2.0);
7371 if (gid(i-1,j,k+1) < gidmax) {
7372 cols[nelems] = gid(i-1,j,k+1);
7378 if (nddom.contains(i,j,k+1)) {
7379 Real tmp = Real(0.);
7380 if (ccdom.contains(i-1,j-1,k )) {
7381 tmp += - sx(i-1,j-1,k ) * facx * Real(2.0)
7382 - sy(i-1,j-1,k ) * facy * Real(2.0)
7383 + sz(i-1,j-1,k ) * facz * Real(4.0);
7385 if (ccdom.contains(i,j-1,k )) {
7386 tmp += - sx(i,j-1,k ) * facx * Real(2.0)
7387 - sy(i,j-1,k ) * facy * Real(2.0)
7388 + sz(i,j-1,k ) * facz * Real(4.0);
7390 if (ccdom.contains(i-1,j,k )) {
7391 tmp += - sx(i-1,j,k ) * facx * Real(2.0)
7392 - sy(i-1,j,k ) * facy * Real(2.0)
7393 + sz(i-1,j,k ) * facz * Real(4.0);
7395 if (ccdom.contains(i,j,k )) {
7396 tmp += - sx(i,j,k ) * facx * Real(2.0)
7397 - sy(i,j,k ) * facy * Real(2.0)
7398 + sz(i,j,k ) * facz * Real(4.0);
7401 if (gid(i,j,k+1) < gidmax && tmp != Real(0.0)) {
7402 cols[nelems] = gid(i,j,k+1);
7408 if (nddom.contains(i+1,j,k+1)) {
7409 Real tmp = Real(0.);
7410 if (ccdom.contains(i ,j-1,k )) {
7411 tmp += sx(i ,j-1,k ) * facx * Real(2.0)
7412 - sy(i ,j-1,k ) * facy
7413 + sz(i ,j-1,k ) * facz * Real(2.0);
7415 if (ccdom.contains(i ,j,k )) {
7416 tmp += sx(i ,j,k ) * facx * Real(2.0)
7417 - sy(i ,j,k ) * facy
7418 + sz(i ,j,k ) * facz * Real(2.0);
7421 if (gid(i+1,j,k+1) < gidmax) {
7422 cols[nelems] = gid(i+1,j,k+1);
7428 if (nddom.contains(i-1,j+1,k+1)) {
7429 Real tmp = sx(i-1,j ,k ) * facx
7430 + sy(i-1,j ,k ) * facy
7431 + sz(i-1,j ,k ) * facz;
7433 if (gid(i-1,j+1,k+1) < gidmax) {
7434 cols[nelems] = gid(i-1,j+1,k+1);
7440 if (nddom.contains(i,j+1,k+1)) {
7441 Real tmp = Real(0.);
7442 if (ccdom.contains(i-1,j ,k )) {
7443 tmp += - sx(i-1,j ,k ) * facx
7444 + sy(i-1,j ,k ) * facy * Real(2.0)
7445 + sz(i-1,j ,k ) * facz * Real(2.0);
7447 if (ccdom.contains(i,j ,k )) {
7448 tmp += - sx(i,j ,k ) * facx
7449 + sy(i,j ,k ) * facy * Real(2.0)
7450 + sz(i,j ,k ) * facz * Real(2.0);
7453 if (gid(i,j+1,k+1) < gidmax) {
7454 cols[nelems] = gid(i,j+1,k+1);
7460 if (nddom.contains(i+1,j+1,k+1)) {
7461 Real tmp = sx(i ,j ,k ) * facx
7462 + sy(i ,j ,k ) * facy
7463 + sz(i ,j ,k ) * facz;
7465 if (gid(i+1,j+1,k+1) < gidmax) {
7466 cols[nelems] = gid(i+1,j+1,k+1);
7472 mat[nelems_old] = m0;
7473 ncols[lid(i,j,k)] = nelems - nelems_old;
7478 template <
typename HypreInt,
typename AtomicInt>
7479 void mlndlap_fillijmat_cs_cpu (
Box const& ndbx,
7480 Array4<AtomicInt const>
const& gid,
7481 Array4<int const>
const& lid,
7482 HypreInt* ncols, HypreInt* cols,
7485 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
7486 Box const& ccdom) noexcept
7488 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0] * sigma;
7489 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1] * sigma;
7490 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2] * sigma;
7491 Real fxyz = facx + facy + facz;
7492 Real fmx2y2z = -facx + Real(2.0)*facy + Real(2.0)*facz;
7493 Real f2xmy2z = Real(2.0)*facx - facy + Real(2.0)*facz;
7494 Real f2x2ymz = Real(2.0)*facx + Real(2.0)*facy - facz;
7495 Real f4xm2ym2z = Real(4.0)*facx - Real(2.0)*facy - Real(2.0)*facz;
7496 Real fm2x4ym2z = -Real(2.0)*facx + Real(4.0)*facy - Real(2.0)*facz;
7497 Real fm2xm2y4z = -Real(2.0)*facx - Real(2.0)*facy + Real(4.0)*facz;
7502 HypreInt nelems = 0;
7505 if (lid(i,j,k) >= 0)
7507 HypreInt nelems_old = nelems;
7508 cols[nelems_old] = gid(i,j,k);
7512 if (nddom.contains(i-1,j-1,k-1)) {
7515 if ( gid(i-1,j-1,k-1) < gidmax) {
7516 cols[nelems] = gid(i-1,j-1,k-1);
7522 if (nddom.contains(i,j-1,k-1)) {
7523 Real tmp = Real(0.);
7524 if (ccdom.contains(i-1,j-1,k-1)) {
7527 if (ccdom.contains(i,j-1,k-1)) {
7531 if (gid(i,j-1,k-1) < gidmax) {
7532 cols[nelems] = gid(i,j-1,k-1);
7538 if (nddom.contains(i+1,j-1,k-1)) {
7541 if (gid(i+1,j-1,k-1) < gidmax) {
7542 cols[nelems] = gid(i+1,j-1,k-1);
7548 if (nddom.contains(i-1,j,k-1)) {
7549 Real tmp = Real(0.);
7550 if (ccdom.contains(i-1,j-1,k-1)) {
7553 if (ccdom.contains(i-1,j,k-1)) {
7557 if (gid(i-1,j,k-1) < gidmax) {
7558 cols[nelems] = gid(i-1,j,k-1);
7564 if (nddom.contains(i,j,k-1) && fm2xm2y4z != Real(0.0)) {
7565 Real tmp = Real(0.);
7566 if (ccdom.contains(i-1,j-1,k-1)) {
7569 if (ccdom.contains(i,j-1,k-1)) {
7572 if (ccdom.contains(i-1,j,k-1)) {
7575 if (ccdom.contains(i,j,k-1)) {
7579 if (gid(i,j,k-1) < gidmax) {
7580 cols[nelems] = gid(i,j,k-1);
7586 if (nddom.contains(i+1,j,k-1)) {
7587 Real tmp = Real(0.);
7588 if (ccdom.contains(i ,j-1,k-1)) {
7591 if (ccdom.contains(i ,j,k-1)) {
7595 if (gid(i+1,j,k-1) < gidmax) {
7596 cols[nelems] = gid(i+1,j,k-1);
7602 if (nddom.contains(i-1,j+1,k-1)) {
7605 if (gid(i-1,j+1,k-1) < gidmax) {
7606 cols[nelems] = gid(i-1,j+1,k-1);
7612 if (nddom.contains(i,j+1,k-1)) {
7613 Real tmp = Real(0.);
7614 if (ccdom.contains(i-1,j ,k-1)) {
7617 if (ccdom.contains(i,j ,k-1)) {
7621 if (gid(i,j+1,k-1) < gidmax) {
7622 cols[nelems] = gid(i,j+1,k-1);
7628 if (nddom.contains(i+1,j+1,k-1)) {
7631 if (gid(i+1,j+1,k-1) < gidmax) {
7632 cols[nelems] = gid(i+1,j+1,k-1);
7638 if (nddom.contains(i-1,j-1,k)) {
7639 Real tmp = Real(0.);
7640 if (ccdom.contains(i-1,j-1,k-1)) {
7643 if (ccdom.contains(i-1,j-1,k)) {
7647 if (gid(i-1,j-1,k) < gidmax) {
7648 cols[nelems] = gid(i-1,j-1,k);
7654 if (nddom.contains(i,j-1,k) && fm2x4ym2z != Real(0.0)) {
7655 Real tmp = Real(0.);
7656 if (ccdom.contains(i-1,j-1,k-1)) {
7659 if (ccdom.contains(i,j-1,k-1)) {
7662 if (ccdom.contains(i-1,j-1,k)) {
7665 if (ccdom.contains(i,j-1,k)) {
7669 if (gid(i,j-1,k) < gidmax) {
7670 cols[nelems] = gid(i,j-1,k);
7676 if (nddom.contains(i+1,j-1,k)) {
7677 Real tmp = Real(0.);
7678 if (ccdom.contains(i ,j-1,k-1)) {
7681 if (ccdom.contains(i ,j-1,k)) {
7685 if (gid(i+1,j-1,k) < gidmax) {
7686 cols[nelems] = gid(i+1,j-1,k);
7692 if (nddom.contains(i-1,j,k) && f4xm2ym2z != Real(0.0)) {
7693 Real tmp = Real(0.);
7694 if (ccdom.contains(i-1,j-1,k-1)) {
7697 if (ccdom.contains(i-1,j,k-1)) {
7700 if (ccdom.contains(i-1,j-1,k)) {
7703 if (ccdom.contains(i-1,j,k)) {
7707 if (gid(i-1,j,k) < gidmax) {
7708 cols[nelems] = gid(i-1,j,k);
7714 if (nddom.contains(i+1,j,k) && f4xm2ym2z != Real(0.0)) {
7715 Real tmp = Real(0.);
7716 if (ccdom.contains(i ,j-1,k-1)) {
7719 if (ccdom.contains(i ,j,k-1)) {
7722 if (ccdom.contains(i ,j-1,k)) {
7725 if (ccdom.contains(i ,j,k)) {
7729 if (gid(i+1,j,k) < gidmax) {
7730 cols[nelems] = gid(i+1,j,k);
7736 if (nddom.contains(i-1,j+1,k)) {
7737 Real tmp = Real(0.);
7738 if (ccdom.contains(i-1,j ,k-1)) {
7741 if (ccdom.contains(i-1,j ,k)) {
7745 if (gid(i-1,j+1,k) < gidmax) {
7746 cols[nelems] = gid(i-1,j+1,k);
7752 if (nddom.contains(i,j+1,k) && fm2x4ym2z != Real(0.0)) {
7753 Real tmp = Real(0.);
7754 if (ccdom.contains(i-1,j ,k-1)) {
7757 if (ccdom.contains(i,j ,k-1)) {
7760 if (ccdom.contains(i-1,j ,k)) {
7763 if (ccdom.contains(i,j ,k)) {
7767 if (gid(i,j+1,k) < gidmax) {
7768 cols[nelems] = gid(i,j+1,k);
7774 if (nddom.contains(i+1,j+1,k)) {
7775 Real tmp = Real(0.);
7776 if (ccdom.contains(i ,j ,k-1)) {
7779 if (ccdom.contains(i ,j ,k)) {
7783 if (gid(i+1,j+1,k) < gidmax) {
7784 cols[nelems] = gid(i+1,j+1,k);
7790 if (nddom.contains(i-1,j-1,k+1)) {
7793 if (gid(i-1,j-1,k+1) < gidmax) {
7794 cols[nelems] = gid(i-1,j-1,k+1);
7800 if (nddom.contains(i,j-1,k+1)) {
7801 Real tmp = Real(0.);
7802 if (ccdom.contains(i-1,j-1,k )) {
7805 if (ccdom.contains(i,j-1,k )) {
7809 if (gid(i,j-1,k+1) < gidmax) {
7810 cols[nelems] = gid(i,j-1,k+1);
7816 if (nddom.contains(i+1,j-1,k+1)) {
7819 if (gid(i+1,j-1,k+1) < gidmax) {
7820 cols[nelems] = gid(i+1,j-1,k+1);
7826 if (nddom.contains(i-1,j,k+1)) {
7827 Real tmp = Real(0.);
7828 if (ccdom.contains(i-1,j-1,k )) {
7831 if (ccdom.contains(i-1,j,k )) {
7835 if (gid(i-1,j,k+1) < gidmax) {
7836 cols[nelems] = gid(i-1,j,k+1);
7842 if (nddom.contains(i,j,k+1) && fm2xm2y4z != Real(0.0)) {
7843 Real tmp = Real(0.);
7844 if (ccdom.contains(i-1,j-1,k )) {
7847 if (ccdom.contains(i,j-1,k )) {
7850 if (ccdom.contains(i-1,j,k )) {
7853 if (ccdom.contains(i,j,k )) {
7857 if (gid(i,j,k+1) < gidmax) {
7858 cols[nelems] = gid(i,j,k+1);
7864 if (nddom.contains(i+1,j,k+1)) {
7865 Real tmp = Real(0.);
7866 if (ccdom.contains(i ,j-1,k )) {
7869 if (ccdom.contains(i ,j,k )) {
7873 if (gid(i+1,j,k+1) < gidmax) {
7874 cols[nelems] = gid(i+1,j,k+1);
7880 if (nddom.contains(i-1,j+1,k+1)) {
7883 if (gid(i-1,j+1,k+1) < gidmax) {
7884 cols[nelems] = gid(i-1,j+1,k+1);
7890 if (nddom.contains(i,j+1,k+1)) {
7891 Real tmp = Real(0.);
7892 if (ccdom.contains(i-1,j ,k )) {
7895 if (ccdom.contains(i,j ,k )) {
7899 if (gid(i,j+1,k+1) < gidmax) {
7900 cols[nelems] = gid(i,j+1,k+1);
7906 if (nddom.contains(i+1,j+1,k+1)) {
7909 if (gid(i+1,j+1,k+1) < gidmax) {
7910 cols[nelems] = gid(i+1,j+1,k+1);
7916 mat[nelems_old] = m0;
7917 ncols[lid(i,j,k)] = nelems - nelems_old;
7922 #ifdef AMREX_USE_GPU
7924 template <
typename HypreInt,
typename AtomicInt>
7926 void mlndlap_fillijmat_sten_gpu (
const int ps,
const int i,
const int j,
const int k,
7928 Array4<AtomicInt const>
const& gid,
7929 Array4<int const>
const& lid,
7930 HypreInt* ncols, HypreInt* cols,
7932 Array4<Real const>
const& sten) noexcept
7934 if (lid(i,j,k) >= 0)
7949 if (gid(i-1,j-1,k-1) < gidmax) {
7951 cols[ps] = gid(i-1,j-1,k-1);
7952 mat[ps] = sten(i-1,j-1,k-1,
ist_ppp);
7956 if (
offset != 0) {
return; }
7960 if (gid(i,j-1,k-1) < gidmax) {
7962 cols[ps] = gid(i,j-1,k-1);
7963 mat[ps] = sten(i,j-1,k-1,
ist_0pp);
7967 if (
offset != 0) {
return; }
7971 if (gid(i+1,j-1,k-1) < gidmax) {
7973 cols[ps] = gid(i+1,j-1,k-1);
7974 mat[ps] = sten(i,j-1,k-1,
ist_ppp);
7978 if (
offset != 0) {
return; }
7982 if (gid(i-1,j,k-1) < gidmax) {
7984 cols[ps] = gid(i-1,j,k-1);
7985 mat[ps] = sten(i-1,j,k-1,
ist_p0p);
7989 if (
offset != 0) {
return; }
7993 if (gid(i,j,k-1) < gidmax) {
7995 cols[ps] = gid(i,j,k-1);
7996 mat[ps] = sten(i,j,k-1,
ist_00p);
8000 if (
offset != 0) {
return; }
8004 if (gid(i+1,j,k-1) < gidmax) {
8006 cols[ps] = gid(i+1,j,k-1);
8007 mat[ps] = sten(i,j,k-1,
ist_p0p);
8011 if (
offset != 0) {
return; }
8015 if (gid(i-1,j+1,k-1) < gidmax) {
8017 cols[ps] = gid(i-1,j+1,k-1);
8018 mat[ps] = sten(i-1,j,k-1,
ist_ppp);
8022 if (
offset != 0) {
return; }
8026 if (gid(i,j+1,k-1) < gidmax) {
8028 cols[ps] = gid(i,j+1,k-1);
8029 mat[ps] = sten(i,j,k-1,
ist_0pp);
8033 if (
offset != 0) {
return; }
8037 if (gid(i+1,j+1,k-1) < gidmax) {
8039 cols[ps] = gid(i+1,j+1,k-1);
8040 mat[ps] = sten(i,j,k-1,
ist_ppp);
8044 if (
offset != 0) {
return; }
8048 if (gid(i-1,j-1,k) < gidmax) {
8050 cols[ps] = gid(i-1,j-1,k);
8051 mat[ps] = sten(i-1,j-1,k,
ist_pp0);
8055 if (
offset != 0) {
return; }
8059 if (gid(i,j-1,k) < gidmax) {
8061 cols[ps] = gid(i,j-1,k);
8062 mat[ps] = sten(i,j-1,k,
ist_0p0);
8066 if (
offset != 0) {
return; }
8070 if (gid(i+1,j-1,k) < gidmax) {
8072 cols[ps] = gid(i+1,j-1,k);
8073 mat[ps] = sten(i,j-1,k,
ist_pp0);
8077 if (
offset != 0) {
return; }
8081 if (gid(i-1,j,k) < gidmax) {
8083 cols[ps] = gid(i-1,j,k);
8084 mat[ps] = sten(i-1,j,k,
ist_p00);
8088 if (
offset != 0) {
return; }
8092 if (gid(i+1,j,k) < gidmax) {
8094 cols[ps] = gid(i+1,j,k);
8095 mat[ps] = sten(i,j,k,
ist_p00);
8099 if (
offset != 0) {
return; }
8103 if (gid(i-1,j+1,k) < gidmax) {
8105 cols[ps] = gid(i-1,j+1,k);
8106 mat[ps] = sten(i-1,j,k,
ist_pp0);
8110 if (
offset != 0) {
return; }
8114 if (gid(i,j+1,k) < gidmax) {
8116 cols[ps] = gid(i,j+1,k);
8117 mat[ps] = sten(i,j,k,
ist_0p0);
8121 if (
offset != 0) {
return; }
8125 if (gid(i+1,j+1,k) < gidmax) {
8127 cols[ps] = gid(i+1,j+1,k);
8128 mat[ps] = sten(i,j,k,
ist_pp0);
8132 if (
offset != 0) {
return; }
8136 if (gid(i-1,j-1,k+1) < gidmax) {
8138 cols[ps] = gid(i-1,j-1,k+1);
8139 mat[ps] = sten(i-1,j-1,k,
ist_ppp);
8143 if (
offset != 0) {
return; }
8147 if (gid(i,j-1,k+1) < gidmax) {
8149 cols[ps] = gid(i,j-1,k+1);
8150 mat[ps] = sten(i,j-1,k,
ist_0pp);
8154 if (
offset != 0) {
return; }
8158 if (gid(i+1,j-1,k+1) < gidmax) {
8160 cols[ps] = gid(i+1,j-1,k+1);
8161 mat[ps] = sten(i,j-1,k,
ist_ppp);
8165 if (
offset != 0) {
return; }
8169 if (gid(i-1,j,k+1) < gidmax) {
8171 cols[ps] = gid(i-1,j,k+1);
8172 mat[ps] = sten(i-1,j,k,
ist_p0p);
8176 if (
offset != 0) {
return; }
8180 if (gid(i,j,k+1) < gidmax) {
8182 cols[ps] = gid(i,j,k+1);
8183 mat[ps] = sten(i,j,k,
ist_00p);
8187 if (
offset != 0) {
return; }
8191 if (gid(i+1,j,k+1) < gidmax) {
8193 cols[ps] = gid(i+1,j,k+1);
8194 mat[ps] = sten(i,j,k,
ist_p0p);
8198 if (
offset != 0) {
return; }
8202 if (gid(i-1,j+1,k+1) < gidmax) {
8204 cols[ps] = gid(i-1,j+1,k+1);
8205 mat[ps] = sten(i-1,j,k,
ist_ppp);
8209 if (
offset != 0) {
return; }
8213 if (gid(i,j+1,k+1) < gidmax) {
8215 cols[ps] = gid(i,j+1,k+1);
8216 mat[ps] = sten(i,j,k,
ist_0pp);
8220 if (
offset != 0) {
return; }
8224 if (gid(i+1,j+1,k+1) < gidmax) {
8226 cols[ps] = gid(i+1,j+1,k+1);
8227 mat[ps] = sten(i,j,k,
ist_ppp);
8231 if (
offset != 0) {
return; }
8235 cols[ps] = gid(i,j,k);
8236 mat[ps] = sten(i,j,k,
ist_000);
8237 ncols[lid(i,j,k)] = nelems+1;
8241 template <
typename HypreInt,
typename AtomicInt>
8243 void mlndlap_fillijmat_aa_gpu (
const int ps,
const int i,
const int j,
const int k,
8245 Box const& ndbx, Array4<AtomicInt const>
const& gid,
8246 Array4<int const>
const& lid,
8247 HypreInt* ncols, HypreInt* cols,
8249 Array4<Real const>
const& sig,
8250 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
8251 Box const& ccdom) noexcept
8253 if (lid(i,j,k) >= 0)
8255 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
8256 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
8257 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
8258 Real fxyz = facx + facy + facz;
8259 Real fmx2y2z = -facx + Real(2.0)*facy + Real(2.0)*facz;
8260 Real f2xmy2z = Real(2.0)*facx - facy + Real(2.0)*facz;
8261 Real f2x2ymz = Real(2.0)*facx + Real(2.0)*facy - facz;
8262 Real f4xm2ym2z = Real(4.0)*facx - Real(2.0)*facy - Real(2.0)*facz;
8263 Real fm2x4ym2z = -Real(2.0)*facx + Real(4.0)*facy - Real(2.0)*facz;
8264 Real fm2xm2y4z = -Real(2.0)*facx - Real(2.0)*facy + Real(4.0)*facz;
8273 if (nddom.contains(i-1,j-1,k-1)) {
8274 Real tmp = sig(i-1,j-1,k-1) * fxyz;
8276 if ( gid(i-1,j-1,k-1) < gidmax) {
8278 cols[ps] = gid(i-1,j-1,k-1);
8284 if (
offset != 0) {
return; }
8288 if (nddom.contains(i,j-1,k-1)) {
8289 Real tmp = Real(0.);
8290 if (ccdom.contains(i-1,j-1,k-1)) {
8291 tmp += sig(i-1,j-1,k-1) * fmx2y2z;
8293 if (ccdom.contains(i,j-1,k-1)) {
8294 tmp += sig(i,j-1,k-1) * fmx2y2z;
8297 if (gid(i,j-1,k-1) < gidmax) {
8299 cols[ps] = gid(i,j-1,k-1);
8305 if (
offset != 0) {
return; }
8309 if (nddom.contains(i+1,j-1,k-1)) {
8310 Real tmp = sig(i ,j-1,k-1) * fxyz;
8312 if (gid(i+1,j-1,k-1) < gidmax) {
8314 cols[ps] = gid(i+1,j-1,k-1);
8320 if (
offset != 0) {
return; }
8324 if (nddom.contains(i-1,j,k-1)) {
8325 Real tmp = Real(0.);
8326 if (ccdom.contains(i-1,j-1,k-1)) {
8327 tmp += sig(i-1,j-1,k-1) * f2xmy2z;
8329 if (ccdom.contains(i-1,j,k-1)) {
8330 tmp += sig(i-1,j,k-1) * f2xmy2z;
8333 if (gid(i-1,j,k-1) < gidmax) {
8335 cols[ps] = gid(i-1,j,k-1);
8341 if (
offset != 0) {
return; }
8345 if (nddom.contains(i,j,k-1)) {
8346 Real tmp = Real(0.);
8347 if (ccdom.contains(i-1,j-1,k-1)) {
8348 tmp += sig(i-1,j-1,k-1) * fm2xm2y4z;
8350 if (ccdom.contains(i,j-1,k-1)) {
8351 tmp += sig(i,j-1,k-1) * fm2xm2y4z;
8353 if (ccdom.contains(i-1,j,k-1)) {
8354 tmp += sig(i-1,j,k-1) * fm2xm2y4z;
8356 if (ccdom.contains(i,j,k-1)) {
8357 tmp += sig(i,j,k-1) * fm2xm2y4z;
8360 if (gid(i,j,k-1) < gidmax) {
8362 cols[ps] = gid(i,j,k-1);
8368 if (
offset != 0) {
return; }
8372 if (nddom.contains(i+1,j,k-1)) {
8373 Real tmp = Real(0.);
8374 if (ccdom.contains(i ,j-1,k-1)) {
8375 tmp += sig(i ,j-1,k-1) * f2xmy2z;
8377 if (ccdom.contains(i ,j,k-1)) {
8378 tmp += sig(i ,j,k-1) * f2xmy2z;
8381 if (gid(i+1,j,k-1) < gidmax) {
8383 cols[ps] = gid(i+1,j,k-1);
8389 if (
offset != 0) {
return; }
8393 if (nddom.contains(i-1,j+1,k-1)) {
8394 Real tmp = sig(i-1,j ,k-1) * fxyz;
8396 if (gid(i-1,j+1,k-1) < gidmax) {
8398 cols[ps] = gid(i-1,j+1,k-1);
8404 if (
offset != 0) {
return; }
8408 if (nddom.contains(i,j+1,k-1)) {
8409 Real tmp = Real(0.);
8410 if (ccdom.contains(i-1,j ,k-1)) {
8411 tmp += sig(i-1,j ,k-1) * fmx2y2z;
8413 if (ccdom.contains(i,j ,k-1)) {
8414 tmp += sig(i,j ,k-1) * fmx2y2z;
8417 if (gid(i,j+1,k-1) < gidmax) {
8419 cols[ps] = gid(i,j+1,k-1);
8425 if (
offset != 0) {
return; }
8429 if (nddom.contains(i+1,j+1,k-1)) {
8430 Real tmp = sig(i ,j ,k-1) * fxyz;
8432 if (gid(i+1,j+1,k-1) < gidmax) {
8434 cols[ps] = gid(i+1,j+1,k-1);
8440 if (
offset != 0) {
return; }
8444 if (nddom.contains(i-1,j-1,k)) {
8445 Real tmp = Real(0.);
8446 if (ccdom.contains(i-1,j-1,k-1)) {
8447 tmp += sig(i-1,j-1,k-1) * f2x2ymz;
8449 if (ccdom.contains(i-1,j-1,k)) {
8450 tmp += sig(i-1,j-1,k) * f2x2ymz;
8453 if (gid(i-1,j-1,k) < gidmax) {
8455 cols[ps] = gid(i-1,j-1,k);
8461 if (
offset != 0) {
return; }
8465 if (nddom.contains(i,j-1,k)) {
8466 Real tmp = Real(0.);
8467 if (ccdom.contains(i-1,j-1,k-1)) {
8468 tmp += sig(i-1,j-1,k-1) * fm2x4ym2z;
8470 if (ccdom.contains(i,j-1,k-1)) {
8471 tmp += sig(i,j-1,k-1) * fm2x4ym2z;
8473 if (ccdom.contains(i-1,j-1,k)) {
8474 tmp += sig(i-1,j-1,k) * fm2x4ym2z;
8476 if (ccdom.contains(i,j-1,k)) {
8477 tmp += sig(i,j-1,k) * fm2x4ym2z;
8480 if (gid(i,j-1,k) < gidmax) {
8482 cols[ps] = gid(i,j-1,k);
8488 if (
offset != 0) {
return; }
8492 if (nddom.contains(i+1,j-1,k)) {
8493 Real tmp = Real(0.);
8494 if (ccdom.contains(i ,j-1,k-1)) {
8495 tmp += sig(i ,j-1,k-1) * f2x2ymz;
8497 if (ccdom.contains(i ,j-1,k)) {
8498 tmp += sig(i ,j-1,k) * f2x2ymz;
8501 if (gid(i+1,j-1,k) < gidmax) {
8503 cols[ps] = gid(i+1,j-1,k);
8509 if (
offset != 0) {
return; }
8513 if (nddom.contains(i-1,j,k)) {
8514 Real tmp = Real(0.);
8515 if (ccdom.contains(i-1,j-1,k-1)) {
8516 tmp += sig(i-1,j-1,k-1) * f4xm2ym2z;
8518 if (ccdom.contains(i-1,j,k-1)) {
8519 tmp += sig(i-1,j,k-1) * f4xm2ym2z;
8521 if (ccdom.contains(i-1,j-1,k)) {
8522 tmp += sig(i-1,j-1,k) * f4xm2ym2z;
8524 if (ccdom.contains(i-1,j,k)) {
8525 tmp += sig(i-1,j,k) * f4xm2ym2z;
8528 if (gid(i-1,j,k) < gidmax) {
8530 cols[ps] = gid(i-1,j,k);
8536 if (
offset != 0) {
return; }
8540 if (nddom.contains(i+1,j,k)) {
8541 Real tmp = Real(0.);
8542 if (ccdom.contains(i ,j-1,k-1)) {
8543 tmp += sig(i ,j-1,k-1) * f4xm2ym2z;
8545 if (ccdom.contains(i ,j,k-1)) {
8546 tmp += sig(i ,j,k-1) * f4xm2ym2z;
8548 if (ccdom.contains(i ,j-1,k)) {
8549 tmp += sig(i ,j-1,k) * f4xm2ym2z;
8551 if (ccdom.contains(i ,j,k)) {
8552 tmp += sig(i ,j,k) * f4xm2ym2z;
8555 if (gid(i+1,j,k) < gidmax) {
8557 cols[ps] = gid(i+1,j,k);
8563 if (
offset != 0) {
return; }
8567 if (nddom.contains(i-1,j+1,k)) {
8568 Real tmp = Real(0.);
8569 if (ccdom.contains(i-1,j ,k-1)) {
8570 tmp += sig(i-1,j ,k-1) * f2x2ymz;
8572 if (ccdom.contains(i-1,j ,k)) {
8573 tmp += sig(i-1,j ,k) * f2x2ymz;
8576 if (gid(i-1,j+1,k) < gidmax) {
8578 cols[ps] = gid(i-1,j+1,k);
8584 if (
offset != 0) {
return; }
8588 if (nddom.contains(i,j+1,k)) {
8589 Real tmp = Real(0.);
8590 if (ccdom.contains(i-1,j ,k-1)) {
8591 tmp += sig(i-1,j ,k-1) * fm2x4ym2z;
8593 if (ccdom.contains(i,j ,k-1)) {
8594 tmp += sig(i,j ,k-1) * fm2x4ym2z;
8596 if (ccdom.contains(i-1,j ,k)) {
8597 tmp += sig(i-1,j ,k) * fm2x4ym2z;
8599 if (ccdom.contains(i,j ,k)) {
8600 tmp += sig(i,j ,k) * fm2x4ym2z;
8603 if (gid(i,j+1,k) < gidmax) {
8605 cols[ps] = gid(i,j+1,k);
8611 if (
offset != 0) {
return; }
8615 if (nddom.contains(i+1,j+1,k)) {
8616 Real tmp = Real(0.);
8617 if (ccdom.contains(i ,j ,k-1)) {
8618 tmp += sig(i ,j ,k-1) * f2x2ymz;
8620 if (ccdom.contains(i ,j ,k)) {
8621 tmp += sig(i ,j ,k) * f2x2ymz;
8624 if (gid(i+1,j+1,k) < gidmax) {
8626 cols[ps] = gid(i+1,j+1,k);
8632 if (
offset != 0) {
return; }
8636 if (nddom.contains(i-1,j-1,k+1)) {
8637 Real tmp = sig(i-1,j-1,k ) * fxyz;
8639 if (gid(i-1,j-1,k+1) < gidmax) {
8641 cols[ps] = gid(i-1,j-1,k+1);
8647 if (
offset != 0) {
return; }
8651 if (nddom.contains(i,j-1,k+1)) {
8652 Real tmp = Real(0.);
8653 if (ccdom.contains(i-1,j-1,k )) {
8654 tmp += sig(i-1,j-1,k ) * fmx2y2z;
8656 if (ccdom.contains(i,j-1,k )) {
8657 tmp += sig(i,j-1,k ) * fmx2y2z;
8660 if (gid(i,j-1,k+1) < gidmax) {
8662 cols[ps] = gid(i,j-1,k+1);
8668 if (
offset != 0) {
return; }
8672 if (nddom.contains(i+1,j-1,k+1)) {
8673 Real tmp = sig(i ,j-1,k ) * fxyz;
8675 if (gid(i+1,j-1,k+1) < gidmax) {
8677 cols[ps] = gid(i+1,j-1,k+1);
8683 if (
offset != 0) {
return; }
8687 if (nddom.contains(i-1,j,k+1)) {
8688 Real tmp = Real(0.);
8689 if (ccdom.contains(i-1,j-1,k )) {
8690 tmp += sig(i-1,j-1,k ) * f2xmy2z;
8692 if (ccdom.contains(i-1,j,k )) {
8693 tmp += sig(i-1,j,k ) * f2xmy2z;
8696 if (gid(i-1,j,k+1) < gidmax) {
8698 cols[ps] = gid(i-1,j,k+1);
8704 if (
offset != 0) {
return; }
8708 if (nddom.contains(i,j,k+1)) {
8709 Real tmp = Real(0.);
8710 if (ccdom.contains(i-1,j-1,k )) {
8711 tmp += sig(i-1,j-1,k ) * fm2xm2y4z;
8713 if (ccdom.contains(i,j-1,k )) {
8714 tmp += sig(i,j-1,k ) * fm2xm2y4z;
8716 if (ccdom.contains(i-1,j,k )) {
8717 tmp += sig(i-1,j,k ) * fm2xm2y4z;
8719 if (ccdom.contains(i,j,k )) {
8720 tmp += sig(i,j,k ) * fm2xm2y4z;
8723 if (gid(i,j,k+1) < gidmax) {
8725 cols[ps] = gid(i,j,k+1);
8731 if (
offset != 0) {
return; }
8735 if (nddom.contains(i+1,j,k+1)) {
8736 Real tmp = Real(0.);
8737 if (ccdom.contains(i ,j-1,k )) {
8738 tmp += sig(i ,j-1,k ) * f2xmy2z;
8740 if (ccdom.contains(i ,j,k )) {
8741 tmp += sig(i ,j,k ) * f2xmy2z;
8744 if (gid(i+1,j,k+1) < gidmax) {
8746 cols[ps] = gid(i+1,j,k+1);
8752 if (
offset != 0) {
return; }
8756 if (nddom.contains(i-1,j+1,k+1)) {
8757 Real tmp = sig(i-1,j ,k ) * fxyz;
8759 if (gid(i-1,j+1,k+1) < gidmax) {
8761 cols[ps] = gid(i-1,j+1,k+1);
8767 if (
offset != 0) {
return; }
8771 if (nddom.contains(i,j+1,k+1)) {
8772 Real tmp = Real(0.);
8773 if (ccdom.contains(i-1,j ,k )) {
8774 tmp += sig(i-1,j ,k ) * fmx2y2z;
8776 if (ccdom.contains(i,j ,k )) {
8777 tmp += sig(i,j ,k ) * fmx2y2z;
8780 if (gid(i,j+1,k+1) < gidmax) {
8782 cols[ps] = gid(i,j+1,k+1);
8788 if (
offset != 0) {
return; }
8792 if (nddom.contains(i+1,j+1,k+1)) {
8793 Real tmp = sig(i ,j ,k ) * fxyz;
8795 if (gid(i+1,j+1,k+1) < gidmax) {
8797 cols[ps] = gid(i+1,j+1,k+1);
8803 if (
offset != 0) {
return; }
8807 cols[ps] = gid(i,j,k);
8809 ncols[lid(i,j,k)] = nelems+1;
8813 template <
typename HypreInt,
typename AtomicInt>
8815 void mlndlap_fillijmat_ha_gpu (
const int ps,
const int i,
const int j,
const int k,
8817 Box const& ndbx, Array4<AtomicInt const>
const& gid,
8818 Array4<int const>
const& lid,
8819 HypreInt* ncols, HypreInt* cols,
8821 Array4<Real const>
const& sx,
8822 Array4<Real const>
const& sy,
8823 Array4<Real const>
const& sz,
8824 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
8825 Box const& ccdom) noexcept
8827 if (lid(i,j,k) >= 0)
8829 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
8830 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
8831 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
8840 if (nddom.contains(i-1,j-1,k-1)) {
8841 Real tmp = sx(i-1,j-1,k-1) * facx
8842 + sy(i-1,j-1,k-1) * facy
8843 + sz(i-1,j-1,k-1) * facz;
8845 if ( gid(i-1,j-1,k-1) < gidmax) {
8847 cols[ps] = gid(i-1,j-1,k-1);
8853 if (
offset != 0) {
return; }
8857 if (nddom.contains(i,j-1,k-1)) {
8858 Real tmp = Real(0.);
8859 if (ccdom.contains(i-1,j-1,k-1)) {
8860 tmp += - sx(i-1,j-1,k-1) * facx
8861 + sy(i-1,j-1,k-1) * facy * Real(2.0)
8862 + sz(i-1,j-1,k-1) * facz * Real(2.0);
8864 if (ccdom.contains(i,j-1,k-1)) {
8865 tmp += - sx(i,j-1,k-1) * facx
8866 + sy(i,j-1,k-1) * facy * Real(2.0)
8867 + sz(i,j-1,k-1) * facz * Real(2.0);
8870 if (gid(i,j-1,k-1) < gidmax) {
8872 cols[ps] = gid(i,j-1,k-1);
8878 if (
offset != 0) {
return; }
8882 if (nddom.contains(i+1,j-1,k-1)) {
8883 Real tmp = sx(i ,j-1,k-1) * facx
8884 + sy(i ,j-1,k-1) * facy
8885 + sz(i ,j-1,k-1) * facz;
8887 if (gid(i+1,j-1,k-1) < gidmax) {
8889 cols[ps] = gid(i+1,j-1,k-1);
8895 if (
offset != 0) {
return; }
8899 if (nddom.contains(i-1,j,k-1)) {
8900 Real tmp = Real(0.);
8901 if (ccdom.contains(i-1,j-1,k-1)) {
8902 tmp += sx(i-1,j-1,k-1) * facx * Real(2.0)
8903 - sy(i-1,j-1,k-1) * facy
8904 + sz(i-1,j-1,k-1) * facz * Real(2.0);
8906 if (ccdom.contains(i-1,j,k-1)) {
8907 tmp += sx(i-1,j,k-1) * facx * Real(2.0)
8908 - sy(i-1,j,k-1) * facy
8909 + sz(i-1,j,k-1) * facz * Real(2.0);
8912 if (gid(i-1,j,k-1) < gidmax) {
8914 cols[ps] = gid(i-1,j,k-1);
8920 if (
offset != 0) {
return; }
8924 if (nddom.contains(i,j,k-1)) {
8925 Real tmp = Real(0.);
8926 if (ccdom.contains(i-1,j-1,k-1)) {
8927 tmp += - sx(i-1,j-1,k-1) * facx * Real(2.0)
8928 - sy(i-1,j-1,k-1) * facy * Real(2.0)
8929 + sz(i-1,j-1,k-1) * facz * Real(4.0);
8931 if (ccdom.contains(i,j-1,k-1)) {
8932 tmp += - sx(i,j-1,k-1) * facx * Real(2.0)
8933 - sy(i,j-1,k-1) * facy * Real(2.0)
8934 + sz(i,j-1,k-1) * facz * Real(4.0);
8937 if (ccdom.contains(i-1,j,k-1)) {
8938 tmp += - sx(i-1,j,k-1) * facx * Real(2.0)
8939 - sy(i-1,j,k-1) * facy * Real(2.0)
8940 + sz(i-1,j,k-1) * facz * Real(4.0);
8942 if (ccdom.contains(i,j,k-1)) {
8943 tmp += - sx(i,j,k-1) * facx * Real(2.0)
8944 - sy(i,j,k-1) * facy * Real(2.0)
8945 + sz(i,j,k-1) * facz * Real(4.0);
8948 if (gid(i,j,k-1) < gidmax) {
8950 cols[ps] = gid(i,j,k-1);
8956 if (
offset != 0) {
return; }
8960 if (nddom.contains(i+1,j,k-1)) {
8961 Real tmp = Real(0.);
8962 if (ccdom.contains(i ,j-1,k-1)) {
8963 tmp += sx(i ,j-1,k-1) * facx * Real(2.0)
8964 - sy(i ,j-1,k-1) * facy
8965 + sz(i ,j-1,k-1) * facz * Real(2.0);
8967 if (ccdom.contains(i ,j,k-1)) {
8968 tmp += sx(i ,j,k-1) * facx * Real(2.0)
8969 - sy(i ,j,k-1) * facy
8970 + sz(i ,j,k-1) * facz * Real(2.0);
8973 if (gid(i+1,j,k-1) < gidmax) {
8975 cols[ps] = gid(i+1,j,k-1);
8981 if (
offset != 0) {
return; }
8985 if (nddom.contains(i-1,j+1,k-1)) {
8986 Real tmp = sx(i-1,j ,k-1) * facx
8987 + sy(i-1,j ,k-1) * facy
8988 + sz(i-1,j ,k-1) * facz;
8990 if (gid(i-1,j+1,k-1) < gidmax) {
8992 cols[ps] = gid(i-1,j+1,k-1);
8998 if (
offset != 0) {
return; }
9002 if (nddom.contains(i,j+1,k-1)) {
9003 Real tmp = Real(0.);
9004 if (ccdom.contains(i-1,j ,k-1)) {
9005 tmp += - sx(i-1,j ,k-1) * facx
9006 + sy(i-1,j ,k-1) * facy * Real(2.0)
9007 + sz(i-1,j ,k-1) * facz * Real(2.0);
9009 if (ccdom.contains(i,j ,k-1)) {
9010 tmp += - sx(i,j ,k-1) * facx
9011 + sy(i,j ,k-1) * facy * Real(2.0)
9012 + sz(i,j ,k-1) * facz * Real(2.0);
9015 if (gid(i,j+1,k-1) < gidmax) {
9017 cols[ps] = gid(i,j+1,k-1);
9023 if (
offset != 0) {
return; }
9027 if (nddom.contains(i+1,j+1,k-1)) {
9028 Real tmp = sx(i ,j ,k-1) * facx
9029 + sy(i ,j ,k-1) * facy
9030 + sz(i ,j ,k-1) * facz;
9032 if (gid(i+1,j+1,k-1) < gidmax) {
9034 cols[ps] = gid(i+1,j+1,k-1);
9040 if (
offset != 0) {
return; }
9044 if (nddom.contains(i-1,j-1,k)) {
9045 Real tmp = Real(0.);
9046 if (ccdom.contains(i-1,j-1,k-1)) {
9047 tmp += sx(i-1,j-1,k-1) * facx * Real(2.0)
9048 + sy(i-1,j-1,k-1) * facy * Real(2.0)
9049 - sz(i-1,j-1,k-1) * facz;
9051 if (ccdom.contains(i-1,j-1,k)) {
9052 tmp += sx(i-1,j-1,k) * facx * Real(2.0)
9053 + sy(i-1,j-1,k) * facy * Real(2.0)
9054 - sz(i-1,j-1,k) * facz;
9057 if (gid(i-1,j-1,k) < gidmax) {
9059 cols[ps] = gid(i-1,j-1,k);
9065 if (
offset != 0) {
return; }
9069 if (nddom.contains(i,j-1,k)) {
9070 Real tmp = Real(0.);
9071 if (ccdom.contains(i-1,j-1,k-1)) {
9072 tmp += - sx(i-1,j-1,k-1) * facx * Real(2.0)
9073 + sy(i-1,j-1,k-1) * facy * Real(4.0)
9074 - sz(i-1,j-1,k-1) * facz * Real(2.0);
9076 if (ccdom.contains(i,j-1,k-1)) {
9077 tmp += - sx(i,j-1,k-1) * facx * Real(2.0)
9078 + sy(i,j-1,k-1) * facy * Real(4.0)
9079 - sz(i,j-1,k-1) * facz * Real(2.0);
9081 if (ccdom.contains(i-1,j-1,k)) {
9082 tmp += - sx(i-1,j-1,k) * facx * Real(2.0)
9083 + sy(i-1,j-1,k) * facy * Real(4.0)
9084 - sz(i-1,j-1,k) * facz * Real(2.0);
9086 if (ccdom.contains(i,j-1,k)) {
9087 tmp += - sx(i,j-1,k) * facx * Real(2.0)
9088 + sy(i,j-1,k) * facy * Real(4.0)
9089 - sz(i,j-1,k) * facz * Real(2.0);
9092 if (gid(i,j-1,k) < gidmax) {
9094 cols[ps] = gid(i,j-1,k);
9100 if (
offset != 0) {
return; }
9104 if (nddom.contains(i+1,j-1,k)) {
9105 Real tmp = Real(0.);
9106 if (ccdom.contains(i ,j-1,k-1)) {
9107 tmp += sx(i ,j-1,k-1) * facx * Real(2.0)
9108 + sy(i ,j-1,k-1) * facy * Real(2.0)
9109 - sz(i ,j-1,k-1) * facz;
9111 if (ccdom.contains(i ,j-1,k)) {
9112 tmp += sx(i ,j-1,k) * facx * Real(2.0)
9113 + sy(i ,j-1,k) * facy * Real(2.0)
9114 - sz(i ,j-1,k) * facz;
9117 if (gid(i+1,j-1,k) < gidmax) {
9119 cols[ps] = gid(i+1,j-1,k);
9125 if (
offset != 0) {
return; }
9129 if (nddom.contains(i-1,j,k)) {
9130 Real tmp = Real(0.);
9131 if (ccdom.contains(i-1,j-1,k-1)) {
9132 tmp += sx(i-1,j-1,k-1) * facx * Real(4.0)
9133 - sy(i-1,j-1,k-1) * facy * Real(2.0)
9134 - sz(i-1,j-1,k-1) * facz * Real(2.0);
9136 if (ccdom.contains(i-1,j,k-1)) {
9137 tmp += sx(i-1,j,k-1) * facx * Real(4.0)
9138 - sy(i-1,j,k-1) * facy * Real(2.0)
9139 - sz(i-1,j,k-1) * facz * Real(2.0);
9141 if (ccdom.contains(i-1,j-1,k)) {
9142 tmp += sx(i-1,j-1,k) * facx * Real(4.0)
9143 - sy(i-1,j-1,k) * facy * Real(2.0)
9144 - sz(i-1,j-1,k) * facz * Real(2.0);
9146 if (ccdom.contains(i-1,j,k)) {
9147 tmp += sx(i-1,j,k) * facx * Real(4.0)
9148 - sy(i-1,j,k) * facy * Real(2.0)
9149 - sz(i-1,j,k) * facz * Real(2.0);
9152 if (gid(i-1,j,k) < gidmax) {
9154 cols[ps] = gid(i-1,j,k);
9160 if (
offset != 0) {
return; }
9164 if (nddom.contains(i+1,j,k)) {
9165 Real tmp = Real(0.);
9166 if (ccdom.contains(i ,j-1,k-1)) {
9167 tmp += sx(i ,j-1,k-1) * facx * Real(4.0)
9168 - sy(i ,j-1,k-1) * facy * Real(2.0)
9169 - sz(i ,j-1,k-1) * facz * Real(2.0);
9171 if (ccdom.contains(i ,j,k-1)) {
9172 tmp += sx(i ,j,k-1) * facx * Real(4.0)
9173 - sy(i ,j,k-1) * facy * Real(2.0)
9174 - sz(i ,j,k-1) * facz * Real(2.0);
9176 if (ccdom.contains(i ,j-1,k)) {
9177 tmp += sx(i ,j-1,k) * facx * Real(4.0)
9178 - sy(i ,j-1,k) * facy * Real(2.0)
9179 - sz(i ,j-1,k) * facz * Real(2.0);
9181 if (ccdom.contains(i ,j,k)) {
9182 tmp += sx(i ,j,k) * facx * Real(4.0)
9183 - sy(i ,j,k) * facy * Real(2.0)
9184 - sz(i ,j,k) * facz * Real(2.0);
9187 if (gid(i+1,j,k) < gidmax) {
9189 cols[ps] = gid(i+1,j,k);
9195 if (
offset != 0) {
return; }
9199 if (nddom.contains(i-1,j+1,k)) {
9200 Real tmp = Real(0.);
9201 if (ccdom.contains(i-1,j ,k-1)) {
9202 tmp += sx(i-1,j ,k-1) * facx * Real(2.0)
9203 + sy(i-1,j ,k-1) * facy * Real(2.0)
9204 - sz(i-1,j ,k-1) * facz;
9206 if (ccdom.contains(i-1,j ,k)) {
9207 tmp += sx(i-1,j ,k) * facx * Real(2.0)
9208 + sy(i-1,j ,k) * facy * Real(2.0)
9209 - sz(i-1,j ,k) * facz;
9212 if (gid(i-1,j+1,k) < gidmax) {
9214 cols[ps] = gid(i-1,j+1,k);
9220 if (
offset != 0) {
return; }
9224 if (nddom.contains(i,j+1,k)) {
9225 Real tmp = Real(0.);
9226 if (ccdom.contains(i-1,j ,k-1)) {
9227 tmp += - sx(i-1,j ,k-1) * facx * Real(2.0)
9228 + sy(i-1,j ,k-1) * facy * Real(4.0)
9229 - sz(i-1,j ,k-1) * facz * Real(2.0);
9231 if (ccdom.contains(i,j ,k-1)) {
9232 tmp += - sx(i,j ,k-1) * facx * Real(2.0)
9233 + sy(i,j ,k-1) * facy * Real(4.0)
9234 - sz(i,j ,k-1) * facz * Real(2.0);
9236 if (ccdom.contains(i-1,j ,k)) {
9237 tmp += - sx(i-1,j ,k) * facx * Real(2.0)
9238 + sy(i-1,j ,k) * facy * Real(4.0)
9239 - sz(i-1,j ,k) * facz * Real(2.0);
9241 if (ccdom.contains(i,j ,k)) {
9242 tmp += - sx(i,j ,k) * facx * Real(2.0)
9243 + sy(i,j ,k) * facy * Real(4.0)
9244 - sz(i,j ,k) * facz * Real(2.0);
9247 if (gid(i,j+1,k) < gidmax) {
9249 cols[ps] = gid(i,j+1,k);
9255 if (
offset != 0) {
return; }
9259 if (nddom.contains(i+1,j+1,k)) {
9260 Real tmp = Real(0.);
9261 if (ccdom.contains(i ,j ,k-1)) {
9262 tmp += sx(i ,j ,k-1) * facx * Real(2.0)
9263 + sy(i ,j ,k-1) * facy * Real(2.0)
9264 - sz(i ,j ,k-1) * facz;
9266 if (ccdom.contains(i ,j ,k)) {
9267 tmp += sx(i ,j ,k) * facx * Real(2.0)
9268 + sy(i ,j ,k) * facy * Real(2.0)
9269 - sz(i ,j ,k) * facz;
9272 if (gid(i+1,j+1,k) < gidmax) {
9274 cols[ps] = gid(i+1,j+1,k);
9280 if (
offset != 0) {
return; }
9284 if (nddom.contains(i-1,j-1,k+1)) {
9285 Real tmp = sx(i-1,j-1,k ) * facx
9286 + sy(i-1,j-1,k ) * facy
9287 + sz(i-1,j-1,k ) * facz;
9289 if (gid(i-1,j-1,k+1) < gidmax) {
9291 cols[ps] = gid(i-1,j-1,k+1);
9297 if (
offset != 0) {
return; }
9301 if (nddom.contains(i,j-1,k+1)) {
9302 Real tmp = Real(0.);
9303 if (ccdom.contains(i-1,j-1,k )) {
9304 tmp += - sx(i-1,j-1,k ) * facx
9305 + sy(i-1,j-1,k ) * facy * Real(2.0)
9306 + sz(i-1,j-1,k ) * facz * Real(2.0);
9308 if (ccdom.contains(i,j-1,k )) {
9309 tmp += - sx(i,j-1,k ) * facx
9310 + sy(i,j-1,k ) * facy * Real(2.0)
9311 + sz(i,j-1,k ) * facz * Real(2.0);
9314 if (gid(i,j-1,k+1) < gidmax) {
9316 cols[ps] = gid(i,j-1,k+1);
9322 if (
offset != 0) {
return; }
9326 if (nddom.contains(i+1,j-1,k+1)) {
9327 Real tmp = sx(i ,j-1,k ) * facx
9328 + sy(i ,j-1,k ) * facy
9329 + sz(i ,j-1,k ) * facz;
9331 if (gid(i+1,j-1,k+1) < gidmax) {
9333 cols[ps] = gid(i+1,j-1,k+1);
9339 if (
offset != 0) {
return; }
9343 if (nddom.contains(i-1,j,k+1)) {
9344 Real tmp = Real(0.);
9345 if (ccdom.contains(i-1,j-1,k )) {
9346 tmp += sx(i-1,j-1,k ) * facx * Real(2.0)
9347 - sy(i-1,j-1,k ) * facy
9348 + sz(i-1,j-1,k ) * facz * Real(2.0);
9350 if (ccdom.contains(i-1,j,k )) {
9351 tmp += sx(i-1,j,k ) * facx * Real(2.0)
9352 - sy(i-1,j,k ) * facy
9353 + sz(i-1,j,k ) * facz * Real(2.0);
9356 if (gid(i-1,j,k+1) < gidmax) {
9358 cols[ps] = gid(i-1,j,k+1);
9364 if (
offset != 0) {
return; }
9368 if (nddom.contains(i,j,k+1)) {
9369 Real tmp = Real(0.);
9370 if (ccdom.contains(i-1,j-1,k )) {
9371 tmp += - sx(i-1,j-1,k ) * facx * Real(2.0)
9372 - sy(i-1,j-1,k ) * facy * Real(2.0)
9373 + sz(i-1,j-1,k ) * facz * Real(4.0);
9375 if (ccdom.contains(i,j-1,k )) {
9376 tmp += - sx(i,j-1,k ) * facx * Real(2.0)
9377 - sy(i,j-1,k ) * facy * Real(2.0)
9378 + sz(i,j-1,k ) * facz * Real(4.0);
9380 if (ccdom.contains(i-1,j,k )) {
9381 tmp += - sx(i-1,j,k ) * facx * Real(2.0)
9382 - sy(i-1,j,k ) * facy * Real(2.0)
9383 + sz(i-1,j,k ) * facz * Real(4.0);
9385 if (ccdom.contains(i,j,k )) {
9386 tmp += - sx(i,j,k ) * facx * Real(2.0)
9387 - sy(i,j,k ) * facy * Real(2.0)
9388 + sz(i,j,k ) * facz * Real(4.0);
9391 if (gid(i,j,k+1) < gidmax) {
9393 cols[ps] = gid(i,j,k+1);
9399 if (
offset != 0) {
return; }
9403 if (nddom.contains(i+1,j,k+1)) {
9404 Real tmp = Real(0.);
9405 if (ccdom.contains(i ,j-1,k )) {
9406 tmp += sx(i ,j-1,k ) * facx * Real(2.0)
9407 - sy(i ,j-1,k ) * facy
9408 + sz(i ,j-1,k ) * facz * Real(2.0);
9410 if (ccdom.contains(i ,j,k )) {
9411 tmp += sx(i ,j,k ) * facx * Real(2.0)
9412 - sy(i ,j,k ) * facy
9413 + sz(i ,j,k ) * facz * Real(2.0);
9416 if (gid(i+1,j,k+1) < gidmax) {
9418 cols[ps] = gid(i+1,j,k+1);
9424 if (
offset != 0) {
return; }
9428 if (nddom.contains(i-1,j+1,k+1)) {
9429 Real tmp = sx(i-1,j ,k ) * facx
9430 + sy(i-1,j ,k ) * facy
9431 + sz(i-1,j ,k ) * facz;
9433 if (gid(i-1,j+1,k+1) < gidmax) {
9435 cols[ps] = gid(i-1,j+1,k+1);
9441 if (
offset != 0) {
return; }
9445 if (nddom.contains(i,j+1,k+1)) {
9446 Real tmp = Real(0.);
9447 if (ccdom.contains(i-1,j ,k )) {
9448 tmp += - sx(i-1,j ,k ) * facx
9449 + sy(i-1,j ,k ) * facy * Real(2.0)
9450 + sz(i-1,j ,k ) * facz * Real(2.0);
9452 if (ccdom.contains(i,j ,k )) {
9453 tmp += - sx(i,j ,k ) * facx
9454 + sy(i,j ,k ) * facy * Real(2.0)
9455 + sz(i,j ,k ) * facz * Real(2.0);
9458 if (gid(i,j+1,k+1) < gidmax) {
9460 cols[ps] = gid(i,j+1,k+1);
9466 if (
offset != 0) {
return; }
9470 if (nddom.contains(i+1,j+1,k+1)) {
9471 Real tmp = sx(i ,j ,k ) * facx
9472 + sy(i ,j ,k ) * facy
9473 + sz(i ,j ,k ) * facz;
9475 if (gid(i+1,j+1,k+1) < gidmax) {
9477 cols[ps] = gid(i+1,j+1,k+1);
9483 if (
offset != 0) {
return; }
9487 cols[ps] = gid(i,j,k);
9489 ncols[lid(i,j,k)] = nelems+1;
9493 template <
typename HypreInt,
typename AtomicInt>
9495 void mlndlap_fillijmat_cs_gpu (
const int ps,
const int i,
const int j,
const int k,
9497 Box const& ndbx, Array4<AtomicInt const>
const& gid,
9498 Array4<int const>
const& lid,
9499 HypreInt* ncols, HypreInt* cols,
9501 Real sigma, GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
9502 Box const& ccdom) noexcept
9504 if (lid(i,j,k) >= 0)
9506 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0] * sigma;
9507 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1] * sigma;
9508 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2] * sigma;
9509 Real fxyz = facx + facy + facz;
9510 Real fmx2y2z = -facx + Real(2.0)*facy + Real(2.0)*facz;
9511 Real f2xmy2z = Real(2.0)*facx - facy + Real(2.0)*facz;
9512 Real f2x2ymz = Real(2.0)*facx + Real(2.0)*facy - facz;
9513 Real f4xm2ym2z = Real(4.0)*facx - Real(2.0)*facy - Real(2.0)*facz;
9514 Real fm2x4ym2z = -Real(2.0)*facx + Real(4.0)*facy - Real(2.0)*facz;
9515 Real fm2xm2y4z = -Real(2.0)*facx - Real(2.0)*facy + Real(4.0)*facz;
9524 if (nddom.contains(i-1,j-1,k-1)) {
9527 if ( gid(i-1,j-1,k-1) < gidmax) {
9529 cols[ps] = gid(i-1,j-1,k-1);
9535 if (
offset != 0) {
return; }
9539 if (nddom.contains(i,j-1,k-1)) {
9540 Real tmp = Real(0.);
9541 if (ccdom.contains(i-1,j-1,k-1)) {
9544 if (ccdom.contains(i,j-1,k-1)) {
9548 if (gid(i,j-1,k-1) < gidmax) {
9550 cols[ps] = gid(i,j-1,k-1);
9556 if (
offset != 0) {
return; }
9560 if (nddom.contains(i+1,j-1,k-1)) {
9563 if (gid(i+1,j-1,k-1) < gidmax) {
9565 cols[ps] = gid(i+1,j-1,k-1);
9571 if (
offset != 0) {
return; }
9575 if (nddom.contains(i-1,j,k-1)) {
9576 Real tmp = Real(0.);
9577 if (ccdom.contains(i-1,j-1,k-1)) {
9580 if (ccdom.contains(i-1,j,k-1)) {
9584 if (gid(i-1,j,k-1) < gidmax) {
9586 cols[ps] = gid(i-1,j,k-1);
9592 if (
offset != 0) {
return; }
9596 if (nddom.contains(i,j,k-1)) {
9597 Real tmp = Real(0.);
9598 if (ccdom.contains(i-1,j-1,k-1)) {
9601 if (ccdom.contains(i,j-1,k-1)) {
9604 if (ccdom.contains(i-1,j,k-1)) {
9607 if (ccdom.contains(i,j,k-1)) {
9611 if (gid(i,j,k-1) < gidmax) {
9613 cols[ps] = gid(i,j,k-1);
9619 if (
offset != 0) {
return; }
9623 if (nddom.contains(i+1,j,k-1)) {
9624 Real tmp = Real(0.);
9625 if (ccdom.contains(i ,j-1,k-1)) {
9628 if (ccdom.contains(i ,j,k-1)) {
9632 if (gid(i+1,j,k-1) < gidmax) {
9634 cols[ps] = gid(i+1,j,k-1);
9640 if (
offset != 0) {
return; }
9644 if (nddom.contains(i-1,j+1,k-1)) {
9647 if (gid(i-1,j+1,k-1) < gidmax) {
9649 cols[ps] = gid(i-1,j+1,k-1);
9655 if (
offset != 0) {
return; }
9659 if (nddom.contains(i,j+1,k-1)) {
9660 Real tmp = Real(0.);
9661 if (ccdom.contains(i-1,j ,k-1)) {
9664 if (ccdom.contains(i,j ,k-1)) {
9668 if (gid(i,j+1,k-1) < gidmax) {
9670 cols[ps] = gid(i,j+1,k-1);
9676 if (
offset != 0) {
return; }
9680 if (nddom.contains(i+1,j+1,k-1)) {
9683 if (gid(i+1,j+1,k-1) < gidmax) {
9685 cols[ps] = gid(i+1,j+1,k-1);
9691 if (
offset != 0) {
return; }
9695 if (nddom.contains(i-1,j-1,k)) {
9696 Real tmp = Real(0.);
9697 if (ccdom.contains(i-1,j-1,k-1)) {
9700 if (ccdom.contains(i-1,j-1,k)) {
9704 if (gid(i-1,j-1,k) < gidmax) {
9706 cols[ps] = gid(i-1,j-1,k);
9712 if (
offset != 0) {
return; }
9716 if (nddom.contains(i,j-1,k)) {
9717 Real tmp = Real(0.);
9718 if (ccdom.contains(i-1,j-1,k-1)) {
9721 if (ccdom.contains(i,j-1,k-1)) {
9724 if (ccdom.contains(i-1,j-1,k)) {
9727 if (ccdom.contains(i,j-1,k)) {
9731 if (gid(i,j-1,k) < gidmax) {
9733 cols[ps] = gid(i,j-1,k);
9739 if (
offset != 0) {
return; }
9743 if (nddom.contains(i+1,j-1,k)) {
9744 Real tmp = Real(0.);
9745 if (ccdom.contains(i ,j-1,k-1)) {
9748 if (ccdom.contains(i ,j-1,k)) {
9752 if (gid(i+1,j-1,k) < gidmax) {
9754 cols[ps] = gid(i+1,j-1,k);
9760 if (
offset != 0) {
return; }
9764 if (nddom.contains(i-1,j,k)) {
9765 Real tmp = Real(0.);
9766 if (ccdom.contains(i-1,j-1,k-1)) {
9769 if (ccdom.contains(i-1,j,k-1)) {
9772 if (ccdom.contains(i-1,j-1,k)) {
9775 if (ccdom.contains(i-1,j,k)) {
9779 if (gid(i-1,j,k) < gidmax) {
9781 cols[ps] = gid(i-1,j,k);
9787 if (
offset != 0) {
return; }
9791 if (nddom.contains(i+1,j,k)) {
9792 Real tmp = Real(0.);
9793 if (ccdom.contains(i ,j-1,k-1)) {
9796 if (ccdom.contains(i ,j,k-1)) {
9799 if (ccdom.contains(i ,j-1,k)) {
9802 if (ccdom.contains(i ,j,k)) {
9806 if (gid(i+1,j,k) < gidmax) {
9808 cols[ps] = gid(i+1,j,k);
9814 if (
offset != 0) {
return; }
9818 if (nddom.contains(i-1,j+1,k)) {
9819 Real tmp = Real(0.);
9820 if (ccdom.contains(i-1,j ,k-1)) {
9823 if (ccdom.contains(i-1,j ,k)) {
9827 if (gid(i-1,j+1,k) < gidmax) {
9829 cols[ps] = gid(i-1,j+1,k);
9835 if (
offset != 0) {
return; }
9839 if (nddom.contains(i,j+1,k)) {
9840 Real tmp = Real(0.);
9841 if (ccdom.contains(i-1,j ,k-1)) {
9844 if (ccdom.contains(i,j ,k-1)) {
9847 if (ccdom.contains(i-1,j ,k)) {
9850 if (ccdom.contains(i,j ,k)) {
9854 if (gid(i,j+1,k) < gidmax) {
9856 cols[ps] = gid(i,j+1,k);
9862 if (
offset != 0) {
return; }
9866 if (nddom.contains(i+1,j+1,k)) {
9867 Real tmp = Real(0.);
9868 if (ccdom.contains(i ,j ,k-1)) {
9871 if (ccdom.contains(i ,j ,k)) {
9875 if (gid(i+1,j+1,k) < gidmax) {
9877 cols[ps] = gid(i+1,j+1,k);
9883 if (
offset != 0) {
return; }
9887 if (nddom.contains(i-1,j-1,k+1)) {
9890 if (gid(i-1,j-1,k+1) < gidmax) {
9892 cols[ps] = gid(i-1,j-1,k+1);
9898 if (
offset != 0) {
return; }
9902 if (nddom.contains(i,j-1,k+1)) {
9903 Real tmp = Real(0.);
9904 if (ccdom.contains(i-1,j-1,k )) {
9907 if (ccdom.contains(i,j-1,k )) {
9911 if (gid(i,j-1,k+1) < gidmax) {
9913 cols[ps] = gid(i,j-1,k+1);
9919 if (
offset != 0) {
return; }
9923 if (nddom.contains(i+1,j-1,k+1)) {
9926 if (gid(i+1,j-1,k+1) < gidmax) {
9928 cols[ps] = gid(i+1,j-1,k+1);
9934 if (
offset != 0) {
return; }
9938 if (nddom.contains(i-1,j,k+1)) {
9939 Real tmp = Real(0.);
9940 if (ccdom.contains(i-1,j-1,k )) {
9943 if (ccdom.contains(i-1,j,k )) {
9947 if (gid(i-1,j,k+1) < gidmax) {
9949 cols[ps] = gid(i-1,j,k+1);
9955 if (
offset != 0) {
return; }
9959 if (nddom.contains(i,j,k+1)) {
9960 Real tmp = Real(0.);
9961 if (ccdom.contains(i-1,j-1,k )) {
9964 if (ccdom.contains(i,j-1,k )) {
9967 if (ccdom.contains(i-1,j,k )) {
9970 if (ccdom.contains(i,j,k )) {
9974 if (gid(i,j,k+1) < gidmax) {
9976 cols[ps] = gid(i,j,k+1);
9982 if (
offset != 0) {
return; }
9986 if (nddom.contains(i+1,j,k+1)) {
9987 Real tmp = Real(0.);
9988 if (ccdom.contains(i ,j-1,k )) {
9991 if (ccdom.contains(i ,j,k )) {
9995 if (gid(i+1,j,k+1) < gidmax) {
9997 cols[ps] = gid(i+1,j,k+1);
10003 if (
offset != 0) {
return; }
10007 if (nddom.contains(i-1,j+1,k+1)) {
10010 if (gid(i-1,j+1,k+1) < gidmax) {
10012 cols[ps] = gid(i-1,j+1,k+1);
10018 if (
offset != 0) {
return; }
10022 if (nddom.contains(i,j+1,k+1)) {
10023 Real tmp = Real(0.);
10024 if (ccdom.contains(i-1,j ,k )) {
10027 if (ccdom.contains(i,j ,k )) {
10031 if (gid(i,j+1,k+1) < gidmax) {
10033 cols[ps] = gid(i,j+1,k+1);
10039 if (
offset != 0) {
return; }
10043 if (nddom.contains(i+1,j+1,k+1)) {
10046 if (gid(i+1,j+1,k+1) < gidmax) {
10048 cols[ps] = gid(i+1,j+1,k+1);
10054 if (
offset != 0) {
return; }
10058 cols[ps] = gid(i,j,k);
10060 ncols[lid(i,j,k)] = nelems+1;
10071 return (i%2) + (j%2)*2 + (k%2)*4;
10083 sol(i,j,k) = Real(0.0);
10085 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
10086 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
10087 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
10089 Real s0 = Real(-4.0)*(facx*(sx(i-1,j-1,k-1)+sx(i,j-1,k-1)+sx(i-1,j,k-1)+sx(i,j,k-1)
10090 +sx(i-1,j-1,k )+sx(i,j-1,k )+sx(i-1,j,k )+sx(i,j,k ))
10091 +facy*(sy(i-1,j-1,k-1)+sy(i,j-1,k-1)+sy(i-1,j,k-1)+sy(i,j,k-1)
10092 +sy(i-1,j-1,k )+sy(i,j-1,k )+sy(i-1,j,k )+sy(i,j,k ))
10093 +facz*(sz(i-1,j-1,k-1)+sz(i,j-1,k-1)+sz(i-1,j,k-1)+sz(i,j,k-1)
10094 +sz(i-1,j-1,k )+sz(i,j-1,k )+sz(i-1,j,k )+sz(i,j,k )));
10095 Real Ax = sol(i,j,k)*s0
10096 + sol(i-1,j-1,k-1)*(facx*sx(i-1,j-1,k-1)
10097 +facy*sy(i-1,j-1,k-1)
10098 +facz*sz(i-1,j-1,k-1))
10099 + sol(i+1,j-1,k-1)*(facx*sx(i ,j-1,k-1)
10100 +facy*sy(i ,j-1,k-1)
10101 +facz*sz(i ,j-1,k-1))
10102 + sol(i-1,j+1,k-1)*(facx*sx(i-1,j ,k-1)
10103 +facy*sy(i-1,j ,k-1)
10104 +facz*sz(i-1,j ,k-1))
10105 + sol(i+1,j+1,k-1)*(facx*sx(i ,j ,k-1)
10106 +facy*sy(i ,j ,k-1)
10107 +facz*sz(i ,j ,k-1))
10108 + sol(i-1,j-1,k+1)*(facx*sx(i-1,j-1,k )
10109 +facy*sy(i-1,j-1,k )
10110 +facz*sz(i-1,j-1,k ))
10111 + sol(i+1,j-1,k+1)*(facx*sx(i ,j-1,k )
10112 +facy*sy(i ,j-1,k )
10113 +facz*sz(i ,j-1,k ))
10114 + sol(i-1,j+1,k+1)*(facx*sx(i-1,j ,k )
10115 +facy*sy(i-1,j ,k )
10116 +facz*sz(i-1,j ,k ))
10117 + sol(i+1,j+1,k+1)*(facx*sx(i ,j ,k )
10119 +facz*sz(i ,j ,k ))
10120 +sol(i ,j-1,k-1)*( -facx*(sx(i-1,j-1,k-1)+sx(i,j-1,k-1))
10121 +Real(2.0)*facy*(sy(i-1,j-1,k-1)+sy(i,j-1,k-1))
10122 +Real(2.0)*facz*(sz(i-1,j-1,k-1)+sz(i,j-1,k-1)))
10123 +sol(i ,j+1,k-1)*( -facx*(sx(i-1,j ,k-1)+sx(i,j ,k-1))
10124 +Real(2.0)*facy*(sy(i-1,j ,k-1)+sy(i,j ,k-1))
10125 +Real(2.0)*facz*(sz(i-1,j ,k-1)+sz(i,j ,k-1)))
10126 +sol(i ,j-1,k+1)*( -facx*(sx(i-1,j-1,k )+sx(i,j-1,k ))
10127 +Real(2.0)*facy*(sy(i-1,j-1,k )+sy(i,j-1,k ))
10128 +Real(2.0)*facz*(sz(i-1,j-1,k )+sz(i,j-1,k )))
10129 +sol(i ,j+1,k+1)*( -facx*(sx(i-1,j ,k )+sx(i,j ,k ))
10130 +Real(2.0)*facy*(sy(i-1,j ,k )+sy(i,j ,k ))
10131 +Real(2.0)*facz*(sz(i-1,j ,k )+sz(i,j ,k )))
10132 +sol(i-1,j ,k-1)*( Real(2.0)*facx*(sx(i-1,j-1,k-1)+sx(i-1,j,k-1))
10133 -facy*(sy(i-1,j-1,k-1)+sy(i-1,j,k-1))
10134 +Real(2.0)*facz*(sz(i-1,j-1,k-1)+sz(i-1,j,k-1)))
10135 +sol(i+1,j ,k-1)*( Real(2.0)*facx*(sx(i ,j-1,k-1)+sx(i ,j,k-1))
10136 -facy*(sy(i ,j-1,k-1)+sy(i ,j,k-1))
10137 +Real(2.0)*facz*(sz(i ,j-1,k-1)+sz(i ,j,k-1)))
10138 +sol(i-1,j ,k+1)*( Real(2.0)*facx*(sx(i-1,j-1,k )+sx(i-1,j,k ))
10139 -facy*(sy(i-1,j-1,k )+sy(i-1,j,k ))
10140 +Real(2.0)*facz*(sz(i-1,j-1,k )+sz(i-1,j,k )))
10141 +sol(i+1,j ,k+1)*( Real(2.0)*facx*(sx(i ,j-1,k )+sx(i ,j,k ))
10142 -facy*(sy(i ,j-1,k )+sy(i ,j,k ))
10143 +Real(2.0)*facz*(sz(i ,j-1,k )+sz(i ,j,k )))
10144 +sol(i-1,j-1,k )*( Real(2.0)*facx*(sx(i-1,j-1,k-1)+sx(i-1,j-1,k))
10145 +Real(2.0)*facy*(sy(i-1,j-1,k-1)+sy(i-1,j-1,k))
10146 -facz*(sz(i-1,j-1,k-1)+sz(i-1,j-1,k)))
10147 +sol(i+1,j-1,k )*( Real(2.0)*facx*(sx(i ,j-1,k-1)+sx(i ,j-1,k))
10148 +Real(2.0)*facy*(sy(i ,j-1,k-1)+sy(i ,j-1,k))
10149 -facz*(sz(i ,j-1,k-1)+sz(i ,j-1,k)))
10150 +sol(i-1,j+1,k )*( Real(2.0)*facx*(sx(i-1,j ,k-1)+sx(i-1,j ,k))
10151 +Real(2.0)*facy*(sy(i-1,j ,k-1)+sy(i-1,j ,k))
10152 -facz*(sz(i-1,j ,k-1)+sz(i-1,j ,k)))
10153 +sol(i+1,j+1,k )*( Real(2.0)*facx*(sx(i ,j ,k-1)+sx(i ,j ,k))
10154 +Real(2.0)*facy*(sy(i ,j ,k-1)+sy(i ,j ,k))
10155 -facz*(sz(i ,j ,k-1)+sz(i ,j ,k)))
10156 + Real(2.0)*sol(i-1,j,k)*(Real(2.0)*facx*(sx(i-1,j-1,k-1)+sx(i-1,j,k-1)+sx(i-1,j-1,k)+sx(i-1,j,k))
10157 -facy*(sy(i-1,j-1,k-1)+sy(i-1,j,k-1)+sy(i-1,j-1,k)+sy(i-1,j,k))
10158 -facz*(sz(i-1,j-1,k-1)+sz(i-1,j,k-1)+sz(i-1,j-1,k)+sz(i-1,j,k)))
10159 + Real(2.0)*sol(i+1,j,k)*(Real(2.0)*facx*(sx(i ,j-1,k-1)+sx(i ,j,k-1)+sx(i ,j-1,k)+sx(i ,j,k))
10160 -facy*(sy(i ,j-1,k-1)+sy(i ,j,k-1)+sy(i ,j-1,k)+sy(i ,j,k))
10161 -facz*(sz(i ,j-1,k-1)+sz(i ,j,k-1)+sz(i ,j-1,k)+sz(i ,j,k)))
10162 + Real(2.0)*sol(i,j-1,k)*( -facx*(sx(i-1,j-1,k-1)+sx(i,j-1,k-1)+sx(i-1,j-1,k)+sx(i,j-1,k))
10163 +Real(2.0)*facy*(sy(i-1,j-1,k-1)+sy(i,j-1,k-1)+sy(i-1,j-1,k)+sy(i,j-1,k))
10164 -facz*(sz(i-1,j-1,k-1)+sz(i,j-1,k-1)+sz(i-1,j-1,k)+sz(i,j-1,k)))
10165 + Real(2.0)*sol(i,j+1,k)*( -facx*(sx(i-1,j ,k-1)+sx(i,j ,k-1)+sx(i-1,j ,k)+sx(i,j ,k))
10166 +Real(2.0)*facy*(sy(i-1,j ,k-1)+sy(i,j ,k-1)+sy(i-1,j ,k)+sy(i,j ,k))
10167 -facz*(sz(i-1,j ,k-1)+sz(i,j ,k-1)+sz(i-1,j ,k)+sz(i,j ,k)))
10168 + Real(2.0)*sol(i,j,k-1)*( -facx*(sx(i-1,j-1,k-1)+sx(i,j-1,k-1)+sx(i-1,j,k-1)+sx(i,j,k-1))
10169 -facy*(sy(i-1,j-1,k-1)+sy(i,j-1,k-1)+sy(i-1,j,k-1)+sy(i,j,k-1))
10170 +Real(2.0)*facz*(sz(i-1,j-1,k-1)+sz(i,j-1,k-1)+sz(i-1,j,k-1)+sz(i,j,k-1)))
10171 + Real(2.0)*sol(i,j,k+1)*( -facx*(sx(i-1,j-1,k )+sx(i,j-1,k )+sx(i-1,j,k )+sx(i,j,k ))
10172 -facy*(sy(i-1,j-1,k )+sy(i,j-1,k )+sy(i-1,j,k )+sy(i,j,k ))
10173 +Real(2.0)*facz*(sz(i-1,j-1,k )+sz(i,j-1,k )+sz(i-1,j,k )+sz(i,j,k )));
10175 sol(i,j,k) += (rhs(i,j,k) - Ax) / s0;
10182 Array4<Real const>
const& rhs, Array4<Real const>
const& sig,
10183 Array4<int const>
const& msk,
10184 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
int color) noexcept
10188 sol(i,j,k) = Real(0.0);
10190 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
10191 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
10192 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
10193 Real fxyz = facx + facy + facz;
10194 Real fmx2y2z = -facx + Real(2.0)*facy + Real(2.0)*facz;
10195 Real f2xmy2z = Real(2.0)*facx - facy + Real(2.0)*facz;
10196 Real f2x2ymz = Real(2.0)*facx + Real(2.0)*facy - facz;
10197 Real f4xm2ym2z = Real(4.0)*facx - Real(2.0)*facy - Real(2.0)*facz;
10198 Real fm2x4ym2z = -Real(2.0)*facx + Real(4.0)*facy - Real(2.0)*facz;
10199 Real fm2xm2y4z = -Real(2.0)*facx - Real(2.0)*facy + Real(4.0)*facz;
10201 Real s0 = Real(-4.0)*fxyz*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1)+sig(i-1,j,k-1)+sig(i,j,k-1)
10202 +sig(i-1,j-1,k )+sig(i,j-1,k )+sig(i-1,j,k )+sig(i,j,k ));
10203 Real Ax = sol(i,j,k)*s0
10204 + fxyz*(sol(i-1,j-1,k-1)*sig(i-1,j-1,k-1)
10205 + sol(i+1,j-1,k-1)*sig(i ,j-1,k-1)
10206 + sol(i-1,j+1,k-1)*sig(i-1,j ,k-1)
10207 + sol(i+1,j+1,k-1)*sig(i ,j ,k-1)
10208 + sol(i-1,j-1,k+1)*sig(i-1,j-1,k )
10209 + sol(i+1,j-1,k+1)*sig(i ,j-1,k )
10210 + sol(i-1,j+1,k+1)*sig(i-1,j ,k )
10211 + sol(i+1,j+1,k+1)*sig(i ,j ,k ))
10212 + fmx2y2z*(sol(i ,j-1,k-1)*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1))
10213 + sol(i ,j+1,k-1)*(sig(i-1,j ,k-1)+sig(i,j ,k-1))
10214 + sol(i ,j-1,k+1)*(sig(i-1,j-1,k )+sig(i,j-1,k ))
10215 + sol(i ,j+1,k+1)*(sig(i-1,j ,k )+sig(i,j ,k )))
10216 + f2xmy2z*(sol(i-1,j ,k-1)*(sig(i-1,j-1,k-1)+sig(i-1,j,k-1))
10217 + sol(i+1,j ,k-1)*(sig(i ,j-1,k-1)+sig(i ,j,k-1))
10218 + sol(i-1,j ,k+1)*(sig(i-1,j-1,k )+sig(i-1,j,k ))
10219 + sol(i+1,j ,k+1)*(sig(i ,j-1,k )+sig(i ,j,k )))
10220 + f2x2ymz*(sol(i-1,j-1,k )*(sig(i-1,j-1,k-1)+sig(i-1,j-1,k))
10221 + sol(i+1,j-1,k )*(sig(i ,j-1,k-1)+sig(i ,j-1,k))
10222 + sol(i-1,j+1,k )*(sig(i-1,j ,k-1)+sig(i-1,j ,k))
10223 + sol(i+1,j+1,k )*(sig(i ,j ,k-1)+sig(i ,j ,k)))
10224 + f4xm2ym2z*(sol(i-1,j,k)*(sig(i-1,j-1,k-1)+sig(i-1,j,k-1)+sig(i-1,j-1,k)+sig(i-1,j,k))
10225 + sol(i+1,j,k)*(sig(i ,j-1,k-1)+sig(i ,j,k-1)+sig(i ,j-1,k)+sig(i ,j,k)))
10226 + fm2x4ym2z*(sol(i,j-1,k)*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1)+sig(i-1,j-1,k)+sig(i,j-1,k))
10227 + sol(i,j+1,k)*(sig(i-1,j ,k-1)+sig(i,j ,k-1)+sig(i-1,j ,k)+sig(i,j ,k)))
10228 + fm2xm2y4z*(sol(i,j,k-1)*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1)+sig(i-1,j,k-1)+sig(i,j,k-1))
10229 + sol(i,j,k+1)*(sig(i-1,j-1,k )+sig(i,j-1,k )+sig(i-1,j,k )+sig(i,j,k )));
10231 sol(i,j,k) += (rhs(i,j,k) - Ax) / s0;
10238 Array4<Real const>
const& rhs, Real sig,
10239 Array4<int const>
const& msk,
10240 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
int color) noexcept
10244 sol(i,j,k) = Real(0.0);
10246 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
10247 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
10248 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
10249 Real fxyz = facx + facy + facz;
10250 Real fmx2y2z = -facx + Real(2.0)*facy + Real(2.0)*facz;
10251 Real f2xmy2z = Real(2.0)*facx - facy + Real(2.0)*facz;
10252 Real f2x2ymz = Real(2.0)*facx + Real(2.0)*facy - facz;
10253 Real f4xm2ym2z = Real(4.0)*facx - Real(2.0)*facy - Real(2.0)*facz;
10254 Real fm2x4ym2z = -Real(2.0)*facx + Real(4.0)*facy - Real(2.0)*facz;
10255 Real fm2xm2y4z = -Real(2.0)*facx - Real(2.0)*facy + Real(4.0)*facz;
10257 Real s0 = Real(-4.0)*fxyz*Real(8.);
10258 Real Ax = sol(i,j,k)*s0
10259 + fxyz*(sol(i-1,j-1,k-1)
10266 + sol(i+1,j+1,k+1))
10267 + fmx2y2z*(sol(i ,j-1,k-1)*Real(2.)
10268 + sol(i ,j+1,k-1)*Real(2.)
10269 + sol(i ,j-1,k+1)*Real(2.)
10270 + sol(i ,j+1,k+1)*Real(2.))
10271 + f2xmy2z*(sol(i-1,j ,k-1)*Real(2.)
10272 + sol(i+1,j ,k-1)*Real(2.)
10273 + sol(i-1,j ,k+1)*Real(2.)
10274 + sol(i+1,j ,k+1)*Real(2.))
10275 + f2x2ymz*(sol(i-1,j-1,k )*Real(2.)
10276 + sol(i+1,j-1,k )*Real(2.)
10277 + sol(i-1,j+1,k )*Real(2.)
10278 + sol(i+1,j+1,k )*Real(2.))
10279 + f4xm2ym2z*(sol(i-1,j,k)*Real(4.)
10280 + sol(i+1,j,k)*Real(4.))
10281 + fm2x4ym2z*(sol(i,j-1,k)*Real(4.)
10282 + sol(i,j+1,k)*Real(4.))
10283 + fm2xm2y4z*(sol(i,j,k-1)*Real(4.)
10284 + sol(i,j,k+1)*Real(4.));
10286 sol(i,j,k) += (rhs(i,j,k) - Ax*sig) / (s0*sig);
10293 Array4<Real const>
const& rhs,
10294 Array4<Real const>
const& sten,
10295 Array4<int const>
const& msk,
int color) noexcept
#define AMREX_FORCE_INLINE
Definition: AMReX_Extension.H:119
#define AMREX_GPU_DEVICE
Definition: AMReX_GpuQualifiers.H:18
#define AMREX_GPU_HOST_DEVICE
Definition: AMReX_GpuQualifiers.H:20
int idir
Definition: AMReX_HypreMLABecLap.cpp:1093
Array4< int const > offset
Definition: AMReX_HypreMLABecLap.cpp:1089
Array4< Real > fine
Definition: AMReX_InterpFaceRegister.cpp:90
Array4< Real const > crse
Definition: AMReX_InterpFaceRegister.cpp:92
#define AMREX_LOOP_3D(bx, i, j, k, block)
Definition: AMReX_Loop.nolint.H:4
HYPRE_Int Int
Definition: AMReX_HypreNodeLap.H:36
static int f(amrex::Real t, N_Vector y_data, N_Vector y_rhs, void *user_data)
Definition: AMReX_SundialsIntegrator.H:44
static constexpr int i_B_xyz
Definition: AMReX_algoim.H:42
static constexpr int i_S_y_z2
Definition: AMReX_algoim.H:26
static constexpr int i_S_y_z
Definition: AMReX_algoim.H:20
static constexpr int i_S_x2
Definition: AMReX_algoim.H:15
static constexpr int numSurfIntgs
Definition: AMReX_algoim.H:43
static constexpr int i_S_x_y
Definition: AMReX_algoim.H:18
static constexpr int i_S_y
Definition: AMReX_algoim.H:13
static constexpr int i_S_x_z
Definition: AMReX_algoim.H:19
static constexpr int i_B_z
Definition: AMReX_algoim.H:38
static constexpr int i_S_x_y2
Definition: AMReX_algoim.H:23
static constexpr int i_S_xyz
Definition: AMReX_algoim.H:30
static constexpr int i_S_y2_z2
Definition: AMReX_algoim.H:29
static constexpr int i_B_x_y
Definition: AMReX_algoim.H:39
static constexpr int i_B_x_z
Definition: AMReX_algoim.H:40
static constexpr int i_S_x2_y2
Definition: AMReX_algoim.H:27
static constexpr int i_S_x2_z2
Definition: AMReX_algoim.H:28
static constexpr int i_S_x
Definition: AMReX_algoim.H:12
static constexpr int i_S_y2_z
Definition: AMReX_algoim.H:24
static constexpr int i_S_x2_y
Definition: AMReX_algoim.H:21
static constexpr int i_B_y_z
Definition: AMReX_algoim.H:41
static constexpr int i_B_x
Definition: AMReX_algoim.H:36
static constexpr int i_S_z
Definition: AMReX_algoim.H:14
static constexpr int i_S_z2
Definition: AMReX_algoim.H:17
static constexpr int i_S_x_z2
Definition: AMReX_algoim.H:25
static constexpr int i_S_x2_z
Definition: AMReX_algoim.H:22
static constexpr int i_B_y
Definition: AMReX_algoim.H:37
static constexpr int i_S_y2
Definition: AMReX_algoim.H:16
@ max
Definition: AMReX_ParallelReduce.H:17
constexpr int iz
Definition: AMReX_Interp_3D_C.H:37
constexpr int iy
Definition: AMReX_Interp_2D_C.H:33
constexpr int ix
Definition: AMReX_Interp_2D_C.H:32
constexpr int ist_000
Definition: AMReX_MLNodeLap_3D_K.H:1949
constexpr int ist_pp0
Definition: AMReX_MLNodeLap_3D_K.H:1953
constexpr int ist_p00
Definition: AMReX_MLNodeLap_3D_K.H:1950
constexpr int ist_ppp
Definition: AMReX_MLNodeLap_3D_K.H:1956
constexpr int ist_00p
Definition: AMReX_MLNodeLap_3D_K.H:1952
constexpr int crse_cell
Definition: AMReX_MLNodeLinOp_K.H:54
constexpr int ist_p0p
Definition: AMReX_MLNodeLap_3D_K.H:1954
constexpr int ist_inv
Definition: AMReX_MLNodeLap_3D_K.H:1957
constexpr int ist_0p0
Definition: AMReX_MLNodeLap_3D_K.H:1951
constexpr int crse_fine_node
Definition: AMReX_MLNodeLinOp_K.H:57
constexpr double eps
Definition: AMReX_MLNodeLap_K.H:19
constexpr int n_sten
Definition: AMReX_MLNodeLap_3D_K.H:1958
constexpr int ist_0pp
Definition: AMReX_MLNodeLap_3D_K.H:1955
constexpr Real almostone
Definition: AMReX_MLNodeLap_K.H:21
static constexpr int P
Definition: AMReX_OpenBC.H:14
Definition: AMReX_Amr.cpp:49
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real mlndlap_adotx_ha(int i, int, int, Array4< Real const > const &x, Array4< Real const > const &sx, Array4< int const > const &msk, GpuArray< Real, AMREX_SPACEDIM > const &dxinv) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:52
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void mlndlap_gscolor_ha(int i, int j, int k, Array4< Real > const &sol, Array4< Real const > const &rhs, Array4< Real const > const &sx, Array4< int const > const &msk, GpuArray< Real, AMREX_SPACEDIM > const &dxinv, int color) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:426
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real ha_interp_face_xz(Array4< Real const > const &crse, Array4< Real const > const &sigx, Array4< Real const > const &sigz, int i, int j, int k, int ic, int jc, int kc) noexcept
Definition: AMReX_MLNodeLap_3D_K.H:1187
AMREX_ATTRIBUTE_FLATTEN_FOR void LoopOnCpu(Dim3 lo, Dim3 hi, F const &f) noexcept
Definition: AMReX_Loop.H:355
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_Ax_fine_contrib_cs(int i, int j, int, Box const &ndbx, Box const &ccbx, Array4< Real > const &f, Array4< Real const > const &res, Array4< Real const > const &rhs, Array4< Real const > const &phi, Real const sig, Array4< int const > const &msk, bool is_rz, GpuArray< Real, AMREX_SPACEDIM > const &dxinv) noexcept
Definition: AMReX_MLNodeLap_2D_K.H:1157
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_divu_fine_contrib(int i, int j, int, Box const &fvbx, Box const &velbx, Array4< Real > const &rhs, Array4< Real const > const &vel, Array4< Real const > const &frhs, Array4< int const > const &msk, GpuArray< Real, AMREX_SPACEDIM > const &dxinv, bool is_rz) noexcept
Definition: AMReX_MLNodeLap_2D_K.H:867
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_avgdown_coeff_z(int i, int j, int k, Array4< Real > const &crse, Array4< Real const > const &fine) noexcept
Definition: AMReX_MLNodeLap_3D_K.H:53
BoxND< AMREX_SPACEDIM > Box
Definition: AMReX_BaseFwd.H:27
AMREX_ATTRIBUTE_FLATTEN_FOR void LoopConcurrentOnCpu(Dim3 lo, Dim3 hi, F const &f) noexcept
Definition: AMReX_Loop.H:378
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real aa_interp_line_z(Array4< Real const > const &crse, Array4< Real const > const &sig, int i, int j, int k, int ic, int jc, int kc) noexcept
Definition: AMReX_MLNodeLap_3D_K.H:941
void mlndlap_gauss_seidel_with_line_solve_aa(Box const &, Array4< Real > const &, Array4< Real const > const &, Array4< Real const > const &, Array4< int const > const &, GpuArray< Real, AMREX_SPACEDIM > const &) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:225
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void mlndlap_jacobi_ha(int i, int, int, Array4< Real > const &sol, Real Ax, Array4< Real const > const &rhs, Array4< Real const > const &sx, Array4< int const > const &msk, GpuArray< Real, AMREX_SPACEDIM > const &dxinv) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:92
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_semi_avgdown_coeff(int i, int j, int k, Array4< Real > const &crse, Array4< Real const > const &fine, int) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:30
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real ha_interp_face_yz(Array4< Real const > const &crse, Array4< Real const > const &sigy, Array4< Real const > const &sigz, int i, int j, int k, int ic, int jc, int kc) noexcept
Definition: AMReX_MLNodeLap_3D_K.H:1202
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_interpadd_rap(int, int, int, Array4< Real > const &, Array4< Real const > const &, Array4< Real const > const &, Array4< int const > const &) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:408
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_avgdown_coeff_y(int i, int j, int k, Array4< Real > const &crse, Array4< Real const > const &fine) noexcept
Definition: AMReX_MLNodeLap_2D_K.H:36
void mlndlap_gauss_seidel_aa(Box const &bx, Array4< Real > const &sol, Array4< Real const > const &rhs, Array4< Real const > const &sx, Array4< int const > const &msk, GpuArray< Real, AMREX_SPACEDIM > const &dxinv) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:193
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 AMREX_FORCE_INLINE Real mlndlap_adotx_aa(int i, int j, int k, Array4< Real const > const &x, Array4< Real const > const &sx, Array4< int const > const &msk, GpuArray< Real, AMREX_SPACEDIM > const &dxinv) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:66
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void mlndlap_jacobi_c(int i, int, int, Array4< Real > const &sol, Real Ax, Array4< Real const > const &rhs, Real sig, Array4< int const > const &msk, GpuArray< Real, AMREX_SPACEDIM > const &dxinv) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:141
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void mlndlap_jacobi_aa(int i, int j, int k, Array4< Real > const &sol, Real Ax, Array4< Real const > const &rhs, Array4< Real const > const &sig, Array4< int const > const &msk, GpuArray< Real, AMREX_SPACEDIM > const &dxinv) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:125
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real mlndlap_adotx_sten(int, int, int, Array4< Real const > const &, Array4< Real const > const &, Array4< int const > const &) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:396
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const T & min(const T &a, const T &b) noexcept
Definition: AMReX_Algorithm.H:21
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_interpadd_c(int i, int, int, Array4< Real > const &fine, Array4< Real const > const &crse, Array4< int const > const &msk) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:233
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_set_stencil_s0(int, int, int, Array4< Real > const &) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:387
void mlndlap_gauss_seidel_ha(Box const &bx, Array4< Real > const &sol, Array4< Real const > const &rhs, Array4< Real const > const &sx, Array4< int const > const &msk, GpuArray< Real, AMREX_SPACEDIM > const &dxinv) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:170
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T abs(const GpuComplex< T > &a_z) noexcept
Return the absolute value of a complex number.
Definition: AMReX_GpuComplex.H:356
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_res_cf_contrib(int, int, int, Array4< Real > const &, Array4< Real const > const &, Array4< Real const > const &, Array4< Real const > const &, Array4< int const > const &, Array4< int const > const &, Array4< int const > const &, Array4< Real const > const &, GpuArray< Real, AMREX_SPACEDIM > const &, Box const &, GpuArray< LinOpBCType, AMREX_SPACEDIM > const &, GpuArray< LinOpBCType, AMREX_SPACEDIM > const &, bool) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:357
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_normalize_aa(int i, int j, int k, Array4< Real > const &x, Array4< Real const > const &sx, Array4< int const > const &msk, GpuArray< Real, AMREX_SPACEDIM > const &dxinv) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:84
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real mlndlap_sum_Ax(P const &pred, S const &sig, int i, int j, Real facx, Real facy, Array4< Real const > const &phi, bool is_rz) noexcept
Definition: AMReX_MLNodeLap_2D_K.H:1057
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 void mlndlap_rhcc_fine_contrib(int, int, int, Box const &, Array4< Real > const &, Array4< Real const > const &, Array4< int const > const &) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:332
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_semi_interpadd_aa(int, int, int, Array4< Real > const &, Array4< Real const > const &, Array4< Real const > const &, Array4< int const > const &, int) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:270
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Dim3 lbound(Array4< T > const &a) noexcept
Definition: AMReX_Array4.H:308
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_set_stencil(Box const &, Array4< Real > const &, Array4< Real const > const &, GpuArray< Real, AMREX_SPACEDIM > const &) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:381
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real aa_interp_line_y(Array4< Real const > const &crse, Array4< Real const > const &sig, int i, int j, int ic, int jc) noexcept
Definition: AMReX_MLNodeLap_2D_K.H:582
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_zero_fine(int i, int, int, Array4< Real > const &phi, Array4< int const > const &msk, int fine_flag) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:8
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real mlndlap_adotx_c(int i, int, int, Array4< Real const > const &x, Real sigma, Array4< int const > const &msk, GpuArray< Real, AMREX_SPACEDIM > const &dxinv) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:37
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real ha_interp_face_xy(Array4< Real const > const &crse, Array4< Real const > const &sigx, Array4< Real const > const &sigy, int i, int j, int ic, int jc) noexcept
Definition: AMReX_MLNodeLap_2D_K.H:694
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_interpadd_aa(int i, int, int, Array4< Real > const &fine, Array4< Real const > const &crse, Array4< Real const > const &sig, Array4< int const > const &msk) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:251
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_res_cf_contrib_cs(int, int, int, Array4< Real > const &, Array4< Real const > const &, Array4< Real const > const &, Real, Array4< int const > const &, Array4< int const > const &, Array4< int const > const &, Array4< Real const > const &, GpuArray< Real, AMREX_SPACEDIM > const &, Box const &, GpuArray< LinOpBCType, AMREX_SPACEDIM > const &, GpuArray< LinOpBCType, AMREX_SPACEDIM > const &, bool) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:369
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_divu(int i, int, int, Array4< Real > const &rhs, Array4< Real const > const &vel, Array4< int const > const &msk, GpuArray< Real, AMREX_SPACEDIM > const &dxinv, Box const &, GpuArray< LinOpBCType, AMREX_SPACEDIM > const &, GpuArray< LinOpBCType, AMREX_SPACEDIM > const &) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:284
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_divu_cf_contrib(int, int, int, Array4< Real > const &, Array4< Real const > const &, Array4< Real const > const &, Array4< Real const > const &, Array4< int const > const &, Array4< int const > const &, Array4< int const > const &, GpuArray< Real, AMREX_SPACEDIM > const &, Box const &, GpuArray< LinOpBCType, AMREX_SPACEDIM > const &, GpuArray< LinOpBCType, AMREX_SPACEDIM > const &, bool) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:338
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void ignore_unused(const Ts &...)
This shuts up the compiler about unused variables.
Definition: AMReX.H:111
void mlndlap_gauss_seidel_sten(Box const &, Array4< Real > const &, Array4< Real const > const &, Array4< Real const > const &, Array4< int const > const &) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:401
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_gscolor_sten(int, int, int, Array4< Real > const &, Array4< Real const > const &, Array4< Real const > const &, Array4< int const > const &, int) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:479
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< dim > surroundingNodes(const BoxND< dim > &b, int dir) noexcept
Returns a BoxND with NODE based coordinates in direction dir that encloses BoxND b....
Definition: AMReX_Box.H:1399
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > scale(const IntVectND< dim > &p, int s) noexcept
Returns a IntVectND obtained by multiplying each of the components of this IntVectND by s.
Definition: AMReX_IntVect.H:1006
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void mlndlap_gscolor_aa(int i, int j, int k, Array4< Real > const &sol, Array4< Real const > const &rhs, Array4< Real const > const &sx, Array4< int const > const &msk, GpuArray< Real, AMREX_SPACEDIM > const &dxinv, int color) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:448
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_mknewu(int i, int, int, Array4< Real > const &u, Array4< Real const > const &p, Array4< Real const > const &sig, GpuArray< Real, AMREX_SPACEDIM > const &dxinv) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:312
AMREX_GPU_HOST_DEVICE AMREX_ATTRIBUTE_FLATTEN_FOR void LoopConcurrent(Dim3 lo, Dim3 hi, F const &f) noexcept
Definition: AMReX_Loop.H:150
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_restriction_rap(int, int, int, Array4< Real > const &, Array4< Real const > const &, Array4< Real const > const &, Array4< int const > const &) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:414
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void mlndlap_gscolor_c(int i, int j, int k, Array4< Real > const &sol, Array4< Real const > const &rhs, Real sig, Array4< int const > const &msk, GpuArray< Real, AMREX_SPACEDIM > const &dxinv, int color) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:458
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real aa_interp_face_yz(Array4< Real const > const &crse, Array4< Real const > const &sig, int i, int j, int k, int ic, int jc, int kc) noexcept
Definition: AMReX_MLNodeLap_3D_K.H:978
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real mlndlap_sum_Df(int ii, int jj, Real facx, Real facy, Array4< Real const > const &vel, Box const &velbx, bool is_rz) noexcept
Definition: AMReX_MLNodeLap_2D_K.H:843
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_Ax_fine_contrib_doit(S const &sig, int i, int j, Box const &ndbx, Box const &ccbx, Array4< Real > const &f, Array4< Real const > const &res, Array4< Real const > const &rhs, Array4< Real const > const &phi, Array4< int const > const &msk, bool is_rz, GpuArray< Real, AMREX_SPACEDIM > const &dxinv) noexcept
Definition: AMReX_MLNodeLap_2D_K.H:1099
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real aa_interp_face_xy(Array4< Real const > const &crse, Array4< Real const > const &sig, int i, int j, int ic, int jc) noexcept
Definition: AMReX_MLNodeLap_2D_K.H:591
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< dim > coarsen(const BoxND< dim > &b, int ref_ratio) noexcept
Coarsen BoxND by given (positive) refinement ratio. NOTE: if type(dir) = CELL centered: lo <- lo/rati...
Definition: AMReX_Box.H:1304
AMREX_GPU_DEVICE AMREX_FORCE_INLINE int mlndlap_color(int i, int, int)
Definition: AMReX_MLNodeLap_1D_K.H:420
void Abort(const std::string &msg)
Print out message to cerr and exit via abort().
Definition: AMReX.cpp:225
const int[]
Definition: AMReX_BLProfiler.cpp:1664
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_crse_resid(int, int, int, Array4< Real > const &, Array4< Real const > const &, Array4< int const > const &, Box const &, GpuArray< LinOpBCType, AMREX_SPACEDIM > const &, GpuArray< LinOpBCType, AMREX_SPACEDIM > const &, bool) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:349
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_normalize_ha(int i, int, int, Array4< Real > const &x, Array4< Real const > const &sx, Array4< int const > const &msk, GpuArray< Real, AMREX_SPACEDIM > const &dxinv) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:74
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_avgdown_coeff_x(int i, int, int, Array4< Real > const &crse, Array4< Real const > const &fine) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:21
void mlndlap_gauss_seidel_c(Box const &bx, Array4< Real > const &sol, Array4< Real const > const &rhs, Real sig, Array4< int const > const &msk, GpuArray< Real, AMREX_SPACEDIM > const &dxinv) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:203
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_interpadd_ha(int i, int j, int k, Array4< Real > const &fine, Array4< Real const > const &crse, Array4< Real const > const &sig, Array4< int const > const &msk) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:276
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_Ax_fine_contrib(int i, int j, int, Box const &ndbx, Box const &ccbx, Array4< Real > const &f, Array4< Real const > const &res, Array4< Real const > const &rhs, Array4< Real const > const &phi, Array4< Real const > const &sig, Array4< int const > const &msk, bool is_rz, GpuArray< Real, AMREX_SPACEDIM > const &dxinv) noexcept
Definition: AMReX_MLNodeLap_2D_K.H:1143
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real aa_interp_line_x(Array4< Real const > const &crse, Array4< Real const > const &sig, int i, int j, int ic, int jc) noexcept
Definition: AMReX_MLNodeLap_2D_K.H:573
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_stencil_rap(int, int, int, Array4< Real > const &, Array4< Real const > const &) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:391
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real mlndlap_adotx_sten_doit(int i, int j, int k, Array4< Real const > const &x, Array4< Real const > const &sten) noexcept
Definition: AMReX_MLNodeLap_2D_K.H:1507
AMREX_FORCE_INLINE void tridiagonal_solve(Array1D< T, 0, 31 > &a_ls, Array1D< T, 0, 31 > &b_ls, Array1D< T, 0, 31 > &c_ls, Array1D< T, 0, 31 > &r_ls, Array1D< T, 0, 31 > &u_ls, Array1D< T, 0, 31 > &gam, int ilen) noexcept
Definition: AMReX_MLABecLap_3D_K.H:432
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real mlndlap_rhcc(int i, int, int, Array4< Real const > const &rhcc, Array4< int const > const &msk) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:299
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_mknewu_c(int i, int, int, Array4< Real > const &u, Array4< Real const > const &p, Real sig, GpuArray< Real, AMREX_SPACEDIM > const &dxinv) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:322
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real aa_interp_face_xz(Array4< Real const > const &crse, Array4< Real const > const &sig, int i, int j, int k, int ic, int jc, int kc) noexcept
Definition: AMReX_MLNodeLap_3D_K.H:964
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real neumann_scale(int i, int j, Box const &nddom, GpuArray< LinOpBCType, AMREX_SPACEDIM > const &bclo, GpuArray< LinOpBCType, AMREX_SPACEDIM > const &bchi) noexcept
Definition: AMReX_MLNodeLap_2D_K.H:930
Definition: AMReX_Array4.H:61