Block-Structured AMR Software Framework
AMReX_extrapolater_3D_K.H
Go to the documentation of this file.
1 #ifndef AMReX_extrapolater_3D_K_H_
2 #define AMReX_extrapolater_3D_K_H_
3 #include <AMReX_Config.H>
4 
5 namespace amrex {
6 
9 void
11  int nComp,
13  amrex::Array4<amrex::Real> const& data) noexcept
14 {
15  using namespace amrex::literals;
16 
17  constexpr int finecell = 1;
18  constexpr int crsecell = 0;
19 
20  const auto lo = amrex::lbound(bx);
21  const auto hi = amrex::ubound(bx);
22 
23  for (int n = 0; n < nComp; n++) {
24 
25  // set the crse cells in the current layer to zero
26  { // z-dir faces
27  int k = lo.z-1;
28  for (int j = lo.y-1; j <= hi.y+1; ++j) {
29  for (int i = lo.x-1; i <= hi.x+1; ++i) {
30  if (mask(i,j,k) == crsecell) { data(i,j,k,n) = Real(0.0); }
31  }
32  }
33  k = hi.z+1;
34  for (int j = lo.y-1; j <= hi.y+1; ++j) {
35  for (int i = lo.x-1; i <= hi.x+1; ++i) {
36  if (mask(i,j,k) == crsecell) { data(i,j,k,n) = Real(0.0); }
37  }
38  }
39  }
40  { // y-dir faces
41  int j = lo.y-1;
42  for (int k = lo.z-1; k <= hi.z+1; ++k) {
43  for (int i = lo.x-1; i <= hi.x+1; ++i) {
44  if (mask(i,j,k) == crsecell) { data(i,j,k,n) = Real(0.0); }
45  }
46  }
47  j = hi.y+1;
48  for (int k = lo.z-1; k <= hi.z+1; ++k) {
49  for (int i = lo.x-1; i <= hi.x+1; ++i) {
50  if (mask(i,j,k) == crsecell) { data(i,j,k,n) = Real(0.0); }
51  }
52  }
53  }
54  { // x-dir faces
55  int i = lo.x-1;
56  for (int k = lo.z-1; k <= hi.z+1; ++k) {
57  for (int j = lo.y-1; j <= hi.y+1; ++j) {
58  if (mask(i,j,k) == crsecell) { data(i,j,k,n) = Real(0.0); }
59  }
60  }
61  i = hi.x+1;
62  for (int k = lo.z-1; k <= hi.z+1; ++k) {
63  for (int j = lo.y-1; j <= hi.y+1; ++j) {
64  if (mask(i,j,k) == crsecell) { data(i,j,k,n) = Real(0.0); }
65  }
66  }
67  }
68 
69  // Corners
70  // xlo, ylo, zlo
71  {
72  int i = lo.x-1;
73  int j = lo.y-1;
74  int k = lo.z-1;
75  if ( mask(i,j,k) == crsecell ) {
76  if ( ( mask(i+1,j,k) == finecell ) ||
77  ( mask(i,j+1,k) == finecell ) ||
78  ( mask(i,j,k+1) == finecell ) ) {
79  data(i,j,k,n) = ( Real(mask(i+1,j,k)) * data(i+1,j,k,n)
80  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
81  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
82  / Real( mask(i+1,j,k) + mask(i,j+1,k) + mask(i,j,k+1) );
83  } else if ( ( mask(i+1,j+1,k) == finecell ) ||
84  ( mask(i+1,j,k+1) == finecell ) ||
85  ( mask(i,j+1,k+1) == finecell ) ) {
86  data(i,j,k,n) = ( Real(mask(i+1,j+1,k)) * data(i+1,j+1,k,n)
87  + Real(mask(i+1,j,k+1)) * data(i+1,j,k+1,n)
88  + Real(mask(i,j+1,k+1)) * data(i,j+1,k+1,n) )
89  / Real( mask(i+1,j+1,k) + mask(i+1,j,k+1) + mask(i,j+1,k+1) );
90  } else {
91  data(i,j,k,n) = data(i+1,j+1,k+1,n);
92  }
93  }
94  }
95  // xlo, ylo, zhi
96  {
97  int i = lo.x-1;
98  int j = lo.y-1;
99  int k = hi.z+1;
100  if ( mask(i,j,k) == crsecell ) {
101  if ( ( mask(i+1,j,k) == finecell ) ||
102  ( mask(i,j+1,k) == finecell ) ||
103  ( mask(i,j,k-1) == finecell ) ) {
104  data(i,j,k,n) = ( Real(mask(i+1,j,k)) * data(i+1,j,k,n)
105  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
106  + Real(mask(i,j,k-1)) * data(i,j,k-1,n) )
107  / Real( mask(i+1,j,k) + mask(i,j+1,k) + mask(i,j,k-1) );
108  } else if ( ( mask(i+1,j+1,k) == finecell ) ||
109  ( mask(i+1,j,k-1) == finecell ) ||
110  ( mask(i,j+1,k-1) == finecell ) ) {
111  data(i,j,k,n) = ( Real(mask(i+1,j+1,k)) * data(i+1,j+1,k,n)
112  + Real(mask(i+1,j,k-1)) * data(i+1,j,k-1,n)
113  + Real(mask(i,j+1,k-1)) * data(i,j+1,k-1,n) )
114  / Real( mask(i+1,j+1,k) + mask(i+1,j,k-1) + mask(i,j+1,k-1) );
115  } else {
116  data(i,j,k,n) = data(i+1,j+1,k-1,n);
117  }
118  }
119  }
120  // xlo, yhi, zlo
121  {
122  int i = lo.x-1;
123  int j = hi.y+1;
124  int k = lo.z-1;
125  if ( mask(i,j,k) == crsecell ) {
126  if ( ( mask(i+1,j,k) == finecell ) ||
127  ( mask(i,j-1,k) == finecell ) ||
128  ( mask(i,j,k+1) == finecell ) ) {
129  data(i,j,k,n) = ( Real(mask(i+1,j,k)) * data(i+1,j,k,n)
130  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
131  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
132  / Real( mask(i+1,j,k) + mask(i,j-1,k) + mask(i,j,k+1) );
133  } else if ( ( mask(i+1,j-1,k) == finecell ) ||
134  ( mask(i+1,j,k+1) == finecell ) ||
135  ( mask(i,j-1,k+1) == finecell ) ) {
136  data(i,j,k,n) = ( Real(mask(i+1,j-1,k)) * data(i+1,j-1,k,n)
137  + Real(mask(i+1,j,k+1)) * data(i+1,j,k+1,n)
138  + Real(mask(i,j-1,k+1)) * data(i,j-1,k+1,n) )
139  / Real( mask(i+1,j-1,k) + mask(i+1,j,k+1) + mask(i,j-1,k+1) );
140  } else {
141  data(i,j,k,n) = data(i+1,j-1,k+1,n);
142  }
143  }
144  }
145  // xlo, yhi, zhi
146  {
147  int i = lo.x-1;
148  int j = hi.y+1;
149  int k = hi.z+1;
150  if ( mask(i,j,k) == crsecell ) {
151  if ( ( mask(i+1,j,k) == finecell ) ||
152  ( mask(i,j-1,k) == finecell ) ||
153  ( mask(i,j,k-1) == finecell ) ) {
154  data(i,j,k,n) = ( Real(mask(i+1,j,k)) * data(i+1,j,k,n)
155  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
156  + Real(mask(i,j,k-1)) * data(i,j,k-1,n) )
157  / Real( mask(i+1,j,k) + mask(i,j-1,k) + mask(i,j,k-1) );
158  } else if ( ( mask(i+1,j-1,k) == finecell ) ||
159  ( mask(i+1,j,k-1) == finecell ) ||
160  ( mask(i,j-1,k-1) == finecell ) ) {
161  data(i,j,k,n) = ( Real(mask(i+1,j-1,k)) * data(i+1,j-1,k,n)
162  + Real(mask(i+1,j,k-1)) * data(i+1,j,k-1,n)
163  + Real(mask(i,j-1,k-1)) * data(i,j-1,k-1,n) )
164  / Real( mask(i+1,j-1,k) + mask(i+1,j,k-1) + mask(i,j-1,k-1) );
165  } else {
166  data(i,j,k,n) = data(i+1,j-1,k-1,n);
167  }
168  }
169  }
170  // xhi, ylo, zlo
171  {
172  int i = hi.x+1;
173  int j = lo.y-1;
174  int k = lo.z-1;
175  if ( mask(i,j,k) == crsecell ) {
176  if ( ( mask(i-1,j,k) == finecell ) ||
177  ( mask(i,j+1,k) == finecell ) ||
178  ( mask(i,j,k+1) == finecell ) ) {
179  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
180  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
181  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
182  / Real( mask(i-1,j,k) + mask(i,j+1,k) + mask(i,j,k+1) );
183  } else if ( ( mask(i-1,j+1,k) == finecell ) ||
184  ( mask(i-1,j,k+1) == finecell ) ||
185  ( mask(i,j+1,k+1) == finecell ) ) {
186  data(i,j,k,n) = ( Real(mask(i-1,j+1,k)) * data(i-1,j+1,k,n)
187  + Real(mask(i-1,j,k+1)) * data(i-1,j,k+1,n)
188  + Real(mask(i,j+1,k+1)) * data(i,j+1,k+1,n) )
189  / Real( mask(i-1,j+1,k) + mask(i-1,j,k+1) + mask(i,j+1,k+1) );
190  } else {
191  data(i,j,k,n) = data(i-1,j+1,k+1,n);
192  }
193  }
194  }
195  // xhi, ylo, zhi
196  {
197  int i = hi.x+1;
198  int j = lo.y-1;
199  int k = hi.z+1;
200  if ( mask(i,j,k) == crsecell ) {
201  if ( ( mask(i-1,j,k) == finecell ) ||
202  ( mask(i,j+1,k) == finecell ) ||
203  ( mask(i,j,k-1) == finecell ) ) {
204  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
205  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
206  + Real(mask(i,j,k-1)) * data(i,j,k-1,n) )
207  / Real( mask(i-1,j,k) + mask(i,j+1,k) + mask(i,j,k-1) );
208  } else if ( ( mask(i-1,j+1,k) == finecell ) ||
209  ( mask(i-1,j,k-1) == finecell ) ||
210  ( mask(i,j+1,k-1) == finecell ) ) {
211  data(i,j,k,n) = ( Real(mask(i-1,j+1,k)) * data(i-1,j+1,k,n)
212  + Real(mask(i-1,j,k-1)) * data(i-1,j,k-1,n)
213  + Real(mask(i,j+1,k-1)) * data(i,j+1,k-1,n) )
214  / Real( mask(i-1,j+1,k) + mask(i-1,j,k-1) + mask(i,j+1,k-1) );
215  } else {
216  data(i,j,k,n) = data(i-1,j+1,k-1,n);
217  }
218  }
219  }
220  // xhi, yhi, zlo
221  {
222  int i = hi.x+1;
223  int j = hi.y+1;
224  int k = lo.z-1;
225  if ( mask(i,j,k) == crsecell ) {
226  if ( ( mask(i-1,j,k) == finecell ) ||
227  ( mask(i,j-1,k) == finecell ) ||
228  ( mask(i,j,k+1) == finecell ) ) {
229  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
230  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
231  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
232  / Real( mask(i-1,j,k) + mask(i,j-1,k) + mask(i,j,k+1) );
233  } else if ( ( mask(i-1,j-1,k) == finecell ) ||
234  ( mask(i-1,j,k+1) == finecell ) ||
235  ( mask(i,j-1,k+1) == finecell ) ) {
236  data(i,j,k,n) = ( Real(mask(i-1,j-1,k)) * data(i-1,j-1,k,n)
237  + Real(mask(i-1,j,k+1)) * data(i-1,j,k+1,n)
238  + Real(mask(i,j-1,k+1)) * data(i,j-1,k+1,n) )
239  / Real( mask(i-1,j-1,k) + mask(i-1,j,k+1) + mask(i,j-1,k+1) );
240  } else {
241  data(i,j,k,n) = data(i-1,j-1,k+1,n);
242  }
243  }
244  }
245  // xhi, yhi, zhi
246  {
247  int i = hi.x+1;
248  int j = hi.y+1;
249  int k = hi.z+1;
250  if ( mask(i,j,k) == crsecell ) {
251  if ( ( mask(i-1,j,k) == finecell ) ||
252  ( mask(i,j-1,k) == finecell ) ||
253  ( mask(i,j,k-1) == finecell ) ) {
254  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
255  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
256  + Real(mask(i,j,k-1)) * data(i,j,k-1,n) )
257  / Real( mask(i-1,j,k) + mask(i,j-1,k) + mask(i,j,k-1) );
258  } else if ( ( mask(i-1,j-1,k) == finecell ) ||
259  ( mask(i-1,j,k-1) == finecell ) ||
260  ( mask(i,j-1,k-1) == finecell ) ) {
261  data(i,j,k,n) = ( Real(mask(i-1,j-1,k)) * data(i-1,j-1,k,n)
262  + Real(mask(i-1,j,k-1)) * data(i-1,j,k-1,n)
263  + Real(mask(i,j-1,k-1)) * data(i,j-1,k-1,n) )
264  / Real( mask(i-1,j-1,k) + mask(i-1,j,k-1) + mask(i,j-1,k-1) );
265  } else {
266  data(i,j,k,n) = data(i-1,j-1,k-1,n);
267  }
268  }
269  }
270  // Edges
271  // xlo, ylo, z-valid
272  {
273  int i = lo.x-1;
274  int j = lo.y-1;
275  for (int k = lo.z; k <= hi.z; ++k) {
276  if ( mask(i,j,k) == crsecell ) {
277  if ( ( mask(i+1,j,k) == finecell ) ||
278  ( mask(i,j+1,k) == finecell ) ||
279  ( mask(i,j,k-1) == finecell ) ||
280  ( mask(i,j,k+1) == finecell ) ) {
281  data(i,j,k,n) = ( Real(mask(i+1,j,k)) * data(i+1,j,k,n)
282  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
283  + Real(mask(i,j,k-1)) * data(i,j,k-1,n)
284  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
285  / Real( mask(i+1,j,k) + mask(i,j+1,k) + mask(i,j,k-1) + mask(i,j,k+1) );
286  } else {
287  data(i,j,k,n) = ( data(i+1,j+1,k,n)
288  + Real(mask(i+1,j,k-1)) * data(i+1,j,k-1,n)
289  + Real(mask(i+1,j,k+1)) * data(i+1,j,k+1,n)
290  + Real(mask(i,j+1,k-1)) * data(i,j+1,k-1,n)
291  + Real(mask(i,j+1,k+1)) * data(i,j+1,k+1,n) )
292  / Real( 1 + mask(i+1,j,k-1) + mask(i+1,j,k+1) + mask(i,j+1,k-1) + mask(i,j+1,k+1) );
293  }
294  }
295  }
296  }
297  // xlo, yhi, z-valid
298  {
299  int i = lo.x-1;
300  int j = hi.y+1;
301  for (int k = lo.z; k <= hi.z; ++k) {
302  if ( mask(i,j,k) == crsecell ) {
303  if ( ( mask(i+1,j,k) == finecell ) ||
304  ( mask(i,j-1,k) == finecell ) ||
305  ( mask(i,j,k-1) == finecell ) ||
306  ( mask(i,j,k+1) == finecell ) ) {
307  data(i,j,k,n) = ( Real(mask(i+1,j,k)) * data(i+1,j,k,n)
308  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
309  + Real(mask(i,j,k-1)) * data(i,j,k-1,n)
310  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
311  / Real( mask(i+1,j,k) + mask(i,j-1,k) + mask(i,j,k-1) + mask(i,j,k+1) );
312  } else {
313  data(i,j,k,n) = ( data(i+1,j-1,k,n)
314  + Real(mask(i+1,j,k-1)) * data(i+1,j,k-1,n)
315  + Real(mask(i+1,j,k+1)) * data(i+1,j,k+1,n)
316  + Real(mask(i,j-1,k-1)) * data(i,j-1,k-1,n)
317  + Real(mask(i,j-1,k+1)) * data(i,j-1,k+1,n) )
318  / Real( 1 + mask(i+1,j,k-1) + mask(i+1,j,k+1) + mask(i,j-1,k-1) + mask(i,j-1,k+1) );
319  }
320  }
321  }
322  }
323  // xhi, ylo, z-valid
324  {
325  int i = hi.x+1;
326  int j = lo.y-1;
327  for (int k = lo.z; k <= hi.z; ++k) {
328  if ( mask(i,j,k) == crsecell ) {
329  if ( ( mask(i-1,j,k) == finecell ) ||
330  ( mask(i,j+1,k) == finecell ) ||
331  ( mask(i,j,k-1) == finecell ) ||
332  ( mask(i,j,k+1) == finecell ) ) {
333  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
334  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
335  + Real(mask(i,j,k-1)) * data(i,j,k-1,n)
336  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
337  / Real( mask(i-1,j,k) + mask(i,j+1,k) + mask(i,j,k-1) + mask(i,j,k+1) );
338  } else {
339  data(i,j,k,n) = ( data(i-1,j+1,k,n)
340  + Real(mask(i-1,j,k-1)) * data(i-1,j,k-1,n)
341  + Real(mask(i-1,j,k+1)) * data(i-1,j,k+1,n)
342  + Real(mask(i,j+1,k-1)) * data(i,j+1,k-1,n)
343  + Real(mask(i,j+1,k+1)) * data(i,j+1,k+1,n) )
344  / Real( 1 + mask(i-1,j,k-1) + mask(i-1,j,k+1) + mask(i,j+1,k-1) + mask(i,j+1,k+1) );
345  }
346  }
347  }
348  }
349  // xhi, yhi, z-valid
350  {
351  int i = hi.x+1;
352  int j = hi.y+1;
353  for (int k = lo.z; k <= hi.z; ++k) {
354  if ( mask(i,j,k) == crsecell ) {
355  if ( ( mask(i-1,j,k) == finecell ) ||
356  ( mask(i,j-1,k) == finecell ) ||
357  ( mask(i,j,k-1) == finecell ) ||
358  ( mask(i,j,k+1) == finecell ) ) {
359  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
360  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
361  + Real(mask(i,j,k-1)) * data(i,j,k-1,n)
362  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
363  / Real( mask(i-1,j,k) + mask(i,j-1,k) + mask(i,j,k-1) + mask(i,j,k+1) );
364  } else {
365  data(i,j,k,n) = ( data(i-1,j-1,k,n)
366  + Real(mask(i-1,j,k-1)) * data(i-1,j,k-1,n)
367  + Real(mask(i-1,j,k+1)) * data(i-1,j,k+1,n)
368  + Real(mask(i,j-1,k-1)) * data(i,j-1,k-1,n)
369  + Real(mask(i,j-1,k+1)) * data(i,j-1,k+1,n) )
370  / Real( 1 + mask(i-1,j,k-1) + mask(i-1,j,k+1) + mask(i,j-1,k-1) + mask(i,j-1,k+1) );
371  }
372  }
373  }
374  }
375  // xlo, y-valid, zlo
376  {
377  int i = lo.x-1;
378  int k = lo.z-1;
379  for (int j = lo.y; j <= hi.y; ++j) {
380  if ( mask(i,j,k) == crsecell ) {
381  if ( ( mask(i+1,j,k) == finecell ) ||
382  ( mask(i,j-1,k) == finecell ) ||
383  ( mask(i,j+1,k) == finecell ) ||
384  ( mask(i,j,k+1) == finecell ) ) {
385  data(i,j,k,n) = ( Real(mask(i+1,j,k)) * data(i+1,j,k,n)
386  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
387  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
388  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
389  / Real( mask(i+1,j,k) + mask(i,j-1,k) + mask(i,j+1,k) + mask(i,j,k+1) );
390  } else {
391  data(i,j,k,n) = ( Real(mask(i+1,j-1,k)) * data(i+1,j-1,k,n)
392  + Real(mask(i+1,j+1,k)) * data(i+1,j+1,k,n)
393  + data(i+1,j,k+1,n)
394  + Real(mask(i,j-1,k+1)) * data(i,j-1,k+1,n)
395  + Real(mask(i,j+1,k+1)) * data(i,j+1,k+1,n) )
396  / Real( mask(i+1,j-1,k) + mask(i+1,j+1,k) + 1 + mask(i,j-1,k+1) + mask(i,j+1,k+1) );
397  }
398  }
399  }
400  }
401  // xlo, y-valid, zhi
402  {
403  int i = lo.x-1;
404  int k = hi.z+1;
405  for (int j = lo.y; j <= hi.y; ++j) {
406  if ( mask(i,j,k) == crsecell ) {
407  if ( ( mask(i+1,j,k) == finecell ) ||
408  ( mask(i,j-1,k) == finecell ) ||
409  ( mask(i,j+1,k) == finecell ) ||
410  ( mask(i,j,k-1) == finecell ) ) {
411  data(i,j,k,n) = ( Real(mask(i+1,j,k)) * data(i+1,j,k,n)
412  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
413  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
414  + Real(mask(i,j,k-1)) * data(i,j,k-1,n) )
415  / Real( mask(i+1,j,k) + mask(i,j-1,k) + mask(i,j+1,k) + mask(i,j,k-1) );
416  } else {
417  data(i,j,k,n) = ( Real(mask(i+1,j-1,k)) * data(i+1,j-1,k,n)
418  + Real(mask(i+1,j+1,k)) * data(i+1,j+1,k,n)
419  + data(i+1,j,k-1,n)
420  + Real(mask(i,j-1,k-1)) * data(i,j-1,k-1,n)
421  + Real(mask(i,j+1,k-1)) * data(i,j+1,k-1,n) )
422  / Real( mask(i+1,j-1,k) + mask(i+1,j+1,k) + 1 + mask(i,j-1,k-1) + mask(i,j+1,k-1) );
423  }
424  }
425  }
426  }
427  // xhi, y-valid, zlo
428  {
429  int i = hi.x+1;
430  int k = lo.z-1;
431  for (int j = lo.y; j <= hi.y; ++j) {
432  if ( mask(i,j,k) == crsecell ) {
433  if ( ( mask(i-1,j,k) == finecell ) ||
434  ( mask(i,j-1,k) == finecell ) ||
435  ( mask(i,j+1,k) == finecell ) ||
436  ( mask(i,j,k+1) == finecell ) ) {
437  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
438  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
439  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
440  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
441  / Real( mask(i-1,j,k) + mask(i,j-1,k) + mask(i,j+1,k) + mask(i,j,k+1) );
442  } else {
443  data(i,j,k,n) = ( Real(mask(i-1,j-1,k)) * data(i-1,j-1,k,n)
444  + Real(mask(i-1,j+1,k)) * data(i-1,j+1,k,n)
445  + data(i-1,j,k+1,n)
446  + Real(mask(i,j-1,k+1)) * data(i,j-1,k+1,n)
447  + Real(mask(i,j+1,k+1)) * data(i,j+1,k+1,n) )
448  / Real( mask(i-1,j-1,k) + mask(i-1,j+1,k) + 1 + mask(i,j-1,k+1) + mask(i,j+1,k+1) );
449  }
450  }
451  }
452  }
453  // xhi, y-valid, zhi
454  {
455  int i = hi.x+1;
456  int k = hi.z+1;
457  for (int j = lo.y; j <= hi.y; ++j) {
458  if ( mask(i,j,k) == crsecell ) {
459  if ( ( mask(i-1,j,k) == finecell ) ||
460  ( mask(i,j-1,k) == finecell ) ||
461  ( mask(i,j+1,k) == finecell ) ||
462  ( mask(i,j,k-1) == finecell ) ) {
463  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
464  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
465  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
466  + Real(mask(i,j,k-1)) * data(i,j,k-1,n) )
467  / Real( mask(i-1,j,k) + mask(i,j-1,k) + mask(i,j+1,k) + mask(i,j,k-1) );
468  } else {
469  data(i,j,k,n) = ( Real(mask(i-1,j-1,k)) * data(i-1,j-1,k,n)
470  + Real(mask(i-1,j+1,k)) * data(i-1,j+1,k,n)
471  + data(i-1,j,k-1,n)
472  + Real(mask(i,j-1,k-1)) * data(i,j-1,k-1,n)
473  + Real(mask(i,j+1,k-1)) * data(i,j+1,k-1,n) )
474  / Real( mask(i-1,j-1,k) + mask(i-1,j+1,k) + 1 + mask(i,j-1,k-1) + mask(i,j+1,k-1) );
475  }
476  }
477  }
478  }
479  // x-valid, ylo, zlo
480  {
481  int j = lo.y-1;
482  int k = lo.z-1;
483  for (int i = lo.x; i <= hi.x; ++i) {
484  if ( mask(i,j,k) == crsecell ) {
485  if ( ( mask(i-1,j,k) == finecell ) ||
486  ( mask(i+1,j,k) == finecell ) ||
487  ( mask(i,j+1,k) == finecell ) ||
488  ( mask(i,j,k+1) == finecell ) ) {
489  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
490  + Real(mask(i+1,j,k)) * data(i+1,j,k,n)
491  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
492  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
493  / Real( mask(i-1,j,k) + mask(i+1,j,k) + mask(i,j+1,k) + mask(i,j,k+1) );
494  } else {
495  data(i,j,k,n) = ( Real(mask(i-1,j+1,k)) * data(i-1,j+1,k,n)
496  + Real(mask(i+1,j+1,k)) * data(i+1,j+1,k,n)
497  + Real(mask(i-1,j,k+1)) * data(i-1,j,k+1,n)
498  + Real(mask(i+1,j,k+1)) * data(i+1,j,k+1,n)
499  + data(i,j+1,k+1,n) )
500  / Real( mask(i-1,j+1,k) + mask(i+1,j+1,k) + mask(i-1,j,k+1) + mask(i+1,j,k+1) + 1 );
501  }
502  }
503  }
504  }
505  // x-valid, ylo, zhi
506  {
507  int j = lo.y-1;
508  int k = hi.z+1;
509  for (int i = lo.x; i <= hi.x; ++i) {
510  if ( mask(i,j,k) == crsecell ) {
511  if ( ( mask(i-1,j,k) == finecell ) ||
512  ( mask(i+1,j,k) == finecell ) ||
513  ( mask(i,j+1,k) == finecell ) ||
514  ( mask(i,j,k-1) == finecell ) ) {
515  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
516  + Real(mask(i+1,j,k)) * data(i+1,j,k,n)
517  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
518  + Real(mask(i,j,k-1)) * data(i,j,k-1,n) )
519  / Real( mask(i-1,j,k) + mask(i+1,j,k) + mask(i,j+1,k) + mask(i,j,k-1) );
520  } else {
521  data(i,j,k,n) = ( Real(mask(i-1,j+1,k)) * data(i-1,j+1,k,n)
522  + Real(mask(i+1,j+1,k)) * data(i+1,j+1,k,n)
523  + Real(mask(i-1,j,k-1)) * data(i-1,j,k-1,n)
524  + Real(mask(i+1,j,k-1)) * data(i+1,j,k-1,n)
525  + data(i,j+1,k-1,n) )
526  / Real( mask(i-1,j+1,k) + mask(i+1,j+1,k) + mask(i-1,j,k-1) + mask(i+1,j,k-1) + 1 );
527  }
528  }
529  }
530  }
531  // x-valid, yhi, zlo
532  {
533  int j = hi.y+1;
534  int k = lo.z-1;
535  for (int i = lo.x; i <= hi.x; ++i) {
536  if ( mask(i,j,k) == crsecell ) {
537  if ( ( mask(i-1,j,k) == finecell ) ||
538  ( mask(i+1,j,k) == finecell ) ||
539  ( mask(i,j-1,k) == finecell ) ||
540  ( mask(i,j,k+1) == finecell ) ) {
541  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
542  + Real(mask(i+1,j,k)) * data(i+1,j,k,n)
543  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
544  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
545  / Real( mask(i-1,j,k) + mask(i+1,j,k) + mask(i,j-1,k) + mask(i,j,k+1) );
546  } else {
547  data(i,j,k,n) = ( Real(mask(i-1,j-1,k)) * data(i-1,j-1,k,n)
548  + Real(mask(i+1,j-1,k)) * data(i+1,j-1,k,n)
549  + Real(mask(i-1,j,k+1)) * data(i-1,j,k+1,n)
550  + Real(mask(i+1,j,k+1)) * data(i+1,j,k+1,n)
551  + data(i,j-1,k+1,n) )
552  / Real( mask(i-1,j-1,k) + mask(i+1,j-1,k) + mask(i-1,j,k+1) + mask(i+1,j,k+1) + 1 );
553  }
554  }
555  }
556  }
557  // x-valid, yhi, zhi
558  {
559  int j = hi.y+1;
560  int k = hi.z+1;
561  for (int i = lo.x; i <= hi.x; ++i) {
562  if ( mask(i,j,k) == crsecell ) {
563  if ( ( mask(i-1,j,k) == finecell ) ||
564  ( mask(i+1,j,k) == finecell ) ||
565  ( mask(i,j-1,k) == finecell ) ||
566  ( mask(i,j,k-1) == finecell ) ) {
567  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
568  + Real(mask(i+1,j,k)) * data(i+1,j,k,n)
569  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
570  + Real(mask(i,j,k-1)) * data(i,j,k-1,n) )
571  / Real( mask(i-1,j,k) + mask(i+1,j,k) + mask(i,j-1,k) + mask(i,j,k-1) );
572  } else {
573  data(i,j,k,n) = ( Real(mask(i-1,j-1,k)) * data(i-1,j-1,k,n)
574  + Real(mask(i+1,j-1,k)) * data(i+1,j-1,k,n)
575  + Real(mask(i-1,j,k-1)) * data(i-1,j,k-1,n)
576  + Real(mask(i+1,j,k-1)) * data(i+1,j,k-1,n)
577  + data(i,j-1,k-1,n) )
578  / Real( mask(i-1,j-1,k) + mask(i+1,j-1,k) + mask(i-1,j,k-1) + mask(i+1,j,k-1) + 1 );
579  }
580  }
581  }
582  }
583  // Faces
584  // xlo, y-valid, z-valid
585  {
586  int i = lo.x-1;
587  for (int k = lo.z; k <= hi.z; ++k) {
588  for (int j = lo.y; j <= hi.y; ++j) {
589  if ( mask(i,j,k) == crsecell ) {
590  data(i,j,k,n) = ( data(i+1,j,k,n)
591  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
592  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
593  + Real(mask(i,j,k-1)) * data(i,j,k-1,n)
594  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
595  / Real( 1 + mask(i,j-1,k) + mask(i,j+1,k) + mask(i,j,k-1) + mask(i,j,k+1) );
596  }
597  }
598  }
599  }
600  // xhi, y-valid, z-valid
601  {
602  int i = hi.x+1;
603  for (int k = lo.z; k <= hi.z; ++k) {
604  for (int j = lo.y; j <= hi.y; ++j) {
605  if ( mask(i,j,k) == crsecell ) {
606  data(i,j,k,n) = ( data(i-1,j,k,n)
607  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
608  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
609  + Real(mask(i,j,k-1)) * data(i,j,k-1,n)
610  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
611  / Real( 1 + mask(i,j-1,k) + mask(i,j+1,k) + mask(i,j,k-1) + mask(i,j,k+1) );
612  }
613  }
614  }
615  }
616  // x-valid, ylo, z-valid
617  {
618  int j = lo.y-1;
619  for (int k = lo.z; k <= hi.z; ++k) {
620  for (int i = lo.x; i <= hi.x; ++i) {
621  if ( mask(i,j,k) == crsecell ) {
622  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
623  + Real(mask(i+1,j,k)) * data(i+1,j,k,n)
624  + data(i,j+1,k,n)
625  + Real(mask(i,j,k-1)) * data(i,j,k-1,n)
626  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
627  / Real( mask(i-1,j,k) + mask(i+1,j,k) + 1 + mask(i,j,k-1) + mask(i,j,k+1) );
628  }
629  }
630  }
631  }
632  // x-valid, yhi, z-valid
633  {
634  int j = hi.y+1;
635  for (int k = lo.z; k <= hi.z; ++k) {
636  for (int i = lo.x; i <= hi.x; ++i) {
637  if ( mask(i,j,k) == crsecell ) {
638  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
639  + Real(mask(i+1,j,k)) * data(i+1,j,k,n)
640  + data(i,j-1,k,n)
641  + Real(mask(i,j,k-1)) * data(i,j,k-1,n)
642  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
643  / Real( mask(i-1,j,k) + mask(i+1,j,k) + 1 + mask(i,j,k-1) + mask(i,j,k+1) );
644  }
645  }
646  }
647  }
648  // x-valid, y-valid, zlo
649  {
650  int k = lo.z-1;
651  for (int j = lo.y; j <= hi.y; ++j) {
652  for (int i = lo.x; i <= hi.x; ++i) {
653  if ( mask(i,j,k) == crsecell ) {
654  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
655  + Real(mask(i+1,j,k)) * data(i+1,j,k,n)
656  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
657  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
658  + data(i,j,k+1,n) )
659  / Real( mask(i-1,j,k) + mask(i+1,j,k) + mask(i,j-1,k) + mask(i,j+1,k) + 1 );
660  }
661  }
662  }
663  }
664  // x-valid, y-valid, zhi
665  {
666  int k = hi.z+1;
667  for (int j = lo.y; j <= hi.y; ++j) {
668  for (int i = lo.x; i <= hi.x; ++i) {
669  if ( mask(i,j,k) == crsecell ) {
670  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
671  + Real(mask(i+1,j,k)) * data(i+1,j,k,n)
672  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
673  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
674  + data(i,j,k-1,n) )
675  / Real( mask(i-1,j,k) + mask(i+1,j,k) + mask(i,j-1,k) + mask(i,j+1,k) + 1 );
676  }
677  }
678  }
679  }
680  }
681 }
682 
685 void
686 amrex_first_order_extrap_gpu(int i, int j, int k, int n,
687  amrex::Box const& bx,
689  amrex::Array4<amrex::Real> const& data) noexcept
690 {
691  using namespace amrex::literals;
692 
693  constexpr int finecell = 1;
694  constexpr int crsecell = 0;
695 
696  const auto lo = amrex::lbound(bx);
697  const auto hi = amrex::ubound(bx);
698 
699  if ( mask(i,j,k) == crsecell ) {
700  // Corners
701  // xlo, ylo, zlo
702  if ( ( i == lo.x-1) && ( j == lo.y-1 ) && ( k == lo.z-1 ) ) {
703  if ( ( mask(i+1,j,k) == finecell ) ||
704  ( mask(i,j+1,k) == finecell ) ||
705  ( mask(i,j,k+1) == finecell ) ) {
706  data(i,j,k,n) = ( Real(mask(i+1,j,k)) * data(i+1,j,k,n)
707  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
708  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
709  / Real( mask(i+1,j,k) + mask(i,j+1,k) + mask(i,j,k+1) );
710  } else if ( ( mask(i+1,j+1,k) == finecell ) ||
711  ( mask(i+1,j,k+1) == finecell ) ||
712  ( mask(i,j+1,k+1) == finecell ) ) {
713  data(i,j,k,n) = ( Real(mask(i+1,j+1,k)) * data(i+1,j+1,k,n)
714  + Real(mask(i+1,j,k+1)) * data(i+1,j,k+1,n)
715  + Real(mask(i,j+1,k+1)) * data(i,j+1,k+1,n) )
716  / Real( mask(i+1,j+1,k) + mask(i+1,j,k+1) + mask(i,j+1,k+1) );
717  } else {
718  data(i,j,k,n) = data(i+1,j+1,k+1,n);
719  }
720  // xlo, ylo, zhi
721  } else if ( ( i == lo.x-1) && ( j == lo.y-1 ) && ( k == hi.z+1 ) ) {
722  if ( ( mask(i+1,j,k) == finecell ) ||
723  ( mask(i,j+1,k) == finecell ) ||
724  ( mask(i,j,k-1) == finecell ) ) {
725  data(i,j,k,n) = ( Real(mask(i+1,j,k)) * data(i+1,j,k,n)
726  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
727  + Real(mask(i,j,k-1)) * data(i,j,k-1,n) )
728  / Real( mask(i+1,j,k) + mask(i,j+1,k) + mask(i,j,k-1) );
729  } else if ( ( mask(i+1,j+1,k) == finecell ) ||
730  ( mask(i+1,j,k-1) == finecell ) ||
731  ( mask(i,j+1,k-1) == finecell ) ) {
732  data(i,j,k,n) = ( Real(mask(i+1,j+1,k)) * data(i+1,j+1,k,n)
733  + Real(mask(i+1,j,k-1)) * data(i+1,j,k-1,n)
734  + Real(mask(i,j+1,k-1)) * data(i,j+1,k-1,n) )
735  / Real( mask(i+1,j+1,k) + mask(i+1,j,k-1) + mask(i,j+1,k-1) );
736  } else {
737  data(i,j,k,n) = data(i+1,j+1,k-1,n);
738  }
739  // xlo, yhi, zlo
740  } else if ( ( i == lo.x-1) && ( j == hi.y+1 ) && ( k == lo.z-1 ) ) {
741  if ( ( mask(i+1,j,k) == finecell ) ||
742  ( mask(i,j-1,k) == finecell ) ||
743  ( mask(i,j,k+1) == finecell ) ) {
744  data(i,j,k,n) = ( Real(mask(i+1,j,k)) * data(i+1,j,k,n)
745  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
746  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
747  / Real( mask(i+1,j,k) + mask(i,j-1,k) + mask(i,j,k+1) );
748  } else if ( ( mask(i+1,j-1,k) == finecell ) ||
749  ( mask(i+1,j,k+1) == finecell ) ||
750  ( mask(i,j-1,k+1) == finecell ) ) {
751  data(i,j,k,n) = ( Real(mask(i+1,j-1,k)) * data(i+1,j-1,k,n)
752  + Real(mask(i+1,j,k+1)) * data(i+1,j,k+1,n)
753  + Real(mask(i,j-1,k+1)) * data(i,j-1,k+1,n) )
754  / Real( mask(i+1,j-1,k) + mask(i+1,j,k+1) + mask(i,j-1,k+1) );
755  } else {
756  data(i,j,k,n) = data(i+1,j-1,k+1,n);
757  }
758  // xlo, yhi, zhi
759  } else if ( ( i == lo.x-1) && ( j == hi.y+1 ) && ( k == hi.z+1 ) ) {
760  if ( ( mask(i+1,j,k) == finecell ) ||
761  ( mask(i,j-1,k) == finecell ) ||
762  ( mask(i,j,k-1) == finecell ) ) {
763  data(i,j,k,n) = ( Real(mask(i+1,j,k)) * data(i+1,j,k,n)
764  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
765  + Real(mask(i,j,k-1)) * data(i,j,k-1,n) )
766  / Real( mask(i+1,j,k) + mask(i,j-1,k) + mask(i,j,k-1) );
767  } else if ( ( mask(i+1,j-1,k) == finecell ) ||
768  ( mask(i+1,j,k-1) == finecell ) ||
769  ( mask(i,j-1,k-1) == finecell ) ) {
770  data(i,j,k,n) = ( Real(mask(i+1,j-1,k)) * data(i+1,j-1,k,n)
771  + Real(mask(i+1,j,k-1)) * data(i+1,j,k-1,n)
772  + Real(mask(i,j-1,k-1)) * data(i,j-1,k-1,n) )
773  / Real( mask(i+1,j-1,k) + mask(i+1,j,k-1) + mask(i,j-1,k-1) );
774  } else {
775  data(i,j,k,n) = data(i+1,j-1,k-1,n);
776  }
777  // xhi, ylo, zlo
778  } else if ( ( i == hi.x+1) && ( j == lo.y-1 ) && ( k == lo.z-1 ) ) {
779  if ( ( mask(i-1,j,k) == finecell ) ||
780  ( mask(i,j+1,k) == finecell ) ||
781  ( mask(i,j,k+1) == finecell ) ) {
782  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
783  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
784  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
785  / Real( mask(i-1,j,k) + mask(i,j+1,k) + mask(i,j,k+1) );
786  } else if ( ( mask(i-1,j+1,k) == finecell ) ||
787  ( mask(i-1,j,k+1) == finecell ) ||
788  ( mask(i,j+1,k+1) == finecell ) ) {
789  data(i,j,k,n) = ( Real(mask(i-1,j+1,k)) * data(i-1,j+1,k,n)
790  + Real(mask(i-1,j,k+1)) * data(i-1,j,k+1,n)
791  + Real(mask(i,j+1,k+1)) * data(i,j+1,k+1,n) )
792  / Real( mask(i-1,j+1,k) + mask(i-1,j,k+1) + mask(i,j+1,k+1) );
793  } else {
794  data(i,j,k,n) = data(i-1,j+1,k+1,n);
795  }
796  // xhi, ylo, zhi
797  } else if ( ( i == hi.x+1) && ( j == lo.y-1 ) && ( k == hi.z+1 ) ) {
798  if ( ( mask(i-1,j,k) == finecell ) ||
799  ( mask(i,j+1,k) == finecell ) ||
800  ( mask(i,j,k-1) == finecell ) ) {
801  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
802  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
803  + Real(mask(i,j,k-1)) * data(i,j,k-1,n) )
804  / Real( mask(i-1,j,k) + mask(i,j+1,k) + mask(i,j,k-1) );
805  } else if ( ( mask(i-1,j+1,k) == finecell ) ||
806  ( mask(i-1,j,k-1) == finecell ) ||
807  ( mask(i,j+1,k-1) == finecell ) ) {
808  data(i,j,k,n) = ( Real(mask(i-1,j+1,k)) * data(i-1,j+1,k,n)
809  + Real(mask(i-1,j,k-1)) * data(i-1,j,k-1,n)
810  + Real(mask(i,j+1,k-1)) * data(i,j+1,k-1,n) )
811  / Real( mask(i-1,j+1,k) + mask(i-1,j,k-1) + mask(i,j+1,k-1) );
812  } else {
813  data(i,j,k,n) = data(i-1,j+1,k-1,n);
814  }
815  // xhi, yhi, zlo
816  } else if ( ( i == hi.x+1) && ( j == hi.y+1 ) && ( k == lo.z-1 ) ) {
817  if ( ( mask(i-1,j,k) == finecell ) ||
818  ( mask(i,j-1,k) == finecell ) ||
819  ( mask(i,j,k+1) == finecell ) ) {
820  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
821  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
822  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
823  / Real( mask(i-1,j,k) + mask(i,j-1,k) + mask(i,j,k+1) );
824  } else if ( ( mask(i-1,j-1,k) == finecell ) ||
825  ( mask(i-1,j,k+1) == finecell ) ||
826  ( mask(i,j-1,k+1) == finecell ) ) {
827  data(i,j,k,n) = ( Real(mask(i-1,j-1,k)) * data(i-1,j-1,k,n)
828  + Real(mask(i-1,j,k+1)) * data(i-1,j,k+1,n)
829  + Real(mask(i,j-1,k+1)) * data(i,j-1,k+1,n) )
830  / Real( mask(i-1,j-1,k) + mask(i-1,j,k+1) + mask(i,j-1,k+1) );
831  } else {
832  data(i,j,k,n) = data(i-1,j-1,k+1,n);
833  }
834  // xhi, yhi, zhi
835  } else if ( ( i == hi.x+1) && ( j == hi.y+1 ) && ( k == hi.z+1 ) ) {
836  if ( ( mask(i-1,j,k) == finecell ) ||
837  ( mask(i,j-1,k) == finecell ) ||
838  ( mask(i,j,k-1) == finecell ) ) {
839  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
840  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
841  + Real(mask(i,j,k-1)) * data(i,j,k-1,n) )
842  / Real( mask(i-1,j,k) + mask(i,j-1,k) + mask(i,j,k-1) );
843  } else if ( ( mask(i-1,j-1,k) == finecell ) ||
844  ( mask(i-1,j,k-1) == finecell ) ||
845  ( mask(i,j-1,k-1) == finecell ) ) {
846  data(i,j,k,n) = ( Real(mask(i-1,j-1,k)) * data(i-1,j-1,k,n)
847  + Real(mask(i-1,j,k-1)) * data(i-1,j,k-1,n)
848  + Real(mask(i,j-1,k-1)) * data(i,j-1,k-1,n) )
849  / Real( mask(i-1,j-1,k) + mask(i-1,j,k-1) + mask(i,j-1,k-1) );
850  } else {
851  data(i,j,k,n) = data(i-1,j-1,k-1,n);
852  }
853  // Edges
854  // xlo, ylo, z-valid
855  } else if ( ( i == lo.x-1) && ( j == lo.y-1 ) &&
856  ( k >= lo.z ) && ( k <= hi.z ) ) {
857  if ( ( mask(i+1,j,k) == finecell ) ||
858  ( mask(i,j+1,k) == finecell ) ||
859  ( mask(i,j,k-1) == finecell ) ||
860  ( mask(i,j,k+1) == finecell ) ) {
861  data(i,j,k,n) = ( Real(mask(i+1,j,k)) * data(i+1,j,k,n)
862  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
863  + Real(mask(i,j,k-1)) * data(i,j,k-1,n)
864  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
865  / Real( mask(i+1,j,k) + mask(i,j+1,k) + mask(i,j,k-1) + mask(i,j,k+1) );
866  } else {
867  data(i,j,k,n) = ( data(i+1,j+1,k,n)
868  + Real(mask(i+1,j,k-1)) * data(i+1,j,k-1,n)
869  + Real(mask(i+1,j,k+1)) * data(i+1,j,k+1,n)
870  + Real(mask(i,j+1,k-1)) * data(i,j+1,k-1,n)
871  + Real(mask(i,j+1,k+1)) * data(i,j+1,k+1,n) )
872  / Real( 1 + mask(i+1,j,k-1) + mask(i+1,j,k+1) + mask(i,j+1,k-1) + mask(i,j+1,k+1) );
873  }
874  // xlo, yhi, z-valid
875  } else if ( ( i == lo.x-1) && ( j == hi.y+1 ) &&
876  ( k >= lo.z ) && ( k <= hi.z ) ) {
877  if ( ( mask(i+1,j,k) == finecell ) ||
878  ( mask(i,j-1,k) == finecell ) ||
879  ( mask(i,j,k-1) == finecell ) ||
880  ( mask(i,j,k+1) == finecell ) ) {
881  data(i,j,k,n) = ( Real(mask(i+1,j,k)) * data(i+1,j,k,n)
882  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
883  + Real(mask(i,j,k-1)) * data(i,j,k-1,n)
884  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
885  / Real( mask(i+1,j,k) + mask(i,j-1,k) + mask(i,j,k-1) + mask(i,j,k+1) );
886  } else {
887  data(i,j,k,n) = ( data(i+1,j-1,k,n)
888  + Real(mask(i+1,j,k-1)) * data(i+1,j,k-1,n)
889  + Real(mask(i+1,j,k+1)) * data(i+1,j,k+1,n)
890  + Real(mask(i,j-1,k-1)) * data(i,j-1,k-1,n)
891  + Real(mask(i,j-1,k+1)) * data(i,j-1,k+1,n) )
892  / Real( 1 + mask(i+1,j,k-1) + mask(i+1,j,k+1) + mask(i,j-1,k-1) + mask(i,j-1,k+1) );
893  }
894  // xhi, ylo, z-valid
895  } else if ( ( i == hi.x+1) && ( j == lo.y-1 ) &&
896  ( k >= lo.z ) && ( k <= hi.z ) ) {
897  if ( ( mask(i-1,j,k) == finecell ) ||
898  ( mask(i,j+1,k) == finecell ) ||
899  ( mask(i,j,k-1) == finecell ) ||
900  ( mask(i,j,k+1) == finecell ) ) {
901  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
902  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
903  + Real(mask(i,j,k-1)) * data(i,j,k-1,n)
904  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
905  / Real( mask(i-1,j,k) + mask(i,j+1,k) + mask(i,j,k-1) + mask(i,j,k+1) );
906  } else {
907  data(i,j,k,n) = ( data(i-1,j+1,k,n)
908  + Real(mask(i-1,j,k-1)) * data(i-1,j,k-1,n)
909  + Real(mask(i-1,j,k+1)) * data(i-1,j,k+1,n)
910  + Real(mask(i,j+1,k-1)) * data(i,j+1,k-1,n)
911  + Real(mask(i,j+1,k+1)) * data(i,j+1,k+1,n) )
912  / Real( 1 + mask(i-1,j,k-1) + mask(i-1,j,k+1) + mask(i,j+1,k-1) + mask(i,j+1,k+1) );
913  }
914  // xhi, yhi, z-valid
915  } else if ( ( i == hi.x+1) && ( j == hi.y+1 ) &&
916  ( k >= lo.z ) && ( k <= hi.z ) ) {
917  if ( ( mask(i-1,j,k) == finecell ) ||
918  ( mask(i,j-1,k) == finecell ) ||
919  ( mask(i,j,k-1) == finecell ) ||
920  ( mask(i,j,k+1) == finecell ) ) {
921  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
922  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
923  + Real(mask(i,j,k-1)) * data(i,j,k-1,n)
924  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
925  / Real( mask(i-1,j,k) + mask(i,j-1,k) + mask(i,j,k-1) + mask(i,j,k+1) );
926  } else {
927  data(i,j,k,n) = ( data(i-1,j-1,k,n)
928  + Real(mask(i-1,j,k-1)) * data(i-1,j,k-1,n)
929  + Real(mask(i-1,j,k+1)) * data(i-1,j,k+1,n)
930  + Real(mask(i,j-1,k-1)) * data(i,j-1,k-1,n)
931  + Real(mask(i,j-1,k+1)) * data(i,j-1,k+1,n) )
932  / Real( 1 + mask(i-1,j,k-1) + mask(i-1,j,k+1) + mask(i,j-1,k-1) + mask(i,j-1,k+1) );
933  }
934  // xlo, y-valid, zlo
935  } else if ( ( i == lo.x-1) && ( j >= lo.y ) &&
936  ( j <= hi.y ) && ( k == lo.z-1 ) ) {
937  if ( ( mask(i+1,j,k) == finecell ) ||
938  ( mask(i,j-1,k) == finecell ) ||
939  ( mask(i,j+1,k) == finecell ) ||
940  ( mask(i,j,k+1) == finecell ) ) {
941  data(i,j,k,n) = ( Real(mask(i+1,j,k)) * data(i+1,j,k,n)
942  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
943  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
944  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
945  / Real( mask(i+1,j,k) + mask(i,j-1,k) + mask(i,j+1,k) + mask(i,j,k+1) );
946  } else {
947  data(i,j,k,n) = ( Real(mask(i+1,j-1,k)) * data(i+1,j-1,k,n)
948  + Real(mask(i+1,j+1,k)) * data(i+1,j+1,k,n)
949  + data(i+1,j,k+1,n)
950  + Real(mask(i,j-1,k+1)) * data(i,j-1,k+1,n)
951  + Real(mask(i,j+1,k+1)) * data(i,j+1,k+1,n) )
952  / Real( mask(i+1,j-1,k) + mask(i+1,j+1,k) + 1 + mask(i,j-1,k+1) + mask(i,j+1,k+1) );
953  }
954  // xlo, y-valid, zhi
955  } else if ( ( i == lo.x-1) && ( j >= lo.y ) &&
956  ( j <= hi.y ) && ( k == hi.z+1 ) ) {
957  if ( ( mask(i+1,j,k) == finecell ) ||
958  ( mask(i,j-1,k) == finecell ) ||
959  ( mask(i,j+1,k) == finecell ) ||
960  ( mask(i,j,k-1) == finecell ) ) {
961  data(i,j,k,n) = ( Real(mask(i+1,j,k)) * data(i+1,j,k,n)
962  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
963  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
964  + Real(mask(i,j,k-1)) * data(i,j,k-1,n) )
965  / Real( mask(i+1,j,k) + mask(i,j-1,k) + mask(i,j+1,k) + mask(i,j,k-1) );
966  } else {
967  data(i,j,k,n) = ( Real(mask(i+1,j-1,k)) * data(i+1,j-1,k,n)
968  + Real(mask(i+1,j+1,k)) * data(i+1,j+1,k,n)
969  + data(i+1,j,k-1,n)
970  + Real(mask(i,j-1,k-1)) * data(i,j-1,k-1,n)
971  + Real(mask(i,j+1,k-1)) * data(i,j+1,k-1,n) )
972  / Real( mask(i+1,j-1,k) + mask(i+1,j+1,k) + 1 + mask(i,j-1,k-1) + mask(i,j+1,k-1) );
973  }
974  // xhi, y-valid, zlo
975  } else if ( ( i == hi.x+1) && ( j >= lo.y ) &&
976  ( j <= hi.y ) && ( k == lo.z-1 ) ) {
977  if ( ( mask(i-1,j,k) == finecell ) ||
978  ( mask(i,j-1,k) == finecell ) ||
979  ( mask(i,j+1,k) == finecell ) ||
980  ( mask(i,j,k+1) == finecell ) ) {
981  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
982  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
983  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
984  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
985  / Real( mask(i-1,j,k) + mask(i,j-1,k) + mask(i,j+1,k) + mask(i,j,k+1) );
986  } else {
987  data(i,j,k,n) = ( Real(mask(i-1,j-1,k)) * data(i-1,j-1,k,n)
988  + Real(mask(i-1,j+1,k)) * data(i-1,j+1,k,n)
989  + data(i-1,j,k+1,n)
990  + Real(mask(i,j-1,k+1)) * data(i,j-1,k+1,n)
991  + Real(mask(i,j+1,k+1)) * data(i,j+1,k+1,n) )
992  / Real( mask(i-1,j-1,k) + mask(i-1,j+1,k) + 1 + mask(i,j-1,k+1) + mask(i,j+1,k+1) );
993  }
994  // xhi, y-valid, zhi
995  } else if ( ( i == hi.x+1) && ( j >= lo.y ) &&
996  ( j <= hi.y ) && ( k == hi.z+1 ) ) {
997  if ( ( mask(i-1,j,k) == finecell ) ||
998  ( mask(i,j-1,k) == finecell ) ||
999  ( mask(i,j+1,k) == finecell ) ||
1000  ( mask(i,j,k-1) == finecell ) ) {
1001  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
1002  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
1003  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
1004  + Real(mask(i,j,k-1)) * data(i,j,k-1,n) )
1005  / Real( mask(i-1,j,k) + mask(i,j-1,k) + mask(i,j+1,k) + mask(i,j,k-1) );
1006  } else {
1007  data(i,j,k,n) = ( Real(mask(i-1,j-1,k)) * data(i-1,j-1,k,n)
1008  + Real(mask(i-1,j+1,k)) * data(i-1,j+1,k,n)
1009  + data(i-1,j,k-1,n)
1010  + Real(mask(i,j-1,k-1)) * data(i,j-1,k-1,n)
1011  + Real(mask(i,j+1,k-1)) * data(i,j+1,k-1,n) )
1012  / Real( mask(i-1,j-1,k) + mask(i-1,j+1,k) + 1 + mask(i,j-1,k-1) + mask(i,j+1,k-1) );
1013  }
1014  // x-valid, ylo, zlo
1015  } else if ( ( i >= lo.x) && ( i <= hi.x ) &&
1016  ( j == lo.y-1 ) && ( k == lo.z-1 ) ) {
1017  if ( ( mask(i-1,j,k) == finecell ) ||
1018  ( mask(i+1,j,k) == finecell ) ||
1019  ( mask(i,j+1,k) == finecell ) ||
1020  ( mask(i,j,k+1) == finecell ) ) {
1021  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
1022  + Real(mask(i+1,j,k)) * data(i+1,j,k,n)
1023  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
1024  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
1025  / Real( mask(i-1,j,k) + mask(i+1,j,k) + mask(i,j+1,k) + mask(i,j,k+1) );
1026  } else {
1027  data(i,j,k,n) = ( Real(mask(i-1,j+1,k)) * data(i-1,j+1,k,n)
1028  + Real(mask(i+1,j+1,k)) * data(i+1,j+1,k,n)
1029  + Real(mask(i-1,j,k+1)) * data(i-1,j,k+1,n)
1030  + Real(mask(i+1,j,k+1)) * data(i+1,j,k+1,n)
1031  + data(i,j+1,k+1,n) )
1032  / Real( mask(i-1,j+1,k) + mask(i+1,j+1,k) + mask(i-1,j,k+1) + mask(i+1,j,k+1) + 1 );
1033  }
1034  // x-valid, ylo, zhi
1035  } else if ( ( i >= lo.x) && ( i <= hi.x ) &&
1036  ( j == lo.y-1 ) && ( k == hi.z+1 ) ) {
1037  if ( ( mask(i-1,j,k) == finecell ) ||
1038  ( mask(i+1,j,k) == finecell ) ||
1039  ( mask(i,j+1,k) == finecell ) ||
1040  ( mask(i,j,k-1) == finecell ) ) {
1041  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
1042  + Real(mask(i+1,j,k)) * data(i+1,j,k,n)
1043  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
1044  + Real(mask(i,j,k-1)) * data(i,j,k-1,n) )
1045  / Real( mask(i-1,j,k) + mask(i+1,j,k) + mask(i,j+1,k) + mask(i,j,k-1) );
1046  } else {
1047  data(i,j,k,n) = ( Real(mask(i-1,j+1,k)) * data(i-1,j+1,k,n)
1048  + Real(mask(i+1,j+1,k)) * data(i+1,j+1,k,n)
1049  + Real(mask(i-1,j,k-1)) * data(i-1,j,k-1,n)
1050  + Real(mask(i+1,j,k-1)) * data(i+1,j,k-1,n)
1051  + data(i,j+1,k-1,n) )
1052  / Real( mask(i-1,j+1,k) + mask(i+1,j+1,k) + mask(i-1,j,k-1) + mask(i+1,j,k-1) + 1 );
1053  }
1054  // x-valid, yhi, zlo
1055  } else if ( ( i >= lo.x) && ( i <= hi.x ) &&
1056  ( j == hi.y+1 ) && ( k == lo.z-1 ) ) {
1057  if ( ( mask(i-1,j,k) == finecell ) ||
1058  ( mask(i+1,j,k) == finecell ) ||
1059  ( mask(i,j-1,k) == finecell ) ||
1060  ( mask(i,j,k+1) == finecell ) ) {
1061  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
1062  + Real(mask(i+1,j,k)) * data(i+1,j,k,n)
1063  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
1064  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
1065  / Real( mask(i-1,j,k) + mask(i+1,j,k) + mask(i,j-1,k) + mask(i,j,k+1) );
1066  } else {
1067  data(i,j,k,n) = ( Real(mask(i-1,j-1,k)) * data(i-1,j-1,k,n)
1068  + Real(mask(i+1,j-1,k)) * data(i+1,j-1,k,n)
1069  + Real(mask(i-1,j,k+1)) * data(i-1,j,k+1,n)
1070  + Real(mask(i+1,j,k+1)) * data(i+1,j,k+1,n)
1071  + data(i,j-1,k+1,n) )
1072  / Real( mask(i-1,j-1,k) + mask(i+1,j-1,k) + mask(i-1,j,k+1) + mask(i+1,j,k+1) + 1 );
1073  }
1074  // x-valid, yhi, zhi
1075  } else if ( ( i >= lo.x) && ( i <= hi.x ) &&
1076  ( j == hi.y+1 ) && ( k == hi.z+1 ) ) {
1077  if ( ( mask(i-1,j,k) == finecell ) ||
1078  ( mask(i+1,j,k) == finecell ) ||
1079  ( mask(i,j-1,k) == finecell ) ||
1080  ( mask(i,j,k-1) == finecell ) ) {
1081  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
1082  + Real(mask(i+1,j,k)) * data(i+1,j,k,n)
1083  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
1084  + Real(mask(i,j,k-1)) * data(i,j,k-1,n) )
1085  / Real( mask(i-1,j,k) + mask(i+1,j,k) + mask(i,j-1,k) + mask(i,j,k-1) );
1086  } else {
1087  data(i,j,k,n) = ( Real(mask(i-1,j-1,k)) * data(i-1,j-1,k,n)
1088  + Real(mask(i+1,j-1,k)) * data(i+1,j-1,k,n)
1089  + Real(mask(i-1,j,k-1)) * data(i-1,j,k-1,n)
1090  + Real(mask(i+1,j,k-1)) * data(i+1,j,k-1,n)
1091  + data(i,j-1,k-1,n) )
1092  / Real( mask(i-1,j-1,k) + mask(i+1,j-1,k) + mask(i-1,j,k-1) + mask(i+1,j,k-1) + 1 );
1093  }
1094  // Faces
1095  // xlo, y-valid, z-valid
1096  } else if ( ( i == lo.x-1) &&
1097  ( j >= lo.y ) && ( j <= hi.y ) &&
1098  ( k >= lo.z ) && ( k <= hi.z ) ) {
1099  data(i,j,k,n) = ( data(i+1,j,k,n)
1100  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
1101  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
1102  + Real(mask(i,j,k-1)) * data(i,j,k-1,n)
1103  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
1104  / Real( 1 + mask(i,j-1,k) + mask(i,j+1,k) + mask(i,j,k-1) + mask(i,j,k+1) );
1105  // xhi, y-valid, z-valid
1106  } else if ( ( i == hi.x+1) &&
1107  ( j >= lo.y ) && ( j <= hi.y ) &&
1108  ( k >= lo.z ) && ( k <= hi.z ) ) {
1109  data(i,j,k,n) = ( data(i-1,j,k,n)
1110  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
1111  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
1112  + Real(mask(i,j,k-1)) * data(i,j,k-1,n)
1113  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
1114  / Real( 1 + mask(i,j-1,k) + mask(i,j+1,k) + mask(i,j,k-1) + mask(i,j,k+1) );
1115  // x-valid, ylo, z-valid
1116  } else if ( ( i >= lo.x ) && ( i <= hi.x ) &&
1117  ( j == lo.y-1) &&
1118  ( k >= lo.z ) && ( k <= hi.z ) ) {
1119  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
1120  + Real(mask(i+1,j,k)) * data(i+1,j,k,n)
1121  + data(i,j+1,k,n)
1122  + Real(mask(i,j,k-1)) * data(i,j,k-1,n)
1123  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
1124  / Real( mask(i-1,j,k) + mask(i+1,j,k) + 1 + mask(i,j,k-1) + mask(i,j,k+1) );
1125  // x-valid, yhi, z-valid
1126  } else if ( ( i >= lo.x ) && ( i <= hi.x ) &&
1127  ( j == hi.y+1) &&
1128  ( k >= lo.z ) && ( k <= hi.z ) ) {
1129  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
1130  + Real(mask(i+1,j,k)) * data(i+1,j,k,n)
1131  + data(i,j-1,k,n)
1132  + Real(mask(i,j,k-1)) * data(i,j,k-1,n)
1133  + Real(mask(i,j,k+1)) * data(i,j,k+1,n) )
1134  / Real( mask(i-1,j,k) + mask(i+1,j,k) + 1 + mask(i,j,k-1) + mask(i,j,k+1) );
1135  // x-valid, y-valid, zlo
1136  } else if ( ( i >= lo.x ) && ( i <= hi.x ) &&
1137  ( j >= lo.y ) && ( j <= hi.y ) &&
1138  ( k == lo.z-1) ) {
1139  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
1140  + Real(mask(i+1,j,k)) * data(i+1,j,k,n)
1141  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
1142  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
1143  + data(i,j,k+1,n) )
1144  / Real( mask(i-1,j,k) + mask(i+1,j,k) + mask(i,j-1,k) + mask(i,j+1,k) + 1 );
1145  // x-valid, y-valid, zhi
1146  } else if ( ( i >= lo.x ) && ( i <= hi.x ) &&
1147  ( j >= lo.y ) && ( j <= hi.y ) &&
1148  ( k == hi.z+1) ) {
1149  data(i,j,k,n) = ( Real(mask(i-1,j,k)) * data(i-1,j,k,n)
1150  + Real(mask(i+1,j,k)) * data(i+1,j,k,n)
1151  + Real(mask(i,j-1,k)) * data(i,j-1,k,n)
1152  + Real(mask(i,j+1,k)) * data(i,j+1,k,n)
1153  + data(i,j,k-1,n) )
1154  / Real( mask(i-1,j,k) + mask(i+1,j,k) + mask(i,j-1,k) + mask(i,j+1,k) + 1 );
1155  }
1156  }
1157 }
1158 
1159 }
1160 #endif
#define AMREX_FORCE_INLINE
Definition: AMReX_Extension.H:119
#define AMREX_GPU_HOST_DEVICE
Definition: AMReX_GpuQualifiers.H:20
#define AMREX_GPU_HOST
Definition: AMReX_GpuQualifiers.H:17
Array4< int const > mask
Definition: AMReX_InterpFaceRegister.cpp:93
Definition: AMReX_Amr.cpp:49
int nComp(FabArrayBase const &fa)
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Dim3 ubound(Array4< T > const &a) noexcept
Definition: AMReX_Array4.H:315
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Dim3 lbound(Array4< T > const &a) noexcept
Definition: AMReX_Array4.H:308
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void amrex_first_order_extrap_gpu(int i, int j, int k, int n, amrex::Box const &bx, amrex::Array4< const int > const &mask, amrex::Array4< amrex::Real > const &data) noexcept
Definition: AMReX_extrapolater_1D_K.H:36
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void amrex_first_order_extrap_cpu(amrex::Box const &bx, int nComp, amrex::Array4< const int > const &mask, amrex::Array4< amrex::Real > const &data) noexcept
Definition: AMReX_extrapolater_1D_K.H:10
Definition: AMReX_Array4.H:61