1 #ifndef AMREX_MLEB_LEASTSQUARES_K_H_
2 #define AMREX_MLEB_LEASTSQUARES_K_H_
3 #include <AMReX_Config.H>
18 for (
int ii = 0; ii < neq; ii++)
22 for (
int jj = ii; jj < neq; jj++)
26 for (
int kk = ii-1; kk >= 0; kk--)
28 sum1 = sum1 - aa(ii,kk)*aa(jj,kk);
33 if (sum1 <= Real(0.0))
42 aa(jj,ii) = sum1 / p[ii];
44 aa(jj,ii) = Real(0.0);
50 for (
int ii = 0; ii < neq; ii++)
52 for (
int jj = ii+1; jj < neq; jj++)
54 aa(ii,jj) = Real(0.0);
55 aa(ii,jj) = aa(jj,ii);
70 for (
int irow = 0; irow < neq; irow++) {
71 for (
int icol = 0; icol < neq; icol++) {
72 AtA(irow,icol) = Real(0.0);
76 for (
int irow = 0; irow < 36; irow++)
78 AtA(0,0) += Amatrix(irow,0)*Amatrix(irow,0);
79 AtA(0,1) += Amatrix(irow,0)*Amatrix(irow,1);
80 AtA(0,2) += Amatrix(irow,0)*Amatrix(irow,2);
81 AtA(0,3) += Amatrix(irow,0)*Amatrix(irow,3);
82 AtA(0,4) += Amatrix(irow,0)*Amatrix(irow,4);
83 AtA(0,5) += Amatrix(irow,0)*Amatrix(irow,5);
84 AtA(0,6) += Amatrix(irow,0)*Amatrix(irow,6);
85 AtA(0,7) += Amatrix(irow,0)*Amatrix(irow,7);
86 AtA(0,8) += Amatrix(irow,0)*Amatrix(irow,8);
87 AtA(0,9) += Amatrix(irow,0)*Amatrix(irow,9);
89 AtA(1,1) += Amatrix(irow,1)*Amatrix(irow,1);
90 AtA(1,2) += Amatrix(irow,1)*Amatrix(irow,2);
91 AtA(1,3) += Amatrix(irow,1)*Amatrix(irow,3);
92 AtA(1,4) += Amatrix(irow,1)*Amatrix(irow,4);
93 AtA(1,5) += Amatrix(irow,1)*Amatrix(irow,5);
94 AtA(1,6) += Amatrix(irow,1)*Amatrix(irow,6);
95 AtA(1,7) += Amatrix(irow,1)*Amatrix(irow,7);
96 AtA(1,8) += Amatrix(irow,1)*Amatrix(irow,8);
97 AtA(1,9) += Amatrix(irow,1)*Amatrix(irow,9);
99 AtA(2,2) += Amatrix(irow,2)*Amatrix(irow,2);
100 AtA(2,3) += Amatrix(irow,2)*Amatrix(irow,3);
101 AtA(2,4) += Amatrix(irow,2)*Amatrix(irow,4);
102 AtA(2,5) += Amatrix(irow,2)*Amatrix(irow,5);
103 AtA(2,6) += Amatrix(irow,2)*Amatrix(irow,6);
104 AtA(2,7) += Amatrix(irow,2)*Amatrix(irow,7);
105 AtA(2,8) += Amatrix(irow,2)*Amatrix(irow,8);
106 AtA(2,9) += Amatrix(irow,2)*Amatrix(irow,9);
108 AtA(3,3) += Amatrix(irow,3)*Amatrix(irow,3);
109 AtA(3,4) += Amatrix(irow,3)*Amatrix(irow,4);
110 AtA(3,5) += Amatrix(irow,3)*Amatrix(irow,5);
111 AtA(3,6) += Amatrix(irow,3)*Amatrix(irow,6);
112 AtA(3,7) += Amatrix(irow,3)*Amatrix(irow,7);
113 AtA(3,8) += Amatrix(irow,3)*Amatrix(irow,8);
114 AtA(3,9) += Amatrix(irow,3)*Amatrix(irow,9);
116 AtA(4,4) += Amatrix(irow,4)*Amatrix(irow,4);
117 AtA(4,5) += Amatrix(irow,4)*Amatrix(irow,5);
118 AtA(4,6) += Amatrix(irow,4)*Amatrix(irow,6);
119 AtA(4,7) += Amatrix(irow,4)*Amatrix(irow,7);
120 AtA(4,8) += Amatrix(irow,4)*Amatrix(irow,8);
121 AtA(4,9) += Amatrix(irow,4)*Amatrix(irow,9);
123 AtA(5,5) += Amatrix(irow,5)*Amatrix(irow,5);
124 AtA(5,6) += Amatrix(irow,5)*Amatrix(irow,6);
125 AtA(5,7) += Amatrix(irow,5)*Amatrix(irow,7);
126 AtA(5,8) += Amatrix(irow,5)*Amatrix(irow,8);
127 AtA(5,9) += Amatrix(irow,5)*Amatrix(irow,9);
129 AtA(6,6) += Amatrix(irow,6)*Amatrix(irow,6);
130 AtA(6,7) += Amatrix(irow,6)*Amatrix(irow,7);
131 AtA(6,8) += Amatrix(irow,6)*Amatrix(irow,8);
132 AtA(6,9) += Amatrix(irow,6)*Amatrix(irow,9);
134 AtA(7,7) += Amatrix(irow,7)*Amatrix(irow,7);
135 AtA(7,8) += Amatrix(irow,7)*Amatrix(irow,8);
136 AtA(7,9) += Amatrix(irow,7)*Amatrix(irow,9);
138 AtA(8,8) += Amatrix(irow,8)*Amatrix(irow,8);
139 AtA(8,9) += Amatrix(irow,8)*Amatrix(irow,9);
141 AtA(9,9) += Amatrix(irow,9)*Amatrix(irow,9);
144 for (
int irow = 0; irow < neq-1; irow++) {
145 for (
int icol = irow+1; icol < neq; icol++) {
146 AtA(icol,irow) = AtA(irow,icol);
153 b(0) =
b(0) / AtA(0,0);
158 for (
int ii = 1; ii < neq; ii++)
162 for (
int jj = 0; jj < ii; jj++) {
163 b(ii) =
b(ii) - AtA(ii,jj)*
b(jj);
166 b(ii) =
b(ii) / AtA(ii,ii);
174 if (AtA(neq-1,neq-1) > 0.) {
175 b(neq-1) =
b(neq-1) / AtA(neq-1,neq-1);
177 b(neq-1) = Real(0.0);
180 for (
int ii = neq-2; ii >= 0; ii--)
184 for (
int jj = ii+1; jj < neq; jj++) {
185 b(ii) =
b(ii) - AtA(ii,jj)*
b(jj);
188 b(ii) =
b(ii) / AtA(ii,ii);
205 for (
int irow = 0; irow < neq; irow++) {
206 for (
int icol = 0; icol < neq; icol++) {
207 AtA(irow,icol) = Real(0.0);
211 for (
int irow = 0; irow < 54; irow++)
213 AtA(0,0) += Amatrix(irow,0)*Amatrix(irow,0);
214 AtA(0,1) += Amatrix(irow,0)*Amatrix(irow,1);
215 AtA(0,2) += Amatrix(irow,0)*Amatrix(irow,2);
216 AtA(0,3) += Amatrix(irow,0)*Amatrix(irow,3);
217 AtA(0,4) += Amatrix(irow,0)*Amatrix(irow,4);
218 AtA(0,5) += Amatrix(irow,0)*Amatrix(irow,5);
219 AtA(0,6) += Amatrix(irow,0)*Amatrix(irow,6);
220 AtA(0,7) += Amatrix(irow,0)*Amatrix(irow,7);
221 AtA(0,8) += Amatrix(irow,0)*Amatrix(irow,8);
222 AtA(0,9) += Amatrix(irow,0)*Amatrix(irow,9);
224 AtA(1,1) += Amatrix(irow,1)*Amatrix(irow,1);
225 AtA(1,2) += Amatrix(irow,1)*Amatrix(irow,2);
226 AtA(1,3) += Amatrix(irow,1)*Amatrix(irow,3);
227 AtA(1,4) += Amatrix(irow,1)*Amatrix(irow,4);
228 AtA(1,5) += Amatrix(irow,1)*Amatrix(irow,5);
229 AtA(1,6) += Amatrix(irow,1)*Amatrix(irow,6);
230 AtA(1,7) += Amatrix(irow,1)*Amatrix(irow,7);
231 AtA(1,8) += Amatrix(irow,1)*Amatrix(irow,8);
232 AtA(1,9) += Amatrix(irow,1)*Amatrix(irow,9);
234 AtA(2,2) += Amatrix(irow,2)*Amatrix(irow,2);
235 AtA(2,3) += Amatrix(irow,2)*Amatrix(irow,3);
236 AtA(2,4) += Amatrix(irow,2)*Amatrix(irow,4);
237 AtA(2,5) += Amatrix(irow,2)*Amatrix(irow,5);
238 AtA(2,6) += Amatrix(irow,2)*Amatrix(irow,6);
239 AtA(2,7) += Amatrix(irow,2)*Amatrix(irow,7);
240 AtA(2,8) += Amatrix(irow,2)*Amatrix(irow,8);
241 AtA(2,9) += Amatrix(irow,2)*Amatrix(irow,9);
243 AtA(3,3) += Amatrix(irow,3)*Amatrix(irow,3);
244 AtA(3,4) += Amatrix(irow,3)*Amatrix(irow,4);
245 AtA(3,5) += Amatrix(irow,3)*Amatrix(irow,5);
246 AtA(3,6) += Amatrix(irow,3)*Amatrix(irow,6);
247 AtA(3,7) += Amatrix(irow,3)*Amatrix(irow,7);
248 AtA(3,8) += Amatrix(irow,3)*Amatrix(irow,8);
249 AtA(3,9) += Amatrix(irow,3)*Amatrix(irow,9);
251 AtA(4,4) += Amatrix(irow,4)*Amatrix(irow,4);
252 AtA(4,5) += Amatrix(irow,4)*Amatrix(irow,5);
253 AtA(4,6) += Amatrix(irow,4)*Amatrix(irow,6);
254 AtA(4,7) += Amatrix(irow,4)*Amatrix(irow,7);
255 AtA(4,8) += Amatrix(irow,4)*Amatrix(irow,8);
256 AtA(4,9) += Amatrix(irow,4)*Amatrix(irow,9);
258 AtA(5,5) += Amatrix(irow,5)*Amatrix(irow,5);
259 AtA(5,6) += Amatrix(irow,5)*Amatrix(irow,6);
260 AtA(5,7) += Amatrix(irow,5)*Amatrix(irow,7);
261 AtA(5,8) += Amatrix(irow,5)*Amatrix(irow,8);
262 AtA(5,9) += Amatrix(irow,5)*Amatrix(irow,9);
264 AtA(6,6) += Amatrix(irow,6)*Amatrix(irow,6);
265 AtA(6,7) += Amatrix(irow,6)*Amatrix(irow,7);
266 AtA(6,8) += Amatrix(irow,6)*Amatrix(irow,8);
267 AtA(6,9) += Amatrix(irow,6)*Amatrix(irow,9);
269 AtA(7,7) += Amatrix(irow,7)*Amatrix(irow,7);
270 AtA(7,8) += Amatrix(irow,7)*Amatrix(irow,8);
271 AtA(7,9) += Amatrix(irow,7)*Amatrix(irow,9);
273 AtA(8,8) += Amatrix(irow,8)*Amatrix(irow,8);
274 AtA(8,9) += Amatrix(irow,8)*Amatrix(irow,9);
276 AtA(9,9) += Amatrix(irow,9)*Amatrix(irow,9);
279 for (
int irow = 0; irow < neq-1; irow++) {
280 for (
int icol = irow+1; icol < neq; icol++) {
281 AtA(icol,irow) = AtA(irow,icol);
288 b(0) =
b(0) / AtA(0,0);
293 for (
int ii = 1; ii < neq; ii++)
297 for (
int jj = 0; jj < ii; jj++) {
298 b(ii) =
b(ii) - AtA(ii,jj)*
b(jj);
301 b(ii) =
b(ii) / AtA(ii,ii);
309 if (AtA(neq-1,neq-1) > 0.) {
310 b(neq-1) =
b(neq-1) / AtA(neq-1,neq-1);
312 b(neq-1) = Real(0.0);
315 for (
int ii = neq-2; ii >= 0; ii--)
319 for (
int jj = ii+1; jj < neq; jj++) {
320 b(ii) =
b(ii) - AtA(ii,jj)*
b(jj);
323 b(ii) =
b(ii) / AtA(ii,ii);
339 Real& yloc_on_xface, Real& zloc_on_xface,
340 bool is_eb_dirichlet,
bool is_eb_inhomog)
348 for (
int irow = 0; irow < 36; irow++) {
349 for (
int icol = 0; icol < 10; icol++) {
350 Amatrix(irow,icol) = Real(0.0);
355 for (
int ii = i-1; ii <= i; ii++) {
356 for (
int kk = k-1; kk <= k+1; kk++) {
357 for (
int jj = j-1; jj <= j+1; jj++) {
358 if (!flag(ii,jj,kk).isCovered())
360 int a_ind = (jj-(j-1)) + 3*(kk-(k-1)) + 9*(ii-(i-1));
362 Real x_off =
static_cast<Real
>(ii-i) + Real(0.5);
363 Real y_off =
static_cast<Real
>(jj-j);
364 Real z_off =
static_cast<Real
>(kk-k);
366 Amatrix(a_ind,0) = Real(1.0);
367 Amatrix(a_ind,1) = x_off + ccent(ii,jj,kk,0);
368 Amatrix(a_ind,2) = y_off + ccent(ii,jj,kk,1) - yloc_on_xface;
369 Amatrix(a_ind,3) = z_off + ccent(ii,jj,kk,2) - zloc_on_xface;
371 if (!flag(ii,jj,kk).isRegular())
373 Amatrix(a_ind+18,0) = Real(1.0);
374 Amatrix(a_ind+18,1) = x_off + bcent(ii,jj,kk,0);
375 Amatrix(a_ind+18,2) = y_off + bcent(ii,jj,kk,1) - yloc_on_xface;
376 Amatrix(a_ind+18,3) = z_off + bcent(ii,jj,kk,2) - zloc_on_xface;
384 for (
int irow = 0; irow < 36; irow++)
386 Amatrix(irow,4) = Amatrix(irow,1) * Amatrix(irow,1);
387 Amatrix(irow,5) = Amatrix(irow,1) * Amatrix(irow,2);
388 Amatrix(irow,6) = Amatrix(irow,2) * Amatrix(irow,2);
389 Amatrix(irow,7) = Amatrix(irow,1) * Amatrix(irow,3);
390 Amatrix(irow,8) = Amatrix(irow,2) * Amatrix(irow,3);
391 Amatrix(irow,9) = Amatrix(irow,3) * Amatrix(irow,3);
395 for (
int irow = 0; irow < 10; irow++)
399 for (
int ii = i-1; ii <= i; ii++) {
400 for (
int kk = k-1; kk <= k+1; kk++) {
401 for (
int jj = j-1; jj <= j+1; jj++) {
402 if (!flag(ii,jj,kk).isCovered())
404 int a_ind = (jj-(j-1)) + 3*(kk-(k-1)) + 9*(ii-(i-1));
406 rhs(irow) += Amatrix(a_ind,irow)* phi(ii,jj,kk,n);
408 if (flag(ii,jj,kk).isSingleValued() && is_eb_inhomog) {
409 rhs(irow) += Amatrix(a_ind+18,irow)*phieb(ii,jj,kk,n);
429 Real& xloc_on_yface, Real& zloc_on_yface,
430 bool is_eb_dirichlet,
bool is_eb_inhomog)
438 for (
int irow = 0; irow < 36; irow++) {
439 for (
int icol = 0; icol < 10; icol++) {
440 Amatrix(irow,icol) = Real(0.0);
445 for (
int jj = j-1; jj <= j; jj++) {
446 for (
int kk = k-1; kk <= k+1; kk++) {
447 for (
int ii = i-1; ii <= i+1; ii++) {
448 if (!flag(ii,jj,kk).isCovered())
450 int a_ind = (ii-(i-1)) + 3*(kk-(k-1)) + 9*(jj-(j-1));
452 Real x_off =
static_cast<Real
>(ii-i);
453 Real y_off =
static_cast<Real
>(jj-j) + Real(0.5);
454 Real z_off =
static_cast<Real
>(kk-k);
456 Amatrix(a_ind,0) = Real(1.0);
457 Amatrix(a_ind,1) = x_off + ccent(ii,jj,kk,0) - xloc_on_yface;
458 Amatrix(a_ind,2) = y_off + ccent(ii,jj,kk,1);
459 Amatrix(a_ind,3) = z_off + ccent(ii,jj,kk,2) - zloc_on_yface;
461 if (!flag(ii,jj,kk).isRegular())
463 Amatrix(a_ind+18,0) = Real(1.0);
464 Amatrix(a_ind+18,1) = x_off + bcent(ii,jj,kk,0) - xloc_on_yface;
465 Amatrix(a_ind+18,2) = y_off + bcent(ii,jj,kk,1);
466 Amatrix(a_ind+18,3) = z_off + bcent(ii,jj,kk,2) - zloc_on_yface;
474 for (
int irow = 0; irow < 36; irow++)
476 Amatrix(irow,4) = Amatrix(irow,1) * Amatrix(irow,1);
477 Amatrix(irow,5) = Amatrix(irow,1) * Amatrix(irow,2);
478 Amatrix(irow,6) = Amatrix(irow,2) * Amatrix(irow,2);
479 Amatrix(irow,7) = Amatrix(irow,1) * Amatrix(irow,3);
480 Amatrix(irow,8) = Amatrix(irow,2) * Amatrix(irow,3);
481 Amatrix(irow,9) = Amatrix(irow,3) * Amatrix(irow,3);
485 for (
int irow = 0; irow < 10; irow++)
489 for (
int jj = j-1; jj <= j; jj++) {
490 for (
int kk = k-1; kk <= k+1; kk++) {
491 for (
int ii = i-1; ii <= i+1; ii++) {
492 if (!flag(ii,jj,kk).isCovered())
494 int a_ind = (ii-(i-1)) + 3*(kk-(k-1)) + 9*(jj-(j-1));
496 rhs(irow) += Amatrix(a_ind,irow)* phi(ii,jj,kk,n);
498 if (flag(ii,jj,kk).isSingleValued() && is_eb_inhomog) {
499 rhs(irow) += Amatrix(a_ind+18,irow)*phieb(ii,jj,kk,n);
519 Real& xloc_on_zface, Real& yloc_on_zface,
520 bool is_eb_dirichlet,
bool is_eb_inhomog)
528 for (
int irow = 0; irow < 36; irow++) {
529 for (
int icol = 0; icol < 10; icol++) {
530 Amatrix(irow,icol) = Real(0.0);
535 for (
int kk = k-1; kk <= k; kk++)
537 for (
int jj = j-1; jj <= j+1; jj++) {
538 for (
int ii = i-1; ii <= i+1; ii++)
540 if (!flag(ii,jj,kk).isCovered())
542 int a_ind = (ii-(i-1)) + 3*(jj-(j-1)) + 9*(kk-(k-1));
544 Real x_off =
static_cast<Real
>(ii-i);
545 Real y_off =
static_cast<Real
>(jj-j);
546 Real z_off =
static_cast<Real
>(kk-k) + Real(0.5);
548 Amatrix(a_ind,0) = Real(1.0);
549 Amatrix(a_ind,1) = x_off + ccent(ii,jj,kk,0) - xloc_on_zface;
550 Amatrix(a_ind,2) = y_off + ccent(ii,jj,kk,1) - yloc_on_zface;
551 Amatrix(a_ind,3) = z_off + ccent(ii,jj,kk,2);
553 if (!flag(ii,jj,kk).isRegular())
555 Amatrix(a_ind+18,0) = Real(1.0);
556 Amatrix(a_ind+18,1) = x_off + bcent(ii,jj,kk,0) - xloc_on_zface;
557 Amatrix(a_ind+18,2) = y_off + bcent(ii,jj,kk,1) - yloc_on_zface;
558 Amatrix(a_ind+18,3) = z_off + bcent(ii,jj,kk,2);
566 for (
int irow = 0; irow < 36; irow++)
568 Amatrix(irow,4) = Amatrix(irow,1) * Amatrix(irow,1);
569 Amatrix(irow,5) = Amatrix(irow,1) * Amatrix(irow,2);
570 Amatrix(irow,6) = Amatrix(irow,2) * Amatrix(irow,2);
571 Amatrix(irow,7) = Amatrix(irow,1) * Amatrix(irow,3);
572 Amatrix(irow,8) = Amatrix(irow,2) * Amatrix(irow,3);
573 Amatrix(irow,9) = Amatrix(irow,3) * Amatrix(irow,3);
577 for (
int irow = 0; irow < 10; irow++)
581 for (
int kk = k-1; kk <= k; kk++) {
582 for (
int jj = j-1; jj <= j+1; jj++) {
583 for (
int ii = i-1; ii <= i+1; ii++) {
584 if (!flag(ii,jj,kk).isCovered())
586 int a_ind = (ii-(i-1)) + 3*(jj-(j-1)) + 9*(kk-(k-1));
588 rhs(irow) += Amatrix(a_ind,irow)* phi(ii,jj,kk,n);
590 if (flag(ii,jj,kk).isSingleValued() && is_eb_inhomog) {
591 rhs(irow) += Amatrix(a_ind+18,irow)*phieb(ii,jj,kk,n);
611 Real& nrmx, Real& nrmy, Real& nrmz,
619 for (
int irow = 0; irow < 54; irow++) {
620 for (
int icol = 0; icol < 10; icol++) {
621 Amatrix(irow,icol) = Real(0.0);
626 for (
int kk = k-1; kk <= k+1; kk++) {
627 for (
int jj = j-1; jj <= j+1; jj++) {
628 for (
int ii = i-1; ii <= i+1; ii++)
630 if (!flag(ii,jj,kk).isCovered())
632 int a_ind = (ii-(i-1)) + 3*(jj-(j-1)) + 9*(kk-(k-1));
634 Real x_off =
static_cast<Real
>(ii-i) - bcent(i,j,k,0);
635 Real y_off =
static_cast<Real
>(jj-j) - bcent(i,j,k,1);
636 Real z_off =
static_cast<Real
>(kk-k) - bcent(i,j,k,2);
638 Amatrix(a_ind,0) = Real(1.0);
639 Amatrix(a_ind,1) = x_off + ccent(ii,jj,kk,0);
640 Amatrix(a_ind,2) = y_off + ccent(ii,jj,kk,1);
641 Amatrix(a_ind,3) = z_off + ccent(ii,jj,kk,2);
643 if (!flag(ii,jj,kk).isRegular())
645 Amatrix(a_ind+27,0) = Real(1.0);
646 Amatrix(a_ind+27,1) = x_off + bcent(ii,jj,kk,0);
647 Amatrix(a_ind+27,2) = y_off + bcent(ii,jj,kk,1);
648 Amatrix(a_ind+27,3) = z_off + bcent(ii,jj,kk,2);
656 for (
int irow = 0; irow < 54; irow++)
658 Amatrix(irow,4) = Amatrix(irow,1) * Amatrix(irow,1);
659 Amatrix(irow,5) = Amatrix(irow,1) * Amatrix(irow,2);
660 Amatrix(irow,6) = Amatrix(irow,2) * Amatrix(irow,2);
661 Amatrix(irow,7) = Amatrix(irow,1) * Amatrix(irow,3);
662 Amatrix(irow,8) = Amatrix(irow,2) * Amatrix(irow,3);
663 Amatrix(irow,9) = Amatrix(irow,3) * Amatrix(irow,3);
667 for (
int irow = 0; irow < 10; irow++)
671 for (
int kk = k-1; kk <= k+1; kk++) {
672 for (
int jj = j-1; jj <= j+1; jj++) {
673 for (
int ii = i-1; ii <= i+1; ii++) {
674 if (!flag(ii,jj,kk).isCovered())
676 int a_ind = (ii-(i-1)) + 3*(jj-(j-1)) + 9*(kk-(k-1));
678 rhs(irow) += Amatrix(a_ind,irow)* phi(ii,jj,kk,n);
680 if (flag(ii,jj,kk).isSingleValued() && is_eb_inhomog) {
681 rhs(irow) += Amatrix(a_ind+27,irow)*phieb(ii,jj,kk,n);
691 Real dphidn = rhs(1)*nrmx + rhs(2)*nrmy + rhs(3)*nrmz;
703 Real& yloc_on_xface, Real& zloc_on_xface,
704 bool is_eb_dirichlet,
bool is_eb_inhomog,
705 const bool on_x_face,
const int domlo_x,
const int domhi_x,
706 const bool on_y_face,
const int domlo_y,
const int domhi_y,
707 const bool on_z_face,
const int domlo_z,
const int domhi_z)
716 for (
int irow = 0; irow < 54; irow++) {
717 for (
int icol = 0; icol < 10; icol++) {
718 Amatrix(irow,icol) = Real(0.0);
722 const int im = (i > domhi_x) ? 2 : 1;
723 const int ip = 2 - im;
726 for (
int ii = i-im; ii <= i+ip; ii++) {
727 for (
int kk = k-1; kk <= k+1; kk++) {
728 for (
int jj = j-1; jj <= j+1; jj++)
732 if (((on_x_face && ii < domlo_x) && (on_y_face && jj < domlo_y)) ||
733 ((on_x_face && ii < domlo_x) && (on_y_face && jj > domhi_y)) ||
734 ((on_x_face && ii > domhi_x) && (on_y_face && jj < domlo_y)) ||
735 ((on_x_face && ii > domhi_x) && (on_y_face && jj > domhi_y)) ||
736 ((on_y_face && jj < domlo_y) && (on_z_face && kk < domlo_z)) ||
737 ((on_y_face && jj < domlo_y) && (on_z_face && kk > domhi_z)) ||
738 ((on_y_face && jj > domhi_y) && (on_z_face && kk < domlo_z)) ||
739 ((on_y_face && jj > domhi_y) && (on_z_face && kk > domhi_z)) ||
740 ((on_x_face && ii < domlo_x) && (on_z_face && kk < domlo_z)) ||
741 ((on_x_face && ii < domlo_x) && (on_z_face && kk > domhi_z)) ||
742 ((on_x_face && ii > domhi_x) && (on_z_face && kk < domlo_z)) ||
743 ((on_x_face && ii > domhi_x) && (on_z_face && kk > domhi_z))) {
751 if (!flag(ii,jj,kk).isCovered())
754 int a_ind = (jj-(j-1)) + 3*(kk-(k-1)) + 9*(ii-(i-im));
756 Real x_off =
static_cast<Real
>(ii-i) + Real(0.5);
757 Real y_off =
static_cast<Real
>(jj-j);
758 Real z_off =
static_cast<Real
>(kk-k);
761 if (ii < domlo_x && (vfrac(ii+1,jj,kk) != Real(1.0) || vfrac(ii+2,jj,kk) != Real(1.0)) ) {
764 if (ii > domhi_x && (vfrac(ii-1,jj,kk) != Real(1.0) || vfrac(ii-2,jj,kk) != Real(1.0))) {
770 if (jj < domlo_y && (vfrac(ii,jj+1,kk) != Real(1.0) || vfrac(ii,jj+2,kk) != Real(1.0)) ) {
773 if (jj > domhi_y && (vfrac(ii,jj-1,kk) != Real(1.0) || vfrac(ii,jj-2,kk) != Real(1.0)) ) {
779 if (kk < domlo_z && (vfrac(ii,jj,kk+1) != Real(1.0) || vfrac(ii,jj,kk+2) != Real(1.0)) ) {
782 if (kk > domhi_z && (vfrac(ii,jj,kk-1) != Real(1.0) || vfrac(ii,jj,kk-2) != Real(1.0)) ) {
787 Amatrix(a_ind,0) = Real(1.0);
788 Amatrix(a_ind,1) = x_off + ccent(ii,jj,kk,0);
789 Amatrix(a_ind,2) = y_off + ccent(ii,jj,kk,1) - yloc_on_xface;
790 Amatrix(a_ind,3) = z_off + ccent(ii,jj,kk,2) - zloc_on_xface;
794 if (flag(ii,jj,kk).isSingleValued() &&
795 domlo_x <= ii && ii <= domhi_x &&
796 domlo_y <= jj && jj <= domhi_y &&
797 domlo_z <= kk && kk <= domhi_z)
799 Amatrix(a_ind+27,0) = Real(1.0);
800 Amatrix(a_ind+27,1) = x_off + bcent(ii,jj,kk,0);
801 Amatrix(a_ind+27,2) = y_off + bcent(ii,jj,kk,1) - yloc_on_xface;
802 Amatrix(a_ind+27,3) = z_off + bcent(ii,jj,kk,2) - zloc_on_xface;
810 for (
int irow = 0; irow < 54; irow++)
812 Amatrix(irow,4) = Amatrix(irow,1) * Amatrix(irow,1);
813 Amatrix(irow,5) = Amatrix(irow,1) * Amatrix(irow,2);
814 Amatrix(irow,6) = Amatrix(irow,2) * Amatrix(irow,2);
815 Amatrix(irow,7) = Amatrix(irow,1) * Amatrix(irow,3);
816 Amatrix(irow,8) = Amatrix(irow,2) * Amatrix(irow,3);
817 Amatrix(irow,9) = Amatrix(irow,3) * Amatrix(irow,3);
821 for (
int irow = 0; irow < 10; irow++)
825 for (
int ii = i-im; ii <= i+ip; ii++) {
826 for (
int kk = k-1; kk <= k+1; kk++) {
827 for (
int jj = j-1; jj <= j+1; jj++) {
832 if (!flag(ii,jj,kk).isCovered())
834 int a_ind = (jj-(j-1)) + 3*(kk-(k-1)) + 9*(ii-(i-im));
835 Real phi_val = Amatrix(a_ind,0)*phi(ii,jj,kk,n);
837 rhs(irow) += Amatrix(a_ind,irow)* phi_val;
839 if (flag(ii,jj,kk).isSingleValued() && is_eb_inhomog && Amatrix(a_ind+27,irow) != Real(0.0)) {
840 rhs(irow) += Amatrix(a_ind+27,irow)*phieb(ii,jj,kk,n);
861 Real& xloc_on_yface, Real& zloc_on_yface,
862 bool is_eb_dirichlet,
bool is_eb_inhomog,
863 const bool on_x_face,
const int domlo_x,
const int domhi_x,
864 const bool on_y_face,
const int domlo_y,
const int domhi_y,
865 const bool on_z_face,
const int domlo_z,
const int domhi_z)
873 for (
int irow = 0; irow < 54; irow++) {
874 for (
int icol = 0; icol < 10; icol++) {
875 Amatrix(irow,icol) = Real(0.0);
879 const int jm = (j > domhi_y) ? 2 : 1;
880 const int jp = 2 - jm;
883 for (
int jj = j-jm; jj <= j+jp; jj++) {
884 for (
int kk = k-1; kk <= k+1; kk++) {
885 for (
int ii = i-1; ii <= i+1; ii++)
889 if (((on_x_face && ii < domlo_x) && (on_y_face && jj < domlo_y)) ||
890 ((on_x_face && ii < domlo_x) && (on_y_face && jj > domhi_y)) ||
891 ((on_x_face && ii > domhi_x) && (on_y_face && jj < domlo_y)) ||
892 ((on_x_face && ii > domhi_x) && (on_y_face && jj > domhi_y)) ||
893 ((on_y_face && jj < domlo_y) && (on_z_face && kk < domlo_z)) ||
894 ((on_y_face && jj < domlo_y) && (on_z_face && kk > domhi_z)) ||
895 ((on_y_face && jj > domhi_y) && (on_z_face && kk < domlo_z)) ||
896 ((on_y_face && jj > domhi_y) && (on_z_face && kk > domhi_z)) ||
897 ((on_x_face && ii < domlo_x) && (on_z_face && kk < domlo_z)) ||
898 ((on_x_face && ii < domlo_x) && (on_z_face && kk > domhi_z)) ||
899 ((on_x_face && ii > domhi_x) && (on_z_face && kk < domlo_z)) ||
900 ((on_x_face && ii > domhi_x) && (on_z_face && kk > domhi_z))) {
908 if (!flag(ii,jj,kk).isCovered())
910 int a_ind = (ii-(i-1)) + 3*(kk-(k-1)) + 9*(jj-(j-jm));
912 Real x_off =
static_cast<Real
>(ii-i);
913 Real y_off =
static_cast<Real
>(jj-j) + Real(0.5);
914 Real z_off =
static_cast<Real
>(kk-k);
917 if (ii < domlo_x && (vfrac(ii+1,jj,kk) != Real(1.0) || vfrac(ii+2,jj,kk) != Real(1.0)) ) {
920 if (ii > domhi_x && (vfrac(ii-1,jj,kk) != Real(1.0) || vfrac(ii-2,jj,kk) != Real(1.0))) {
926 if (jj < domlo_y && (vfrac(ii,jj+1,kk) != Real(1.0) || vfrac(ii,jj+2,kk) != Real(1.0)) ) {
929 if (jj > domhi_y && (vfrac(ii,jj-1,kk) != Real(1.0) || vfrac(ii,jj-2,kk) != Real(1.0)) ) {
935 if (kk < domlo_z && (vfrac(ii,jj,kk+1) != Real(1.0) || vfrac(ii,jj,kk+2) != Real(1.0)) ) {
938 if (kk > domhi_z && (vfrac(ii,jj,kk-1) != Real(1.0) || vfrac(ii,jj,kk-2) != Real(1.0)) ) {
943 Amatrix(a_ind,0) = Real(1.0);
944 Amatrix(a_ind,1) = x_off + ccent(ii,jj,kk,0) - xloc_on_yface;
945 Amatrix(a_ind,2) = y_off + ccent(ii,jj,kk,1);
946 Amatrix(a_ind,3) = z_off + ccent(ii,jj,kk,2) - zloc_on_yface;
950 if (flag(ii,jj,kk).isSingleValued() &&
951 domlo_x <= ii && ii <= domhi_x &&
952 domlo_y <= jj && jj <= domhi_y &&
953 domlo_z <= kk && kk <= domhi_z)
955 Amatrix(a_ind+27,0) = Real(1.0);
956 Amatrix(a_ind+27,1) = x_off + bcent(ii,jj,kk,0) - xloc_on_yface;
957 Amatrix(a_ind+27,2) = y_off + bcent(ii,jj,kk,1);
958 Amatrix(a_ind+27,3) = z_off + bcent(ii,jj,kk,2) - zloc_on_yface;
966 for (
int irow = 0; irow < 54; irow++)
968 Amatrix(irow,4) = Amatrix(irow,1) * Amatrix(irow,1);
969 Amatrix(irow,5) = Amatrix(irow,1) * Amatrix(irow,2);
970 Amatrix(irow,6) = Amatrix(irow,2) * Amatrix(irow,2);
971 Amatrix(irow,7) = Amatrix(irow,1) * Amatrix(irow,3);
972 Amatrix(irow,8) = Amatrix(irow,2) * Amatrix(irow,3);
973 Amatrix(irow,9) = Amatrix(irow,3) * Amatrix(irow,3);
977 for (
int irow = 0; irow < 10; irow++)
981 for (
int jj = j-jm; jj <= j+jp; jj++) {
982 for (
int kk = k-1; kk <= k+1; kk++) {
983 for (
int ii = i-1; ii <= i+1; ii++) {
988 if (!flag(ii,jj,kk).isCovered())
990 int a_ind = (ii-(i-1)) + 3*(kk-(k-1)) + 9*(jj-(j-jm));
991 Real phi_val = Amatrix(a_ind,0) * phi(ii,jj,kk,n);
993 rhs(irow) += Amatrix(a_ind,irow)* phi_val;
995 if (flag(ii,jj,kk).isSingleValued() && is_eb_inhomog && Amatrix(a_ind+27,irow) != Real(0.0)) {
996 rhs(irow) += Amatrix(a_ind+27,irow)*phieb(ii,jj,kk,n);
1017 Real& xloc_on_zface, Real& yloc_on_zface,
1018 bool is_eb_dirichlet,
bool is_eb_inhomog,
1019 const bool on_x_face,
const int domlo_x,
const int domhi_x,
1020 const bool on_y_face,
const int domlo_y,
const int domhi_y,
1021 const bool on_z_face,
const int domlo_z,
const int domhi_z)
1029 for (
int irow = 0; irow < 54; irow++) {
1030 for (
int icol = 0; icol < 10; icol++) {
1031 Amatrix(irow,icol) = Real(0.0);
1035 const int km = (k > domhi_z) ? 2 : 1;
1036 const int kp = 2 - km;
1039 for (
int kk = k-km; kk <= k+kp; kk++)
1041 for (
int jj = j-1; jj <= j+1; jj++) {
1042 for (
int ii = i-1; ii <= i+1; ii++)
1046 if (((on_x_face && ii < domlo_x) && (on_y_face && jj < domlo_y)) ||
1047 ((on_x_face && ii < domlo_x) && (on_y_face && jj > domhi_y)) ||
1048 ((on_x_face && ii > domhi_x) && (on_y_face && jj < domlo_y)) ||
1049 ((on_x_face && ii > domhi_x) && (on_y_face && jj > domhi_y)) ||
1050 ((on_y_face && jj < domlo_y) && (on_z_face && kk < domlo_z)) ||
1051 ((on_y_face && jj < domlo_y) && (on_z_face && kk > domhi_z)) ||
1052 ((on_y_face && jj > domhi_y) && (on_z_face && kk < domlo_z)) ||
1053 ((on_y_face && jj > domhi_y) && (on_z_face && kk > domhi_z)) ||
1054 ((on_x_face && ii < domlo_x) && (on_z_face && kk < domlo_z)) ||
1055 ((on_x_face && ii < domlo_x) && (on_z_face && kk > domhi_z)) ||
1056 ((on_x_face && ii > domhi_x) && (on_z_face && kk < domlo_z)) ||
1057 ((on_x_face && ii > domhi_x) && (on_z_face && kk > domhi_z))) {
1065 if (!flag(ii,jj,kk).isCovered())
1067 int a_ind = (ii-(i-1)) + 3*(jj-(j-1)) + 9*(kk-(k-km));
1069 Real x_off =
static_cast<Real
>(ii-i);
1070 Real y_off =
static_cast<Real
>(jj-j);
1071 Real z_off =
static_cast<Real
>(kk-k) + Real(0.5);
1074 if (ii < domlo_x && (vfrac(ii+1,jj,kk) != Real(1.0) || vfrac(ii+2,jj,kk) != Real(1.0)) ) {
1077 if (ii > domhi_x && (vfrac(ii-1,jj,kk) != Real(1.0) || vfrac(ii-2,jj,kk) != Real(1.0))) {
1083 if (jj < domlo_y && (vfrac(ii,jj+1,kk) != Real(1.0) || vfrac(ii,jj+2,kk) != Real(1.0)) ) {
1086 if (jj > domhi_y && (vfrac(ii,jj-1,kk) != Real(1.0) || vfrac(ii,jj-2,kk) != Real(1.0)) ) {
1092 if (kk < domlo_z && (vfrac(ii,jj,kk+1) != Real(1.0) || vfrac(ii,jj,kk+2) != Real(1.0)) ) {
1095 if (kk > domhi_z && (vfrac(ii,jj,kk-1) != Real(1.0) || vfrac(ii,jj,kk-2) != Real(1.0)) ) {
1100 Amatrix(a_ind,0) = Real(1.0);
1101 Amatrix(a_ind,1) = x_off + ccent(ii,jj,kk,0) - xloc_on_zface;
1102 Amatrix(a_ind,2) = y_off + ccent(ii,jj,kk,1) - yloc_on_zface ;
1103 Amatrix(a_ind,3) = z_off + ccent(ii,jj,kk,2);
1107 if (flag(ii,jj,kk).isSingleValued() &&
1108 domlo_x <= ii && ii <= domhi_x &&
1109 domlo_y <= jj && jj <= domhi_y &&
1110 domlo_z <= kk && kk <= domhi_z)
1112 Amatrix(a_ind+27,0) = Real(1.0);
1113 Amatrix(a_ind+27,1) = x_off + bcent(ii,jj,kk,0) - xloc_on_zface;
1114 Amatrix(a_ind+27,2) = y_off + bcent(ii,jj,kk,1) - yloc_on_zface;
1115 Amatrix(a_ind+27,3) = z_off + bcent(ii,jj,kk,2);
1123 for (
int irow = 0; irow < 54; irow++)
1125 Amatrix(irow,4) = Amatrix(irow,1) * Amatrix(irow,1);
1126 Amatrix(irow,5) = Amatrix(irow,1) * Amatrix(irow,2);
1127 Amatrix(irow,6) = Amatrix(irow,2) * Amatrix(irow,2);
1128 Amatrix(irow,7) = Amatrix(irow,1) * Amatrix(irow,3);
1129 Amatrix(irow,8) = Amatrix(irow,2) * Amatrix(irow,3);
1130 Amatrix(irow,9) = Amatrix(irow,3) * Amatrix(irow,3);
1134 for (
int irow = 0; irow < 10; irow++)
1138 for (
int kk = k-km; kk <= k+kp; kk++) {
1139 for (
int jj = j-1; jj <= j+1; jj++) {
1140 for (
int ii = i-1; ii <= i+1; ii++) {
1145 if (!flag(ii,jj,kk).isCovered())
1147 int a_ind = (ii-(i-1)) + 3*(jj-(j-1)) + 9*(kk-(k-km));
1148 Real phi_val = Amatrix(a_ind,0) * phi(ii,jj,kk,n);
1150 rhs(irow) += Amatrix(a_ind,irow)* phi_val;
1152 if (flag(ii,jj,kk).isSingleValued() && is_eb_inhomog && Amatrix(a_ind+27,irow) != Real(0.0)) {
1153 rhs(irow) += Amatrix(a_ind+27,irow)*phieb(ii,jj,kk,n);
1174 Real& nrmx, Real& nrmy, Real& nrmz,
1176 const bool on_x_face,
const int domlo_x,
const int domhi_x,
1177 const bool on_y_face,
const int domlo_y,
const int domhi_y,
1178 const bool on_z_face,
const int domlo_z,
const int domhi_z)
1185 for (
int irow = 0; irow < 54; irow++) {
1186 for (
int icol = 0; icol < 10; icol++) {
1187 Amatrix(irow,icol) = Real(0.0);
1192 for (
int kk = k-1; kk <= k+1; kk++) {
1193 for (
int jj = j-1; jj <= j+1; jj++) {
1194 for (
int ii = i-1; ii <= i+1; ii++)
1199 if (((on_x_face && ii < domlo_x) && (on_y_face && jj < domlo_y)) ||
1200 ((on_x_face && ii < domlo_x) && (on_y_face && jj > domhi_y)) ||
1201 ((on_x_face && ii > domhi_x) && (on_y_face && jj < domlo_y)) ||
1202 ((on_x_face && ii > domhi_x) && (on_y_face && jj > domhi_y)) ||
1203 ((on_y_face && jj < domlo_y) && (on_z_face && kk < domlo_z)) ||
1204 ((on_y_face && jj < domlo_y) && (on_z_face && kk > domhi_z)) ||
1205 ((on_y_face && jj > domhi_y) && (on_z_face && kk < domlo_z)) ||
1206 ((on_y_face && jj > domhi_y) && (on_z_face && kk > domhi_z)) ||
1207 ((on_x_face && ii < domlo_x) && (on_z_face && kk < domlo_z)) ||
1208 ((on_x_face && ii < domlo_x) && (on_z_face && kk > domhi_z)) ||
1209 ((on_x_face && ii > domhi_x) && (on_z_face && kk < domlo_z)) ||
1210 ((on_x_face && ii > domhi_x) && (on_z_face && kk > domhi_z))) {
1218 if (!flag(ii,jj,kk).isCovered())
1220 int a_ind = (ii-(i-1)) + 3*(jj-(j-1)) + 9*(kk-(k-1));
1222 Real x_off =
static_cast<Real
>(ii-i) - bcent(i,j,k,0);
1223 Real y_off =
static_cast<Real
>(jj-j) - bcent(i,j,k,1);
1224 Real z_off =
static_cast<Real
>(kk-k) - bcent(i,j,k,2);
1227 if (ii < domlo_x && (vfrac(ii+1,jj,kk) != Real(1.0) || vfrac(ii+2,jj,kk) != Real(1.0)) ) {
1230 if (ii > domhi_x && (vfrac(ii-1,jj,kk) != Real(1.0) || vfrac(ii-2,jj,kk) != Real(1.0))) {
1236 if (jj < domlo_y && (vfrac(ii,jj+1,kk) != Real(1.0) || vfrac(ii,jj+2,kk) != Real(1.0)) ) {
1239 if (jj > domhi_y && (vfrac(ii,jj-1,kk) != Real(1.0) || vfrac(ii,jj-2,kk) != Real(1.0)) ) {
1245 if (kk < domlo_z && (vfrac(ii,jj,kk+1) != Real(1.0) || vfrac(ii,jj,kk+2) != Real(1.0)) ) {
1248 if (kk > domhi_z && (vfrac(ii,jj,kk-1) != Real(1.0) || vfrac(ii,jj,kk-2) != Real(1.0)) ) {
1253 Amatrix(a_ind,0) = Real(1.0);
1254 Amatrix(a_ind,1) = x_off + ccent(ii,jj,kk,0);
1255 Amatrix(a_ind,2) = y_off + ccent(ii,jj,kk,1);
1256 Amatrix(a_ind,3) = z_off + ccent(ii,jj,kk,2);
1258 if (flag(ii,jj,kk).isSingleValued() &&
1259 domlo_x <= ii && ii <= domhi_x &&
1260 domlo_y <= jj && jj <= domhi_y &&
1261 domlo_z <= kk && kk <= domhi_z)
1263 Amatrix(a_ind+27,0) = Real(1.0);
1264 Amatrix(a_ind+27,1) = x_off + bcent(ii,jj,kk,0);
1265 Amatrix(a_ind+27,2) = y_off + bcent(ii,jj,kk,1);
1266 Amatrix(a_ind+27,3) = z_off + bcent(ii,jj,kk,2);
1274 for (
int irow = 0; irow < 54; irow++)
1276 Amatrix(irow,4) = Amatrix(irow,1) * Amatrix(irow,1);
1277 Amatrix(irow,5) = Amatrix(irow,1) * Amatrix(irow,2);
1278 Amatrix(irow,6) = Amatrix(irow,2) * Amatrix(irow,2);
1279 Amatrix(irow,7) = Amatrix(irow,1) * Amatrix(irow,3);
1280 Amatrix(irow,8) = Amatrix(irow,2) * Amatrix(irow,3);
1281 Amatrix(irow,9) = Amatrix(irow,3) * Amatrix(irow,3);
1285 for (
int irow = 0; irow < 10; irow++)
1289 for (
int kk = k-1; kk <= k+1; kk++) {
1290 for (
int jj = j-1; jj <= j+1; jj++) {
1291 for (
int ii = i-1; ii <= i+1; ii++) {
1296 if (!flag(ii,jj,kk).isCovered())
1298 int a_ind = (ii-(i-1)) + 3*(jj-(j-1)) + 9*(kk-(k-1));
1300 Real phi_val = Amatrix(a_ind,0) * phi(ii,jj,kk,n);
1302 rhs(irow) += Amatrix(a_ind,irow)* phi_val;
1304 if (flag(ii,jj,kk).isSingleValued() && is_eb_inhomog && Amatrix(a_ind+27,irow) != Real(0.0)) {
1305 rhs(irow) += Amatrix(a_ind+27,irow)*phieb(ii,jj,kk,n);
1315 Real dphidn = rhs(1)*nrmx + rhs(2)*nrmy + rhs(3)*nrmz;
#define AMREX_ALWAYS_ASSERT(EX)
Definition: AMReX_BLassert.H:50
#define AMREX_FORCE_INLINE
Definition: AMReX_Extension.H:119
#define AMREX_GPU_HOST_DEVICE
Definition: AMReX_GpuQualifiers.H:20
Definition: AMReX_Amr.cpp:49
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real grad_y_of_phi_on_centroids(int i, int j, int k, int n, Array4< Real const > const &phi, Array4< Real const > const &phieb, Array4< EBCellFlag const > const &flag, Array4< Real const > const &ccent, Array4< Real const > const &bcent, Real &xloc_on_yface, bool is_eb_dirichlet, bool is_eb_inhomog)
Definition: AMReX_EB_LeastSquares_2D_K.H:331
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void cholsol_for_eb(Array2D< Real, 0, 17, 0, 5 > &Amatrix, Array1D< Real, 0, 5 > &b)
Definition: AMReX_EB_LeastSquares_2D_K.H:155
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real grad_eb_of_phi_on_centroids(int i, int j, int k, int n, Array4< Real const > const &phi, Array4< Real const > const &phieb, Array4< EBCellFlag const > const &flag, Array4< Real const > const &ccent, Array4< Real const > const &bcent, Real &nrmx, Real &nrmy, bool is_eb_inhomog)
Definition: AMReX_EB_LeastSquares_2D_K.H:412
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real grad_x_of_phi_on_centroids_extdir(int i, int j, int k, int n, Array4< Real const > const &phi, Array4< Real const > const &phieb, Array4< EBCellFlag const > const &flag, Array4< Real const > const &ccent, Array4< Real const > const &bcent, Array4< Real const > const &vfrac, Real &yloc_on_xface, bool is_eb_dirichlet, bool is_eb_inhomog, const bool on_x_face, const int domlo_x, const int domhi_x, const bool on_y_face, const int domlo_y, const int domhi_y)
Definition: AMReX_EB_LeastSquares_2D_K.H:495
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real grad_z_of_phi_on_centroids(int i, int j, int k, int n, Array4< Real const > const &phi, Array4< Real const > const &phieb, Array4< EBCellFlag const > const &flag, Array4< Real const > const &ccent, Array4< Real const > const &bcent, Real &xloc_on_zface, Real &yloc_on_zface, bool is_eb_dirichlet, bool is_eb_inhomog)
Definition: AMReX_EB_LeastSquares_3D_K.H:513
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real grad_eb_of_phi_on_centroids_extdir(int i, int j, int k, int n, Array4< Real const > const &phi, Array4< Real const > const &phieb, Array4< EBCellFlag const > const &flag, Array4< Real const > const &ccent, Array4< Real const > const &bcent, Array4< Real const > const &vfrac, Real &nrmx, Real &nrmy, bool is_eb_inhomog, const bool on_x_face, const int domlo_x, const int domhi_x, const bool on_y_face, const int domlo_y, const int domhi_y)
Definition: AMReX_EB_LeastSquares_2D_K.H:765
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real grad_z_of_phi_on_centroids_extdir(int i, int j, int k, int n, Array4< Real const > const &phi, Array4< Real const > const &phieb, Array4< EBCellFlag const > const &flag, Array4< Real const > const &ccent, Array4< Real const > const &bcent, Array4< Real const > const &vfrac, Real &xloc_on_zface, Real &yloc_on_zface, bool is_eb_dirichlet, bool is_eb_inhomog, const bool on_x_face, const int domlo_x, const int domhi_x, const bool on_y_face, const int domlo_y, const int domhi_y, const bool on_z_face, const int domlo_z, const int domhi_z)
Definition: AMReX_EB_LeastSquares_3D_K.H:1010
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real grad_y_of_phi_on_centroids_extdir(int i, int j, int k, int n, Array4< Real const > const &phi, Array4< Real const > const &phieb, Array4< EBCellFlag const > const &flag, Array4< Real const > const &ccent, Array4< Real const > const &bcent, Array4< Real const > const &vfrac, Real &xloc_on_yface, bool is_eb_dirichlet, bool is_eb_inhomog, const bool on_x_face, const int domlo_x, const int domhi_x, const bool on_y_face, const int domlo_y, const int domhi_y)
Definition: AMReX_EB_LeastSquares_2D_K.H:632
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void cholsol_np10(Array2D< Real, 0, 35, 0, 9 > &Amatrix, Array1D< Real, 0, 9 > &b)
Definition: AMReX_EB_LeastSquares_3D_K.H:64
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real grad_x_of_phi_on_centroids(int i, int j, int k, int n, Array4< Real const > const &phi, Array4< Real const > const &phieb, Array4< EBCellFlag const > const &flag, Array4< Real const > const &ccent, Array4< Real const > const &bcent, Real &yloc_on_xface, bool is_eb_dirichlet, bool is_eb_inhomog)
Definition: AMReX_EB_LeastSquares_2D_K.H:246
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void decomp_chol_np10(Array2D< Real, 0, 9, 0, 9 > &aa)
Definition: AMReX_EB_LeastSquares_3D_K.H:10
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > sqrt(const GpuComplex< T > &a_z) noexcept
Return the square root of a complex number.
Definition: AMReX_GpuComplex.H:373
Definition: AMReX_Array.H:161
Definition: AMReX_Array.H:282
Definition: AMReX_Array4.H:61
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool contains(int i, int j, int k) const noexcept
Definition: AMReX_Array4.H:251