1 #ifndef AMREX_MLNODELAP_3D_K_H_
2 #define AMREX_MLNODELAP_3D_K_H_
3 #include <AMReX_Config.H>
13 Array4<int const>
const& cmsk) noexcept
15 using namespace nodelap_detail;
17 int s = cmsk(i-1,j-1,k-1) + cmsk(i ,j-1,k-1)
18 + cmsk(i-1,j ,k-1) + cmsk(i ,j ,k-1)
19 + cmsk(i-1,j-1,k ) + cmsk(i ,j-1,k )
20 + cmsk(i-1,j ,k ) + cmsk(i ,j ,k );
33 Array4<int const>
const& omsk,
Box const& dom,
34 GpuArray<LinOpBCType, AMREX_SPACEDIM>
const& bclo,
35 GpuArray<LinOpBCType, AMREX_SPACEDIM>
const& bchi) noexcept
39 for (
int k = lo.z; k <= hi.z; ++k) {
40 for (
int j = lo.y; j <= hi.y; ++j) {
42 for (
int i = lo.x; i <= hi.x; ++i) {
44 dmsk(i,j,k) = (omsk(i-1,j-1,k-1) == 1 || omsk(i,j-1,k-1) == 1 ||
45 omsk(i-1,j ,k-1) == 1 || omsk(i,j ,k-1) == 1 ||
46 omsk(i-1,j-1,k ) == 1 || omsk(i,j-1,k ) == 1 ||
47 omsk(i-1,j ,k ) == 1 || omsk(i,j ,k ) == 1);
54 if (bclo[0] == LinOpBCType::Dirichlet && lo.x == domlo.x) {
55 for (
int k = lo.z; k <= hi.z; ++k) {
56 for (
int j = lo.y; j <= hi.y; ++j) {
61 if (bchi[0] == LinOpBCType::Dirichlet && hi.x == domhi.x) {
62 for (
int k = lo.z; k <= hi.z; ++k) {
63 for (
int j = lo.y; j <= hi.y; ++j) {
68 if (bclo[1] == LinOpBCType::Dirichlet && lo.y == domlo.y) {
69 for (
int k = lo.z; k <= hi.z; ++k) {
71 for (
int i = lo.x; i <= hi.x; ++i) {
76 if (bchi[1] == LinOpBCType::Dirichlet && hi.y == domhi.y) {
77 for (
int k = lo.z; k <= hi.z; ++k) {
79 for (
int i = lo.x; i <= hi.x; ++i) {
84 if (bclo[2] == LinOpBCType::Dirichlet && lo.z == domlo.z) {
85 for (
int j = lo.y; j <= hi.y; ++j) {
87 for (
int i = lo.x; i <= hi.x; ++i) {
92 if (bchi[2] == LinOpBCType::Dirichlet && hi.z == domhi.z) {
93 for (
int j = lo.y; j <= hi.y; ++j) {
95 for (
int i = lo.x; i <= hi.x; ++i) {
103 Array4<int const>
const& omsk,
Box const& dom,
104 GpuArray<LinOpBCType, AMREX_SPACEDIM>
const& bclo,
105 GpuArray<LinOpBCType, AMREX_SPACEDIM>
const& bchi) noexcept
109 for (
int k = lo.z; k <= hi.z; ++k) {
110 for (
int j = lo.y; j <= hi.y; ++j) {
112 for (
int i = lo.x; i <= hi.x; ++i) {
113 dmsk(i,j,k) =
static_cast<Real
>(omsk(i,j,k));
119 if ((bclo[0] == LinOpBCType::Neumann || bclo[0] == LinOpBCType::inflow)
122 for (
int k = lo.z; k <= hi.z; ++k) {
123 for (
int j = lo.y; j <= hi.y; ++j) {
124 dmsk(lo.x,j,k) *= Real(0.5);
128 if ((bchi[0] == LinOpBCType::Neumann || bchi[0] == LinOpBCType::inflow)
131 for (
int k = lo.z; k <= hi.z; ++k) {
132 for (
int j = lo.y; j <= hi.y; ++j) {
133 dmsk(hi.x,j,k) *= Real(0.5);
137 if ((bclo[1] == LinOpBCType::Neumann || bclo[1] == LinOpBCType::inflow)
140 for (
int k = lo.z; k <= hi.z; ++k) {
142 for (
int i = lo.x; i <= hi.x; ++i) {
143 dmsk(i,lo.y,k) *= Real(0.5);
147 if ((bchi[1] == LinOpBCType::Neumann || bchi[1] == LinOpBCType::inflow)
150 for (
int k = lo.z; k <= hi.z; ++k) {
152 for (
int i = lo.x; i <= hi.x; ++i) {
153 dmsk(i,hi.y,k) *= Real(0.5);
157 if ((bclo[2] == LinOpBCType::Neumann || bclo[2] == LinOpBCType::inflow)
160 for (
int j = lo.y; j <= hi.y; ++j) {
162 for (
int i = lo.x; i <= hi.x; ++i) {
163 dmsk(i,j,lo.z) *= Real(0.5);
167 if ((bchi[2] == LinOpBCType::Neumann || bchi[2] == LinOpBCType::inflow)
170 for (
int j = lo.y; j <= hi.y; ++j) {
172 for (
int i = lo.x; i <= hi.x; ++i) {
173 dmsk(i,j,hi.z) *= Real(0.5);
180 Array4<int const>
const& msk,
int fine_flag) noexcept
184 if (msk(i-1,j-1,k-1) == fine_flag &&
185 msk(i ,j-1,k-1) == fine_flag &&
186 msk(i-1,j ,k-1) == fine_flag &&
187 msk(i ,j ,k-1) == fine_flag &&
188 msk(i-1,j-1,k ) == fine_flag &&
189 msk(i ,j-1,k ) == fine_flag &&
190 msk(i-1,j ,k ) == fine_flag &&
191 msk(i ,j ,k ) == fine_flag)
193 phi(i,j,k) = Real(0.0);
203 Array4<Real const>
const&
fine) noexcept
205 Real cl =
fine(2*i ,2*j,2*k )+
fine(2*i ,2*j+1,2*k )+
206 fine(2*i ,2*j,2*k+1)+
fine(2*i ,2*j+1,2*k+1);
207 Real cr =
fine(2*i+1,2*j,2*k )+
fine(2*i+1,2*j+1,2*k )+
208 fine(2*i+1,2*j,2*k+1)+
fine(2*i+1,2*j+1,2*k+1);
209 crse(i,j,k) = Real(0.5)*cl*cr/(cl+cr);
214 Array4<Real const>
const&
fine) noexcept
216 Real cl =
fine(2*i,2*j ,2*k )+
fine(2*i+1,2*j ,2*k )+
217 fine(2*i,2*j ,2*k+1)+
fine(2*i+1,2*j ,2*k+1);
218 Real cr =
fine(2*i,2*j+1,2*k )+
fine(2*i+1,2*j+1,2*k )+
219 fine(2*i,2*j+1,2*k+1)+
fine(2*i+1,2*j+1,2*k+1);
220 crse(i,j,k) = Real(0.5)*cl*cr/(cl+cr);
227 Real cl =
fine(2*i,2*j ,2*k )+
fine(2*i+1,2*j ,2*k )+
228 fine(2*i,2*j+1,2*k )+
fine(2*i+1,2*j+1,2*k );
229 Real cr =
fine(2*i,2*j ,2*k+1)+
fine(2*i+1,2*j ,2*k+1)+
230 fine(2*i,2*j+1,2*k+1)+
fine(2*i+1,2*j+1,2*k+1);
231 crse(i,j,k) = Real(0.5)*cl*cr/(cl+cr);
236 Array4<Real const>
const&
fine,
int idir) noexcept
239 Real cl =
fine(2*i ,2*j,k) +
fine(2*i ,2*j+1,k);
240 Real cr =
fine(2*i+1,2*j,k) +
fine(2*i+1,2*j+1,k);
241 crse(i,j,k) = cl*cr/(cl+cr);
242 }
else if (
idir == 1) {
243 Real cl =
fine(2*i ,j,2*k) +
fine(2*i ,j,2*k+1);
244 Real cr =
fine(2*i+1,j,2*k) +
fine(2*i+1,j,2*k+1);
245 crse(i,j,k) = cl*cr/(cl+cr);
247 Real cl =
fine(i,2*j ,2*k) +
fine(i,2*j ,2*k+1);
248 Real cr =
fine(i,2*j+1,2*k) +
fine(i,2*j+1,2*k+1);
249 crse(i,j,k) = cl*cr/(cl+cr);
256 template <
typename T>
258 GpuArray<bool,AMREX_SPACEDIM>
const& bflo,
259 GpuArray<bool,AMREX_SPACEDIM>
const& bfhi) noexcept
261 Box gdomain = domain;
262 for (
int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
263 if (! bflo[idim]) { gdomain.
growLo(idim,1); }
264 if (! bfhi[idim]) { gdomain.
growHi(idim,1); }
267 if (gdomain.strictly_contains(vbx)) {
return; }
269 const int offset = domain.cellCentered() ? 0 : 1;
277 if (! gdomain.contains(
IntVect(i,j,k))) {
279 if (i == dlo.x-1 && j == dlo.y-1 && k == dlo.z-1 && (bflo[0] || bflo[1] || bflo[2]))
281 if (bflo[0] && bflo[1] && bflo[2])
283 a(i,j,k) = a(i+1+offset, j+1+offset, k+1+offset);
285 else if (bflo[0] && bflo[1])
289 else if (bflo[0] && bflo[2])
293 else if (bflo[1] && bflo[2])
299 a(i,j,k) = a(i+1+
offset, j, k);
303 a(i,j,k) = a(i, j+1+
offset, k);
307 a(i,j,k) = a(i, j, k+1+
offset);
311 else if (i == dhi.x+1 && j == dlo.y-1 && k == dlo.z-1 && (bfhi[0] || bflo[1] || bflo[2]))
313 if (bfhi[0] && bflo[1] && bflo[2])
317 else if (bfhi[0] && bflo[1])
321 else if (bfhi[0] && bflo[2])
325 else if (bflo[1] && bflo[2])
331 a(i,j,k) = a(i-1-
offset, j, k);
335 a(i,j,k) = a(i, j+1+
offset, k);
339 a(i,j,k) = a(i, j, k+1+
offset);
343 else if (i == dlo.x-1 && j == dhi.y+1 && k == dlo.z-1 && (bflo[0] || bfhi[1] || bflo[2]))
345 if (bflo[0] && bfhi[1] && bflo[2])
349 else if (bflo[0] && bfhi[1])
353 else if (bflo[0] && bflo[2])
357 else if (bfhi[1] && bflo[2])
363 a(i,j,k) = a(i+1+
offset, j, k);
367 a(i,j,k) = a(i, j-1-
offset, k);
371 a(i,j,k) = a(i, j, k+1+
offset);
375 else if (i == dhi.x+1 && j == dhi.y+1 && k == dlo.z-1 && (bfhi[0] || bfhi[1] || bflo[2]))
377 if (bfhi[0] && bfhi[1] && bflo[2])
381 else if (bfhi[0] && bfhi[1])
385 else if (bfhi[0] && bflo[2])
389 else if (bfhi[1] && bflo[2])
395 a(i,j,k) = a(i-1-
offset, j, k);
399 a(i,j,k) = a(i, j-1-
offset, k);
403 a(i,j,k) = a(i, j, k+1+
offset);
407 else if (i == dlo.x-1 && j == dlo.y-1 && k == dhi.z+1 && (bflo[0] || bflo[1] || bfhi[2]))
409 if (bflo[0] && bflo[1] && bfhi[2])
413 else if (bflo[0] && bflo[1])
417 else if (bflo[0] && bfhi[2])
421 else if (bflo[1] && bfhi[2])
427 a(i,j,k) = a(i+1+
offset, j, k);
431 a(i,j,k) = a(i, j+1+
offset, k);
435 a(i,j,k) = a(i, j, k-1-
offset);
439 else if (i == dhi.x+1 && j == dlo.y-1 && k == dhi.z+1 && (bfhi[0] || bflo[1] || bfhi[2]))
441 if (bfhi[0] && bflo[1] && bfhi[2])
445 else if (bfhi[0] && bflo[1])
449 else if (bfhi[0] && bfhi[2])
453 else if (bflo[1] && bfhi[2])
459 a(i,j,k) = a(i-1-
offset, j, k);
463 a(i,j,k) = a(i, j+1+
offset, k);
467 a(i,j,k) = a(i, j, k-1-
offset);
471 else if (i == dlo.x-1 && j == dhi.y+1 && k == dhi.z+1 && (bflo[0] || bfhi[1] || bfhi[2]))
473 if (bflo[0] && bfhi[1] && bfhi[2])
477 else if (bflo[0] && bfhi[1])
481 else if (bflo[0] && bfhi[2])
485 else if (bfhi[1] && bfhi[2])
491 a(i,j,k) = a(i+1+
offset, j, k);
495 a(i,j,k) = a(i, j-1-
offset, k);
499 a(i,j,k) = a(i, j, k-1-
offset);
503 else if (i == dhi.x+1 && j == dhi.y+1 && k == dhi.z+1 && (bfhi[0] || bfhi[1] || bfhi[2]))
505 if (bfhi[0] && bfhi[1] && bfhi[2])
509 else if (bfhi[0] && bfhi[1])
513 else if (bfhi[0] && bfhi[2])
517 else if (bfhi[1] && bfhi[2])
523 a(i,j,k) = a(i-1-
offset, j, k);
527 a(i,j,k) = a(i, j-1-
offset, k);
531 a(i,j,k) = a(i, j, k-1-
offset);
535 else if (i == dlo.x-1 && j == dlo.y-1 && (bflo[0] || bflo[1]))
537 if (bflo[0] && bflo[1])
543 a(i,j,k) = a(i+1+
offset, j, k);
547 a(i,j,k) = a(i, j+1+
offset, k);
551 else if (i == dhi.x+1 && j == dlo.y-1 && (bfhi[0] || bflo[1]))
553 if (bfhi[0] && bflo[1])
559 a(i,j,k) = a(i-1-
offset, j, k);
563 a(i,j,k) = a(i, j+1+
offset, k);
567 else if (i == dlo.x-1 && j == dhi.y+1 && (bflo[0] || bfhi[1]))
569 if (bflo[0] && bfhi[1])
575 a(i,j,k) = a(i+1+
offset, j, k);
579 a(i,j,k) = a(i, j-1-
offset, k);
583 else if (i == dhi.x+1 && j == dhi.y+1 && (bfhi[0] || bfhi[1]))
585 if (bfhi[0] && bfhi[1])
591 a(i,j,k) = a(i-1-
offset, j, k);
595 a(i,j,k) = a(i, j-1-
offset, k);
599 else if (i == dlo.x-1 && k == dlo.z-1 && (bflo[0] || bflo[2]))
601 if (bflo[0] && bflo[2])
607 a(i,j,k) = a(i+1+
offset, j, k);
611 a(i,j,k) = a(i, j, k+1+
offset);
615 else if (i == dhi.x+1 && k == dlo.z-1 && (bfhi[0] || bflo[2]))
617 if (bfhi[0] && bflo[2])
623 a(i,j,k) = a(i-1-
offset, j, k);
627 a(i,j,k) = a(i, j, k+1+
offset);
631 else if (i == dlo.x-1 && k == dhi.z+1 && (bflo[0] || bfhi[2]))
633 if (bflo[0] && bfhi[2])
639 a(i,j,k) = a(i+1+
offset, j, k);
643 a(i,j,k) = a(i, j, k-1-
offset);
647 else if (i == dhi.x+1 && k == dhi.z+1 && (bfhi[0] || bfhi[2]))
649 if (bfhi[0] && bfhi[2])
655 a(i,j,k) = a(i-1-
offset, j, k);
659 a(i,j,k) = a(i, j, k-1-
offset);
663 else if (j == dlo.y-1 && k == dlo.z-1 && (bflo[1] || bflo[2]))
665 if (bflo[1] && bflo[2])
671 a(i,j,k) = a(i, j+1+
offset, k);
675 a(i,j,k) = a(i, j, k+1+
offset);
679 else if (j == dhi.y+1 && k == dlo.z-1 && (bfhi[1] || bflo[2]))
681 if (bfhi[1] && bflo[2])
687 a(i,j,k) = a(i, j-1-
offset, k);
691 a(i,j,k) = a(i, j, k+1+
offset);
695 else if (j == dlo.y-1 && k == dhi.z+1 && (bflo[1] || bfhi[2]))
697 if (bflo[1] && bfhi[2])
703 a(i,j,k) = a(i, j+1+
offset, k);
707 a(i,j,k) = a(i, j, k-1-
offset);
711 else if (j == dhi.y+1 && k == dhi.z+1 && (bfhi[1] || bfhi[2]))
713 if (bfhi[1] && bfhi[2])
719 a(i,j,k) = a(i, j-1-
offset, k);
723 a(i,j,k) = a(i, j, k-1-
offset);
726 else if (i == dlo.x-1 && bflo[0])
728 a(i,j,k) = a(i+1+
offset, j, k);
730 else if (i == dhi.x+1 && bfhi[0])
732 a(i,j,k) = a(i-1-
offset, j, k);
734 else if (j == dlo.y-1 && bflo[1])
736 a(i,j,k) = a(i, j+1+
offset, k);
738 else if (j == dhi.y+1 && bfhi[1])
740 a(i,j,k) = a(i, j-1-
offset, k);
742 else if (k == dlo.z-1 && bflo[2])
744 a(i,j,k) = a(i, j, k+1+
offset);
746 else if (k == dhi.z+1 && bfhi[2])
748 a(i,j,k) = a(i, j, k-1-
offset);
767 Real facx = Real(1./36.)*dxinv[0]*dxinv[0];
768 Real facy = Real(1./36.)*dxinv[1]*dxinv[1];
769 Real facz = Real(1./36.)*dxinv[2]*dxinv[2];
770 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)
771 +sx(i-1,j-1,k )+sx(i,j-1,k )+sx(i-1,j,k )+sx(i,j,k ))
772 +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)
773 +sy(i-1,j-1,k )+sy(i,j-1,k )+sy(i-1,j,k )+sy(i,j,k ))
774 +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)
775 +sz(i-1,j-1,k )+sz(i,j-1,k )+sz(i-1,j,k )+sz(i,j,k )));
776 y +=
x(i-1,j-1,k-1)*(facx*sx(i-1,j-1,k-1)
777 +facy*sy(i-1,j-1,k-1)
778 +facz*sz(i-1,j-1,k-1))
779 +
x(i+1,j-1,k-1)*(facx*sx(i ,j-1,k-1)
781 +facz*sz(i ,j-1,k-1))
782 +
x(i-1,j+1,k-1)*(facx*sx(i-1,j ,k-1)
784 +facz*sz(i-1,j ,k-1))
785 +
x(i+1,j+1,k-1)*(facx*sx(i ,j ,k-1)
788 +
x(i-1,j-1,k+1)*(facx*sx(i-1,j-1,k )
790 +facz*sz(i-1,j-1,k ))
791 +
x(i+1,j-1,k+1)*(facx*sx(i ,j-1,k )
794 +
x(i-1,j+1,k+1)*(facx*sx(i-1,j ,k )
797 +
x(i+1,j+1,k+1)*(facx*sx(i ,j ,k )
800 y +=
x(i ,j-1,k-1)*( -facx*(sx(i-1,j-1,k-1)+sx(i,j-1,k-1))
801 +Real(2.0)*facy*(sy(i-1,j-1,k-1)+sy(i,j-1,k-1))
802 +Real(2.0)*facz*(sz(i-1,j-1,k-1)+sz(i,j-1,k-1)))
803 +
x(i ,j+1,k-1)*( -facx*(sx(i-1,j ,k-1)+sx(i,j ,k-1))
804 +Real(2.0)*facy*(sy(i-1,j ,k-1)+sy(i,j ,k-1))
805 +Real(2.0)*facz*(sz(i-1,j ,k-1)+sz(i,j ,k-1)))
806 +
x(i ,j-1,k+1)*( -facx*(sx(i-1,j-1,k )+sx(i,j-1,k ))
807 +Real(2.0)*facy*(sy(i-1,j-1,k )+sy(i,j-1,k ))
808 +Real(2.0)*facz*(sz(i-1,j-1,k )+sz(i,j-1,k )))
809 +
x(i ,j+1,k+1)*( -facx*(sx(i-1,j ,k )+sx(i,j ,k ))
810 +Real(2.0)*facy*(sy(i-1,j ,k )+sy(i,j ,k ))
811 +Real(2.0)*facz*(sz(i-1,j ,k )+sz(i,j ,k )))
812 +
x(i-1,j ,k-1)*( Real(2.0)*facx*(sx(i-1,j-1,k-1)+sx(i-1,j,k-1))
813 -facy*(sy(i-1,j-1,k-1)+sy(i-1,j,k-1))
814 +Real(2.0)*facz*(sz(i-1,j-1,k-1)+sz(i-1,j,k-1)))
815 +
x(i+1,j ,k-1)*( Real(2.0)*facx*(sx(i ,j-1,k-1)+sx(i ,j,k-1))
816 -facy*(sy(i ,j-1,k-1)+sy(i ,j,k-1))
817 +Real(2.0)*facz*(sz(i ,j-1,k-1)+sz(i ,j,k-1)))
818 +
x(i-1,j ,k+1)*( Real(2.0)*facx*(sx(i-1,j-1,k )+sx(i-1,j,k ))
819 -facy*(sy(i-1,j-1,k )+sy(i-1,j,k ))
820 +Real(2.0)*facz*(sz(i-1,j-1,k )+sz(i-1,j,k )))
821 +
x(i+1,j ,k+1)*( Real(2.0)*facx*(sx(i ,j-1,k )+sx(i ,j,k ))
822 -facy*(sy(i ,j-1,k )+sy(i ,j,k ))
823 +Real(2.0)*facz*(sz(i ,j-1,k )+sz(i ,j,k )))
824 +
x(i-1,j-1,k )*( Real(2.0)*facx*(sx(i-1,j-1,k-1)+sx(i-1,j-1,k))
825 +Real(2.0)*facy*(sy(i-1,j-1,k-1)+sy(i-1,j-1,k))
826 -facz*(sz(i-1,j-1,k-1)+sz(i-1,j-1,k)))
827 +
x(i+1,j-1,k )*( Real(2.0)*facx*(sx(i ,j-1,k-1)+sx(i ,j-1,k))
828 +Real(2.0)*facy*(sy(i ,j-1,k-1)+sy(i ,j-1,k))
829 -facz*(sz(i ,j-1,k-1)+sz(i ,j-1,k)))
830 +
x(i-1,j+1,k )*( Real(2.0)*facx*(sx(i-1,j ,k-1)+sx(i-1,j ,k))
831 +Real(2.0)*facy*(sy(i-1,j ,k-1)+sy(i-1,j ,k))
832 -facz*(sz(i-1,j ,k-1)+sz(i-1,j ,k)))
833 +
x(i+1,j+1,k )*( Real(2.0)*facx*(sx(i ,j ,k-1)+sx(i ,j ,k))
834 +Real(2.0)*facy*(sy(i ,j ,k-1)+sy(i ,j ,k))
835 -facz*(sz(i ,j ,k-1)+sz(i ,j ,k)));
836 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))
837 -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))
838 -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)))
839 + 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))
840 -facy*(sy(i ,j-1,k-1)+sy(i ,j,k-1)+sy(i ,j-1,k)+sy(i ,j,k))
841 -facz*(sz(i ,j-1,k-1)+sz(i ,j,k-1)+sz(i ,j-1,k)+sz(i ,j,k)))
842 + 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))
843 +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))
844 -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)))
845 + 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))
846 +Real(2.0)*facy*(sy(i-1,j ,k-1)+sy(i,j ,k-1)+sy(i-1,j ,k)+sy(i,j ,k))
847 -facz*(sz(i-1,j ,k-1)+sz(i,j ,k-1)+sz(i-1,j ,k)+sz(i,j ,k)))
848 + 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))
849 -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))
850 +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)))
851 + 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 ))
852 -facy*(sy(i-1,j-1,k )+sy(i,j-1,k )+sy(i-1,j,k )+sy(i,j,k ))
853 +Real(2.0)*facz*(sz(i-1,j-1,k )+sz(i,j-1,k )+sz(i-1,j,k )+sz(i,j,k )));
860 Array4<Real const>
const& sig, Array4<int const>
const& msk,
861 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
866 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
867 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
868 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
869 Real fxyz = facx + facy + facz;
870 Real fmx2y2z = -facx + Real(2.0)*facy + Real(2.0)*facz;
871 Real f2xmy2z = Real(2.0)*facx - facy + Real(2.0)*facz;
872 Real f2x2ymz = Real(2.0)*facx + Real(2.0)*facy - facz;
873 Real f4xm2ym2z = Real(4.0)*facx - Real(2.0)*facy - Real(2.0)*facz;
874 Real fm2x4ym2z = -Real(2.0)*facx + Real(4.0)*facy - Real(2.0)*facz;
875 Real fm2xm2y4z = -Real(2.0)*facx - Real(2.0)*facy + Real(4.0)*facz;
876 return x(i,j,k)*Real(-4.0)*fxyz*
877 (sig(i-1,j-1,k-1)+sig(i,j-1,k-1)+sig(i-1,j,k-1)+sig(i,j,k-1)
878 +sig(i-1,j-1,k )+sig(i,j-1,k )+sig(i-1,j,k )+sig(i,j,k ))
879 + fxyz*(
x(i-1,j-1,k-1)*sig(i-1,j-1,k-1)
880 +
x(i+1,j-1,k-1)*sig(i ,j-1,k-1)
881 +
x(i-1,j+1,k-1)*sig(i-1,j ,k-1)
882 +
x(i+1,j+1,k-1)*sig(i ,j ,k-1)
883 +
x(i-1,j-1,k+1)*sig(i-1,j-1,k )
884 +
x(i+1,j-1,k+1)*sig(i ,j-1,k )
885 +
x(i-1,j+1,k+1)*sig(i-1,j ,k )
886 +
x(i+1,j+1,k+1)*sig(i ,j ,k ))
887 + fmx2y2z*(
x(i ,j-1,k-1)*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1))
888 +
x(i ,j+1,k-1)*(sig(i-1,j ,k-1)+sig(i,j ,k-1))
889 +
x(i ,j-1,k+1)*(sig(i-1,j-1,k )+sig(i,j-1,k ))
890 +
x(i ,j+1,k+1)*(sig(i-1,j ,k )+sig(i,j ,k )))
891 + f2xmy2z*(
x(i-1,j ,k-1)*(sig(i-1,j-1,k-1)+sig(i-1,j,k-1))
892 +
x(i+1,j ,k-1)*(sig(i ,j-1,k-1)+sig(i ,j,k-1))
893 +
x(i-1,j ,k+1)*(sig(i-1,j-1,k )+sig(i-1,j,k ))
894 +
x(i+1,j ,k+1)*(sig(i ,j-1,k )+sig(i ,j,k )))
895 + f2x2ymz*(
x(i-1,j-1,k )*(sig(i-1,j-1,k-1)+sig(i-1,j-1,k))
896 +
x(i+1,j-1,k )*(sig(i ,j-1,k-1)+sig(i ,j-1,k))
897 +
x(i-1,j+1,k )*(sig(i-1,j ,k-1)+sig(i-1,j ,k))
898 +
x(i+1,j+1,k )*(sig(i ,j ,k-1)+sig(i ,j ,k)))
899 + 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))
900 +
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)))
901 + 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))
902 +
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)))
903 + 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))
904 +
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 )));
909 Real
mlndlap_adotx_c (
int i,
int j,
int k, Array4<Real const>
const& x,
910 Real sig, Array4<int const>
const& msk,
911 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
916 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
917 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
918 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
919 Real fxyz = facx + facy + facz;
920 Real fmx2y2z = -facx + Real(2.0)*facy + Real(2.0)*facz;
921 Real f2xmy2z = Real(2.0)*facx - facy + Real(2.0)*facz;
922 Real f2x2ymz = Real(2.0)*facx + Real(2.0)*facy - facz;
923 Real f4xm2ym2z = Real(4.0)*facx - Real(2.0)*facy - Real(2.0)*facz;
924 Real fm2x4ym2z = -Real(2.0)*facx + Real(4.0)*facy - Real(2.0)*facz;
925 Real fm2xm2y4z = -Real(2.0)*facx - Real(2.0)*facy + Real(4.0)*facz;
926 return sig * (
x(i,j,k)*Real(-4.0)*fxyz*Real(8.)
927 + fxyz*(
x(i-1,j-1,k-1)
935 + fmx2y2z*(
x(i ,j-1,k-1)*Real(2.)
936 +
x(i ,j+1,k-1)*Real(2.)
937 +
x(i ,j-1,k+1)*Real(2.)
938 +
x(i ,j+1,k+1)*Real(2.))
939 + f2xmy2z*(
x(i-1,j ,k-1)*Real(2.)
940 +
x(i+1,j ,k-1)*Real(2.)
941 +
x(i-1,j ,k+1)*Real(2.)
942 +
x(i+1,j ,k+1)*Real(2.))
943 + f2x2ymz*(
x(i-1,j-1,k )*Real(2.)
944 +
x(i+1,j-1,k )*Real(2.)
945 +
x(i-1,j+1,k )*Real(2.)
946 +
x(i+1,j+1,k )*Real(2.))
947 + f4xm2ym2z*(
x(i-1,j,k)*Real(4.)
948 +
x(i+1,j,k)*Real(4.))
949 + fm2x4ym2z*(
x(i,j-1,k)*Real(4.)
950 +
x(i,j+1,k)*Real(4.))
951 + fm2xm2y4z*(
x(i,j,k-1)*Real(4.)
952 +
x(i,j,k+1)*Real(4.)));
961 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
962 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
963 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
966 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)
967 +sx(i-1,j-1,k )+sx(i,j-1,k )+sx(i-1,j,k )+sx(i,j,k ))
968 +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)
969 +sy(i-1,j-1,k )+sy(i,j-1,k )+sy(i-1,j,k )+sy(i,j,k ))
970 +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)
971 +sz(i-1,j-1,k )+sz(i,j-1,k )+sz(i-1,j,k )+sz(i,j,k ))));
976 void mlndlap_normalize_aa (
int i,
int j,
int k, Array4<Real>
const& x, Array4<Real const>
const& sig,
977 Array4<int const>
const& msk, GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
979 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
980 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
981 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
982 Real fxyz = facx + facy + facz;
985 x(i,j,k) = x(i,j,k) /
986 (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)
987 +sig(i-1,j-1,k )+sig(i,j-1,k )+sig(i-1,j,k )+sig(i,j,k )));
997 Real facx = Real(-4.0 / 36.0)*dxinv[0]*dxinv[0];
998 Real facy = Real(-4.0 / 36.0)*dxinv[1]*dxinv[1];
999 Real facz = Real(-4.0 / 36.0)*dxinv[2]*dxinv[2];
1002 sol(i,j,k) = Real(0.0);
1004 sol(i,j,k) += Real(2.0/3.0) * (rhs(i,j,k) - Ax)
1005 / (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)
1006 +sx(i-1,j-1,k )+sx(i,j-1,k )+sx(i-1,j,k )+sx(i,j,k ))
1007 +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)
1008 +sy(i-1,j-1,k )+sy(i,j-1,k )+sy(i-1,j,k )+sy(i,j,k ))
1009 +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)
1010 +sz(i-1,j-1,k )+sz(i,j-1,k )+sz(i-1,j,k )+sz(i,j,k )));
1020 Real facx = Real(-4.0 / 36.0)*dxinv[0]*dxinv[0];
1021 Real facy = Real(-4.0 / 36.0)*dxinv[1]*dxinv[1];
1022 Real facz = Real(-4.0 / 36.0)*dxinv[2]*dxinv[2];
1027 sol(i,j,k) = Real(0.0);
1029 sol(i,j,k) += Real(2.0/3.0) * (rhs(i,j,k) - Ax(i,j,k))
1030 / (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)
1031 +sx(i-1,j-1,k )+sx(i,j-1,k )+sx(i-1,j,k )+sx(i,j,k ))
1032 +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)
1033 +sy(i-1,j-1,k )+sy(i,j-1,k )+sy(i-1,j,k )+sy(i,j,k ))
1034 +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)
1035 +sz(i-1,j-1,k )+sz(i,j-1,k )+sz(i-1,j,k )+sz(i,j,k )));
1042 Array4<Real const>
const& rhs, Array4<Real const>
const& sig,
1043 Array4<int const>
const& msk, GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
1045 Real fxyz = Real(-4.0 / 36.0)*(dxinv[0]*dxinv[0] +
1050 sol(i,j,k) = Real(0.0);
1052 sol(i,j,k) += Real(2.0/3.0) * (rhs(i,j,k) - Ax)
1053 / (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)
1054 +sig(i-1,j-1,k )+sig(i,j-1,k )+sig(i-1,j,k )+sig(i,j,k )));
1059 void mlndlap_jacobi_c (
int i,
int j,
int k, Array4<Real>
const& sol, Real Ax,
1060 Array4<Real const>
const& rhs, Real sig,
1061 Array4<int const>
const& msk, GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
1063 Real fxyz = Real(-4.0 / 36.0)*(dxinv[0]*dxinv[0] +
1068 sol(i,j,k) = Real(0.0);
1070 sol(i,j,k) += Real(2.0/3.0) * (rhs(i,j,k) - Ax)
1071 / (fxyz*Real(8.)*sig);
1077 Array4<Real const>
const& rhs, Array4<Real const>
const& sig,
1078 Array4<int const>
const& msk, GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
1080 Real fxyz = Real(-4.0 / 36.0)*(dxinv[0]*dxinv[0] +
1087 sol(i,j,k) = Real(0.0);
1089 sol(i,j,k) += Real(2.0/3.0) * (rhs(i,j,k) - Ax(i,j,k))
1090 / (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)
1091 +sig(i-1,j-1,k )+sig(i,j-1,k )+sig(i-1,j,k )+sig(i,j,k )));
1097 void mlndlap_jacobi_c (
Box const& bx, Array4<Real>
const& sol, Array4<Real const>
const& Ax,
1098 Array4<Real const>
const& rhs, Real sig,
1099 Array4<int const>
const& msk, GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
1101 Real fxyz = Real(-4.0 / 36.0)*(dxinv[0]*dxinv[0] +
1108 sol(i,j,k) = Real(0.0);
1110 sol(i,j,k) += Real(2.0/3.0) * (rhs(i,j,k) - Ax(i,j,k))
1111 / (fxyz*Real(8.)*sig);
1123 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
1124 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
1125 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
1130 sol(i,j,k) = Real(0.0);
1132 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)
1133 +sx(i-1,j-1,k )+sx(i,j-1,k )+sx(i-1,j,k )+sx(i,j,k ))
1134 +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)
1135 +sy(i-1,j-1,k )+sy(i,j-1,k )+sy(i-1,j,k )+sy(i,j,k ))
1136 +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)
1137 +sz(i-1,j-1,k )+sz(i,j-1,k )+sz(i-1,j,k )+sz(i,j,k )));
1138 Real Ax = sol(i,j,k)*s0
1139 + sol(i-1,j-1,k-1)*(facx*sx(i-1,j-1,k-1)
1140 +facy*sy(i-1,j-1,k-1)
1141 +facz*sz(i-1,j-1,k-1))
1142 + sol(i+1,j-1,k-1)*(facx*sx(i ,j-1,k-1)
1143 +facy*sy(i ,j-1,k-1)
1144 +facz*sz(i ,j-1,k-1))
1145 + sol(i-1,j+1,k-1)*(facx*sx(i-1,j ,k-1)
1146 +facy*sy(i-1,j ,k-1)
1147 +facz*sz(i-1,j ,k-1))
1148 + sol(i+1,j+1,k-1)*(facx*sx(i ,j ,k-1)
1150 +facz*sz(i ,j ,k-1))
1151 + sol(i-1,j-1,k+1)*(facx*sx(i-1,j-1,k )
1152 +facy*sy(i-1,j-1,k )
1153 +facz*sz(i-1,j-1,k ))
1154 + sol(i+1,j-1,k+1)*(facx*sx(i ,j-1,k )
1156 +facz*sz(i ,j-1,k ))
1157 + sol(i-1,j+1,k+1)*(facx*sx(i-1,j ,k )
1159 +facz*sz(i-1,j ,k ))
1160 + sol(i+1,j+1,k+1)*(facx*sx(i ,j ,k )
1163 +sol(i ,j-1,k-1)*( -facx*(sx(i-1,j-1,k-1)+sx(i,j-1,k-1))
1164 +Real(2.0)*facy*(sy(i-1,j-1,k-1)+sy(i,j-1,k-1))
1165 +Real(2.0)*facz*(sz(i-1,j-1,k-1)+sz(i,j-1,k-1)))
1166 +sol(i ,j+1,k-1)*( -facx*(sx(i-1,j ,k-1)+sx(i,j ,k-1))
1167 +Real(2.0)*facy*(sy(i-1,j ,k-1)+sy(i,j ,k-1))
1168 +Real(2.0)*facz*(sz(i-1,j ,k-1)+sz(i,j ,k-1)))
1169 +sol(i ,j-1,k+1)*( -facx*(sx(i-1,j-1,k )+sx(i,j-1,k ))
1170 +Real(2.0)*facy*(sy(i-1,j-1,k )+sy(i,j-1,k ))
1171 +Real(2.0)*facz*(sz(i-1,j-1,k )+sz(i,j-1,k )))
1172 +sol(i ,j+1,k+1)*( -facx*(sx(i-1,j ,k )+sx(i,j ,k ))
1173 +Real(2.0)*facy*(sy(i-1,j ,k )+sy(i,j ,k ))
1174 +Real(2.0)*facz*(sz(i-1,j ,k )+sz(i,j ,k )))
1175 +sol(i-1,j ,k-1)*( Real(2.0)*facx*(sx(i-1,j-1,k-1)+sx(i-1,j,k-1))
1176 -facy*(sy(i-1,j-1,k-1)+sy(i-1,j,k-1))
1177 +Real(2.0)*facz*(sz(i-1,j-1,k-1)+sz(i-1,j,k-1)))
1178 +sol(i+1,j ,k-1)*( Real(2.0)*facx*(sx(i ,j-1,k-1)+sx(i ,j,k-1))
1179 -facy*(sy(i ,j-1,k-1)+sy(i ,j,k-1))
1180 +Real(2.0)*facz*(sz(i ,j-1,k-1)+sz(i ,j,k-1)))
1181 +sol(i-1,j ,k+1)*( Real(2.0)*facx*(sx(i-1,j-1,k )+sx(i-1,j,k ))
1182 -facy*(sy(i-1,j-1,k )+sy(i-1,j,k ))
1183 +Real(2.0)*facz*(sz(i-1,j-1,k )+sz(i-1,j,k )))
1184 +sol(i+1,j ,k+1)*( Real(2.0)*facx*(sx(i ,j-1,k )+sx(i ,j,k ))
1185 -facy*(sy(i ,j-1,k )+sy(i ,j,k ))
1186 +Real(2.0)*facz*(sz(i ,j-1,k )+sz(i ,j,k )))
1187 +sol(i-1,j-1,k )*( Real(2.0)*facx*(sx(i-1,j-1,k-1)+sx(i-1,j-1,k))
1188 +Real(2.0)*facy*(sy(i-1,j-1,k-1)+sy(i-1,j-1,k))
1189 -facz*(sz(i-1,j-1,k-1)+sz(i-1,j-1,k)))
1190 +sol(i+1,j-1,k )*( Real(2.0)*facx*(sx(i ,j-1,k-1)+sx(i ,j-1,k))
1191 +Real(2.0)*facy*(sy(i ,j-1,k-1)+sy(i ,j-1,k))
1192 -facz*(sz(i ,j-1,k-1)+sz(i ,j-1,k)))
1193 +sol(i-1,j+1,k )*( Real(2.0)*facx*(sx(i-1,j ,k-1)+sx(i-1,j ,k))
1194 +Real(2.0)*facy*(sy(i-1,j ,k-1)+sy(i-1,j ,k))
1195 -facz*(sz(i-1,j ,k-1)+sz(i-1,j ,k)))
1196 +sol(i+1,j+1,k )*( Real(2.0)*facx*(sx(i ,j ,k-1)+sx(i ,j ,k))
1197 +Real(2.0)*facy*(sy(i ,j ,k-1)+sy(i ,j ,k))
1198 -facz*(sz(i ,j ,k-1)+sz(i ,j ,k)))
1199 + 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))
1200 -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))
1201 -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)))
1202 + 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))
1203 -facy*(sy(i ,j-1,k-1)+sy(i ,j,k-1)+sy(i ,j-1,k)+sy(i ,j,k))
1204 -facz*(sz(i ,j-1,k-1)+sz(i ,j,k-1)+sz(i ,j-1,k)+sz(i ,j,k)))
1205 + 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))
1206 +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))
1207 -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)))
1208 + 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))
1209 +Real(2.0)*facy*(sy(i-1,j ,k-1)+sy(i,j ,k-1)+sy(i-1,j ,k)+sy(i,j ,k))
1210 -facz*(sz(i-1,j ,k-1)+sz(i,j ,k-1)+sz(i-1,j ,k)+sz(i,j ,k)))
1211 + 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))
1212 -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))
1213 +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)))
1214 + 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 ))
1215 -facy*(sy(i-1,j-1,k )+sy(i,j-1,k )+sy(i-1,j,k )+sy(i,j,k ))
1216 +Real(2.0)*facz*(sz(i-1,j-1,k )+sz(i,j-1,k )+sz(i-1,j,k )+sz(i,j,k )));
1218 sol(i,j,k) += (rhs(i,j,k) - Ax) / s0;
1225 Array4<Real const>
const& rhs, Array4<Real const>
const& sig,
1226 Array4<int const>
const& msk,
1227 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
1229 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
1230 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
1231 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
1232 Real fxyz = facx + facy + facz;
1233 Real fmx2y2z = -facx + Real(2.0)*facy + Real(2.0)*facz;
1234 Real f2xmy2z = Real(2.0)*facx - facy + Real(2.0)*facz;
1235 Real f2x2ymz = Real(2.0)*facx + Real(2.0)*facy - facz;
1236 Real f4xm2ym2z = Real(4.0)*facx - Real(2.0)*facy - Real(2.0)*facz;
1237 Real fm2x4ym2z = -Real(2.0)*facx + Real(4.0)*facy - Real(2.0)*facz;
1238 Real fm2xm2y4z = -Real(2.0)*facx - Real(2.0)*facy + Real(4.0)*facz;
1243 sol(i,j,k) = Real(0.0);
1245 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)
1246 +sig(i-1,j-1,k )+sig(i,j-1,k )+sig(i-1,j,k )+sig(i,j,k ));
1247 Real Ax = sol(i,j,k)*s0
1248 + fxyz*(sol(i-1,j-1,k-1)*sig(i-1,j-1,k-1)
1249 + sol(i+1,j-1,k-1)*sig(i ,j-1,k-1)
1250 + sol(i-1,j+1,k-1)*sig(i-1,j ,k-1)
1251 + sol(i+1,j+1,k-1)*sig(i ,j ,k-1)
1252 + sol(i-1,j-1,k+1)*sig(i-1,j-1,k )
1253 + sol(i+1,j-1,k+1)*sig(i ,j-1,k )
1254 + sol(i-1,j+1,k+1)*sig(i-1,j ,k )
1255 + sol(i+1,j+1,k+1)*sig(i ,j ,k ))
1256 + fmx2y2z*(sol(i ,j-1,k-1)*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1))
1257 + sol(i ,j+1,k-1)*(sig(i-1,j ,k-1)+sig(i,j ,k-1))
1258 + sol(i ,j-1,k+1)*(sig(i-1,j-1,k )+sig(i,j-1,k ))
1259 + sol(i ,j+1,k+1)*(sig(i-1,j ,k )+sig(i,j ,k )))
1260 + f2xmy2z*(sol(i-1,j ,k-1)*(sig(i-1,j-1,k-1)+sig(i-1,j,k-1))
1261 + sol(i+1,j ,k-1)*(sig(i ,j-1,k-1)+sig(i ,j,k-1))
1262 + sol(i-1,j ,k+1)*(sig(i-1,j-1,k )+sig(i-1,j,k ))
1263 + sol(i+1,j ,k+1)*(sig(i ,j-1,k )+sig(i ,j,k )))
1264 + f2x2ymz*(sol(i-1,j-1,k )*(sig(i-1,j-1,k-1)+sig(i-1,j-1,k))
1265 + sol(i+1,j-1,k )*(sig(i ,j-1,k-1)+sig(i ,j-1,k))
1266 + sol(i-1,j+1,k )*(sig(i-1,j ,k-1)+sig(i-1,j ,k))
1267 + sol(i+1,j+1,k )*(sig(i ,j ,k-1)+sig(i ,j ,k)))
1268 + 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))
1269 + 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)))
1270 + 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))
1271 + 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)))
1272 + 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))
1273 + 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 )));
1275 sol(i,j,k) += (rhs(i,j,k) - Ax) / s0;
1282 Array4<Real const>
const& rhs, Real sig,
1283 Array4<int const>
const& msk,
1284 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
1286 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
1287 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
1288 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
1289 Real fxyz = facx + facy + facz;
1290 Real fmx2y2z = -facx + Real(2.0)*facy + Real(2.0)*facz;
1291 Real f2xmy2z = Real(2.0)*facx - facy + Real(2.0)*facz;
1292 Real f2x2ymz = Real(2.0)*facx + Real(2.0)*facy - facz;
1293 Real f4xm2ym2z = Real(4.0)*facx - Real(2.0)*facy - Real(2.0)*facz;
1294 Real fm2x4ym2z = -Real(2.0)*facx + Real(4.0)*facy - Real(2.0)*facz;
1295 Real fm2xm2y4z = -Real(2.0)*facx - Real(2.0)*facy + Real(4.0)*facz;
1300 sol(i,j,k) = Real(0.0);
1302 Real s0 = Real(-4.0)*fxyz*Real(8.);
1303 Real Ax = sol(i,j,k)*s0
1304 + fxyz*(sol(i-1,j-1,k-1)
1312 + fmx2y2z*(sol(i ,j-1,k-1)*Real(2.)
1313 + sol(i ,j+1,k-1)*Real(2.)
1314 + sol(i ,j-1,k+1)*Real(2.)
1315 + sol(i ,j+1,k+1)*Real(2.))
1316 + f2xmy2z*(sol(i-1,j ,k-1)*Real(2.)
1317 + sol(i+1,j ,k-1)*Real(2.)
1318 + sol(i-1,j ,k+1)*Real(2.)
1319 + sol(i+1,j ,k+1)*Real(2.))
1320 + f2x2ymz*(sol(i-1,j-1,k )*Real(2.)
1321 + sol(i+1,j-1,k )*Real(2.)
1322 + sol(i-1,j+1,k )*Real(2.)
1323 + sol(i+1,j+1,k )*Real(2.))
1324 + f4xm2ym2z*(sol(i-1,j,k)*Real(4.)
1325 + sol(i+1,j,k)*Real(4.))
1326 + fm2x4ym2z*(sol(i,j-1,k)*Real(4.)
1327 + sol(i,j+1,k)*Real(4.))
1328 + fm2xm2y4z*(sol(i,j,k-1)*Real(4.)
1329 + sol(i,j,k+1)*Real(4.));
1331 sol(i,j,k) += (rhs(i,j,k) - Ax*sig) / (s0*sig);
1337 void tridiagonal_solve (Array1D<Real,0,31>& a_ls, Array1D<Real,0,31>& b_ls, Array1D<Real,0,31>& c_ls,
1338 Array1D<Real,0,31>& r_ls, Array1D<Real,0,31>& u_ls, Array1D<Real,0,31>& gam,
1342 u_ls(0) = r_ls(0) / bet;
1344 for (
int i = 1; i <= ilen - 1; i++) {
1345 gam(i) = c_ls(i-1) / bet;
1346 bet = b_ls(i) - a_ls(i)*gam(i);
1348 u_ls(i) = (r_ls(i)-a_ls(i)*u_ls(i-1)) / bet;
1350 for (
int i = ilen-2; i >= 0; i--) {
1351 u_ls(i) = u_ls(i) - gam(i+1)*u_ls(i+1);
1357 Array4<Real const>
const& rhs, Array4<Real const>
const& sig,
1358 Array4<int const>
const& msk,
1359 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
1361 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
1362 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
1363 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
1364 Real fxyz = facx + facy + facz;
1365 Real fmx2y2z = -facx + Real(2.0)*facy + Real(2.0)*facz;
1366 Real f2xmy2z = Real(2.0)*facx - facy + Real(2.0)*facz;
1367 Real f2x2ymz = Real(2.0)*facx + Real(2.0)*facy - facz;
1368 Real f4xm2ym2z = Real(4.0)*facx - Real(2.0)*facy - Real(2.0)*facz;
1369 Real fm2x4ym2z = -Real(2.0)*facx + Real(4.0)*facy - Real(2.0)*facz;
1370 Real fm2xm2y4z = -Real(2.0)*facx - Real(2.0)*facy + Real(4.0)*facz;
1378 if ( (dxinv[0] <= dxinv[2]) && (dxinv[1] <= dxinv[2]) ) {
1380 ilen = hi.z - lo.z + 1;
1382 if ( (dxinv[0] <= dxinv[1]) && (dxinv[2] <= dxinv[1]) ) {
1384 ilen = hi.y - lo.y + 1;
1386 if ( (dxinv[1] <= dxinv[0]) && (dxinv[2] <= dxinv[0]) ) {
1388 ilen = hi.x - lo.x + 1;
1392 amrex::Abort(
"mlndlap_gauss_seidel_with_line_solve_aa is hard-wired to be no longer than 32");
1395 Array1D<Real,0,31> a_ls,b_ls,c_ls,u_ls,r_ls,gam;
1400 for (
int j = lo.y; j <= hi.y; ++j)
1402 for (
int i = lo.x; i <= hi.x; ++i)
1404 for (
int k = lo.z; k <= hi.z; ++k)
1408 a_ls(k-lo.z) = Real(0.);
1409 b_ls(k-lo.z) = Real(1.);
1410 c_ls(k-lo.z) = Real(0.);
1411 u_ls(k-lo.z) = Real(0.);
1412 r_ls(k-lo.z) = Real(0.);
1416 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)
1417 + sig(i-1,j-1,k )+sig(i,j-1,k )+sig(i-1,j,k )+sig(i,j,k ));
1419 Real Ax = fxyz*(sol(i-1,j-1,k-1)*sig(i-1,j-1,k-1)
1420 + sol(i+1,j-1,k-1)*sig(i ,j-1,k-1)
1421 + sol(i-1,j+1,k-1)*sig(i-1,j ,k-1)
1422 + sol(i+1,j+1,k-1)*sig(i ,j ,k-1)
1423 + sol(i-1,j-1,k+1)*sig(i-1,j-1,k )
1424 + sol(i+1,j-1,k+1)*sig(i ,j-1,k )
1425 + sol(i-1,j+1,k+1)*sig(i-1,j ,k )
1426 + sol(i+1,j+1,k+1)*sig(i ,j ,k ))
1427 + fmx2y2z*(sol(i ,j-1,k-1)*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1))
1428 + sol(i ,j+1,k-1)*(sig(i-1,j ,k-1)+sig(i,j ,k-1))
1429 + sol(i ,j-1,k+1)*(sig(i-1,j-1,k )+sig(i,j-1,k ))
1430 + sol(i ,j+1,k+1)*(sig(i-1,j ,k )+sig(i,j ,k )))
1431 + f2xmy2z*(sol(i-1,j ,k-1)*(sig(i-1,j-1,k-1)+sig(i-1,j,k-1))
1432 + sol(i+1,j ,k-1)*(sig(i ,j-1,k-1)+sig(i ,j,k-1))
1433 + sol(i-1,j ,k+1)*(sig(i-1,j-1,k )+sig(i-1,j,k ))
1434 + sol(i+1,j ,k+1)*(sig(i ,j-1,k )+sig(i ,j,k )))
1435 + f2x2ymz*(sol(i-1,j-1,k )*(sig(i-1,j-1,k-1)+sig(i-1,j-1,k))
1436 + sol(i+1,j-1,k )*(sig(i ,j-1,k-1)+sig(i ,j-1,k))
1437 + sol(i-1,j+1,k )*(sig(i-1,j ,k-1)+sig(i-1,j ,k))
1438 + sol(i+1,j+1,k )*(sig(i ,j ,k-1)+sig(i ,j ,k)))
1439 + 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))
1440 + 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)))
1441 + 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))
1442 + 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)));
1444 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));
1446 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 ));
1447 u_ls(k-lo.z) = Real(0.);
1448 r_ls(k-lo.z) = rhs(i,j,k) - Ax;
1453 for (
int k = lo.z; k <= hi.z; ++k)
1455 sol(i,j,k) = u_ls(k-lo.z);
1462 for (
int k = lo.z; k <= hi.z; ++k)
1464 for (
int i = lo.x; i <= hi.x; ++i)
1466 for (
int j = lo.y; j <= hi.y; ++j)
1469 a_ls(j-lo.y) = Real(0.);
1470 b_ls(j-lo.y) = Real(1.);
1471 c_ls(j-lo.y) = Real(0.);
1472 u_ls(j-lo.y) = Real(0.);
1473 r_ls(j-lo.y) = Real(0.);
1477 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)
1478 + sig(i-1,j-1,k )+sig(i,j-1,k )+sig(i-1,j,k )+sig(i,j,k ));
1480 Real Ax = fxyz*(sol(i-1,j-1,k-1)*sig(i-1,j-1,k-1)
1481 + sol(i+1,j-1,k-1)*sig(i ,j-1,k-1)
1482 + sol(i-1,j+1,k-1)*sig(i-1,j ,k-1)
1483 + sol(i+1,j+1,k-1)*sig(i ,j ,k-1)
1484 + sol(i-1,j-1,k+1)*sig(i-1,j-1,k )
1485 + sol(i+1,j-1,k+1)*sig(i ,j-1,k )
1486 + sol(i-1,j+1,k+1)*sig(i-1,j ,k )
1487 + sol(i+1,j+1,k+1)*sig(i ,j ,k ))
1488 + fmx2y2z*(sol(i ,j-1,k-1)*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1))
1489 + sol(i ,j+1,k-1)*(sig(i-1,j ,k-1)+sig(i,j ,k-1))
1490 + sol(i ,j-1,k+1)*(sig(i-1,j-1,k )+sig(i,j-1,k ))
1491 + sol(i ,j+1,k+1)*(sig(i-1,j ,k )+sig(i,j ,k )))
1492 + f2xmy2z*(sol(i-1,j ,k-1)*(sig(i-1,j-1,k-1)+sig(i-1,j,k-1))
1493 + sol(i+1,j ,k-1)*(sig(i ,j-1,k-1)+sig(i ,j,k-1))
1494 + sol(i-1,j ,k+1)*(sig(i-1,j-1,k )+sig(i-1,j,k ))
1495 + sol(i+1,j ,k+1)*(sig(i ,j-1,k )+sig(i ,j,k )))
1496 + f2x2ymz*(sol(i-1,j-1,k )*(sig(i-1,j-1,k-1)+sig(i-1,j-1,k))
1497 + sol(i+1,j-1,k )*(sig(i ,j-1,k-1)+sig(i ,j-1,k))
1498 + sol(i-1,j+1,k )*(sig(i-1,j ,k-1)+sig(i-1,j ,k))
1499 + sol(i+1,j+1,k )*(sig(i ,j ,k-1)+sig(i ,j ,k)))
1500 + 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))
1501 + 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)))
1502 + 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))
1503 + 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 )));
1505 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));
1507 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));
1508 u_ls(j-lo.y) = Real(0.);
1509 r_ls(j-lo.y) = rhs(i,j,k) - Ax;
1515 for (
int j = lo.y; j <= hi.y; ++j)
1517 sol(i,j,k) = u_ls(j-lo.y);
1524 for (
int j = lo.y; j <= hi.y; ++j)
1526 for (
int k = lo.z; k <= hi.z; ++k)
1528 for (
int i = lo.x; i <= hi.x; ++i)
1532 a_ls(i-lo.x) = Real(0.);
1533 b_ls(i-lo.x) = Real(1.);
1534 c_ls(i-lo.x) = Real(0.);
1535 u_ls(i-lo.x) = Real(0.);
1536 r_ls(i-lo.x) = Real(0.);
1540 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)
1541 + sig(i-1,j-1,k )+sig(i,j-1,k )+sig(i-1,j,k )+sig(i,j,k ));
1543 Real Ax = fxyz*(sol(i-1,j-1,k-1)*sig(i-1,j-1,k-1)
1544 + sol(i+1,j-1,k-1)*sig(i ,j-1,k-1)
1545 + sol(i-1,j+1,k-1)*sig(i-1,j ,k-1)
1546 + sol(i+1,j+1,k-1)*sig(i ,j ,k-1)
1547 + sol(i-1,j-1,k+1)*sig(i-1,j-1,k )
1548 + sol(i+1,j-1,k+1)*sig(i ,j-1,k )
1549 + sol(i-1,j+1,k+1)*sig(i-1,j ,k )
1550 + sol(i+1,j+1,k+1)*sig(i ,j ,k ))
1551 + fmx2y2z*(sol(i ,j-1,k-1)*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1))
1552 + sol(i ,j+1,k-1)*(sig(i-1,j ,k-1)+sig(i,j ,k-1))
1553 + sol(i ,j-1,k+1)*(sig(i-1,j-1,k )+sig(i,j-1,k ))
1554 + sol(i ,j+1,k+1)*(sig(i-1,j ,k )+sig(i,j ,k )))
1555 + f2xmy2z*(sol(i-1,j ,k-1)*(sig(i-1,j-1,k-1)+sig(i-1,j,k-1))
1556 + sol(i+1,j ,k-1)*(sig(i ,j-1,k-1)+sig(i ,j,k-1))
1557 + sol(i-1,j ,k+1)*(sig(i-1,j-1,k )+sig(i-1,j,k ))
1558 + sol(i+1,j ,k+1)*(sig(i ,j-1,k )+sig(i ,j,k )))
1559 + f2x2ymz*(sol(i-1,j-1,k )*(sig(i-1,j-1,k-1)+sig(i-1,j-1,k))
1560 + sol(i+1,j-1,k )*(sig(i ,j-1,k-1)+sig(i ,j-1,k))
1561 + sol(i-1,j+1,k )*(sig(i-1,j ,k-1)+sig(i-1,j ,k))
1562 + sol(i+1,j+1,k )*(sig(i ,j ,k-1)+sig(i ,j ,k)))
1563 + 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))
1564 + 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)))
1565 + 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))
1566 + 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 )));
1568 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));
1570 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));
1571 u_ls(i-lo.x) = Real(0.);
1572 r_ls(i-lo.x) = rhs(i,j,k) - Ax;
1577 for (
int i = lo.x; i <= hi.x; ++i)
1579 sol(i,j,k) = u_ls(i-lo.x);
1586 amrex::Abort(
"mlndlap_gauss_seidel_with_line_solve_aa is wrong direction.");
1596 Array4<Real const>
const&
fine, Array4<int const>
const& msk) noexcept
1601 if (msk(ii,jj,kk)) {
1602 crse(i,j,k) = Real(0.0);
1604 crse(i,j,k) = Real(1./64.)*(
fine(ii-1,jj-1,kk-1)+
fine(ii+1,jj-1,kk-1)
1605 +
fine(ii-1,jj+1,kk-1)+
fine(ii+1,jj+1,kk-1)
1606 +
fine(ii-1,jj-1,kk+1)+
fine(ii+1,jj-1,kk+1)
1607 +
fine(ii-1,jj+1,kk+1)+
fine(ii+1,jj+1,kk+1))
1608 + Real(1./32.)*(
fine(ii ,jj-1,kk-1)+
fine(ii ,jj+1,kk-1)
1609 +
fine(ii ,jj-1,kk+1)+
fine(ii ,jj+1,kk+1)
1610 +
fine(ii-1,jj ,kk-1)+
fine(ii+1,jj ,kk-1)
1611 +
fine(ii-1,jj ,kk+1)+
fine(ii+1,jj ,kk+1)
1612 +
fine(ii-1,jj-1,kk )+
fine(ii+1,jj-1,kk )
1613 +
fine(ii-1,jj+1,kk )+
fine(ii+1,jj+1,kk ))
1614 + Real(1./16.)*(
fine(ii-1,jj,kk)+
fine(ii+1,jj,kk)
1616 +
fine(ii,jj,kk-1)+
fine(ii,jj,kk+1))
1617 + Real(1./8.)*
fine(ii,jj,kk);
1624 Array4<Real const>
const&
fine, Array4<int const>
const& msk,
1626 GpuArray<LinOpBCType, AMREX_SPACEDIM>
const& bclo,
1627 GpuArray<LinOpBCType, AMREX_SPACEDIM>
const& bchi) noexcept
1629 const int ii = i*rr;
1630 const int jj = j*rr;
1631 const int kk = k*rr;
1632 if (msk(ii,jj,kk)) {
1633 crse(i,j,k) = Real(0.0);
1637 Real tmp = Real(0.0);
1638 for (
int koff = -rr+1; koff <= rr-1; ++koff) {
1640 for (
int joff = -rr+1; joff <= rr-1; ++joff) {
1642 for (
int ioff = -rr+1; ioff <= rr-1; ++ioff) {
1644 int itmp = ii + ioff;
1645 int jtmp = jj + joff;
1646 int ktmp = kk + koff;
1647 if ((itmp < ndlo.x && (bclo[0] == LinOpBCType::Neumann ||
1648 bclo[0] == LinOpBCType::inflow)) ||
1649 (itmp > ndhi.x && (bchi[0] == LinOpBCType::Neumann ||
1650 bchi[0] == LinOpBCType::inflow))) {
1653 if ((jtmp < ndlo.y && (bclo[1] == LinOpBCType::Neumann ||
1654 bclo[1] == LinOpBCType::inflow)) ||
1655 (jtmp > ndhi.y && (bchi[1] == LinOpBCType::Neumann ||
1656 bchi[1] == LinOpBCType::inflow))) {
1659 if ((ktmp < ndlo.z && (bclo[2] == LinOpBCType::Neumann ||
1660 bclo[2] == LinOpBCType::inflow)) ||
1661 (ktmp > ndhi.z && (bchi[2] == LinOpBCType::Neumann ||
1662 bchi[2] == LinOpBCType::inflow))) {
1665 tmp += wx*wy*wz*
fine(itmp,jtmp,ktmp);
1669 crse(i,j,k) = tmp/Real(rr*rr*rr*rr*rr*rr);
1675 Array4<Real const>
const&
fine, Array4<int const>
const& msk,
int idir) noexcept
1682 if (msk(ii,jj,kk)) {
1683 crse(i,j,k) = Real(0.0);
1685 crse(i,j,k) = Real(1./16.)*(
fine(ii-1,jj-1,kk) + Real(2.)*
fine(ii ,jj-1,kk) +
fine(ii+1,jj-1,kk)
1686 + Real(2.)*
fine(ii-1,jj ,kk) + Real(4.)*
fine(ii ,jj ,kk) + Real(2.)*
fine(ii+1,jj ,kk)
1687 +
fine(ii-1,jj+1,kk) + Real(2.)*
fine(ii ,jj+1,kk) +
fine(ii+1,jj+1,kk));
1695 if (msk(ii,jj,kk)) {
1696 crse(i,j,k) = Real(0.0);
1698 crse(i,j,k) = Real(1./16.)*(
fine(ii-1,jj,kk-1) + Real(2.)*
fine(ii ,jj,kk-1) +
fine(ii+1,jj,kk-1)
1699 + Real(2.)*
fine(ii-1,jj ,kk) + Real(4.)*
fine(ii ,jj,kk ) + Real(2.)*
fine(ii+1,jj,kk )
1700 +
fine(ii-1,jj,kk+1) + Real(2.)*
fine(ii ,jj,kk+1) +
fine(ii+1,jj,kk+1));
1708 if (msk(ii,jj,kk)) {
1709 crse(i,j,k) = Real(0.0);
1711 crse(i,j,k) = Real(1./16.)*(
fine(ii,jj-1,kk-1) + Real(2.)*
fine(ii ,jj,kk-1) +
fine(ii,jj+1,kk-1)
1712 + Real(2.)*
fine(ii,jj-1 ,kk) + Real(4.)*
fine(ii ,jj,kk ) + Real(2.)*
fine(ii,jj+1,kk )
1713 +
fine(ii,jj-1,kk+1) + Real(2.)*
fine(ii ,jj,kk+1) +
fine(ii,jj+1,kk+1));
1718 amrex::Abort(
"mlndlap_semi_restriction semi direction wrong semi-direction. ");
1728 int i,
int j,
int k,
int ic,
int jc,
int kc) noexcept
1730 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);
1731 Real w2 = sig(i ,j-1,k-1) + sig(i ,j,k-1) + sig(i ,j-1,k) + sig(i ,j,k);
1732 return (w1*
crse(ic,jc,kc)+w2*
crse(ic+1,jc,kc))/(w1+w2);
1737 int i,
int j,
int k,
int ic,
int jc,
int kc) noexcept
1739 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);
1740 Real w2 = sig(i-1,j ,k-1) + sig(i,j ,k-1) + sig(i-1,j ,k) + sig(i,j ,k);
1741 return (w1*
crse(ic,jc,kc)+w2*
crse(ic,jc+1,kc))/(w1+w2);
1746 int i,
int j,
int k,
int ic,
int jc,
int kc) noexcept
1748 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);
1749 Real w2 = sig(i-1,j-1,k ) + sig(i,j-1,k ) + sig(i-1,j,k ) + sig(i,j,k );
1750 return (w1*
crse(ic,jc,kc)+w2*
crse(ic,jc,kc+1))/(w1+w2);
1755 int i,
int j,
int k,
int ic,
int jc,
int kc) noexcept
1757 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);
1758 Real w2 = sig(i ,j-1,k-1) + sig(i ,j,k-1) + sig(i ,j-1,k) + sig(i ,j,k);
1759 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);
1760 Real w4 = sig(i-1,j ,k-1) + sig(i,j ,k-1) + sig(i-1,j ,k) + sig(i,j ,k);
1769 int i,
int j,
int k,
int ic,
int jc,
int kc) noexcept
1771 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);
1772 Real w2 = sig(i ,j-1,k-1) + sig(i ,j,k-1) + sig(i ,j-1,k) + sig(i ,j,k);
1773 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);
1774 Real w4 = sig(i-1,j-1,k ) + sig(i,j-1,k ) + sig(i-1,j,k ) + sig(i,j,k );
1783 int i,
int j,
int k,
int ic,
int jc,
int kc) noexcept
1785 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);
1786 Real w2 = sig(i-1,j ,k-1) + sig(i,j ,k-1) + sig(i-1,j ,k) + sig(i,j ,k);
1787 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);
1788 Real w4 = sig(i-1,j-1,k ) + sig(i,j-1,k ) + sig(i-1,j,k ) + sig(i,j,k );
1797 Array4<Real const>
const&
crse,
1798 Array4<int const>
const& msk) noexcept
1804 bool i_is_odd = (ic*2 != i);
1805 bool j_is_odd = (jc*2 != j);
1806 bool k_is_odd = (kc*2 != k);
1807 if (i_is_odd && j_is_odd && k_is_odd) {
1809 fine(i,j,k) += Real(0.125) *
1810 (
crse(ic,jc ,kc ) +
crse(ic+1,jc ,kc ) +
1811 crse(ic,jc+1,kc ) +
crse(ic+1,jc+1,kc ) +
1812 crse(ic,jc ,kc+1) +
crse(ic+1,jc ,kc+1) +
1813 crse(ic,jc+1,kc+1) +
crse(ic+1,jc+1,kc+1));
1814 }
else if (j_is_odd && k_is_odd) {
1816 fine(i,j,k) += Real(0.25) *
1817 (
crse(ic,jc,kc ) +
crse(ic,jc+1,kc ) +
1818 crse(ic,jc,kc+1) +
crse(ic,jc+1,kc+1));
1819 }
else if (i_is_odd && k_is_odd) {
1821 fine(i,j,k) += Real(0.25) *
1822 (
crse(ic,jc,kc ) +
crse(ic+1,jc,kc ) +
1823 crse(ic,jc,kc+1) +
crse(ic+1,jc,kc+1));
1824 }
else if (i_is_odd && j_is_odd) {
1826 fine(i,j,k) += Real(0.25) *
1827 (
crse(ic,jc ,kc) +
crse(ic+1,jc ,kc) +
1828 crse(ic,jc+1,kc) +
crse(ic+1,jc+1,kc));
1829 }
else if (i_is_odd) {
1831 fine(i,j,k) += Real(0.5)*(
crse(ic,jc,kc)+
crse(ic+1,jc,kc));
1832 }
else if (j_is_odd) {
1834 fine(i,j,k) += Real(0.5)*(
crse(ic,jc,kc)+
crse(ic,jc+1,kc));
1835 }
else if (k_is_odd) {
1837 fine(i,j,k) += Real(0.5)*(
crse(ic,jc,kc)+
crse(ic,jc,kc+1));
1847 Array4<Real const>
const&
crse, Array4<Real const>
const& sig,
1848 Array4<int const>
const& msk) noexcept
1854 bool i_is_odd = (ic*2 != i);
1855 bool j_is_odd = (jc*2 != j);
1856 bool k_is_odd = (kc*2 != k);
1857 if (i_is_odd && j_is_odd && k_is_odd) {
1859 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);
1860 Real w2 = sig(i ,j-1,k-1) + sig(i ,j,k-1) + sig(i ,j-1,k) + sig(i ,j,k);
1861 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);
1862 Real w4 = sig(i-1,j ,k-1) + sig(i,j ,k-1) + sig(i-1,j ,k) + sig(i,j ,k);
1863 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);
1864 Real w6 = sig(i-1,j-1,k ) + sig(i,j-1,k ) + sig(i-1,j,k ) + sig(i,j,k );
1871 / (w1+w2+w3+w4+w5+w6);
1872 }
else if (j_is_odd && k_is_odd) {
1875 }
else if (i_is_odd && k_is_odd) {
1878 }
else if (i_is_odd && j_is_odd) {
1881 }
else if (i_is_odd) {
1884 }
else if (j_is_odd) {
1887 }
else if (k_is_odd) {
1899 Array4<Real const>
const&
crse, Array4<Real const>
const& sig,
1900 Array4<int const>
const& msk,
int idir) noexcept
1908 bool i_is_odd = (ic*2 != i);
1909 bool j_is_odd = (jc*2 != j);
1911 if (i_is_odd && j_is_odd) {
1914 }
else if (i_is_odd) {
1917 }
else if (j_is_odd) {
1925 }
else if (
idir ==1 ){
1930 bool i_is_odd = (ic*2 != i);
1931 bool k_is_odd = (kc*2 != k);
1933 if (i_is_odd && k_is_odd) {
1936 }
else if (i_is_odd) {
1939 }
else if (k_is_odd) {
1947 }
else if (
idir == 0 ) {
1952 bool j_is_odd = (jc*2 != j);
1953 bool k_is_odd = (kc*2 != k);
1955 if (j_is_odd && k_is_odd) {
1958 }
else if (j_is_odd) {
1961 }
else if (k_is_odd) {
1970 amrex::Abort(
"mlndlap_semi_interpolation semi direction wrong semi-direction. ");
1978 int i,
int j,
int k,
int ic,
int jc,
int kc) noexcept
1980 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);
1981 Real w2 = sigx(i ,j-1,k-1) + sigx(i ,j,k-1) + sigx(i ,j-1,k) + sigx(i ,j,k);
1982 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);
1983 Real w4 = sigy(i-1,j ,k-1) + sigy(i,j ,k-1) + sigy(i-1,j ,k) + sigy(i,j ,k);
1993 int i,
int j,
int k,
int ic,
int jc,
int kc) noexcept
1995 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);
1996 Real w2 = sigx(i ,j-1,k-1) + sigx(i ,j,k-1) + sigx(i ,j-1,k) + sigx(i ,j,k);
1997 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);
1998 Real w4 = sigz(i-1,j-1,k ) + sigz(i,j-1,k ) + sigz(i-1,j,k ) + sigz(i,j,k );
2008 int i,
int j,
int k,
int ic,
int jc,
int kc) noexcept
2010 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);
2011 Real w2 = sigy(i-1,j ,k-1) + sigy(i,j ,k-1) + sigy(i-1,j ,k) + sigy(i,j ,k);
2012 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);
2013 Real w4 = sigz(i-1,j-1,k ) + sigz(i,j-1,k ) + sigz(i-1,j,k ) + sigz(i,j,k );
2030 bool i_is_odd = (ic*2 != i);
2031 bool j_is_odd = (jc*2 != j);
2032 bool k_is_odd = (kc*2 != k);
2033 if (i_is_odd && j_is_odd && k_is_odd) {
2035 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);
2036 Real w2 = sigx(i ,j-1,k-1) + sigx(i ,j,k-1) + sigx(i ,j-1,k) + sigx(i ,j,k);
2037 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);
2038 Real w4 = sigy(i-1,j ,k-1) + sigy(i,j ,k-1) + sigy(i-1,j ,k) + sigy(i,j ,k);
2039 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);
2040 Real w6 = sigz(i-1,j-1,k ) + sigz(i,j-1,k ) + sigz(i-1,j,k ) + sigz(i,j,k );
2041 fine(i,j,k) += (w1 *
ha_interp_face_yz(
crse,sigy,sigz,i-1,j ,k ,ic ,jc ,kc ) +
2047 / (w1+w2+w3+w4+w5+w6);
2048 }
else if (j_is_odd && k_is_odd) {
2050 fine(i,j,k) +=
ha_interp_face_yz(
crse,sigy,sigz,i,j,k,ic,jc,kc);
2051 }
else if (i_is_odd && k_is_odd) {
2053 fine(i,j,k) +=
ha_interp_face_xz(
crse,sigx,sigz,i,j,k,ic,jc,kc);
2054 }
else if (i_is_odd && j_is_odd) {
2056 fine(i,j,k) +=
ha_interp_face_xy(
crse,sigx,sigy,i,j,k,ic,jc,kc);
2057 }
else if (i_is_odd) {
2060 }
else if (j_is_odd) {
2063 }
else if (k_is_odd) {
2078 void mlndlap_divu (
int i,
int j,
int k, Array4<Real>
const& rhs, Array4<Real const>
const& vel,
2079 Array4<int const>
const& msk,
2080 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
2081 Box const& nodal_domain,
2082 GpuArray<LinOpBCType, AMREX_SPACEDIM>
const& bclo,
2083 GpuArray<LinOpBCType, AMREX_SPACEDIM>
const& bchi) noexcept
2085 Real facx = Real(0.25)*dxinv[0];
2086 Real facy = Real(0.25)*dxinv[1];
2087 Real facz = Real(0.25)*dxinv[2];
2093 rhs(i,j,k) = Real(0.0);
2096 Real zero_ilo = Real(1.0);
2097 Real zero_ihi = Real(1.0);
2098 Real zero_jlo = Real(1.0);
2099 Real zero_jhi = Real(1.0);
2100 Real zero_klo = Real(1.0);
2101 Real zero_khi = Real(1.0);
2105 if ((bclo[0] == LinOpBCType::Neumann || bclo[0] == LinOpBCType::inflow)
2108 zero_ilo = Real(0.0);
2110 if ((bchi[0] == LinOpBCType::Neumann || bchi[0] == LinOpBCType::inflow)
2113 zero_ihi = Real(0.0);
2115 if ((bclo[1] == LinOpBCType::Neumann || bclo[1] == LinOpBCType::inflow)
2118 zero_jlo = Real(0.0);
2120 if ((bchi[1] == LinOpBCType::Neumann || bchi[1] == LinOpBCType::inflow)
2123 zero_jhi = Real(0.0);
2125 if ((bclo[2] == LinOpBCType::Neumann || bclo[2] == LinOpBCType::inflow)
2128 zero_klo = Real(0.0);
2130 if ((bchi[2] == LinOpBCType::Neumann || bchi[2] == LinOpBCType::inflow)
2133 zero_khi = Real(0.0);
2136 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
2137 -vel(i-1,j ,k-1,0)*zero_jhi*zero_klo+vel(i,j ,k-1,0)*zero_jhi*zero_klo
2138 -vel(i-1,j-1,k ,0)*zero_jlo*zero_khi+vel(i,j-1,k ,0)*zero_jlo*zero_khi
2139 -vel(i-1,j ,k ,0)*zero_jhi*zero_khi+vel(i,j ,k ,0)*zero_jhi*zero_khi)
2141 + facy*(-vel(i-1,j-1,k-1,1)*zero_ilo*zero_klo-vel(i,j-1,k-1,1)*zero_ihi*zero_klo
2142 +vel(i-1,j ,k-1,1)*zero_ilo*zero_klo+vel(i,j ,k-1,1)*zero_ihi*zero_klo
2143 -vel(i-1,j-1,k ,1)*zero_ilo*zero_khi-vel(i,j-1,k ,1)*zero_ihi*zero_khi
2144 +vel(i-1,j ,k ,1)*zero_ilo*zero_khi+vel(i,j ,k ,1)*zero_ihi*zero_khi)
2146 + facz*(-vel(i-1,j-1,k-1,2)*zero_ilo*zero_jlo-vel(i,j-1,k-1,2)*zero_ihi*zero_jlo
2147 -vel(i-1,j ,k-1,2)*zero_ilo*zero_jhi-vel(i,j ,k-1,2)*zero_ihi*zero_jhi
2148 +vel(i-1,j-1,k ,2)*zero_ilo*zero_jlo+vel(i,j-1,k ,2)*zero_ihi*zero_jlo
2149 +vel(i-1,j ,k ,2)*zero_ilo*zero_jhi+vel(i,j ,k ,2)*zero_ihi*zero_jhi);
2154 Real
mlndlap_rhcc (
int i,
int j,
int k, Array4<Real const>
const& rhcc,
2155 Array4<int const>
const& msk) noexcept
2161 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) +
2162 rhcc(i-1,j-1,k )+rhcc(i,j-1,k )+rhcc(i-1,j,k )+rhcc(i,j,k ));
2168 void mlndlap_mknewu (
int i,
int j,
int k, Array4<Real>
const& u, Array4<Real const>
const& p,
2169 Array4<Real const>
const& sig, GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
2171 Real facx = Real(0.25)*dxinv[0];
2172 Real facy = Real(0.25)*dxinv[1];
2173 Real facz = Real(0.25)*dxinv[2];
2174 u(i,j,k,0) -= sig(i,j,k)*facx
2175 * (-p(i,j,k )+p(i+1,j,k )-p(i,j+1,k )+p(i+1,j+1,k )
2176 -p(i,j,k+1)+p(i+1,j,k+1)-p(i,j+1,k+1)+p(i+1,j+1,k+1));
2177 u(i,j,k,1) -= sig(i,j,k)*facy
2178 * (-p(i,j,k )-p(i+1,j,k )+p(i,j+1,k )+p(i+1,j+1,k )
2179 -p(i,j,k+1)-p(i+1,j,k+1)+p(i,j+1,k+1)+p(i+1,j+1,k+1));
2180 u(i,j,k,2) -= sig(i,j,k)*facz
2181 * (-p(i,j,k )-p(i+1,j,k )-p(i,j+1,k )-p(i+1,j+1,k )
2182 +p(i,j,k+1)+p(i+1,j,k+1)+p(i,j+1,k+1)+p(i+1,j+1,k+1));
2186 void mlndlap_mknewu_c (
int i,
int j,
int k, Array4<Real>
const& u, Array4<Real const>
const& p,
2187 Real sig, GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
2189 Real facx = Real(0.25)*dxinv[0];
2190 Real facy = Real(0.25)*dxinv[1];
2191 Real facz = Real(0.25)*dxinv[2];
2192 u(i,j,k,0) -= sig*facx
2193 * (-p(i,j,k )+p(i+1,j,k )-p(i,j+1,k )+p(i+1,j+1,k )
2194 -p(i,j,k+1)+p(i+1,j,k+1)-p(i,j+1,k+1)+p(i+1,j+1,k+1));
2195 u(i,j,k,1) -= sig*facy
2196 * (-p(i,j,k )-p(i+1,j,k )+p(i,j+1,k )+p(i+1,j+1,k )
2197 -p(i,j,k+1)-p(i+1,j,k+1)+p(i,j+1,k+1)+p(i+1,j+1,k+1));
2198 u(i,j,k,2) -= sig*facz
2199 * (-p(i,j,k )-p(i+1,j,k )-p(i,j+1,k )-p(i+1,j+1,k )
2200 +p(i,j,k+1)+p(i+1,j,k+1)+p(i,j+1,k+1)+p(i+1,j+1,k+1));
2207 Real Df = Real(0.0);
2208 if (velbx.contains(ii-1,jj-1,kk-1)) {
2209 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);
2211 if (velbx.contains(ii,jj-1,kk-1)) {
2212 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);
2214 if (velbx.contains(ii-1,jj,kk-1)) {
2215 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);
2217 if (velbx.contains(ii,jj,kk-1)) {
2218 Df += facx*vel(ii,jj,kk-1,0) + facy*vel(ii,jj,kk-1,1) - facz*vel(ii,jj,kk-1,2);
2220 if (velbx.contains(ii-1,jj-1,kk)) {
2221 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);
2223 if (velbx.contains(ii,jj-1,kk)) {
2224 Df += facx*vel(ii,jj-1,kk,0) - facy*vel(ii,jj-1,kk,1) + facz*vel(ii,jj-1,kk,2);
2226 if (velbx.contains(ii-1,jj,kk)) {
2227 Df += -facx*vel(ii-1,jj,kk,0) + facy*vel(ii-1,jj,kk,1) + facz*vel(ii-1,jj,kk,2);
2229 if (velbx.contains(ii,jj,kk)) {
2230 Df += facx*vel(ii,jj,kk,0) + facy*vel(ii,jj,kk,1) + facz*vel(ii,jj,kk,2);
2242 const int ii = rr*i;
2243 const int jj = rr*j;
2244 const int kk = rr*k;
2245 if (msk(ii,jj,kk)) {
2246 const Real facx = Real(0.25)*dxinv[0];
2247 const Real facy = Real(0.25)*dxinv[1];
2248 const Real facz = Real(0.25)*dxinv[2];
2250 Real Df = Real(0.0);
2252 const int ilo =
amrex::max(ii-rr+1, fvbx.smallEnd(0));
2253 const int ihi =
amrex::min(ii+rr-1, fvbx.bigEnd (0));
2254 const int jlo =
amrex::max(jj-rr+1, fvbx.smallEnd(1));
2255 const int jhi =
amrex::min(jj+rr-1, fvbx.bigEnd (1));
2256 const int klo =
amrex::max(kk-rr+1, fvbx.smallEnd(2));
2257 const int khi =
amrex::min(kk+rr-1, fvbx.bigEnd (2));
2259 for (
int koff = klo; koff <= khi; ++koff) {
2260 for (
int joff = jlo; joff <= jhi; ++joff) {
2261 for (
int ioff = ilo; ioff <= ihi; ++ioff) {
2265 if (fvbx.strictly_contains(ioff,joff,koff)) {
2266 Df +=
scale * frhs(ioff,joff,koff);
2272 rhs(i,j,k) = Df * (Real(1.0)/
static_cast<Real
>(rr*rr*rr*rr*rr*rr));
2274 rhs(i,j,k) = Real(0.0);
2281 Array4<Real>
const& rhs, Array4<Real const>
const& cc,
2282 Array4<int const>
const& msk) noexcept
2284 const int ii = rr*i;
2285 const int jj = rr*j;
2286 const int kk = rr*k;
2287 if (msk(ii,jj,kk)) {
2288 Real tmp = Real(0.0);
2290 const int ilo =
amrex::max(ii-rr , ccbx.smallEnd(0));
2291 const int ihi =
amrex::min(ii+rr-1, ccbx.bigEnd (0));
2292 const int jlo =
amrex::max(jj-rr , ccbx.smallEnd(1));
2293 const int jhi =
amrex::min(jj+rr-1, ccbx.bigEnd (1));
2294 const int klo =
amrex::max(kk-rr , ccbx.smallEnd(2));
2295 const int khi =
amrex::min(kk+rr-1, ccbx.bigEnd (2));
2297 for (
int koff = klo; koff <= khi; ++koff) {
2298 for (
int joff = jlo; joff <= jhi; ++joff) {
2299 for (
int ioff = ilo; ioff <= ihi; ++ioff) {
2300 Real
scale = (
static_cast<Real
>(rr)-
std::abs(
static_cast<Real
>(ioff-ii)+Real(0.5)))
2301 * (
static_cast<Real
>(rr)-
std::abs(
static_cast<Real
>(joff-jj)+Real(0.5)))
2302 * (
static_cast<Real
>(rr)-
std::abs(
static_cast<Real
>(koff-kk)+Real(0.5)));
2303 tmp += cc(ioff,joff,koff) *
scale;
2306 rhs(i,j,k) += tmp * (Real(1.0)/Real(rr*rr*rr*rr*rr*rr));
2315 Real val = Real(1.0);
2320 if ((i == ndlo.x && ( bclo[0] == LinOpBCType::Neumann ||
2321 bclo[0] == LinOpBCType::inflow)) ||
2322 (i == ndhi.x && ( bchi[0] == LinOpBCType::Neumann ||
2323 bchi[0] == LinOpBCType::inflow))) {
2327 if ((j == ndlo.y && ( bclo[1] == LinOpBCType::Neumann ||
2328 bclo[1] == LinOpBCType::inflow)) ||
2329 (j == ndhi.y && ( bchi[1] == LinOpBCType::Neumann ||
2330 bchi[1] == LinOpBCType::inflow))) {
2334 if ((k == ndlo.z && ( bclo[2] == LinOpBCType::Neumann ||
2335 bclo[2] == LinOpBCType::inflow)) ||
2336 (k == ndhi.z && ( bchi[2] == LinOpBCType::Neumann ||
2337 bchi[2] == LinOpBCType::inflow))) {
2350 Box const& ccdom_p,
Box const& veldom,
Box const& nddom,
2354 using namespace nodelap_detail;
2357 Real facx = Real(0.25) * dxinv[0];
2358 Real facy = Real(0.25) * dxinv[1];
2359 Real facz = Real(0.25) * dxinv[2];
2360 Real tmp = fc(i,j,k);
2365 if (ccmsk(i-1,j-1,k-1) ==
crse_cell && veldom.contains(i-1,j-1,k-1)) {
2366 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);
2367 if (rhcc && ccdom_p.contains(i-1,j-1,k-1)) {
2368 tmp += Real(0.125) * rhcc(i-1,j-1,k-1);
2372 if (ccmsk(i,j-1,k-1) ==
crse_cell && veldom.contains(i,j-1,k-1)) {
2373 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);
2374 if (rhcc && ccdom_p.contains(i,j-1,k-1)) {
2375 tmp += Real(0.125) * rhcc(i,j-1,k-1);
2379 if (ccmsk(i-1,j,k-1) ==
crse_cell && veldom.contains(i-1,j,k-1)) {
2380 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);
2381 if (rhcc && ccdom_p.contains(i-1,j,k-1)) {
2382 tmp += Real(0.125) * rhcc(i-1,j,k-1);
2386 if (ccmsk(i,j,k-1) ==
crse_cell && veldom.contains(i,j,k-1)) {
2387 tmp += facx*vel(i,j,k-1,0) + facy*vel(i,j,k-1,1) - facz*vel(i,j,k-1,2);
2388 if (rhcc && ccdom_p.contains(i,j,k-1)) {
2389 tmp += Real(0.125) * rhcc(i,j,k-1);
2393 if (ccmsk(i-1,j-1,k) ==
crse_cell && veldom.contains(i-1,j-1,k)) {
2394 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);
2395 if (rhcc && ccdom_p.contains(i-1,j-1,k)) {
2396 tmp += Real(0.125) * rhcc(i-1,j-1,k);
2400 if (ccmsk(i,j-1,k) ==
crse_cell && veldom.contains(i,j-1,k)) {
2401 tmp += facx*vel(i,j-1,k,0) - facy*vel(i,j-1,k,1) + facz*vel(i,j-1,k,2);
2402 if (rhcc && ccdom_p.contains(i,j-1,k)) {
2403 tmp += Real(0.125) * rhcc(i,j-1,k);
2407 if (ccmsk(i-1,j,k) ==
crse_cell && veldom.contains(i-1,j,k)) {
2408 tmp += -facx*vel(i-1,j,k,0) + facy*vel(i-1,j,k,1) + facz*vel(i-1,j,k,2);
2409 if (rhcc && ccdom_p.contains(i-1,j,k)) {
2410 tmp += Real(0.125) * rhcc(i-1,j,k);
2414 if (ccmsk(i,j,k) ==
crse_cell && veldom.contains(i,j,k)) {
2415 tmp += facx*vel(i,j,k,0) + facy*vel(i,j,k,1) + facz*vel(i,j,k,2);
2416 if (rhcc && ccdom_p.contains(i,j,k)) {
2417 tmp += Real(0.125) * rhcc(i,j,k);
2421 rhs(i,j,k) = tmp *
neumann_scale(i, j, k, nddom, bclo, bchi);
2431 Array4<Real const>
const& rhs, Array4<int const>
const& msk,
2432 Box const& nddom, GpuArray<LinOpBCType,AMREX_SPACEDIM>
const& bclo,
2433 GpuArray<LinOpBCType,AMREX_SPACEDIM>
const& bchi,
2434 bool neumann_doubling) noexcept
2436 if ( msk(i-1,j-1,k-1) == 0 ||
2437 msk(i ,j-1,k-1) == 0 ||
2438 msk(i-1,j ,k-1) == 0 ||
2439 msk(i ,j ,k-1) == 0 ||
2440 msk(i-1,j-1,k ) == 0 ||
2441 msk(i ,j-1,k ) == 0 ||
2442 msk(i-1,j ,k ) == 0 ||
2443 msk(i ,j ,k ) == 0 )
2445 Real fac = Real(1.0);
2446 if (neumann_doubling) {
2449 if ((i == ndlo.x && ( bclo[0] == LinOpBCType::Neumann ||
2450 bclo[0] == LinOpBCType::inflow)) ||
2451 (i == ndhi.x && ( bchi[0] == LinOpBCType::Neumann ||
2452 bchi[0] == LinOpBCType::inflow))) {
2455 if ((j == ndlo.y && ( bclo[1] == LinOpBCType::Neumann ||
2456 bclo[1] == LinOpBCType::inflow)) ||
2457 (j == ndhi.y && ( bchi[1] == LinOpBCType::Neumann ||
2458 bchi[1] == LinOpBCType::inflow))) {
2461 if ((k == ndlo.z && ( bclo[2] == LinOpBCType::Neumann ||
2462 bclo[2] == LinOpBCType::inflow)) ||
2463 (k == ndhi.z && ( bchi[2] == LinOpBCType::Neumann ||
2464 bchi[2] == LinOpBCType::inflow))) {
2468 resid(i,j,k) = (rhs(i,j,k) - resid(i,j,k)) * fac;
2470 resid(i,j,k) = Real(0.);
2478 template <
typename P,
typename S>
2481 int i,
int j,
int k, Real facx, Real facy, Real facz,
2484 Real Ax = Real(0.0);
2485 if (pred(i-1,j-1,k-1)) {
2486 Ax += sig(i-1,j-1,k-1)*(facx*(Real(4.)*(phi(i-1,j ,k )-phi(i ,j ,k ))
2487 +Real(2.)*(phi(i-1,j-1,k )-phi(i ,j-1,k ))
2488 +Real(2.)*(phi(i-1,j ,k-1)-phi(i ,j ,k-1))
2489 + (phi(i-1,j-1,k-1)-phi(i ,j-1,k-1)))
2490 + facy*(Real(4.)*(phi(i ,j-1,k )-phi(i ,j ,k ))
2491 +Real(2.)*(phi(i-1,j-1,k )-phi(i-1,j ,k ))
2492 +Real(2.)*(phi(i ,j-1,k-1)-phi(i ,j ,k-1))
2493 + (phi(i-1,j-1,k-1)-phi(i-1,j ,k-1)))
2494 + facz*(Real(4.)*(phi(i ,j ,k-1)-phi(i ,j ,k ))
2495 +Real(2.)*(phi(i-1,j ,k-1)-phi(i-1,j ,k ))
2496 +Real(2.)*(phi(i ,j-1,k-1)-phi(i ,j-1,k ))
2497 + (phi(i-1,j-1,k-1)-phi(i-1,j-1,k ))));
2499 if (pred(i,j-1,k-1)) {
2500 Ax += sig(i,j-1,k-1)*(facx*(Real(4.)*(phi(i+1,j ,k )-phi(i ,j ,k ))
2501 +Real(2.)*(phi(i+1,j-1,k )-phi(i ,j-1,k ))
2502 +Real(2.)*(phi(i+1,j ,k-1)-phi(i ,j ,k-1))
2503 + (phi(i+1,j-1,k-1)-phi(i ,j-1,k-1)))
2504 + facy*(Real(4.)*(phi(i ,j-1,k )-phi(i ,j ,k ))
2505 +Real(2.)*(phi(i+1,j-1,k )-phi(i+1,j ,k ))
2506 +Real(2.)*(phi(i ,j-1,k-1)-phi(i ,j ,k-1))
2507 + (phi(i+1,j-1,k-1)-phi(i+1,j ,k-1)))
2508 + facz*(Real(4.)*(phi(i ,j ,k-1)-phi(i ,j ,k ))
2509 +Real(2.)*(phi(i+1,j ,k-1)-phi(i+1,j ,k ))
2510 +Real(2.)*(phi(i ,j-1,k-1)-phi(i ,j-1,k ))
2511 + (phi(i+1,j-1,k-1)-phi(i+1,j-1,k ))));
2513 if (pred(i-1,j,k-1)) {
2514 Ax += sig(i-1,j,k-1)*(facx*(Real(4.)*(phi(i-1,j ,k )-phi(i ,j ,k ))
2515 +Real(2.)*(phi(i-1,j+1,k )-phi(i ,j+1,k ))
2516 +Real(2.)*(phi(i-1,j ,k-1)-phi(i ,j ,k-1))
2517 + (phi(i-1,j+1,k-1)-phi(i ,j+1,k-1)))
2518 + facy*(Real(4.)*(phi(i ,j+1,k )-phi(i ,j ,k ))
2519 +Real(2.)*(phi(i-1,j+1,k )-phi(i-1,j ,k ))
2520 +Real(2.)*(phi(i ,j+1,k-1)-phi(i ,j ,k-1))
2521 + (phi(i-1,j+1,k-1)-phi(i-1,j ,k-1)))
2522 + facz*(Real(4.)*(phi(i ,j ,k-1)-phi(i ,j ,k ))
2523 +Real(2.)*(phi(i-1,j ,k-1)-phi(i-1,j ,k ))
2524 +Real(2.)*(phi(i ,j+1,k-1)-phi(i ,j+1,k ))
2525 + (phi(i-1,j+1,k-1)-phi(i-1,j+1,k ))));
2527 if (pred(i,j,k-1)) {
2528 Ax += sig(i,j,k-1)*(facx*(Real(4.)*(phi(i+1,j ,k )-phi(i ,j ,k ))
2529 +Real(2.)*(phi(i+1,j+1,k )-phi(i ,j+1,k ))
2530 +Real(2.)*(phi(i+1,j ,k-1)-phi(i ,j ,k-1))
2531 + (phi(i+1,j+1,k-1)-phi(i ,j+1,k-1)))
2532 + facy*(Real(4.)*(phi(i ,j+1,k )-phi(i ,j ,k ))
2533 +Real(2.)*(phi(i+1,j+1,k )-phi(i+1,j ,k ))
2534 +Real(2.)*(phi(i ,j+1,k-1)-phi(i ,j ,k-1))
2535 + (phi(i+1,j+1,k-1)-phi(i+1,j ,k-1)))
2536 + facz*(Real(4.)*(phi(i ,j ,k-1)-phi(i ,j ,k ))
2537 +Real(2.)*(phi(i+1,j ,k-1)-phi(i+1,j ,k ))
2538 +Real(2.)*(phi(i ,j+1,k-1)-phi(i ,j+1,k ))
2539 + (phi(i+1,j+1,k-1)-phi(i+1,j+1,k ))));
2541 if (pred(i-1,j-1,k)) {
2542 Ax += sig(i-1,j-1,k)*(facx*(Real(4.)*(phi(i-1,j ,k )-phi(i ,j ,k ))
2543 +Real(2.)*(phi(i-1,j-1,k )-phi(i ,j-1,k ))
2544 +Real(2.)*(phi(i-1,j ,k+1)-phi(i ,j ,k+1))
2545 + (phi(i-1,j-1,k+1)-phi(i ,j-1,k+1)))
2546 + facy*(Real(4.)*(phi(i ,j-1,k )-phi(i ,j ,k ))
2547 +Real(2.)*(phi(i-1,j-1,k )-phi(i-1,j ,k ))
2548 +Real(2.)*(phi(i ,j-1,k+1)-phi(i ,j ,k+1))
2549 + (phi(i-1,j-1,k+1)-phi(i-1,j ,k+1)))
2550 + facz*(Real(4.)*(phi(i ,j ,k+1)-phi(i ,j ,k ))
2551 +Real(2.)*(phi(i-1,j ,k+1)-phi(i-1,j ,k ))
2552 +Real(2.)*(phi(i ,j-1,k+1)-phi(i ,j-1,k ))
2553 + (phi(i-1,j-1,k+1)-phi(i-1,j-1,k ))));
2555 if (pred(i,j-1,k)) {
2556 Ax += sig(i,j-1,k)*(facx*(Real(4.)*(phi(i+1,j ,k )-phi(i ,j ,k ))
2557 +Real(2.)*(phi(i+1,j-1,k )-phi(i ,j-1,k ))
2558 +Real(2.)*(phi(i+1,j ,k+1)-phi(i ,j ,k+1))
2559 + (phi(i+1,j-1,k+1)-phi(i ,j-1,k+1)))
2560 + facy*(Real(4.)*(phi(i ,j-1,k )-phi(i ,j ,k ))
2561 +Real(2.)*(phi(i+1,j-1,k )-phi(i+1,j ,k ))
2562 +Real(2.)*(phi(i ,j-1,k+1)-phi(i ,j ,k+1))
2563 + (phi(i+1,j-1,k+1)-phi(i+1,j ,k+1)))
2564 + facz*(Real(4.)*(phi(i ,j ,k+1)-phi(i ,j ,k ))
2565 +Real(2.)*(phi(i+1,j ,k+1)-phi(i+1,j ,k ))
2566 +Real(2.)*(phi(i ,j-1,k+1)-phi(i ,j-1,k ))
2567 + (phi(i+1,j-1,k+1)-phi(i+1,j-1,k ))));
2569 if (pred(i-1,j,k)) {
2570 Ax += sig(i-1,j,k)*(facx*(Real(4.)*(phi(i-1,j ,k )-phi(i ,j ,k ))
2571 +Real(2.)*(phi(i-1,j+1,k )-phi(i ,j+1,k ))
2572 +Real(2.)*(phi(i-1,j ,k+1)-phi(i ,j ,k+1))
2573 + (phi(i-1,j+1,k+1)-phi(i ,j+1,k+1)))
2574 + facy*(Real(4.)*(phi(i ,j+1,k )-phi(i ,j ,k ))
2575 +Real(2.)*(phi(i-1,j+1,k )-phi(i-1,j ,k ))
2576 +Real(2.)*(phi(i ,j+1,k+1)-phi(i ,j ,k+1))
2577 + (phi(i-1,j+1,k+1)-phi(i-1,j ,k+1)))
2578 + facz*(Real(4.)*(phi(i ,j ,k+1)-phi(i ,j ,k ))
2579 +Real(2.)*(phi(i-1,j ,k+1)-phi(i-1,j ,k ))
2580 +Real(2.)*(phi(i ,j+1,k+1)-phi(i ,j+1,k ))
2581 + (phi(i-1,j+1,k+1)-phi(i-1,j+1,k ))));
2584 Ax += sig(i,j,k)*(facx*(Real(4.)*(phi(i+1,j ,k )-phi(i ,j ,k ))
2585 +Real(2.)*(phi(i+1,j+1,k )-phi(i ,j+1,k ))
2586 +Real(2.)*(phi(i+1,j ,k+1)-phi(i ,j ,k+1))
2587 + (phi(i+1,j+1,k+1)-phi(i ,j+1,k+1)))
2588 + facy*(Real(4.)*(phi(i ,j+1,k )-phi(i ,j ,k ))
2589 +Real(2.)*(phi(i+1,j+1,k )-phi(i+1,j ,k ))
2590 +Real(2.)*(phi(i ,j+1,k+1)-phi(i ,j ,k+1))
2591 + (phi(i+1,j+1,k+1)-phi(i+1,j ,k+1)))
2592 + facz*(Real(4.)*(phi(i ,j ,k+1)-phi(i ,j ,k ))
2593 +Real(2.)*(phi(i+1,j ,k+1)-phi(i+1,j ,k ))
2594 +Real(2.)*(phi(i ,j+1,k+1)-phi(i ,j+1,k ))
2595 + (phi(i+1,j+1,k+1)-phi(i+1,j+1,k ))));
2600 template <
int rr,
typename S>
2603 int i,
int j,
int k,
Box const& ndbx,
Box const& ccbx,
2610 const int ii = rr*i;
2611 const int jj = rr*j;
2612 const int kk = rr*k;
2613 if (msk(ii,jj,kk)) {
2614 Real facx = Real(1./36.)*dxinv[0]*dxinv[0];
2615 Real facy = Real(1./36.)*dxinv[1]*dxinv[1];
2616 Real facz = Real(1./36.)*dxinv[2]*dxinv[2];
2618 auto is_fine = [&ccbx] (
int ix,
int iy,
int iz) ->
bool {
2619 return ccbx.contains(
ix,
iy,
iz);
2622 Real Df = Real(0.0);
2624 const int ilo =
amrex::max(ii-rr+1, ndbx.smallEnd(0));
2625 const int ihi =
amrex::min(ii+rr-1, ndbx.bigEnd (0));
2626 const int jlo =
amrex::max(jj-rr+1, ndbx.smallEnd(1));
2627 const int jhi =
amrex::min(jj+rr-1, ndbx.bigEnd (1));
2628 const int klo =
amrex::max(kk-rr+1, ndbx.smallEnd(2));
2629 const int khi =
amrex::min(kk+rr-1, ndbx.bigEnd (2));
2631 for (
int koff = klo; koff <= khi; ++koff) {
2632 for (
int joff = jlo; joff <= jhi; ++joff) {
2633 for (
int ioff = ilo; ioff <= ihi; ++ioff) {
2637 if (ndbx.strictly_contains(ioff,joff,koff)) {
2638 Df +=
scale * (rhs(ioff,joff,koff)-res(ioff,joff,koff));
2641 (is_fine, sig, ioff, joff, koff, facx, facy, facz, phi);
2645 f(i,j,k) = Df * (Real(1.0)/
static_cast<Real
>(rr*rr*rr*rr*rr*rr));
2647 f(i,j,k) = Real(0.0);
2659 mlndlap_Ax_fine_contrib_doit<rr>
2660 ([&sig] (
int ix,
int iy,
int iz) -> Real
const& {
return sig(
ix,
iy,
iz); },
2661 i,j,k,ndbx,ccbx,
f,res,rhs,phi,msk,dxinv);
2672 mlndlap_Ax_fine_contrib_doit<rr>
2673 ([=] (
int,
int,
int) -> Real {
return sig; },
2674 i,j,k,ndbx,ccbx,
f,res,rhs,phi,msk,dxinv);
2684 Box const& ccdom_p,
Box const& nddom,
2687 bool neumann_doubling) noexcept
2689 using namespace nodelap_detail;
2692 Real facx = Real(1./36.)*dxinv[0]*dxinv[0];
2693 Real facy = Real(1./36.)*dxinv[1]*dxinv[1];
2694 Real facz = Real(1./36.)*dxinv[2]*dxinv[2];
2698 return ccdom_p.contains(
ix,
iy,
iz)
2701 [&sig] (
int ix,
int iy,
int iz) -> Real
const&
2705 i, j, k, facx, facy, facz, phi);
2707 Real
const ns = (neumann_doubling) ?
neumann_scale(i,j,k,nddom,bclo,bchi) : Real(1.0);
2708 res(i,j,k) = rhs(i,j,k) - Ax*ns;
2719 Box const& ccdom_p,
Box const& nddom,
2722 bool neumann_doubling) noexcept
2724 using namespace nodelap_detail;
2727 Real facx = Real(1./36.)*dxinv[0]*dxinv[0];
2728 Real facy = Real(1./36.)*dxinv[1]*dxinv[1];
2729 Real facz = Real(1./36.)*dxinv[2]*dxinv[2];
2733 return ccdom_p.contains(
ix,
iy,
iz)
2740 i, j, k, facx, facy, facz, phi);
2742 Real
const ns = (neumann_doubling) ?
neumann_scale(i,j,k,nddom,bclo,bchi) : Real(1.0);
2743 res(i,j,k) = rhs(i,j,k) - Ax*ns;
2751 namespace nodelap_detail {
2770 using namespace nodelap_detail;
2772 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
2773 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
2774 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
2775 Real fxyz = facx + facy + facz;
2776 Real fmx2y2z = -facx + Real(2.0)*facy + Real(2.0)*facz;
2777 Real f2xmy2z = Real(2.0)*facx - facy + Real(2.0)*facz;
2778 Real f2x2ymz = Real(2.0)*facx + Real(2.0)*facy - facz;
2779 Real f4xm2ym2z = Real(4.0)*facx - Real(2.0)*facy - Real(2.0)*facz;
2780 Real fm2x4ym2z = -Real(2.0)*facx + Real(4.0)*facy - Real(2.0)*facz;
2781 Real fm2xm2y4z = -Real(2.0)*facx - Real(2.0)*facy + Real(4.0)*facz;
2786 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));
2790 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));
2794 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));
2798 sten(i,j,k,
ist_pp0) = f2x2ymz * (sig(i,j,k-1)+sig(i,j,k));
2804 sten(i,j,k,
ist_p0p) = f2xmy2z * (sig(i,j-1,k)+sig(i,j,k));
2810 sten(i,j,k,
ist_0pp) = fmx2y2z * (sig(i-1,j,k)+sig(i,j,k));
2816 sten(i,j,k,
ist_ppp) = fxyz * sig(i,j,k);
2830 using namespace nodelap_detail;
2845 sten(i,j,k,
ist_inv) = Real(1.0) /
2863 Array4<Real const>
const& fsten) noexcept
2865 using namespace nodelap_detail;
2867 auto interp_from_mmm_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2898 auto interp_from_pmm_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2928 auto interp_from_mpm_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2958 auto interp_from_ppm_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
2988 auto interp_from_mmp_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3018 auto interp_from_pmp_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3048 auto interp_from_mpp_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3078 auto interp_from_ppp_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3108 auto interp_from_0mm_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3117 Real wmm =
std::abs(fsten(i_ ,j_-1,k_-1,
ist_0pp)) * (Real(1.) + w1m + w2m);
3118 Real wpm =
std::abs(fsten(i_ ,j_ ,k_-1,
ist_0pp)) * (Real(1.) + w1p + w2m);
3119 Real wmp =
std::abs(fsten(i_ ,j_-1,k_ ,
ist_0pp)) * (Real(1.) + w1m + w2p);
3120 Real wpp =
std::abs(fsten(i_ ,j_ ,k_ ,
ist_0pp)) * (Real(1.) + w1p + w2p);
3121 return wmm / (wmm+wpm+wmp+wpp+
eps);
3124 auto interp_from_0mp_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3133 Real wmm =
std::abs(fsten(i_ ,j_-1,k_-1,
ist_0pp)) * (Real(1.) + w1m + w2m);
3134 Real wpm =
std::abs(fsten(i_ ,j_ ,k_-1,
ist_0pp)) * (Real(1.) + w1p + w2m);
3135 Real wmp =
std::abs(fsten(i_ ,j_-1,k_ ,
ist_0pp)) * (Real(1.) + w1m + w2p);
3136 Real wpp =
std::abs(fsten(i_ ,j_ ,k_ ,
ist_0pp)) * (Real(1.) + w1p + w2p);
3137 return wmp / (wmm+wpm+wmp+wpp+
eps);
3140 auto interp_from_0pm_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3149 Real wmm =
std::abs(fsten(i_ ,j_-1,k_-1,
ist_0pp)) * (Real(1.) + w1m + w2m);
3150 Real wpm =
std::abs(fsten(i_ ,j_ ,k_-1,
ist_0pp)) * (Real(1.) + w1p + w2m);
3151 Real wmp =
std::abs(fsten(i_ ,j_-1,k_ ,
ist_0pp)) * (Real(1.) + w1m + w2p);
3152 Real wpp =
std::abs(fsten(i_ ,j_ ,k_ ,
ist_0pp)) * (Real(1.) + w1p + w2p);
3153 return wpm / (wmm+wpm+wmp+wpp+
eps);
3156 auto interp_from_0pp_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3165 Real wmm =
std::abs(fsten(i_ ,j_-1,k_-1,
ist_0pp)) * (Real(1.) + w1m + w2m);
3166 Real wpm =
std::abs(fsten(i_ ,j_ ,k_-1,
ist_0pp)) * (Real(1.) + w1p + w2m);
3167 Real wmp =
std::abs(fsten(i_ ,j_-1,k_ ,
ist_0pp)) * (Real(1.) + w1m + w2p);
3168 Real wpp =
std::abs(fsten(i_ ,j_ ,k_ ,
ist_0pp)) * (Real(1.) + w1p + w2p);
3169 return wpp / (wmm+wpm+wmp+wpp+
eps);
3172 auto interp_from_m0m_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3181 Real wmm =
std::abs(fsten(i_-1,j_ ,k_-1,
ist_p0p)) * (Real(1.) + w1m + w2m);
3182 Real wpm =
std::abs(fsten(i_ ,j_ ,k_-1,
ist_p0p)) * (Real(1.) + w1p + w2m);
3183 Real wmp =
std::abs(fsten(i_-1,j_ ,k_ ,
ist_p0p)) * (Real(1.) + w1m + w2p);
3184 Real wpp =
std::abs(fsten(i_ ,j_ ,k_ ,
ist_p0p)) * (Real(1.) + w1p + w2p);
3185 return wmm / (wmm+wpm+wmp+wpp+
eps);
3188 auto interp_from_p0m_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3197 Real wmm =
std::abs(fsten(i_-1,j_ ,k_-1,
ist_p0p)) * (Real(1.) + w1m + w2m);
3198 Real wpm =
std::abs(fsten(i_ ,j_ ,k_-1,
ist_p0p)) * (Real(1.) + w1p + w2m);
3199 Real wmp =
std::abs(fsten(i_-1,j_ ,k_ ,
ist_p0p)) * (Real(1.) + w1m + w2p);
3200 Real wpp =
std::abs(fsten(i_ ,j_ ,k_ ,
ist_p0p)) * (Real(1.) + w1p + w2p);
3201 return wpm / (wmm+wpm+wmp+wpp+
eps);
3204 auto interp_from_m0p_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3213 Real wmm =
std::abs(fsten(i_-1,j_ ,k_-1,
ist_p0p)) * (Real(1.) + w1m + w2m);
3214 Real wpm =
std::abs(fsten(i_ ,j_ ,k_-1,
ist_p0p)) * (Real(1.) + w1p + w2m);
3215 Real wmp =
std::abs(fsten(i_-1,j_ ,k_ ,
ist_p0p)) * (Real(1.) + w1m + w2p);
3216 Real wpp =
std::abs(fsten(i_ ,j_ ,k_ ,
ist_p0p)) * (Real(1.) + w1p + w2p);
3217 return wmp / (wmm+wpm+wmp+wpp+
eps);
3220 auto interp_from_p0p_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3229 Real wmm =
std::abs(fsten(i_-1,j_ ,k_-1,
ist_p0p)) * (Real(1.) + w1m + w2m);
3230 Real wpm =
std::abs(fsten(i_ ,j_ ,k_-1,
ist_p0p)) * (Real(1.) + w1p + w2m);
3231 Real wmp =
std::abs(fsten(i_-1,j_ ,k_ ,
ist_p0p)) * (Real(1.) + w1m + w2p);
3232 Real wpp =
std::abs(fsten(i_ ,j_ ,k_ ,
ist_p0p)) * (Real(1.) + w1p + w2p);
3233 return wpp / (wmm+wpm+wmp+wpp+
eps);
3236 auto interp_from_mm0_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3245 Real wmm =
std::abs(fsten(i_-1,j_-1,k_ ,
ist_pp0)) * (Real(1.) + w1m + w2m);
3246 Real wpm =
std::abs(fsten(i_ ,j_-1,k_ ,
ist_pp0)) * (Real(1.) + w1p + w2m);
3247 Real wmp =
std::abs(fsten(i_-1,j_ ,k_ ,
ist_pp0)) * (Real(1.) + w1m + w2p);
3248 Real wpp =
std::abs(fsten(i_ ,j_ ,k_ ,
ist_pp0)) * (Real(1.) + w1p + w2p);
3249 return wmm / (wmm+wpm+wmp+wpp+
eps);
3252 auto interp_from_mp0_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3261 Real wmm =
std::abs(fsten(i_-1,j_-1,k_ ,
ist_pp0)) * (Real(1.) + w1m + w2m);
3262 Real wpm =
std::abs(fsten(i_ ,j_-1,k_ ,
ist_pp0)) * (Real(1.) + w1p + w2m);
3263 Real wmp =
std::abs(fsten(i_-1,j_ ,k_ ,
ist_pp0)) * (Real(1.) + w1m + w2p);
3264 Real wpp =
std::abs(fsten(i_ ,j_ ,k_ ,
ist_pp0)) * (Real(1.) + w1p + w2p);
3265 return wmp / (wmm+wpm+wmp+wpp+
eps);
3268 auto interp_from_pm0_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3277 Real wmm =
std::abs(fsten(i_-1,j_-1,k_ ,
ist_pp0)) * (Real(1.) + w1m + w2m);
3278 Real wpm =
std::abs(fsten(i_ ,j_-1,k_ ,
ist_pp0)) * (Real(1.) + w1p + w2m);
3279 Real wmp =
std::abs(fsten(i_-1,j_ ,k_ ,
ist_pp0)) * (Real(1.) + w1m + w2p);
3280 Real wpp =
std::abs(fsten(i_ ,j_ ,k_ ,
ist_pp0)) * (Real(1.) + w1p + w2p);
3281 return wpm / (wmm+wpm+wmp+wpp+
eps);
3284 auto interp_from_pp0_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3293 Real wmm =
std::abs(fsten(i_-1,j_-1,k_ ,
ist_pp0)) * (Real(1.) + w1m + w2m);
3294 Real wpm =
std::abs(fsten(i_ ,j_-1,k_ ,
ist_pp0)) * (Real(1.) + w1p + w2m);
3295 Real wmp =
std::abs(fsten(i_-1,j_ ,k_ ,
ist_pp0)) * (Real(1.) + w1m + w2p);
3296 Real wpp =
std::abs(fsten(i_ ,j_ ,k_ ,
ist_pp0)) * (Real(1.) + w1p + w2p);
3297 return wpp / (wmm+wpm+wmp+wpp+
eps);
3300 auto interp_from_00m_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3303 if (w1 == Real(0.) && w2 == Real(0.)) {
3306 return w1 / (w1+w2);
3310 auto interp_from_00p_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3313 if (w1 == Real(0.) && w2 == Real(0.)) {
3316 return w2 / (w1+w2);
3320 auto interp_from_0m0_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3323 if (w1 == Real(0.) && w2 == Real(0.)) {
3326 return w1 / (w1+w2);
3330 auto interp_from_0p0_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3333 if (w1 == Real(0.) && w2 == Real(0.)) {
3336 return w2 / (w1+w2);
3340 auto interp_from_m00_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3343 if (w1 == Real(0.) && w2 == Real(0.)) {
3346 return w1 / (w1+w2);
3350 auto interp_from_p00_to = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3353 if (w1 == Real(0.) && w2 == Real(0.)) {
3356 return w2 / (w1+w2);
3360 auto Ammm = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3361 return fsten(i_-1,j_-1,k_-1,
ist_ppp);
3365 auto A0mm = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3366 return fsten(i_ ,j_-1,k_-1,
ist_0pp);
3369 auto Apmm = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3370 return fsten(i_ ,j_-1,k_-1,
ist_ppp);
3373 auto Am0m = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3374 return fsten(i_-1,j_ ,k_-1,
ist_p0p);
3377 auto A00m = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3378 return fsten(i_ ,j_ ,k_-1,
ist_00p);
3381 auto Ap0m = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3382 return fsten(i_ ,j_ ,k_-1,
ist_p0p);
3385 auto Ampm = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3386 return fsten(i_-1,j_ ,k_-1,
ist_ppp);
3389 auto A0pm = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3390 return fsten(i_ ,j_ ,k_-1,
ist_0pp);
3393 auto Appm = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3394 return fsten(i_ ,j_ ,k_-1,
ist_ppp);
3397 auto Amm0 = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3398 return fsten(i_-1,j_-1,k_ ,
ist_pp0);
3401 auto A0m0 = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3402 return fsten(i_ ,j_-1,k_ ,
ist_0p0);
3405 auto Apm0 = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3406 return fsten(i_ ,j_-1,k_ ,
ist_pp0);
3409 auto Am00 = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3410 return fsten(i_-1,j_ ,k_ ,
ist_p00);
3413 auto A000 = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3414 return fsten(i_ ,j_ ,k_ ,
ist_000);
3417 auto Ap00 = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3418 return fsten(i_ ,j_ ,k_ ,
ist_p00);
3421 auto Amp0 = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3422 return fsten(i_-1,j_ ,k_ ,
ist_pp0);
3425 auto A0p0 = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3426 return fsten(i_ ,j_ ,k_ ,
ist_0p0);
3429 auto App0 = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3430 return fsten(i_ ,j_ ,k_ ,
ist_pp0);
3433 auto Ammp = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3434 return fsten(i_-1,j_-1,k_ ,
ist_ppp);
3437 auto A0mp = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3438 return fsten(i_ ,j_-1,k_ ,
ist_0pp);
3441 auto Apmp = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3442 return fsten(i_ ,j_-1,k_ ,
ist_ppp);
3445 auto Am0p = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3446 return fsten(i_-1,j_ ,k_ ,
ist_p0p);
3449 auto A00p = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3450 return fsten(i_ ,j_ ,k_ ,
ist_00p);
3453 auto Ap0p = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3454 return fsten(i_ ,j_ ,k_ ,
ist_p0p);
3457 auto Ampp = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3458 return fsten(i_-1,j_ ,k_ ,
ist_ppp);
3461 auto A0pp = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3462 return fsten(i_ ,j_ ,k_ ,
ist_0pp);
3465 auto Appp = [&fsten] (
int i_,
int j_,
int k_) -> Real {
3466 return fsten(i_ ,j_ ,k_ ,
ist_ppp);
3469 auto restrict_from_mmm_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3500 auto restrict_from_0mm_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3509 Real wmm =
std::abs(fsten(ii_,jj_-2,kk_-2,
ist_0pp)) * (Real(1.) + w1m + w2m);
3510 Real wpm =
std::abs(fsten(ii_,jj_-1,kk_-2,
ist_0pp)) * (Real(1.) + w1p + w2m);
3511 Real wmp =
std::abs(fsten(ii_,jj_-2,kk_-1,
ist_0pp)) * (Real(1.) + w1m + w2p);
3512 Real wpp =
std::abs(fsten(ii_,jj_-1,kk_-1,
ist_0pp)) * (Real(1.) + w1p + w2p);
3513 return wpp / (wmm+wpm+wmp+wpp+
eps);
3516 auto restrict_from_pmm_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3546 auto restrict_from_m0m_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3555 Real wmm =
std::abs(fsten(ii_-2,jj_,kk_-2,
ist_p0p)) * (Real(1.) + w1m + w2m);
3556 Real wpm =
std::abs(fsten(ii_-1,jj_,kk_-2,
ist_p0p)) * (Real(1.) + w1p + w2m);
3557 Real wmp =
std::abs(fsten(ii_-2,jj_,kk_-1,
ist_p0p)) * (Real(1.) + w1m + w2p);
3558 Real wpp =
std::abs(fsten(ii_-1,jj_,kk_-1,
ist_p0p)) * (Real(1.) + w1p + w2p);
3559 return wpp / (wmm+wpm+wmp+wpp+
eps);
3562 auto restrict_from_00m_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3565 if (w1 == Real(0.) && w2 == Real(0.)) {
3568 return w2 / (w1+w2);
3572 auto restrict_from_p0m_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3581 Real wmm =
std::abs(fsten(ii_ ,jj_,kk_-2,
ist_p0p)) * (Real(1.) + w1m + w2m);
3582 Real wpm =
std::abs(fsten(ii_+1,jj_,kk_-2,
ist_p0p)) * (Real(1.) + w1p + w2m);
3583 Real wmp =
std::abs(fsten(ii_ ,jj_,kk_-1,
ist_p0p)) * (Real(1.) + w1m + w2p);
3584 Real wpp =
std::abs(fsten(ii_+1,jj_,kk_-1,
ist_p0p)) * (Real(1.) + w1p + w2p);
3585 return wmp / (wmm+wpm+wmp+wpp+
eps);
3588 auto restrict_from_mpm_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3618 auto restrict_from_0pm_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3627 Real wmm =
std::abs(fsten(ii_,jj_ ,kk_-2,
ist_0pp)) * (Real(1.) + w1m + w2m);
3628 Real wpm =
std::abs(fsten(ii_,jj_+1,kk_-2,
ist_0pp)) * (Real(1.) + w1p + w2m);
3629 Real wmp =
std::abs(fsten(ii_,jj_ ,kk_-1,
ist_0pp)) * (Real(1.) + w1m + w2p);
3630 Real wpp =
std::abs(fsten(ii_,jj_+1,kk_-1,
ist_0pp)) * (Real(1.) + w1p + w2p);
3631 return wmp / (wmm+wpm+wmp+wpp+
eps);
3634 auto restrict_from_ppm_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3664 auto restrict_from_mm0_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3673 Real wmm =
std::abs(fsten(ii_-2,jj_-2,kk_,
ist_pp0)) * (Real(1.) + w1m + w2m);
3674 Real wpm =
std::abs(fsten(ii_-1,jj_-2,kk_,
ist_pp0)) * (Real(1.) + w1p + w2m);
3675 Real wmp =
std::abs(fsten(ii_-2,jj_-1,kk_,
ist_pp0)) * (Real(1.) + w1m + w2p);
3676 Real wpp =
std::abs(fsten(ii_-1,jj_-1,kk_,
ist_pp0)) * (Real(1.) + w1p + w2p);
3677 return wpp / (wmm+wpm+wmp+wpp+
eps);
3680 auto restrict_from_0m0_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3683 if (w1 == Real(0.) && w2 == Real(0.)) {
3686 return w2 / (w1+w2);
3690 auto restrict_from_pm0_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3699 Real wmm =
std::abs(fsten(ii_ ,jj_-2,kk_,
ist_pp0)) * (Real(1.) + w1m + w2m);
3700 Real wpm =
std::abs(fsten(ii_+1,jj_-2,kk_,
ist_pp0)) * (Real(1.) + w1p + w2m);
3701 Real wmp =
std::abs(fsten(ii_ ,jj_-1,kk_,
ist_pp0)) * (Real(1.) + w1m + w2p);
3702 Real wpp =
std::abs(fsten(ii_+1,jj_-1,kk_,
ist_pp0)) * (Real(1.) + w1p + w2p);
3703 return wmp / (wmm+wpm+wmp+wpp+
eps);
3706 auto restrict_from_m00_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3709 if (w1 == Real(0.) && w2 == Real(0.)) {
3712 return w2 / (w1+w2);
3716 auto restrict_from_000_to = [] (
int ,
int ,
int ) -> Real {
3720 auto restrict_from_p00_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3723 if (w1 == Real(0.) && w2 == Real(0.)) {
3726 return w1 / (w1+w2);
3730 auto restrict_from_mp0_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3739 Real wmm =
std::abs(fsten(ii_-2,jj_ ,kk_,
ist_pp0)) * (Real(1.) + w1m + w2m);
3740 Real wpm =
std::abs(fsten(ii_-1,jj_ ,kk_,
ist_pp0)) * (Real(1.) + w1p + w2m);
3741 Real wmp =
std::abs(fsten(ii_-2,jj_+1,kk_,
ist_pp0)) * (Real(1.) + w1m + w2p);
3742 Real wpp =
std::abs(fsten(ii_-1,jj_+1,kk_,
ist_pp0)) * (Real(1.) + w1p + w2p);
3743 return wpm / (wmm+wpm+wmp+wpp+
eps);
3746 auto restrict_from_0p0_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3749 if (w1 == Real(0.) && w2 == Real(0.)) {
3752 return w1 / (w1+w2);
3756 auto restrict_from_pp0_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3765 Real wmm =
std::abs(fsten(ii_ ,jj_ ,kk_,
ist_pp0)) * (Real(1.) + w1m + w2m);
3766 Real wpm =
std::abs(fsten(ii_+1,jj_ ,kk_,
ist_pp0)) * (Real(1.) + w1p + w2m);
3767 Real wmp =
std::abs(fsten(ii_ ,jj_+1,kk_,
ist_pp0)) * (Real(1.) + w1m + w2p);
3768 Real wpp =
std::abs(fsten(ii_+1,jj_+1,kk_,
ist_pp0)) * (Real(1.) + w1p + w2p);
3769 return wmm / (wmm+wpm+wmp+wpp+
eps);
3772 auto restrict_from_mmp_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3802 auto restrict_from_0mp_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3811 Real wmm =
std::abs(fsten(ii_,jj_-2,kk_ ,
ist_0pp)) * (Real(1.) + w1m + w2m);
3812 Real wpm =
std::abs(fsten(ii_,jj_-1,kk_ ,
ist_0pp)) * (Real(1.) + w1p + w2m);
3813 Real wmp =
std::abs(fsten(ii_,jj_-2,kk_+1,
ist_0pp)) * (Real(1.) + w1m + w2p);
3814 Real wpp =
std::abs(fsten(ii_,jj_-1,kk_+1,
ist_0pp)) * (Real(1.) + w1p + w2p);
3815 return wpm / (wmm+wpm+wmp+wpp+
eps);
3818 auto restrict_from_pmp_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3848 auto restrict_from_m0p_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3857 Real wmm =
std::abs(fsten(ii_-2,jj_,kk_ ,
ist_p0p)) * (Real(1.) + w1m + w2m);
3858 Real wpm =
std::abs(fsten(ii_-1,jj_,kk_ ,
ist_p0p)) * (Real(1.) + w1p + w2m);
3859 Real wmp =
std::abs(fsten(ii_-2,jj_,kk_+1,
ist_p0p)) * (Real(1.) + w1m + w2p);
3860 Real wpp =
std::abs(fsten(ii_-1,jj_,kk_+1,
ist_p0p)) * (Real(1.) + w1p + w2p);
3861 return wpm / (wmm+wpm+wmp+wpp+
eps);
3864 auto restrict_from_00p_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3867 if (w1 == Real(0.) && w2 == Real(0.)) {
3870 return w1 / (w1+w2);
3874 auto restrict_from_p0p_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3883 Real wmm =
std::abs(fsten(ii_ ,jj_,kk_ ,
ist_p0p)) * (Real(1.) + w1m + w2m);
3884 Real wpm =
std::abs(fsten(ii_+1,jj_,kk_ ,
ist_p0p)) * (Real(1.) + w1p + w2m);
3885 Real wmp =
std::abs(fsten(ii_ ,jj_,kk_+1,
ist_p0p)) * (Real(1.) + w1m + w2p);
3886 Real wpp =
std::abs(fsten(ii_+1,jj_,kk_+1,
ist_p0p)) * (Real(1.) + w1p + w2p);
3887 return wmm / (wmm+wpm+wmp+wpp+
eps);
3890 auto restrict_from_mpp_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3920 auto restrict_from_0pp_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3929 Real wmm =
std::abs(fsten(ii_,jj_ ,kk_ ,
ist_0pp)) * (Real(1.) + w1m + w2m);
3930 Real wpm =
std::abs(fsten(ii_,jj_+1,kk_ ,
ist_0pp)) * (Real(1.) + w1p + w2m);
3931 Real wmp =
std::abs(fsten(ii_,jj_ ,kk_+1,
ist_0pp)) * (Real(1.) + w1m + w2p);
3932 Real wpp =
std::abs(fsten(ii_,jj_+1,kk_+1,
ist_0pp)) * (Real(1.) + w1p + w2p);
3933 return wmm / (wmm+wpm+wmp+wpp+
eps);
3936 auto restrict_from_ppp_to = [&fsten] (
int ii_,
int jj_,
int kk_) -> Real {
3969 Array3D<Real,-1,1,-1,1,-1,1> p;
3970 Array3D<Real,-1,1,-1,1,-1,1> ap;
3971 Real cs1, cs2, cs3, cs4;
3977 p(-1,-1,-1) = interp_from_ppp_to(iii+1,jjj-1,kkk-1);
3978 p( 0,-1,-1) = interp_from_0pp_to(iii+2,jjj-1,kkk-1);
3979 p(-1, 0,-1) = interp_from_p0p_to(iii+1,jjj ,kkk-1);
3980 p( 0, 0,-1) = interp_from_00p_to(iii+2,jjj ,kkk-1);
3981 p(-1,+1,-1) = interp_from_pmp_to(iii+1,jjj+1,kkk-1);
3982 p( 0,+1,-1) = interp_from_0mp_to(iii+2,jjj+1,kkk-1);
3983 p(-1,-1, 0) = interp_from_pp0_to(iii+1,jjj-1,kkk );
3984 p( 0,-1, 0) = interp_from_0p0_to(iii+2,jjj-1,kkk );
3985 p(-1, 0, 0) = interp_from_p00_to(iii+1,jjj ,kkk );
3986 p( 0, 0, 0) = Real(1.);
3987 p(-1,+1, 0) = interp_from_pm0_to(iii+1,jjj+1,kkk );
3988 p( 0,+1, 0) = interp_from_0m0_to(iii+2,jjj+1,kkk );
3989 p(-1,-1,+1) = interp_from_ppm_to(iii+1,jjj-1,kkk+1);
3990 p( 0,-1,+1) = interp_from_0pm_to(iii+2,jjj-1,kkk+1);
3991 p(-1, 0,+1) = interp_from_p0m_to(iii+1,jjj ,kkk+1);
3992 p( 0, 0,+1) = interp_from_00m_to(iii+2,jjj ,kkk+1);
3993 p(-1,+1,+1) = interp_from_pmm_to(iii+1,jjj+1,kkk+1);
3994 p( 0,+1,+1) = interp_from_0mm_to(iii+2,jjj+1,kkk+1);
3996 Ap00(iii,jjj-1,kkk-1) * p(-1,-1,-1)
3997 + App0(iii,jjj-1,kkk-1) * p(-1, 0,-1)
3998 + Ap0p(iii,jjj-1,kkk-1) * p(-1,-1, 0)
3999 + Appp(iii,jjj-1,kkk-1) * p(-1, 0, 0);
4001 A000(iii+1,jjj-1,kkk-1) * p(-1,-1,-1)
4002 + Ap00(iii+1,jjj-1,kkk-1) * p( 0,-1,-1)
4003 + A0p0(iii+1,jjj-1,kkk-1) * p(-1, 0,-1)
4004 + App0(iii+1,jjj-1,kkk-1) * p( 0, 0,-1)
4005 + A00p(iii+1,jjj-1,kkk-1) * p(-1,-1, 0)
4006 + Ap0p(iii+1,jjj-1,kkk-1) * p( 0,-1, 0)
4007 + A0pp(iii+1,jjj-1,kkk-1) * p(-1, 0, 0)
4008 + Appp(iii+1,jjj-1,kkk-1) * p( 0, 0, 0);
4010 Apm0(iii,jjj,kkk-1) * p(-1,-1,-1)
4011 + Ap00(iii,jjj,kkk-1) * p(-1, 0,-1)
4012 + App0(iii,jjj,kkk-1) * p(-1,+1,-1)
4013 + Apmp(iii,jjj,kkk-1) * p(-1,-1, 0)
4014 + Ap0p(iii,jjj,kkk-1) * p(-1, 0, 0)
4015 + Appp(iii,jjj,kkk-1) * p(-1,+1, 0);
4017 A0m0(iii+1,jjj,kkk-1) * p(-1,-1,-1)
4018 + Apm0(iii+1,jjj,kkk-1) * p( 0,-1,-1)
4019 + A000(iii+1,jjj,kkk-1) * p(-1, 0,-1)
4020 + Ap00(iii+1,jjj,kkk-1) * p( 0, 0,-1)
4021 + A0p0(iii+1,jjj,kkk-1) * p(-1,+1,-1)
4022 + App0(iii+1,jjj,kkk-1) * p( 0,+1,-1)
4023 + A0mp(iii+1,jjj,kkk-1) * p(-1,-1, 0)
4024 + Apmp(iii+1,jjj,kkk-1) * p( 0,-1, 0)
4025 + A00p(iii+1,jjj,kkk-1) * p(-1, 0, 0)
4026 + Ap0p(iii+1,jjj,kkk-1) * p( 0, 0, 0)
4027 + A0pp(iii+1,jjj,kkk-1) * p(-1,+1, 0)
4028 + Appp(iii+1,jjj,kkk-1) * p( 0,+1, 0);
4030 Apm0(iii,jjj+1,kkk-1) * p(-1, 0,-1)
4031 + Ap00(iii,jjj+1,kkk-1) * p(-1,+1,-1)
4032 + Apmp(iii,jjj+1,kkk-1) * p(-1, 0, 0)
4033 + Ap0p(iii,jjj+1,kkk-1) * p(-1,+1, 0);
4035 A0m0(iii+1,jjj+1,kkk-1) * p(-1, 0,-1)
4036 + Apm0(iii+1,jjj+1,kkk-1) * p( 0, 0,-1)
4037 + A000(iii+1,jjj+1,kkk-1) * p(-1,+1,-1)
4038 + Ap00(iii+1,jjj+1,kkk-1) * p( 0,+1,-1)
4039 + A0mp(iii+1,jjj+1,kkk-1) * p(-1, 0, 0)
4040 + Apmp(iii+1,jjj+1,kkk-1) * p( 0, 0, 0)
4041 + A00p(iii+1,jjj+1,kkk-1) * p(-1,+1, 0)
4042 + Ap0p(iii+1,jjj+1,kkk-1) * p( 0,+1, 0);
4044 Ap0m(iii,jjj-1,kkk) * p(-1,-1,-1)
4045 + Appm(iii,jjj-1,kkk) * p(-1, 0,-1)
4046 + Ap00(iii,jjj-1,kkk) * p(-1,-1, 0)
4047 + App0(iii,jjj-1,kkk) * p(-1, 0, 0)
4048 + Ap0p(iii,jjj-1,kkk) * p(-1,-1,+1)
4049 + Appp(iii,jjj-1,kkk) * p(-1, 0,+1);
4051 A00m(iii+1,jjj-1,kkk) * p(-1,-1,-1)
4052 + Ap0m(iii+1,jjj-1,kkk) * p( 0,-1,-1)
4053 + A0pm(iii+1,jjj-1,kkk) * p(-1, 0,-1)
4054 + Appm(iii+1,jjj-1,kkk) * p( 0, 0,-1)
4055 + A000(iii+1,jjj-1,kkk) * p(-1,-1, 0)
4056 + Ap00(iii+1,jjj-1,kkk) * p( 0,-1, 0)
4057 + A0p0(iii+1,jjj-1,kkk) * p(-1, 0, 0)
4058 + App0(iii+1,jjj-1,kkk) * p( 0, 0, 0)
4059 + A00p(iii+1,jjj-1,kkk) * p(-1,-1,+1)
4060 + Ap0p(iii+1,jjj-1,kkk) * p( 0,-1,+1)
4061 + A0pp(iii+1,jjj-1,kkk) * p(-1, 0,+1)
4062 + Appp(iii+1,jjj-1,kkk) * p( 0, 0,+1);
4064 Apmm(iii,jjj,kkk) * p(-1,-1,-1)
4065 + Ap0m(iii,jjj,kkk) * p(-1, 0,-1)
4066 + Appm(iii,jjj,kkk) * p(-1,+1,-1)
4067 + Apm0(iii,jjj,kkk) * p(-1,-1, 0)
4068 + Ap00(iii,jjj,kkk) * p(-1, 0, 0)
4069 + App0(iii,jjj,kkk) * p(-1,+1, 0)
4070 + Apmp(iii,jjj,kkk) * p(-1,-1,+1)
4071 + Ap0p(iii,jjj,kkk) * p(-1, 0,+1)
4072 + Appp(iii,jjj,kkk) * p(-1,+1,+1);
4074 A0mm(iii+1,jjj,kkk) * p(-1,-1,-1)
4075 + Apmm(iii+1,jjj,kkk) * p( 0,-1,-1)
4076 + A00m(iii+1,jjj,kkk) * p(-1, 0,-1)
4077 + Ap0m(iii+1,jjj,kkk) * p( 0, 0,-1)
4078 + A0pm(iii+1,jjj,kkk) * p(-1,+1,-1)
4079 + Appm(iii+1,jjj,kkk) * p( 0,+1,-1)
4080 + A0m0(iii+1,jjj,kkk) * p(-1,-1, 0)
4081 + Apm0(iii+1,jjj,kkk) * p( 0,-1, 0)
4082 + A000(iii+1,jjj,kkk) * p(-1, 0, 0)
4083 + Ap00(iii+1,jjj,kkk) * p( 0, 0, 0)
4084 + A0p0(iii+1,jjj,kkk) * p(-1,+1, 0)
4085 + App0(iii+1,jjj,kkk) * p( 0,+1, 0)
4086 + A0mp(iii+1,jjj,kkk) * p(-1,-1,+1)
4087 + Apmp(iii+1,jjj,kkk) * p( 0,-1,+1)
4088 + A00p(iii+1,jjj,kkk) * p(-1, 0,+1)
4089 + Ap0p(iii+1,jjj,kkk) * p( 0, 0,+1)
4090 + A0pp(iii+1,jjj,kkk) * p(-1,+1,+1)
4091 + Appp(iii+1,jjj,kkk) * p( 0,+1,+1);
4093 Apmm(iii,jjj+1,kkk) * p(-1, 0,-1)
4094 + Ap0m(iii,jjj+1,kkk) * p(-1,+1,-1)
4095 + Apm0(iii,jjj+1,kkk) * p(-1, 0, 0)
4096 + Ap00(iii,jjj+1,kkk) * p(-1,+1, 0)
4097 + Apmp(iii,jjj+1,kkk) * p(-1, 0,+1)
4098 + Ap0p(iii,jjj+1,kkk) * p(-1,+1,+1);
4100 A0mm(iii+1,jjj+1,kkk) * p(-1, 0,-1)
4101 + Apmm(iii+1,jjj+1,kkk) * p( 0, 0,-1)
4102 + A00m(iii+1,jjj+1,kkk) * p(-1,+1,-1)
4103 + Ap0m(iii+1,jjj+1,kkk) * p( 0,+1,-1)
4104 + A0m0(iii+1,jjj+1,kkk) * p(-1, 0, 0)
4105 + Apm0(iii+1,jjj+1,kkk) * p( 0, 0, 0)
4106 + A000(iii+1,jjj+1,kkk) * p(-1,+1, 0)
4107 + Ap00(iii+1,jjj+1,kkk) * p( 0,+1, 0)
4108 + A0mp(iii+1,jjj+1,kkk) * p(-1, 0,+1)
4109 + Apmp(iii+1,jjj+1,kkk) * p( 0, 0,+1)
4110 + A00p(iii+1,jjj+1,kkk) * p(-1,+1,+1)
4111 + Ap0p(iii+1,jjj+1,kkk) * p( 0,+1,+1);
4113 Ap0m(iii,jjj-1,kkk+1) * p(-1,-1, 0)
4114 + Appm(iii,jjj-1,kkk+1) * p(-1, 0, 0)
4115 + Ap00(iii,jjj-1,kkk+1) * p(-1,-1,+1)
4116 + App0(iii,jjj-1,kkk+1) * p(-1, 0,+1);
4118 A00m(iii+1,jjj-1,kkk+1) * p(-1,-1, 0)
4119 + Ap0m(iii+1,jjj-1,kkk+1) * p( 0,-1, 0)
4120 + A0pm(iii+1,jjj-1,kkk+1) * p(-1, 0, 0)
4121 + Appm(iii+1,jjj-1,kkk+1) * p( 0, 0, 0)
4122 + A000(iii+1,jjj-1,kkk+1) * p(-1,-1,+1)
4123 + Ap00(iii+1,jjj-1,kkk+1) * p( 0,-1,+1)
4124 + A0p0(iii+1,jjj-1,kkk+1) * p(-1, 0,+1)
4125 + App0(iii+1,jjj-1,kkk+1) * p( 0, 0,+1);
4127 Apmm(iii,jjj,kkk+1) * p(-1,-1, 0)
4128 + Ap0m(iii,jjj,kkk+1) * p(-1, 0, 0)
4129 + Appm(iii,jjj,kkk+1) * p(-1,+1, 0)
4130 + Apm0(iii,jjj,kkk+1) * p(-1,-1,+1)
4131 + Ap00(iii,jjj,kkk+1) * p(-1, 0,+1)
4132 + App0(iii,jjj,kkk+1) * p(-1,+1,+1);
4134 A0mm(iii+1,jjj,kkk+1) * p(-1,-1, 0)
4135 + Apmm(iii+1,jjj,kkk+1) * p( 0,-1, 0)
4136 + A00m(iii+1,jjj,kkk+1) * p(-1, 0, 0)
4137 + Ap0m(iii+1,jjj,kkk+1) * p( 0, 0, 0)
4138 + A0pm(iii+1,jjj,kkk+1) * p(-1,+1, 0)
4139 + Appm(iii+1,jjj,kkk+1) * p( 0,+1, 0)
4140 + A0m0(iii+1,jjj,kkk+1) * p(-1,-1,+1)
4141 + Apm0(iii+1,jjj,kkk+1) * p( 0,-1,+1)
4142 + A000(iii+1,jjj,kkk+1) * p(-1, 0,+1)
4143 + Ap00(iii+1,jjj,kkk+1) * p( 0, 0,+1)
4144 + A0p0(iii+1,jjj,kkk+1) * p(-1,+1,+1)
4145 + App0(iii+1,jjj,kkk+1) * p( 0,+1,+1);
4147 Apmm(iii,jjj+1,kkk+1) * p(-1, 0, 0)
4148 + Ap0m(iii,jjj+1,kkk+1) * p(-1,+1, 0)
4149 + Apm0(iii,jjj+1,kkk+1) * p(-1, 0,+1)
4150 + Ap00(iii,jjj+1,kkk+1) * p(-1,+1,+1);
4152 A0mm(iii+1,jjj+1,kkk+1) * p(-1, 0, 0)
4153 + Apmm(iii+1,jjj+1,kkk+1) * p( 0, 0, 0)
4154 + A00m(iii+1,jjj+1,kkk+1) * p(-1,+1, 0)
4155 + Ap0m(iii+1,jjj+1,kkk+1) * p( 0,+1, 0)
4156 + A0m0(iii+1,jjj+1,kkk+1) * p(-1, 0,+1)
4157 + Apm0(iii+1,jjj+1,kkk+1) * p( 0, 0,+1)
4158 + A000(iii+1,jjj+1,kkk+1) * p(-1,+1,+1)
4159 + Ap00(iii+1,jjj+1,kkk+1) * p( 0,+1,+1);
4160 csten(i,j,k,
ist_p00) = Real(0.125) *
4161 ( restrict_from_0mm_to(iii,jjj,kkk) * ap( 0,-1,-1)
4162 + restrict_from_pmm_to(iii,jjj,kkk) * ap(+1,-1,-1)
4163 + restrict_from_00m_to(iii,jjj,kkk) * ap( 0, 0,-1)
4164 + restrict_from_p0m_to(iii,jjj,kkk) * ap(+1, 0,-1)
4165 + restrict_from_0pm_to(iii,jjj,kkk) * ap( 0,+1,-1)
4166 + restrict_from_ppm_to(iii,jjj,kkk) * ap(+1,+1,-1)
4167 + restrict_from_0m0_to(iii,jjj,kkk) * ap( 0,-1, 0)
4168 + restrict_from_pm0_to(iii,jjj,kkk) * ap(+1,-1, 0)
4169 + restrict_from_000_to(iii,jjj,kkk) * ap( 0, 0, 0)
4170 + restrict_from_p00_to(iii,jjj,kkk) * ap(+1, 0, 0)
4171 + restrict_from_0p0_to(iii,jjj,kkk) * ap( 0,+1, 0)
4172 + restrict_from_pp0_to(iii,jjj,kkk) * ap(+1,+1, 0)
4173 + restrict_from_0mp_to(iii,jjj,kkk) * ap( 0,-1,+1)
4174 + restrict_from_pmp_to(iii,jjj,kkk) * ap(+1,-1,+1)
4175 + restrict_from_00p_to(iii,jjj,kkk) * ap( 0, 0,+1)
4176 + restrict_from_p0p_to(iii,jjj,kkk) * ap(+1, 0,+1)
4177 + restrict_from_0pp_to(iii,jjj,kkk) * ap( 0,+1,+1)
4178 + restrict_from_ppp_to(iii,jjj,kkk) * ap(+1,+1,+1));
4184 p(-1,-1,-1) = interp_from_ppp_to(iii-1,jjj+1,kkk-1);
4185 p( 0,-1,-1) = interp_from_0pp_to(iii ,jjj+1,kkk-1);
4186 p(+1,-1,-1) = interp_from_mpp_to(iii+1,jjj+1,kkk-1);
4187 p(-1, 0,-1) = interp_from_p0p_to(iii-1,jjj+2,kkk-1);
4188 p( 0, 0,-1) = interp_from_00p_to(iii ,jjj+2,kkk-1);
4189 p(+1, 0,-1) = interp_from_m0p_to(iii+1,jjj+2,kkk-1);
4190 p(-1,-1, 0) = interp_from_pp0_to(iii-1,jjj+1,kkk );
4191 p( 0,-1, 0) = interp_from_0p0_to(iii ,jjj+1,kkk );
4192 p(+1,-1, 0) = interp_from_mp0_to(iii+1,jjj+1,kkk );
4193 p(-1, 0, 0) = interp_from_p00_to(iii-1,jjj+2,kkk );
4194 p( 0, 0, 0) = Real(1.);
4195 p(+1, 0, 0) = interp_from_m00_to(iii+1,jjj+2,kkk );
4196 p(-1,-1,+1) = interp_from_ppm_to(iii-1,jjj+1,kkk+1);
4197 p( 0,-1,+1) = interp_from_0pm_to(iii ,jjj+1,kkk+1);
4198 p(+1,-1,+1) = interp_from_mpm_to(iii+1,jjj+1,kkk+1);
4199 p(-1, 0,+1) = interp_from_p0m_to(iii-1,jjj+2,kkk+1);
4200 p( 0, 0,+1) = interp_from_00m_to(iii ,jjj+2,kkk+1);
4201 p(+1, 0,+1) = interp_from_m0m_to(iii+1,jjj+2,kkk+1);
4203 A0p0(iii-1,jjj,kkk-1) * p(-1,-1,-1)
4204 + App0(iii-1,jjj,kkk-1) * p( 0,-1,-1)
4205 + A0pp(iii-1,jjj,kkk-1) * p(-1,-1, 0)
4206 + Appp(iii-1,jjj,kkk-1) * p( 0,-1, 0);
4208 Amp0(iii,jjj,kkk-1) * p(-1,-1,-1)
4209 + A0p0(iii,jjj,kkk-1) * p( 0,-1,-1)
4210 + App0(iii,jjj,kkk-1) * p(+1,-1,-1)
4211 + Ampp(iii,jjj,kkk-1) * p(-1,-1, 0)
4212 + A0pp(iii,jjj,kkk-1) * p( 0,-1, 0)
4213 + Appp(iii,jjj,kkk-1) * p(+1,-1, 0);
4215 Amp0(iii+1,jjj,kkk-1) * p( 0,-1,-1)
4216 + A0p0(iii+1,jjj,kkk-1) * p(+1,-1,-1)
4217 + Ampp(iii+1,jjj,kkk-1) * p( 0,-1, 0)
4218 + A0pp(iii+1,jjj,kkk-1) * p(+1,-1, 0);
4220 A000(iii-1,jjj+1,kkk-1) * p(-1,-1,-1)
4221 + Ap00(iii-1,jjj+1,kkk-1) * p( 0,-1,-1)
4222 + A0p0(iii-1,jjj+1,kkk-1) * p(-1, 0,-1)
4223 + App0(iii-1,jjj+1,kkk-1) * p( 0, 0,-1)
4224 + A00p(iii-1,jjj+1,kkk-1) * p(-1,-1, 0)
4225 + Ap0p(iii-1,jjj+1,kkk-1) * p( 0,-1, 0)
4226 + A0pp(iii-1,jjj+1,kkk-1) * p(-1, 0, 0)
4227 + Appp(iii-1,jjj+1,kkk-1) * p( 0, 0, 0);
4229 Am00(iii,jjj+1,kkk-1) * p(-1,-1,-1)
4230 + A000(iii,jjj+1,kkk-1) * p( 0,-1,-1)
4231 + Ap00(iii,jjj+1,kkk-1) * p(+1,-1,-1)
4232 + Amp0(iii,jjj+1,kkk-1) * p(-1, 0,-1)
4233 + A0p0(iii,jjj+1,kkk-1) * p( 0, 0,-1)
4234 + App0(iii,jjj+1,kkk-1) * p(+1, 0,-1)
4235 + Am0p(iii,jjj+1,kkk-1) * p(-1,-1, 0)
4236 + A00p(iii,jjj+1,kkk-1) * p( 0,-1, 0)
4237 + Ap0p(iii,jjj+1,kkk-1) * p(+1,-1, 0)
4238 + Ampp(iii,jjj+1,kkk-1) * p(-1, 0, 0)
4239 + A0pp(iii,jjj+1,kkk-1) * p( 0, 0, 0)
4240 + Appp(iii,jjj+1,kkk-1) * p(+1, 0, 0);
4242 Am00(iii+1,jjj+1,kkk-1) * p( 0,-1,-1)
4243 + A000(iii+1,jjj+1,kkk-1) * p(+1,-1,-1)
4244 + Amp0(iii+1,jjj+1,kkk-1) * p( 0, 0,-1)
4245 + A0p0(iii+1,jjj+1,kkk-1) * p(+1, 0,-1)
4246 + Am0p(iii+1,jjj+1,kkk-1) * p( 0,-1, 0)
4247 + A00p(iii+1,jjj+1,kkk-1) * p(+1,-1, 0)
4248 + Ampp(iii+1,jjj+1,kkk-1) * p( 0, 0, 0)
4249 + A0pp(iii+1,jjj+1,kkk-1) * p(+1, 0, 0);
4251 A0pm(iii-1,jjj,kkk) * p(-1,-1,-1)
4252 + Appm(iii-1,jjj,kkk) * p( 0,-1,-1)
4253 + A0p0(iii-1,jjj,kkk) * p(-1,-1, 0)
4254 + App0(iii-1,jjj,kkk) * p( 0,-1, 0)
4255 + A0pp(iii-1,jjj,kkk) * p(-1,-1,+1)
4256 + Appp(iii-1,jjj,kkk) * p( 0,-1,+1);
4258 Ampm(iii,jjj,kkk) * p(-1,-1,-1)
4259 + A0pm(iii,jjj,kkk) * p( 0,-1,-1)
4260 + Appm(iii,jjj,kkk) * p(+1,-1,-1)
4261 + Amp0(iii,jjj,kkk) * p(-1,-1, 0)
4262 + A0p0(iii,jjj,kkk) * p( 0,-1, 0)
4263 + App0(iii,jjj,kkk) * p(+1,-1, 0)
4264 + Ampp(iii,jjj,kkk) * p(-1,-1,+1)
4265 + A0pp(iii,jjj,kkk) * p( 0,-1,+1)
4266 + Appp(iii,jjj,kkk) * p(+1,-1,+1);
4268 Ampm(iii+1,jjj,kkk) * p( 0,-1,-1)
4269 + A0pm(iii+1,jjj,kkk) * p(+1,-1,-1)
4270 + Amp0(iii+1,jjj,kkk) * p( 0,-1, 0)
4271 + A0p0(iii+1,jjj,kkk) * p(+1,-1, 0)
4272 + Ampp(iii+1,jjj,kkk) * p( 0,-1,+1)
4273 + A0pp(iii+1,jjj,kkk) * p(+1,-1,+1);
4275 A00m(iii-1,jjj+1,kkk) * p(-1,-1,-1)
4276 + Ap0m(iii-1,jjj+1,kkk) * p( 0,-1,-1)
4277 + A0pm(iii-1,jjj+1,kkk) * p(-1, 0,-1)
4278 + Appm(iii-1,jjj+1,kkk) * p( 0, 0,-1)
4279 + A000(iii-1,jjj+1,kkk) * p(-1,-1, 0)
4280 + Ap00(iii-1,jjj+1,kkk) * p( 0,-1, 0)
4281 + A0p0(iii-1,jjj+1,kkk) * p(-1, 0, 0)
4282 + App0(iii-1,jjj+1,kkk) * p( 0, 0, 0)
4283 + A00p(iii-1,jjj+1,kkk) * p(-1,-1,+1)
4284 + Ap0p(iii-1,jjj+1,kkk) * p( 0,-1,+1)
4285 + A0pp(iii-1,jjj+1,kkk) * p(-1, 0,+1)
4286 + Appp(iii-1,jjj+1,kkk) * p( 0, 0,+1);
4288 Am0m(iii,jjj+1,kkk) * p(-1,-1,-1)
4289 + A00m(iii,jjj+1,kkk) * p( 0,-1,-1)
4290 + Ap0m(iii,jjj+1,kkk) * p(+1,-1,-1)
4291 + Ampm(iii,jjj+1,kkk) * p(-1, 0,-1)
4292 + A0pm(iii,jjj+1,kkk) * p( 0, 0,-1)
4293 + Appm(iii,jjj+1,kkk) * p(+1, 0,-1)
4294 + Am00(iii,jjj+1,kkk) * p(-1,-1, 0)
4295 + A000(iii,jjj+1,kkk) * p( 0,-1, 0)
4296 + Ap00(iii,jjj+1,kkk) * p(+1,-1, 0)
4297 + Amp0(iii,jjj+1,kkk) * p(-1, 0, 0)
4298 + A0p0(iii,jjj+1,kkk) * p( 0, 0, 0)
4299 + App0(iii,jjj+1,kkk) * p(+1, 0, 0)
4300 + Am0p(iii,jjj+1,kkk) * p(-1,-1,+1)
4301 + A00p(iii,jjj+1,kkk) * p( 0,-1,+1)
4302 + Ap0p(iii,jjj+1,kkk) * p(+1,-1,+1)
4303 + Ampp(iii,jjj+1,kkk) * p(-1, 0,+1)
4304 + A0pp(iii,jjj+1,kkk) * p( 0, 0,+1)
4305 + Appp(iii,jjj+1,kkk) * p(+1, 0,+1);
4307 Am0m(iii+1,jjj+1,kkk) * p( 0,-1,-1)
4308 + A00m(iii+1,jjj+1,kkk) * p(+1,-1,-1)
4309 + Ampm(iii+1,jjj+1,kkk) * p( 0, 0,-1)
4310 + A0pm(iii+1,jjj+1,kkk) * p(+1, 0,-1)
4311 + Am00(iii+1,jjj+1,kkk) * p( 0,-1, 0)
4312 + A000(iii+1,jjj+1,kkk) * p(+1,-1, 0)
4313 + Amp0(iii+1,jjj+1,kkk) * p( 0, 0, 0)
4314 + A0p0(iii+1,jjj+1,kkk) * p(+1, 0, 0)
4315 + Am0p(iii+1,jjj+1,kkk) * p( 0,-1,+1)
4316 + A00p(iii+1,jjj+1,kkk) * p(+1,-1,+1)
4317 + Ampp(iii+1,jjj+1,kkk) * p( 0, 0,+1)
4318 + A0pp(iii+1,jjj+1,kkk) * p(+1, 0,+1);
4320 A0pm(iii-1,jjj,kkk+1) * p(-1,-1, 0)
4321 + Appm(iii-1,jjj,kkk+1) * p( 0,-1, 0)
4322 + A0p0(iii-1,jjj,kkk+1) * p(-1,-1,+1)
4323 + App0(iii-1,jjj,kkk+1) * p( 0,-1,+1);
4325 Ampm(iii,jjj,kkk+1) * p(-1,-1, 0)
4326 + A0pm(iii,jjj,kkk+1) * p( 0,-1, 0)
4327 + Appm(iii,jjj,kkk+1) * p(+1,-1, 0)
4328 + Amp0(iii,jjj,kkk+1) * p(-1,-1,+1)
4329 + A0p0(iii,jjj,kkk+1) * p( 0,-1,+1)
4330 + App0(iii,jjj,kkk+1) * p(+1,-1,+1);
4332 Ampm(iii+1,jjj,kkk+1) * p( 0,-1, 0)
4333 + A0pm(iii+1,jjj,kkk+1) * p(+1,-1, 0)
4334 + Amp0(iii+1,jjj,kkk+1) * p( 0,-1,+1)
4335 + A0p0(iii+1,jjj,kkk+1) * p(+1,-1,+1);
4337 A00m(iii-1,jjj+1,kkk+1) * p(-1,-1, 0)
4338 + Ap0m(iii-1,jjj+1,kkk+1) * p( 0,-1, 0)
4339 + A0pm(iii-1,jjj+1,kkk+1) * p(-1, 0, 0)
4340 + Appm(iii-1,jjj+1,kkk+1) * p( 0, 0, 0)
4341 + A000(iii-1,jjj+1,kkk+1) * p(-1,-1,+1)
4342 + Ap00(iii-1,jjj+1,kkk+1) * p( 0,-1,+1)
4343 + A0p0(iii-1,jjj+1,kkk+1) * p(-1, 0,+1)
4344 + App0(iii-1,jjj+1,kkk+1) * p( 0, 0,+1);
4346 Am0m(iii,jjj+1,kkk+1) * p(-1,-1, 0)
4347 + A00m(iii,jjj+1,kkk+1) * p( 0,-1, 0)
4348 + Ap0m(iii,jjj+1,kkk+1) * p(+1,-1, 0)
4349 + Ampm(iii,jjj+1,kkk+1) * p(-1, 0, 0)
4350 + A0pm(iii,jjj+1,kkk+1) * p( 0, 0, 0)
4351 + Appm(iii,jjj+1,kkk+1) * p(+1, 0, 0)
4352 + Am00(iii,jjj+1,kkk+1) * p(-1,-1,+1)
4353 + A000(iii,jjj+1,kkk+1) * p( 0,-1,+1)
4354 + Ap00(iii,jjj+1,kkk+1) * p(+1,-1,+1)
4355 + Amp0(iii,jjj+1,kkk+1) * p(-1, 0,+1)
4356 + A0p0(iii,jjj+1,kkk+1) * p( 0, 0,+1)
4357 + App0(iii,jjj+1,kkk+1) * p(+1, 0,+1);
4359 Am0m(iii+1,jjj+1,kkk+1) * p( 0,-1, 0)
4360 + A00m(iii+1,jjj+1,kkk+1) * p(+1,-1, 0)
4361 + Ampm(iii+1,jjj+1,kkk+1) * p( 0, 0, 0)
4362 + A0pm(iii+1,jjj+1,kkk+1) * p(+1, 0, 0)
4363 + Am00(iii+1,jjj+1,kkk+1) * p( 0,-1,+1)
4364 + A000(iii+1,jjj+1,kkk+1) * p(+1,-1,+1)
4365 + Amp0(iii+1,jjj+1,kkk+1) * p( 0, 0,+1)
4366 + A0p0(iii+1,jjj+1,kkk+1) * p(+1, 0,+1);
4367 csten(i,j,k,
ist_0p0) = Real(0.125) *
4368 ( restrict_from_m0m_to(iii,jjj,kkk) * ap(-1, 0,-1)
4369 + restrict_from_00m_to(iii,jjj,kkk) * ap( 0, 0,-1)
4370 + restrict_from_p0m_to(iii,jjj,kkk) * ap(+1, 0,-1)
4371 + restrict_from_mpm_to(iii,jjj,kkk) * ap(-1,+1,-1)
4372 + restrict_from_0pm_to(iii,jjj,kkk) * ap( 0,+1,-1)
4373 + restrict_from_ppm_to(iii,jjj,kkk) * ap(+1,+1,-1)
4374 + restrict_from_m00_to(iii,jjj,kkk) * ap(-1, 0, 0)
4375 + restrict_from_000_to(iii,jjj,kkk) * ap( 0, 0, 0)
4376 + restrict_from_p00_to(iii,jjj,kkk) * ap(+1, 0, 0)
4377 + restrict_from_mp0_to(iii,jjj,kkk) * ap(-1,+1, 0)
4378 + restrict_from_0p0_to(iii,jjj,kkk) * ap( 0,+1, 0)
4379 + restrict_from_pp0_to(iii,jjj,kkk) * ap(+1,+1, 0)
4380 + restrict_from_m0p_to(iii,jjj,kkk) * ap(-1, 0,+1)
4381 + restrict_from_00p_to(iii,jjj,kkk) * ap( 0, 0,+1)
4382 + restrict_from_p0p_to(iii,jjj,kkk) * ap(+1, 0,+1)
4383 + restrict_from_mpp_to(iii,jjj,kkk) * ap(-1,+1,+1)
4384 + restrict_from_0pp_to(iii,jjj,kkk) * ap( 0,+1,+1)
4385 + restrict_from_ppp_to(iii,jjj,kkk) * ap(+1,+1,+1));
4391 p(-1,-1,-1) = interp_from_ppp_to(iii-1,jjj-1,kkk+1);
4392 p( 0,-1,-1) = interp_from_0pp_to(iii ,jjj-1,kkk+1);
4393 p(+1,-1,-1) = interp_from_mpp_to(iii+1,jjj-1,kkk+1);
4394 p(-1, 0,-1) = interp_from_p0p_to(iii-1,jjj ,kkk+1);
4395 p( 0, 0,-1) = interp_from_00p_to(iii ,jjj ,kkk+1);
4396 p(+1, 0,-1) = interp_from_m0p_to(iii+1,jjj ,kkk+1);
4397 p(-1,+1,-1) = interp_from_pmp_to(iii-1,jjj+1,kkk+1);
4398 p( 0,+1,-1) = interp_from_0mp_to(iii ,jjj+1,kkk+1);
4399 p(+1,+1,-1) = interp_from_mmp_to(iii+1,jjj+1,kkk+1);
4400 p(-1,-1, 0) = interp_from_pp0_to(iii-1,jjj-1,kkk+2);
4401 p( 0,-1, 0) = interp_from_0p0_to(iii ,jjj-1,kkk+2);
4402 p(+1,-1, 0) = interp_from_mp0_to(iii+1,jjj-1,kkk+2);
4403 p(-1, 0, 0) = interp_from_p00_to(iii-1,jjj ,kkk+2);
4404 p( 0, 0, 0) = Real(1.);
4405 p(+1, 0, 0) = interp_from_m00_to(iii+1,jjj ,kkk+2);
4406 p(-1,+1, 0) = interp_from_pm0_to(iii-1,jjj+1,kkk+2);
4407 p( 0,+1, 0) = interp_from_0m0_to(iii ,jjj+1,kkk+2);
4408 p(+1,+1, 0) = interp_from_mm0_to(iii+1,jjj+1,kkk+2);
4410 A00p(iii-1,jjj-1,kkk) * p(-1,-1,-1)
4411 + Ap0p(iii-1,jjj-1,kkk) * p( 0,-1,-1)
4412 + A0pp(iii-1,jjj-1,kkk) * p(-1, 0,-1)
4413 + Appp(iii-1,jjj-1,kkk) * p( 0, 0,-1);
4415 Am0p(iii,jjj-1,kkk) * p(-1,-1,-1)
4416 + A00p(iii,jjj-1,kkk) * p( 0,-1,-1)
4417 + Ap0p(iii,jjj-1,kkk) * p(+1,-1,-1)
4418 + Ampp(iii,jjj-1,kkk) * p(-1, 0,-1)
4419 + A0pp(iii,jjj-1,kkk) * p( 0, 0,-1)
4420 + Appp(iii,jjj-1,kkk) * p(+1, 0,-1);
4422 Am0p(iii+1,jjj-1,kkk) * p( 0,-1,-1)
4423 + A00p(iii+1,jjj-1,kkk) * p(+1,-1,-1)
4424 + Ampp(iii+1,jjj-1,kkk) * p( 0, 0,-1)
4425 + A0pp(iii+1,jjj-1,kkk) * p(+1, 0,-1);
4427 A0mp(iii-1,jjj,kkk) * p(-1,-1,-1)
4428 + Apmp(iii-1,jjj,kkk) * p( 0,-1,-1)
4429 + A00p(iii-1,jjj,kkk) * p(-1, 0,-1)
4430 + Ap0p(iii-1,jjj,kkk) * p( 0, 0,-1)
4431 + A0pp(iii-1,jjj,kkk) * p(-1,+1,-1)
4432 + Appp(iii-1,jjj,kkk) * p( 0,+1,-1);
4434 Ammp(iii,jjj,kkk) * p(-1,-1,-1)
4435 + A0mp(iii,jjj,kkk) * p( 0,-1,-1)
4436 + Apmp(iii,jjj,kkk) * p(+1,-1,-1)
4437 + Am0p(iii,jjj,kkk) * p(-1, 0,-1)
4438 + A00p(iii,jjj,kkk) * p( 0, 0,-1)
4439 + Ap0p(iii,jjj,kkk) * p(+1, 0,-1)
4440 + Ampp(iii,jjj,kkk) * p(-1,+1,-1)
4441 + A0pp(iii,jjj,kkk) * p( 0,+1,-1)
4442 + Appp(iii,jjj,kkk) * p(+1,+1,-1);
4444 Ammp(iii+1,jjj,kkk) * p( 0,-1,-1)
4445 + A0mp(iii+1,jjj,kkk) * p(+1,-1,-1)
4446 + Am0p(iii+1,jjj,kkk) * p( 0, 0,-1)
4447 + A00p(iii+1,jjj,kkk) * p(+1, 0,-1)
4448 + Ampp(iii+1,jjj,kkk) * p( 0,+1,-1)
4449 + A0pp(iii+1,jjj,kkk) * p(+1,+1,-1);
4451 A0mp(iii-1,jjj+1,kkk) * p(-1, 0,-1)
4452 + Apmp(iii-1,jjj+1,kkk) * p( 0, 0,-1)
4453 + A00p(iii-1,jjj+1,kkk) * p(-1,+1,-1)
4454 + Ap0p(iii-1,jjj+1,kkk) * p( 0,+1,-1);
4456 Ammp(iii,jjj+1,kkk) * p(-1, 0,-1)
4457 + A0mp(iii,jjj+1,kkk) * p( 0, 0,-1)
4458 + Apmp(iii,jjj+1,kkk) * p(+1, 0,-1)
4459 + Am0p(iii,jjj+1,kkk) * p(-1,+1,-1)
4460 + A00p(iii,jjj+1,kkk) * p( 0,+1,-1)
4461 + Ap0p(iii,jjj+1,kkk) * p(+1,+1,-1);
4463 Ammp(iii+1,jjj+1,kkk) * p( 0, 0,-1)
4464 + A0mp(iii+1,jjj+1,kkk) * p(+1, 0,-1)
4465 + Am0p(iii+1,jjj+1,kkk) * p( 0,+1,-1)
4466 + A00p(iii+1,jjj+1,kkk) * p(+1,+1,-1);
4468 A000(iii-1,jjj-1,kkk+1) * p(-1,-1,-1)
4469 + Ap00(iii-1,jjj-1,kkk+1) * p( 0,-1,-1)
4470 + A0p0(iii-1,jjj-1,kkk+1) * p(-1, 0,-1)
4471 + App0(iii-1,jjj-1,kkk+1) * p( 0, 0,-1)
4472 + A00p(iii-1,jjj-1,kkk+1) * p(-1,-1, 0)
4473 + Ap0p(iii-1,jjj-1,kkk+1) * p( 0,-1, 0)
4474 + A0pp(iii-1,jjj-1,kkk+1) * p(-1, 0, 0)
4475 + Appp(iii-1,jjj-1,kkk+1) * p( 0, 0, 0);
4477 Am00(iii,jjj-1,kkk+1) * p(-1,-1,-1)
4478 + A000(iii,jjj-1,kkk+1) * p( 0,-1,-1)
4479 + Ap00(iii,jjj-1,kkk+1) * p(+1,-1,-1)
4480 + Amp0(iii,jjj-1,kkk+1) * p(-1, 0,-1)
4481 + A0p0(iii,jjj-1,kkk+1) * p( 0, 0,-1)
4482 + App0(iii,jjj-1,kkk+1) * p(+1, 0,-1)
4483 + Am0p(iii,jjj-1,kkk+1) * p(-1,-1, 0)
4484 + A00p(iii,jjj-1,kkk+1) * p( 0,-1, 0)
4485 + Ap0p(iii,jjj-1,kkk+1) * p(+1,-1, 0)
4486 + Ampp(iii,jjj-1,kkk+1) * p(-1, 0, 0)
4487 + A0pp(iii,jjj-1,kkk+1) * p( 0, 0, 0)
4488 + Appp(iii,jjj-1,kkk+1) * p(+1, 0, 0);
4490 Am00(iii+1,jjj-1,kkk+1) * p( 0,-1,-1)
4491 + A000(iii+1,jjj-1,kkk+1) * p(+1,-1,-1)
4492 + Amp0(iii+1,jjj-1,kkk+1) * p( 0, 0,-1)
4493 + A0p0(iii+1,jjj-1,kkk+1) * p(+1, 0,-1)
4494 + Am0p(iii+1,jjj-1,kkk+1) * p( 0,-1, 0)
4495 + A00p(iii+1,jjj-1,kkk+1) * p(+1,-1, 0)
4496 + Ampp(iii+1,jjj-1,kkk+1) * p( 0, 0, 0)
4497 + A0pp(iii+1,jjj-1,kkk+1) * p(+1, 0, 0);
4499 A0m0(iii-1,jjj,kkk+1) * p(-1,-1,-1)
4500 + Apm0(iii-1,jjj,kkk+1) * p( 0,-1,-1)
4501 + A000(iii-1,jjj,kkk+1) * p(-1, 0,-1)
4502 + Ap00(iii-1,jjj,kkk+1) * p( 0, 0,-1)
4503 + A0p0(iii-1,jjj,kkk+1) * p(-1,+1,-1)
4504 + App0(iii-1,jjj,kkk+1) * p( 0,+1,-1)
4505 + A0mp(iii-1,jjj,kkk+1) * p(-1,-1, 0)
4506 + Apmp(iii-1,jjj,kkk+1) * p( 0,-1, 0)
4507 + A00p(iii-1,jjj,kkk+1) * p(-1, 0, 0)
4508 + Ap0p(iii-1,jjj,kkk+1) * p( 0, 0, 0)
4509 + A0pp(iii-1,jjj,kkk+1) * p(-1,+1, 0)
4510 + Appp(iii-1,jjj,kkk+1) * p( 0,+1, 0);
4512 Amm0(iii,jjj,kkk+1) * p(-1,-1,-1)
4513 + A0m0(iii,jjj,kkk+1) * p( 0,-1,-1)
4514 + Apm0(iii,jjj,kkk+1) * p(+1,-1,-1)
4515 + Am00(iii,jjj,kkk+1) * p(-1, 0,-1)
4516 + A000(iii,jjj,kkk+1) * p( 0, 0,-1)
4517 + Ap00(iii,jjj,kkk+1) * p(+1, 0,-1)
4518 + Amp0(iii,jjj,kkk+1) * p(-1,+1,-1)
4519 + A0p0(iii,jjj,kkk+1) * p( 0,+1,-1)
4520 + App0(iii,jjj,kkk+1) * p(+1,+1,-1)
4521 + Ammp(iii,jjj,kkk+1) * p(-1,-1, 0)
4522 + A0mp(iii,jjj,kkk+1) * p( 0,-1, 0)
4523 + Apmp(iii,jjj,kkk+1) * p(+1,-1, 0)
4524 + Am0p(iii,jjj,kkk+1) * p(-1, 0, 0)
4525 + A00p(iii,jjj,kkk+1) * p( 0, 0, 0)
4526 + Ap0p(iii,jjj,kkk+1) * p(+1, 0, 0)
4527 + Ampp(iii,jjj,kkk+1) * p(-1,+1, 0)
4528 + A0pp(iii,jjj,kkk+1) * p( 0,+1, 0)
4529 + Appp(iii,jjj,kkk+1) * p(+1,+1, 0);
4531 Amm0(iii+1,jjj,kkk+1) * p( 0,-1,-1)
4532 + A0m0(iii+1,jjj,kkk+1) * p(+1,-1,-1)
4533 + Am00(iii+1,jjj,kkk+1) * p( 0, 0,-1)
4534 + A000(iii+1,jjj,kkk+1) * p(+1, 0,-1)
4535 + Amp0(iii+1,jjj,kkk+1) * p( 0,+1,-1)
4536 + A0p0(iii+1,jjj,kkk+1) * p(+1,+1,-1)
4537 + Ammp(iii+1,jjj,kkk+1) * p( 0,-1, 0)
4538 + A0mp(iii+1,jjj,kkk+1) * p(+1,-1, 0)
4539 + Am0p(iii+1,jjj,kkk+1) * p( 0, 0, 0)
4540 + A00p(iii+1,jjj,kkk+1) * p(+1, 0, 0)
4541 + Ampp(iii+1,jjj,kkk+1) * p( 0,+1, 0)
4542 + A0pp(iii+1,jjj,kkk+1) * p(+1,+1, 0);
4544 A0m0(iii-1,jjj+1,kkk+1) * p(-1, 0,-1)
4545 + Apm0(iii-1,jjj+1,kkk+1) * p( 0, 0,-1)
4546 + A000(iii-1,jjj+1,kkk+1) * p(-1,+1,-1)
4547 + Ap00(iii-1,jjj+1,kkk+1) * p( 0,+1,-1)
4548 + A0mp(iii-1,jjj+1,kkk+1) * p(-1, 0, 0)
4549 + Apmp(iii-1,jjj+1,kkk+1) * p( 0, 0, 0)
4550 + A00p(iii-1,jjj+1,kkk+1) * p(-1,+1, 0)
4551 + Ap0p(iii-1,jjj+1,kkk+1) * p( 0,+1, 0);
4553 Amm0(iii,jjj+1,kkk+1) * p(-1, 0,-1)
4554 + A0m0(iii,jjj+1,kkk+1) * p( 0, 0,-1)
4555 + Apm0(iii,jjj+1,kkk+1) * p(+1, 0,-1)
4556 + Am00(iii,jjj+1,kkk+1) * p(-1,+1,-1)
4557 + A000(iii,jjj+1,kkk+1) * p( 0,+1,-1)
4558 + Ap00(iii,jjj+1,kkk+1) * p(+1,+1,-1)
4559 + Ammp(iii,jjj+1,kkk+1) * p(-1, 0, 0)
4560 + A0mp(iii,jjj+1,kkk+1) * p( 0, 0, 0)
4561 + Apmp(iii,jjj+1,kkk+1) * p(+1, 0, 0)
4562 + Am0p(iii,jjj+1,kkk+1) * p(-1,+1, 0)
4563 + A00p(iii,jjj+1,kkk+1) * p( 0,+1, 0)
4564 + Ap0p(iii,jjj+1,kkk+1) * p(+1,+1, 0);
4566 Amm0(iii+1,jjj+1,kkk+1) * p( 0, 0,-1)
4567 + A0m0(iii+1,jjj+1,kkk+1) * p(+1, 0,-1)
4568 + Am00(iii+1,jjj+1,kkk+1) * p( 0,+1,-1)
4569 + A000(iii+1,jjj+1,kkk+1) * p(+1,+1,-1)
4570 + Ammp(iii+1,jjj+1,kkk+1) * p( 0, 0, 0)
4571 + A0mp(iii+1,jjj+1,kkk+1) * p(+1, 0, 0)
4572 + Am0p(iii+1,jjj+1,kkk+1) * p( 0,+1, 0)
4573 + A00p(iii+1,jjj+1,kkk+1) * p(+1,+1, 0);
4574 csten(i,j,k,
ist_00p) = Real(0.125) *
4575 ( restrict_from_mm0_to(iii,jjj,kkk) * ap(-1,-1, 0)
4576 + restrict_from_0m0_to(iii,jjj,kkk) * ap( 0,-1, 0)
4577 + restrict_from_pm0_to(iii,jjj,kkk) * ap(+1,-1, 0)
4578 + restrict_from_m00_to(iii,jjj,kkk) * ap(-1, 0, 0)
4579 + restrict_from_000_to(iii,jjj,kkk) * ap( 0, 0, 0)
4580 + restrict_from_p00_to(iii,jjj,kkk) * ap(+1, 0, 0)
4581 + restrict_from_mp0_to(iii,jjj,kkk) * ap(-1,+1, 0)
4582 + restrict_from_0p0_to(iii,jjj,kkk) * ap( 0,+1, 0)
4583 + restrict_from_pp0_to(iii,jjj,kkk) * ap(+1,+1, 0)
4584 + restrict_from_mmp_to(iii,jjj,kkk) * ap(-1,-1,+1)
4585 + restrict_from_0mp_to(iii,jjj,kkk) * ap( 0,-1,+1)
4586 + restrict_from_pmp_to(iii,jjj,kkk) * ap(+1,-1,+1)
4587 + restrict_from_m0p_to(iii,jjj,kkk) * ap(-1, 0,+1)
4588 + restrict_from_00p_to(iii,jjj,kkk) * ap( 0, 0,+1)
4589 + restrict_from_p0p_to(iii,jjj,kkk) * ap(+1, 0,+1)
4590 + restrict_from_mpp_to(iii,jjj,kkk) * ap(-1,+1,+1)
4591 + restrict_from_0pp_to(iii,jjj,kkk) * ap( 0,+1,+1)
4592 + restrict_from_ppp_to(iii,jjj,kkk) * ap(+1,+1,+1));
4598 p(-1,-1,-1) = interp_from_ppp_to(iii+1,jjj+1,kkk-1);
4599 p( 0,-1,-1) = interp_from_0pp_to(iii+2,jjj+1,kkk-1);
4600 p(-1, 0,-1) = interp_from_p0p_to(iii+1,jjj+2,kkk-1);
4601 p( 0, 0,-1) = interp_from_00p_to(iii+2,jjj+2,kkk-1);
4602 p(-1,-1, 0) = interp_from_pp0_to(iii+1,jjj+1,kkk );
4603 p( 0,-1, 0) = interp_from_0p0_to(iii+2,jjj+1,kkk );
4604 p(-1, 0, 0) = interp_from_p00_to(iii+1,jjj+2,kkk );
4605 p( 0, 0, 0) = Real(1.);
4606 p(-1,-1,+1) = interp_from_ppm_to(iii+1,jjj+1,kkk+1);
4607 p( 0,-1,+1) = interp_from_0pm_to(iii+2,jjj+1,kkk+1);
4608 p(-1, 0,+1) = interp_from_p0m_to(iii+1,jjj+2,kkk+1);
4609 p( 0, 0,+1) = interp_from_00m_to(iii+2,jjj+2,kkk+1);
4611 App0(iii,jjj,kkk-1) * p(-1,-1,-1)
4612 + Appp(iii,jjj,kkk-1) * p(-1,-1, 0);
4614 A0p0(iii+1,jjj,kkk-1) * p(-1,-1,-1)
4615 + App0(iii+1,jjj,kkk-1) * p( 0,-1,-1)
4616 + A0pp(iii+1,jjj,kkk-1) * p(-1,-1, 0)
4617 + Appp(iii+1,jjj,kkk-1) * p( 0,-1, 0);
4619 Ap00(iii,jjj+1,kkk-1) * p(-1,-1,-1)
4620 + App0(iii,jjj+1,kkk-1) * p(-1, 0,-1)
4621 + Ap0p(iii,jjj+1,kkk-1) * p(-1,-1, 0)
4622 + Appp(iii,jjj+1,kkk-1) * p(-1, 0, 0);
4624 A000(iii+1,jjj+1,kkk-1) * p(-1,-1,-1)
4625 + Ap00(iii+1,jjj+1,kkk-1) * p( 0,-1,-1)
4626 + A0p0(iii+1,jjj+1,kkk-1) * p(-1, 0,-1)
4627 + App0(iii+1,jjj+1,kkk-1) * p( 0, 0,-1)
4628 + A00p(iii+1,jjj+1,kkk-1) * p(-1,-1, 0)
4629 + Ap0p(iii+1,jjj+1,kkk-1) * p( 0,-1, 0)
4630 + A0pp(iii+1,jjj+1,kkk-1) * p(-1, 0, 0)
4631 + Appp(iii+1,jjj+1,kkk-1) * p( 0, 0, 0);
4633 Appm(iii,jjj,kkk) * p(-1,-1,-1)
4634 + App0(iii,jjj,kkk) * p(-1,-1, 0)
4635 + Appp(iii,jjj,kkk) * p(-1,-1,+1);
4637 A0pm(iii+1,jjj,kkk) * p(-1,-1,-1)
4638 + Appm(iii+1,jjj,kkk) * p( 0,-1,-1)
4639 + A0p0(iii+1,jjj,kkk) * p(-1,-1, 0)
4640 + App0(iii+1,jjj,kkk) * p( 0,-1, 0)
4641 + A0pp(iii+1,jjj,kkk) * p(-1,-1,+1)
4642 + Appp(iii+1,jjj,kkk) * p( 0,-1,+1);
4644 Ap0m(iii,jjj+1,kkk) * p(-1,-1,-1)
4645 + Appm(iii,jjj+1,kkk) * p(-1, 0,-1)
4646 + Ap00(iii,jjj+1,kkk) * p(-1,-1, 0)
4647 + App0(iii,jjj+1,kkk) * p(-1, 0, 0)
4648 + Ap0p(iii,jjj+1,kkk) * p(-1,-1,+1)
4649 + Appp(iii,jjj+1,kkk) * p(-1, 0,+1);
4651 A00m(iii+1,jjj+1,kkk) * p(-1,-1,-1)
4652 + Ap0m(iii+1,jjj+1,kkk) * p( 0,-1,-1)
4653 + A0pm(iii+1,jjj+1,kkk) * p(-1, 0,-1)
4654 + Appm(iii+1,jjj+1,kkk) * p( 0, 0,-1)
4655 + A000(iii+1,jjj+1,kkk) * p(-1,-1, 0)
4656 + Ap00(iii+1,jjj+1,kkk) * p( 0,-1, 0)
4657 + A0p0(iii+1,jjj+1,kkk) * p(-1, 0, 0)
4658 + App0(iii+1,jjj+1,kkk) * p( 0, 0, 0)
4659 + A00p(iii+1,jjj+1,kkk) * p(-1,-1,+1)
4660 + Ap0p(iii+1,jjj+1,kkk) * p( 0,-1,+1)
4661 + A0pp(iii+1,jjj+1,kkk) * p(-1, 0,+1)
4662 + Appp(iii+1,jjj+1,kkk) * p( 0, 0,+1);
4664 Appm(iii,jjj,kkk+1) * p(-1,-1, 0)
4665 + App0(iii,jjj,kkk+1) * p(-1,-1,+1);
4667 A0pm(iii+1,jjj,kkk+1) * p(-1,-1, 0)
4668 + Appm(iii+1,jjj,kkk+1) * p( 0,-1, 0)
4669 + A0p0(iii+1,jjj,kkk+1) * p(-1,-1,+1)
4670 + App0(iii+1,jjj,kkk+1) * p( 0,-1,+1);
4672 Ap0m(iii,jjj+1,kkk+1) * p(-1,-1, 0)
4673 + Appm(iii,jjj+1,kkk+1) * p(-1, 0, 0)
4674 + Ap00(iii,jjj+1,kkk+1) * p(-1,-1,+1)
4675 + App0(iii,jjj+1,kkk+1) * p(-1, 0,+1);
4677 A00m(iii+1,jjj+1,kkk+1) * p(-1,-1, 0)
4678 + Ap0m(iii+1,jjj+1,kkk+1) * p( 0,-1, 0)
4679 + A0pm(iii+1,jjj+1,kkk+1) * p(-1, 0, 0)
4680 + Appm(iii+1,jjj+1,kkk+1) * p( 0, 0, 0)
4681 + A000(iii+1,jjj+1,kkk+1) * p(-1,-1,+1)
4682 + Ap00(iii+1,jjj+1,kkk+1) * p( 0,-1,+1)
4683 + A0p0(iii+1,jjj+1,kkk+1) * p(-1, 0,+1)
4684 + App0(iii+1,jjj+1,kkk+1) * p( 0, 0,+1);
4686 ( restrict_from_00m_to(iii,jjj,kkk) * ap( 0, 0,-1)
4687 + restrict_from_p0m_to(iii,jjj,kkk) * ap(+1, 0,-1)
4688 + restrict_from_0pm_to(iii,jjj,kkk) * ap( 0,+1,-1)
4689 + restrict_from_ppm_to(iii,jjj,kkk) * ap(+1,+1,-1)
4690 + restrict_from_000_to(iii,jjj,kkk) * ap( 0, 0, 0)
4691 + restrict_from_p00_to(iii,jjj,kkk) * ap(+1, 0, 0)
4692 + restrict_from_0p0_to(iii,jjj,kkk) * ap( 0,+1, 0)
4693 + restrict_from_pp0_to(iii,jjj,kkk) * ap(+1,+1, 0)
4694 + restrict_from_00p_to(iii,jjj,kkk) * ap( 0, 0,+1)
4695 + restrict_from_p0p_to(iii,jjj,kkk) * ap(+1, 0,+1)
4696 + restrict_from_0pp_to(iii,jjj,kkk) * ap( 0,+1,+1)
4697 + restrict_from_ppp_to(iii,jjj,kkk) * ap(+1,+1,+1));
4703 p( 0,-1,-1) = interp_from_0pp_to(iii-2,jjj+1,kkk-1);
4704 p(+1,-1,-1) = interp_from_mpp_to(iii-1,jjj+1,kkk-1);
4705 p( 0, 0,-1) = interp_from_00p_to(iii-2,jjj+2,kkk-1);
4706 p(+1, 0,-1) = interp_from_m0p_to(iii-1,jjj+2,kkk-1);
4707 p( 0,-1, 0) = interp_from_0p0_to(iii-2,jjj+1,kkk );
4708 p(+1,-1, 0) = interp_from_mp0_to(iii-1,jjj+1,kkk );
4709 p( 0, 0, 0) = Real(1.);
4710 p(+1, 0, 0) = interp_from_m00_to(iii-1,jjj+2,kkk );
4711 p( 0,-1,+1) = interp_from_0pm_to(iii-2,jjj+1,kkk+1);
4712 p(+1,-1,+1) = interp_from_mpm_to(iii-1,jjj+1,kkk+1);
4713 p( 0, 0,+1) = interp_from_00m_to(iii-2,jjj+2,kkk+1);
4714 p(+1, 0,+1) = interp_from_m0m_to(iii-1,jjj+2,kkk+1);
4716 Amp0(iii-1,jjj,kkk-1) * p( 0,-1,-1)
4717 + A0p0(iii-1,jjj,kkk-1) * p(+1,-1,-1)
4718 + Ampp(iii-1,jjj,kkk-1) * p( 0,-1, 0)
4719 + A0pp(iii-1,jjj,kkk-1) * p(+1,-1, 0);
4721 Amp0(iii,jjj,kkk-1) * p(+1,-1,-1)
4722 + Ampp(iii,jjj,kkk-1) * p(+1,-1, 0);
4724 Am00(iii-1,jjj+1,kkk-1) * p( 0,-1,-1)
4725 + A000(iii-1,jjj+1,kkk-1) * p(+1,-1,-1)
4726 + Amp0(iii-1,jjj+1,kkk-1) * p( 0, 0,-1)
4727 + A0p0(iii-1,jjj+1,kkk-1) * p(+1, 0,-1)
4728 + Am0p(iii-1,jjj+1,kkk-1) * p( 0,-1, 0)
4729 + A00p(iii-1,jjj+1,kkk-1) * p(+1,-1, 0)
4730 + Ampp(iii-1,jjj+1,kkk-1) * p( 0, 0, 0)
4731 + A0pp(iii-1,jjj+1,kkk-1) * p(+1, 0, 0);
4733 Am00(iii,jjj+1,kkk-1) * p(+1,-1,-1)
4734 + Amp0(iii,jjj+1,kkk-1) * p(+1, 0,-1)
4735 + Am0p(iii,jjj+1,kkk-1) * p(+1,-1, 0)
4736 + Ampp(iii,jjj+1,kkk-1) * p(+1, 0, 0);
4738 Ampm(iii-1,jjj,kkk) * p( 0,-1,-1)
4739 + A0pm(iii-1,jjj,kkk) * p(+1,-1,-1)
4740 + Amp0(iii-1,jjj,kkk) * p( 0,-1, 0)
4741 + A0p0(iii-1,jjj,kkk) * p(+1,-1, 0)
4742 + Ampp(iii-1,jjj,kkk) * p( 0,-1,+1)
4743 + A0pp(iii-1,jjj,kkk) * p(+1,-1,+1);
4745 Ampm(iii,jjj,kkk) * p(+1,-1,-1)
4746 + Amp0(iii,jjj,kkk) * p(+1,-1, 0)
4747 + Ampp(iii,jjj,kkk) * p(+1,-1,+1);
4749 Am0m(iii-1,jjj+1,kkk) * p( 0,-1,-1)
4750 + A00m(iii-1,jjj+1,kkk) * p(+1,-1,-1)
4751 + Ampm(iii-1,jjj+1,kkk) * p( 0, 0,-1)
4752 + A0pm(iii-1,jjj+1,kkk) * p(+1, 0,-1)
4753 + Am00(iii-1,jjj+1,kkk) * p( 0,-1, 0)
4754 + A000(iii-1,jjj+1,kkk) * p(+1,-1, 0)
4755 + Amp0(iii-1,jjj+1,kkk) * p( 0, 0, 0)
4756 + A0p0(iii-1,jjj+1,kkk) * p(+1, 0, 0)
4757 + Am0p(iii-1,jjj+1,kkk) * p( 0,-1,+1)
4758 + A00p(iii-1,jjj+1,kkk) * p(+1,-1,+1)
4759 + Ampp(iii-1,jjj+1,kkk) * p( 0, 0,+1)
4760 + A0pp(iii-1,jjj+1,kkk) * p(+1, 0,+1);
4762 Am0m(iii,jjj+1,kkk) * p(+1,-1,-1)
4763 + Ampm(iii,jjj+1,kkk) * p(+1, 0,-1)
4764 + Am00(iii,jjj+1,kkk) * p(+1,-1, 0)
4765 + Amp0(iii,jjj+1,kkk) * p(+1, 0, 0)
4766 + Am0p(iii,jjj+1,kkk) * p(+1,-1,+1)
4767 + Ampp(iii,jjj+1,kkk) * p(+1, 0,+1);
4769 Ampm(iii-1,jjj,kkk+1) * p( 0,-1, 0)
4770 + A0pm(iii-1,jjj,kkk+1) * p(+1,-1, 0)
4771 + Amp0(iii-1,jjj,kkk+1) * p( 0,-1,+1)
4772 + A0p0(iii-1,jjj,kkk+1) * p(+1,-1,+1);
4774 Ampm(iii,jjj,kkk+1) * p(+1,-1, 0)
4775 + Amp0(iii,jjj,kkk+1) * p(+1,-1,+1);
4777 Am0m(iii-1,jjj+1,kkk+1) * p( 0,-1, 0)
4778 + A00m(iii-1,jjj+1,kkk+1) * p(+1,-1, 0)
4779 + Ampm(iii-1,jjj+1,kkk+1) * p( 0, 0, 0)
4780 + A0pm(iii-1,jjj+1,kkk+1) * p(+1, 0, 0)
4781 + Am00(iii-1,jjj+1,kkk+1) * p( 0,-1,+1)
4782 + A000(iii-1,jjj+1,kkk+1) * p(+1,-1,+1)
4783 + Amp0(iii-1,jjj+1,kkk+1) * p( 0, 0,+1)
4784 + A0p0(iii-1,jjj+1,kkk+1) * p(+1, 0,+1);
4786 Am0m(iii,jjj+1,kkk+1) * p(+1,-1, 0)
4787 + Ampm(iii,jjj+1,kkk+1) * p(+1, 0, 0)
4788 + Am00(iii,jjj+1,kkk+1) * p(+1,-1,+1)
4789 + Amp0(iii,jjj+1,kkk+1) * p(+1, 0,+1);
4791 ( restrict_from_m0m_to(iii,jjj,kkk) * ap(-1, 0,-1)
4792 + restrict_from_00m_to(iii,jjj,kkk) * ap( 0, 0,-1)
4793 + restrict_from_mpm_to(iii,jjj,kkk) * ap(-1,+1,-1)
4794 + restrict_from_0pm_to(iii,jjj,kkk) * ap( 0,+1,-1)
4795 + restrict_from_m00_to(iii,jjj,kkk) * ap(-1, 0, 0)
4796 + restrict_from_000_to(iii,jjj,kkk) * ap( 0, 0, 0)
4797 + restrict_from_mp0_to(iii,jjj,kkk) * ap(-1,+1, 0)
4798 + restrict_from_0p0_to(iii,jjj,kkk) * ap( 0,+1, 0)
4799 + restrict_from_m0p_to(iii,jjj,kkk) * ap(-1, 0,+1)
4800 + restrict_from_00p_to(iii,jjj,kkk) * ap( 0, 0,+1)
4801 + restrict_from_mpp_to(iii,jjj,kkk) * ap(-1,+1,+1)
4802 + restrict_from_0pp_to(iii,jjj,kkk) * ap( 0,+1,+1));
4804 csten(i,j,k,
ist_pp0) = Real(0.5)*(cs1 + cs2);
4810 p(-1,-1,-1) = interp_from_ppp_to(iii+1,jjj-1,kkk+1);
4811 p( 0,-1,-1) = interp_from_0pp_to(iii+2,jjj-1,kkk+1);
4812 p(-1, 0,-1) = interp_from_p0p_to(iii+1,jjj ,kkk+1);
4813 p( 0, 0,-1) = interp_from_00p_to(iii+2,jjj ,kkk+1);
4814 p(-1,+1,-1) = interp_from_pmp_to(iii+1,jjj+1,kkk+1);
4815 p( 0,+1,-1) = interp_from_0mp_to(iii+2,jjj+1,kkk+1);
4816 p(-1,-1, 0) = interp_from_pp0_to(iii+1,jjj-1,kkk+2);
4817 p( 0,-1, 0) = interp_from_0p0_to(iii+2,jjj-1,kkk+2);
4818 p(-1, 0, 0) = interp_from_p00_to(iii+1,jjj ,kkk+2);
4819 p( 0, 0, 0) = Real(1.);
4820 p(-1,+1, 0) = interp_from_pm0_to(iii+1,jjj+1,kkk+2);
4821 p( 0,+1, 0) = interp_from_0m0_to(iii+2,jjj+1,kkk+2);
4823 Ap0p(iii,jjj-1,kkk) * p(-1,-1,-1)
4824 + Appp(iii,jjj-1,kkk) * p(-1, 0,-1);
4826 A00p(iii+1,jjj-1,kkk) * p(-1,-1,-1)
4827 + Ap0p(iii+1,jjj-1,kkk) * p( 0,-1,-1)
4828 + A0pp(iii+1,jjj-1,kkk) * p(-1, 0,-1)
4829 + Appp(iii+1,jjj-1,kkk) * p( 0, 0,-1);
4831 Apmp(iii,jjj,kkk) * p(-1,-1,-1)
4832 + Ap0p(iii,jjj,kkk) * p(-1, 0,-1)
4833 + Appp(iii,jjj,kkk) * p(-1,+1,-1);
4835 A0mp(iii+1,jjj,kkk) * p(-1,-1,-1)
4836 + Apmp(iii+1,jjj,kkk) * p( 0,-1,-1)
4837 + A00p(iii+1,jjj,kkk) * p(-1, 0,-1)
4838 + Ap0p(iii+1,jjj,kkk) * p( 0, 0,-1)
4839 + A0pp(iii+1,jjj,kkk) * p(-1,+1,-1)
4840 + Appp(iii+1,jjj,kkk) * p( 0,+1,-1);
4842 Apmp(iii,jjj+1,kkk) * p(-1, 0,-1)
4843 + Ap0p(iii,jjj+1,kkk) * p(-1,+1,-1);
4845 A0mp(iii+1,jjj+1,kkk) * p(-1, 0,-1)
4846 + Apmp(iii+1,jjj+1,kkk) * p( 0, 0,-1)
4847 + A00p(iii+1,jjj+1,kkk) * p(-1,+1,-1)
4848 + Ap0p(iii+1,jjj+1,kkk) * p( 0,+1,-1);
4850 Ap00(iii,jjj-1,kkk+1) * p(-1,-1,-1)
4851 + App0(iii,jjj-1,kkk+1) * p(-1, 0,-1)
4852 + Ap0p(iii,jjj-1,kkk+1) * p(-1,-1, 0)
4853 + Appp(iii,jjj-1,kkk+1) * p(-1, 0, 0);
4855 A000(iii+1,jjj-1,kkk+1) * p(-1,-1,-1)
4856 + Ap00(iii+1,jjj-1,kkk+1) * p( 0,-1,-1)
4857 + A0p0(iii+1,jjj-1,kkk+1) * p(-1, 0,-1)
4858 + App0(iii+1,jjj-1,kkk+1) * p( 0, 0,-1)
4859 + A00p(iii+1,jjj-1,kkk+1) * p(-1,-1, 0)
4860 + Ap0p(iii+1,jjj-1,kkk+1) * p( 0,-1, 0)
4861 + A0pp(iii+1,jjj-1,kkk+1) * p(-1, 0, 0)
4862 + Appp(iii+1,jjj-1,kkk+1) * p( 0, 0, 0);
4864 Apm0(iii,jjj,kkk+1) * p(-1,-1,-1)
4865 + Ap00(iii,jjj,kkk+1) * p(-1, 0,-1)
4866 + App0(iii,jjj,kkk+1) * p(-1,+1,-1)
4867 + Apmp(iii,jjj,kkk+1) * p(-1,-1, 0)
4868 + Ap0p(iii,jjj,kkk+1) * p(-1, 0, 0)
4869 + Appp(iii,jjj,kkk+1) * p(-1,+1, 0);
4871 A0m0(iii+1,jjj,kkk+1) * p(-1,-1,-1)
4872 + Apm0(iii+1,jjj,kkk+1) * p( 0,-1,-1)
4873 + A000(iii+1,jjj,kkk+1) * p(-1, 0,-1)
4874 + Ap00(iii+1,jjj,kkk+1) * p( 0, 0,-1)
4875 + A0p0(iii+1,jjj,kkk+1) * p(-1,+1,-1)
4876 + App0(iii+1,jjj,kkk+1) * p( 0,+1,-1)
4877 + A0mp(iii+1,jjj,kkk+1) * p(-1,-1, 0)
4878 + Apmp(iii+1,jjj,kkk+1) * p( 0,-1, 0)
4879 + A00p(iii+1,jjj,kkk+1) * p(-1, 0, 0)
4880 + Ap0p(iii+1,jjj,kkk+1) * p( 0, 0, 0)
4881 + A0pp(iii+1,jjj,kkk+1) * p(-1,+1, 0)
4882 + Appp(iii+1,jjj,kkk+1) * p( 0,+1, 0);
4884 Apm0(iii,jjj+1,kkk+1) * p(-1, 0,-1)
4885 + Ap00(iii,jjj+1,kkk+1) * p(-1,+1,-1)
4886 + Apmp(iii,jjj+1,kkk+1) * p(-1, 0, 0)
4887 + Ap0p(iii,jjj+1,kkk+1) * p(-1,+1, 0);
4889 A0m0(iii+1,jjj+1,kkk+1) * p(-1, 0,-1)
4890 + Apm0(iii+1,jjj+1,kkk+1) * p( 0, 0,-1)
4891 + A000(iii+1,jjj+1,kkk+1) * p(-1,+1,-1)
4892 + Ap00(iii+1,jjj+1,kkk+1) * p( 0,+1,-1)
4893 + A0mp(iii+1,jjj+1,kkk+1) * p(-1, 0, 0)
4894 + Apmp(iii+1,jjj+1,kkk+1) * p( 0, 0, 0)
4895 + A00p(iii+1,jjj+1,kkk+1) * p(-1,+1, 0)
4896 + Ap0p(iii+1,jjj+1,kkk+1) * p( 0,+1, 0);
4898 ( restrict_from_0m0_to(iii,jjj,kkk) * ap( 0,-1, 0)
4899 + restrict_from_pm0_to(iii,jjj,kkk) * ap(+1,-1, 0)
4900 + restrict_from_000_to(iii,jjj,kkk) * ap( 0, 0, 0)
4901 + restrict_from_p00_to(iii,jjj,kkk) * ap(+1, 0, 0)
4902 + restrict_from_0p0_to(iii,jjj,kkk) * ap( 0,+1, 0)
4903 + restrict_from_pp0_to(iii,jjj,kkk) * ap(+1,+1, 0)
4904 + restrict_from_0mp_to(iii,jjj,kkk) * ap( 0,-1,+1)
4905 + restrict_from_pmp_to(iii,jjj,kkk) * ap(+1,-1,+1)
4906 + restrict_from_00p_to(iii,jjj,kkk) * ap( 0, 0,+1)
4907 + restrict_from_p0p_to(iii,jjj,kkk) * ap(+1, 0,+1)
4908 + restrict_from_0pp_to(iii,jjj,kkk) * ap( 0,+1,+1)
4909 + restrict_from_ppp_to(iii,jjj,kkk) * ap(+1,+1,+1));
4915 p( 0,-1,-1) = interp_from_0pp_to(iii-2,jjj-1,kkk+1);
4916 p(+1,-1,-1) = interp_from_mpp_to(iii-1,jjj-1,kkk+1);
4917 p( 0, 0,-1) = interp_from_00p_to(iii-2,jjj ,kkk+1);
4918 p(+1, 0,-1) = interp_from_m0p_to(iii-1,jjj ,kkk+1);
4919 p( 0,+1,-1) = interp_from_0mp_to(iii-2,jjj+1,kkk+1);
4920 p(+1,+1,-1) = interp_from_mmp_to(iii-1,jjj+1,kkk+1);
4921 p( 0,-1, 0) = interp_from_0p0_to(iii-2,jjj-1,kkk+2);
4922 p(+1,-1, 0) = interp_from_mp0_to(iii-1,jjj-1,kkk+2);
4923 p( 0, 0, 0) = Real(1.);
4924 p(+1, 0, 0) = interp_from_m00_to(iii-1,jjj ,kkk+2);
4925 p( 0,+1, 0) = interp_from_0m0_to(iii-2,jjj+1,kkk+2);
4926 p(+1,+1, 0) = interp_from_mm0_to(iii-1,jjj+1,kkk+2);
4929 Am0p(iii-1,jjj-1,kkk) * p( 0,-1,-1)
4930 + A00p(iii-1,jjj-1,kkk) * p(+1,-1,-1)
4931 + Ampp(iii-1,jjj-1,kkk) * p( 0, 0,-1)
4932 + A0pp(iii-1,jjj-1,kkk) * p(+1, 0,-1);
4934 Am0p(iii,jjj-1,kkk) * p(+1,-1,-1)
4935 + Ampp(iii,jjj-1,kkk) * p(+1, 0,-1);
4937 Ammp(iii-1,jjj,kkk) * p( 0,-1,-1)
4938 + A0mp(iii-1,jjj,kkk) * p(+1,-1,-1)
4939 + Am0p(iii-1,jjj,kkk) * p( 0, 0,-1)
4940 + A00p(iii-1,jjj,kkk) * p(+1, 0,-1)
4941 + Ampp(iii-1,jjj,kkk) * p( 0,+1,-1)
4942 + A0pp(iii-1,jjj,kkk) * p(+1,+1,-1);
4944 Ammp(iii,jjj,kkk) * p(+1,-1,-1)
4945 + Am0p(iii,jjj,kkk) * p(+1, 0,-1)
4946 + Ampp(iii,jjj,kkk) * p(+1,+1,-1);
4948 Ammp(iii-1,jjj+1,kkk) * p( 0, 0,-1)
4949 + A0mp(iii-1,jjj+1,kkk) * p(+1, 0,-1)
4950 + Am0p(iii-1,jjj+1,kkk) * p( 0,+1,-1)
4951 + A00p(iii-1,jjj+1,kkk) * p(+1,+1,-1);
4953 Ammp(iii,jjj+1,kkk) * p(+1, 0,-1)
4954 + Am0p(iii,jjj+1,kkk) * p(+1,+1,-1);
4956 Am00(iii-1,jjj-1,kkk+1) * p( 0,-1,-1)
4957 + A000(iii-1,jjj-1,kkk+1) * p(+1,-1,-1)
4958 + Amp0(iii-1,jjj-1,kkk+1) * p( 0, 0,-1)
4959 + A0p0(iii-1,jjj-1,kkk+1) * p(+1, 0,-1)
4960 + Am0p(iii-1,jjj-1,kkk+1) * p( 0,-1, 0)
4961 + A00p(iii-1,jjj-1,kkk+1) * p(+1,-1, 0)
4962 + Ampp(iii-1,jjj-1,kkk+1) * p( 0, 0, 0)
4963 + A0pp(iii-1,jjj-1,kkk+1) * p(+1, 0, 0);
4965 Am00(iii,jjj-1,kkk+1) * p(+1,-1,-1)
4966 + Amp0(iii,jjj-1,kkk+1) * p(+1, 0,-1)
4967 + Am0p(iii,jjj-1,kkk+1) * p(+1,-1, 0)
4968 + Ampp(iii,jjj-1,kkk+1) * p(+1, 0, 0);
4970 Amm0(iii-1,jjj,kkk+1) * p( 0,-1,-1)
4971 + A0m0(iii-1,jjj,kkk+1) * p(+1,-1,-1)
4972 + Am00(iii-1,jjj,kkk+1) * p( 0, 0,-1)
4973 + A000(iii-1,jjj,kkk+1) * p(+1, 0,-1)
4974 + Amp0(iii-1,jjj,kkk+1) * p( 0,+1,-1)
4975 + A0p0(iii-1,jjj,kkk+1) * p(+1,+1,-1)
4976 + Ammp(iii-1,jjj,kkk+1) * p( 0,-1, 0)
4977 + A0mp(iii-1,jjj,kkk+1) * p(+1,-1, 0)
4978 + Am0p(iii-1,jjj,kkk+1) * p( 0, 0, 0)
4979 + A00p(iii-1,jjj,kkk+1) * p(+1, 0, 0)
4980 + Ampp(iii-1,jjj,kkk+1) * p( 0,+1, 0)
4981 + A0pp(iii-1,jjj,kkk+1) * p(+1,+1, 0);
4983 Amm0(iii,jjj,kkk+1) * p(+1,-1,-1)
4984 + Am00(iii,jjj,kkk+1) * p(+1, 0,-1)
4985 + Amp0(iii,jjj,kkk+1) * p(+1,+1,-1)
4986 + Ammp(iii,jjj,kkk+1) * p(+1,-1, 0)
4987 + Am0p(iii,jjj,kkk+1) * p(+1, 0, 0)
4988 + Ampp(iii,jjj,kkk+1) * p(+1,+1, 0);
4990 Amm0(iii-1,jjj+1,kkk+1) * p( 0, 0,-1)
4991 + A0m0(iii-1,jjj+1,kkk+1) * p(+1, 0,-1)
4992 + Am00(iii-1,jjj+1,kkk+1) * p( 0,+1,-1)
4993 + A000(iii-1,jjj+1,kkk+1) * p(+1,+1,-1)
4994 + Ammp(iii-1,jjj+1,kkk+1) * p( 0, 0, 0)
4995 + A0mp(iii-1,jjj+1,kkk+1) * p(+1, 0, 0)
4996 + Am0p(iii-1,jjj+1,kkk+1) * p( 0,+1, 0)
4997 + A00p(iii-1,jjj+1,kkk+1) * p(+1,+1, 0);
4999 Amm0(iii,jjj+1,kkk+1) * p(+1, 0,-1)
5000 + Am00(iii,jjj+1,kkk+1) * p(+1,+1,-1)
5001 + Ammp(iii,jjj+1,kkk+1) * p(+1, 0, 0)
5002 + Am0p(iii,jjj+1,kkk+1) * p(+1,+1, 0);
5004 ( restrict_from_mm0_to(iii,jjj,kkk) * ap(-1,-1, 0)
5005 + restrict_from_0m0_to(iii,jjj,kkk) * ap( 0,-1, 0)
5006 + restrict_from_m00_to(iii,jjj,kkk) * ap(-1, 0, 0)
5007 + restrict_from_000_to(iii,jjj,kkk) * ap( 0, 0, 0)
5008 + restrict_from_mp0_to(iii,jjj,kkk) * ap(-1,+1, 0)
5009 + restrict_from_0p0_to(iii,jjj,kkk) * ap( 0,+1, 0)
5010 + restrict_from_mmp_to(iii,jjj,kkk) * ap(-1,-1,+1)
5011 + restrict_from_0mp_to(iii,jjj,kkk) * ap( 0,-1,+1)
5012 + restrict_from_m0p_to(iii,jjj,kkk) * ap(-1, 0,+1)
5013 + restrict_from_00p_to(iii,jjj,kkk) * ap( 0, 0,+1)
5014 + restrict_from_mpp_to(iii,jjj,kkk) * ap(-1,+1,+1)
5015 + restrict_from_0pp_to(iii,jjj,kkk) * ap( 0,+1,+1));
5017 csten(i,j,k,
ist_p0p) = Real(0.5)*(cs1+cs2);
5023 p(-1,-1,-1) = interp_from_ppp_to(iii-1,jjj+1,kkk+1);
5024 p( 0,-1,-1) = interp_from_0pp_to(iii ,jjj+1,kkk+1);
5025 p(+1,-1,-1) = interp_from_mpp_to(iii+1,jjj+1,kkk+1);
5026 p(-1, 0,-1) = interp_from_p0p_to(iii-1,jjj+2,kkk+1);
5027 p( 0, 0,-1) = interp_from_00p_to(iii ,jjj+2,kkk+1);
5028 p(+1, 0,-1) = interp_from_m0p_to(iii+1,jjj+2,kkk+1);
5029 p(-1,-1, 0) = interp_from_pp0_to(iii-1,jjj+1,kkk+2);
5030 p( 0,-1, 0) = interp_from_0p0_to(iii ,jjj+1,kkk+2);
5031 p(+1,-1, 0) = interp_from_mp0_to(iii+1,jjj+1,kkk+2);
5032 p(-1, 0, 0) = interp_from_p00_to(iii-1,jjj+2,kkk+2);
5033 p( 0, 0, 0) = Real(1.);
5034 p(+1, 0, 0) = interp_from_m00_to(iii+1,jjj+2,kkk+2);
5036 A0pp(iii-1,jjj,kkk) * p(-1,-1,-1)
5037 + Appp(iii-1,jjj,kkk) * p( 0,-1,-1);
5039 Ampp(iii,jjj,kkk) * p(-1,-1,-1)
5040 + A0pp(iii,jjj,kkk) * p( 0,-1,-1)
5041 + Appp(iii,jjj,kkk) * p(+1,-1,-1);
5043 Ampp(iii+1,jjj,kkk) * p( 0,-1,-1)
5044 + A0pp(iii+1,jjj,kkk) * p(+1,-1,-1);
5046 A00p(iii-1,jjj+1,kkk) * p(-1,-1,-1)
5047 + Ap0p(iii-1,jjj+1,kkk) * p( 0,-1,-1)
5048 + A0pp(iii-1,jjj+1,kkk) * p(-1, 0,-1)
5049 + Appp(iii-1,jjj+1,kkk) * p( 0, 0,-1);
5051 Am0p(iii,jjj+1,kkk) * p(-1,-1,-1)
5052 + A00p(iii,jjj+1,kkk) * p( 0,-1,-1)
5053 + Ap0p(iii,jjj+1,kkk) * p(+1,-1,-1)
5054 + Ampp(iii,jjj+1,kkk) * p(-1, 0,-1)
5055 + A0pp(iii,jjj+1,kkk) * p( 0, 0,-1)
5056 + Appp(iii,jjj+1,kkk) * p(+1, 0,-1);
5058 Am0p(iii+1,jjj+1,kkk) * p( 0,-1,-1)
5059 + A00p(iii+1,jjj+1,kkk) * p(+1,-1,-1)
5060 + Ampp(iii+1,jjj+1,kkk) * p( 0, 0,-1)
5061 + A0pp(iii+1,jjj+1,kkk) * p(+1, 0,-1);
5063 A0p0(iii-1,jjj,kkk+1) * p(-1,-1,-1)
5064 + App0(iii-1,jjj,kkk+1) * p( 0,-1,-1)
5065 + A0pp(iii-1,jjj,kkk+1) * p(-1,-1, 0)
5066 + Appp(iii-1,jjj,kkk+1) * p( 0,-1, 0);
5068 Amp0(iii,jjj,kkk+1) * p(-1,-1,-1)
5069 + A0p0(iii,jjj,kkk+1) * p( 0,-1,-1)
5070 + App0(iii,jjj,kkk+1) * p(+1,-1,-1)
5071 + Ampp(iii,jjj,kkk+1) * p(-1,-1, 0)
5072 + A0pp(iii,jjj,kkk+1) * p( 0,-1, 0)
5073 + Appp(iii,jjj,kkk+1) * p(+1,-1, 0);
5075 Amp0(iii+1,jjj,kkk+1) * p( 0,-1,-1)
5076 + A0p0(iii+1,jjj,kkk+1) * p(+1,-1,-1)
5077 + Ampp(iii+1,jjj,kkk+1) * p( 0,-1, 0)
5078 + A0pp(iii+1,jjj,kkk+1) * p(+1,-1, 0);
5080 A000(iii-1,jjj+1,kkk+1) * p(-1,-1,-1)
5081 + Ap00(iii-1,jjj+1,kkk+1) * p( 0,-1,-1)
5082 + A0p0(iii-1,jjj+1,kkk+1) * p(-1, 0,-1)
5083 + App0(iii-1,jjj+1,kkk+1) * p( 0, 0,-1)
5084 + A00p(iii-1,jjj+1,kkk+1) * p(-1,-1, 0)
5085 + Ap0p(iii-1,jjj+1,kkk+1) * p( 0,-1, 0)
5086 + A0pp(iii-1,jjj+1,kkk+1) * p(-1, 0, 0)
5087 + Appp(iii-1,jjj+1,kkk+1) * p( 0, 0, 0);
5089 Am00(iii,jjj+1,kkk+1) * p(-1,-1,-1)
5090 + A000(iii,jjj+1,kkk+1) * p( 0,-1,-1)
5091 + Ap00(iii,jjj+1,kkk+1) * p(+1,-1,-1)
5092 + Amp0(iii,jjj+1,kkk+1) * p(-1, 0,-1)
5093 + A0p0(iii,jjj+1,kkk+1) * p( 0, 0,-1)
5094 + App0(iii,jjj+1,kkk+1) * p(+1, 0,-1)
5095 + Am0p(iii,jjj+1,kkk+1) * p(-1,-1, 0)
5096 + A00p(iii,jjj+1,kkk+1) * p( 0,-1, 0)
5097 + Ap0p(iii,jjj+1,kkk+1) * p(+1,-1, 0)
5098 + Ampp(iii,jjj+1,kkk+1) * p(-1, 0, 0)
5099 + A0pp(iii,jjj+1,kkk+1) * p( 0, 0, 0)
5100 + Appp(iii,jjj+1,kkk+1) * p(+1, 0, 0);
5102 Am00(iii+1,jjj+1,kkk+1) * p( 0,-1,-1)
5103 + A000(iii+1,jjj+1,kkk+1) * p(+1,-1,-1)
5104 + Amp0(iii+1,jjj+1,kkk+1) * p( 0, 0,-1)
5105 + A0p0(iii+1,jjj+1,kkk+1) * p(+1, 0,-1)
5106 + Am0p(iii+1,jjj+1,kkk+1) * p( 0,-1, 0)
5107 + A00p(iii+1,jjj+1,kkk+1) * p(+1,-1, 0)
5108 + Ampp(iii+1,jjj+1,kkk+1) * p( 0, 0, 0)
5109 + A0pp(iii+1,jjj+1,kkk+1) * p(+1, 0, 0);
5111 ( restrict_from_m00_to(iii,jjj,kkk) * ap(-1, 0, 0)
5112 + restrict_from_000_to(iii,jjj,kkk) * ap( 0, 0, 0)
5113 + restrict_from_p00_to(iii,jjj,kkk) * ap(+1, 0, 0)
5114 + restrict_from_mp0_to(iii,jjj,kkk) * ap(-1,+1, 0)
5115 + restrict_from_0p0_to(iii,jjj,kkk) * ap( 0,+1, 0)
5116 + restrict_from_pp0_to(iii,jjj,kkk) * ap(+1,+1, 0)
5117 + restrict_from_m0p_to(iii,jjj,kkk) * ap(-1, 0,+1)
5118 + restrict_from_00p_to(iii,jjj,kkk) * ap( 0, 0,+1)
5119 + restrict_from_p0p_to(iii,jjj,kkk) * ap(+1, 0,+1)
5120 + restrict_from_mpp_to(iii,jjj,kkk) * ap(-1,+1,+1)
5121 + restrict_from_0pp_to(iii,jjj,kkk) * ap( 0,+1,+1)
5122 + restrict_from_ppp_to(iii,jjj,kkk) * ap(+1,+1,+1));
5128 p(-1, 0,-1) = interp_from_p0p_to(iii-1,jjj-2,kkk+1);
5129 p( 0, 0,-1) = interp_from_00p_to(iii ,jjj-2,kkk+1);
5130 p(+1, 0,-1) = interp_from_m0p_to(iii+1,jjj-2,kkk+1);
5131 p(-1,+1,-1) = interp_from_pmp_to(iii-1,jjj-1,kkk+1);
5132 p( 0,+1,-1) = interp_from_0mp_to(iii ,jjj-1,kkk+1);
5133 p(+1,+1,-1) = interp_from_mmp_to(iii+1,jjj-1,kkk+1);
5134 p(-1, 0, 0) = interp_from_p00_to(iii-1,jjj-2,kkk+2);
5135 p( 0, 0, 0) = Real(1.);
5136 p(+1, 0, 0) = interp_from_m00_to(iii+1,jjj-2,kkk+2);
5137 p(-1,+1, 0) = interp_from_pm0_to(iii-1,jjj-1,kkk+2);
5138 p( 0,+1, 0) = interp_from_0m0_to(iii ,jjj-1,kkk+2);
5139 p(+1,+1, 0) = interp_from_mm0_to(iii+1,jjj-1,kkk+2);
5141 A0mp(iii-1,jjj-1,kkk) * p(-1, 0,-1)
5142 + Apmp(iii-1,jjj-1,kkk) * p( 0, 0,-1)
5143 + A00p(iii-1,jjj-1,kkk) * p(-1,+1,-1)
5144 + Ap0p(iii-1,jjj-1,kkk) * p( 0,+1,-1);
5146 Ammp(iii,jjj-1,kkk) * p(-1, 0,-1)
5147 + A0mp(iii,jjj-1,kkk) * p( 0, 0,-1)
5148 + Apmp(iii,jjj-1,kkk) * p(+1, 0,-1)
5149 + Am0p(iii,jjj-1,kkk) * p(-1,+1,-1)
5150 + A00p(iii,jjj-1,kkk) * p( 0,+1,-1)
5151 + Ap0p(iii,jjj-1,kkk) * p(+1,+1,-1);
5153 Ammp(iii+1,jjj-1,kkk) * p( 0, 0,-1)
5154 + A0mp(iii+1,jjj-1,kkk) * p(+1, 0,-1)
5155 + Am0p(iii+1,jjj-1,kkk) * p( 0,+1,-1)
5156 + A00p(iii+1,jjj-1,kkk) * p(+1,+1,-1);
5158 A0mp(iii-1,jjj,kkk) * p(-1,+1,-1)
5159 + Apmp(iii-1,jjj,kkk) * p( 0,+1,-1);
5161 Ammp(iii,jjj,kkk) * p(-1,+1,-1)
5162 + A0mp(iii,jjj,kkk) * p( 0,+1,-1)
5163 + Apmp(iii,jjj,kkk) * p(+1,+1,-1);
5165 Ammp(iii+1,jjj,kkk) * p( 0,+1,-1)
5166 + A0mp(iii+1,jjj,kkk) * p(+1,+1,-1);
5168 A0m0(iii-1,jjj-1,kkk+1) * p(-1, 0,-1)
5169 + Apm0(iii-1,jjj-1,kkk+1) * p( 0, 0,-1)
5170 + A000(iii-1,jjj-1,kkk+1) * p(-1,+1,-1)
5171 + Ap00(iii-1,jjj-1,kkk+1) * p( 0,+1,-1)
5172 + A0mp(iii-1,jjj-1,kkk+1) * p(-1, 0, 0)
5173 + Apmp(iii-1,jjj-1,kkk+1) * p( 0, 0, 0)
5174 + A00p(iii-1,jjj-1,kkk+1) * p(-1,+1, 0)
5175 + Ap0p(iii-1,jjj-1,kkk+1) * p( 0,+1, 0);
5177 Amm0(iii,jjj-1,kkk+1) * p(-1, 0,-1)
5178 + A0m0(iii,jjj-1,kkk+1) * p( 0, 0,-1)
5179 + Apm0(iii,jjj-1,kkk+1) * p(+1, 0,-1)
5180 + Am00(iii,jjj-1,kkk+1) * p(-1,+1,-1)
5181 + A000(iii,jjj-1,kkk+1) * p( 0,+1,-1)
5182 + Ap00(iii,jjj-1,kkk+1) * p(+1,+1,-1)
5183 + Ammp(iii,jjj-1,kkk+1) * p(-1, 0, 0)
5184 + A0mp(iii,jjj-1,kkk+1) * p( 0, 0, 0)
5185 + Apmp(iii,jjj-1,kkk+1) * p(+1, 0, 0)
5186 + Am0p(iii,jjj-1,kkk+1) * p(-1,+1, 0)
5187 + A00p(iii,jjj-1,kkk+1) * p( 0,+1, 0)
5188 + Ap0p(iii,jjj-1,kkk+1) * p(+1,+1, 0);
5190 Amm0(iii+1,jjj-1,kkk+1) * p( 0, 0,-1)
5191 + A0m0(iii+1,jjj-1,kkk+1) * p(+1, 0,-1)
5192 + Am00(iii+1,jjj-1,kkk+1) * p( 0,+1,-1)
5193 + A000(iii+1,jjj-1,kkk+1) * p(+1,+1,-1)
5194 + Ammp(iii+1,jjj-1,kkk+1) * p( 0, 0, 0)
5195 + A0mp(iii+1,jjj-1,kkk+1) * p(+1, 0, 0)
5196 + Am0p(iii+1,jjj-1,kkk+1) * p( 0,+1, 0)
5197 + A00p(iii+1,jjj-1,kkk+1) * p(+1,+1, 0);
5199 A0m0(iii-1,jjj,kkk+1) * p(-1,+1,-1)
5200 + Apm0(iii-1,jjj,kkk+1) * p( 0,+1,-1)
5201 + A0mp(iii-1,jjj,kkk+1) * p(-1,+1, 0)
5202 + Apmp(iii-1,jjj,kkk+1) * p( 0,+1, 0);
5204 Amm0(iii,jjj,kkk+1) * p(-1,+1,-1)
5205 + A0m0(iii,jjj,kkk+1) * p( 0,+1,-1)
5206 + Apm0(iii,jjj,kkk+1) * p(+1,+1,-1)
5207 + Ammp(iii,jjj,kkk+1) * p(-1,+1, 0)
5208 + A0mp(iii,jjj,kkk+1) * p( 0,+1, 0)
5209 + Apmp(iii,jjj,kkk+1) * p(+1,+1, 0);
5211 Amm0(iii+1,jjj,kkk+1) * p( 0,+1,-1)
5212 + A0m0(iii+1,jjj,kkk+1) * p(+1,+1,-1)
5213 + Ammp(iii+1,jjj,kkk+1) * p( 0,+1, 0)
5214 + A0mp(iii+1,jjj,kkk+1) * p(+1,+1, 0);
5216 ( restrict_from_mm0_to(iii,jjj,kkk) * ap(-1,-1, 0)
5217 + restrict_from_0m0_to(iii,jjj,kkk) * ap( 0,-1, 0)
5218 + restrict_from_pm0_to(iii,jjj,kkk) * ap(+1,-1, 0)
5219 + restrict_from_m00_to(iii,jjj,kkk) * ap(-1, 0, 0)
5220 + restrict_from_000_to(iii,jjj,kkk) * ap( 0, 0, 0)
5221 + restrict_from_p00_to(iii,jjj,kkk) * ap(+1, 0, 0)
5222 + restrict_from_mmp_to(iii,jjj,kkk) * ap(-1,-1,+1)
5223 + restrict_from_0mp_to(iii,jjj,kkk) * ap( 0,-1,+1)
5224 + restrict_from_pmp_to(iii,jjj,kkk) * ap(+1,-1,+1)
5225 + restrict_from_m0p_to(iii,jjj,kkk) * ap(-1, 0,+1)
5226 + restrict_from_00p_to(iii,jjj,kkk) * ap( 0, 0,+1)
5227 + restrict_from_p0p_to(iii,jjj,kkk) * ap(+1, 0,+1));
5229 csten(i,j,k,
ist_0pp) = Real(0.5)*(cs1+cs2);
5235 p(-1,-1,-1) = interp_from_ppp_to(iii+1,jjj+1,kkk+1);
5236 p( 0,-1,-1) = interp_from_0pp_to(iii+2,jjj+1,kkk+1);
5237 p(-1, 0,-1) = interp_from_p0p_to(iii+1,jjj+2,kkk+1);
5238 p( 0, 0,-1) = interp_from_00p_to(iii+2,jjj+2,kkk+1);
5239 p(-1,-1, 0) = interp_from_pp0_to(iii+1,jjj+1,kkk+2);
5240 p( 0,-1, 0) = interp_from_0p0_to(iii+2,jjj+1,kkk+2);
5241 p(-1, 0, 0) = interp_from_p00_to(iii+1,jjj+2,kkk+2);
5242 p( 0, 0, 0) = Real(1.);
5244 Appp(iii,jjj,kkk) * p(-1,-1,-1);
5246 A0pp(iii+1,jjj,kkk) * p(-1,-1,-1)
5247 + Appp(iii+1,jjj,kkk) * p( 0,-1,-1);
5249 Ap0p(iii,jjj+1,kkk) * p(-1,-1,-1)
5250 + Appp(iii,jjj+1,kkk) * p(-1, 0,-1);
5252 A00p(iii+1,jjj+1,kkk) * p(-1,-1,-1)
5253 + Ap0p(iii+1,jjj+1,kkk) * p( 0,-1,-1)
5254 + A0pp(iii+1,jjj+1,kkk) * p(-1, 0,-1)
5255 + Appp(iii+1,jjj+1,kkk) * p( 0, 0,-1);
5257 App0(iii,jjj,kkk+1) * p(-1,-1,-1)
5258 + Appp(iii,jjj,kkk+1) * p(-1,-1, 0);
5260 A0p0(iii+1,jjj,kkk+1) * p(-1,-1,-1)
5261 + App0(iii+1,jjj,kkk+1) * p( 0,-1,-1)
5262 + A0pp(iii+1,jjj,kkk+1) * p(-1,-1, 0)
5263 + Appp(iii+1,jjj,kkk+1) * p( 0,-1, 0);
5265 Ap00(iii,jjj+1,kkk+1) * p(-1,-1,-1)
5266 + App0(iii,jjj+1,kkk+1) * p(-1, 0,-1)
5267 + Ap0p(iii,jjj+1,kkk+1) * p(-1,-1, 0)
5268 + Appp(iii,jjj+1,kkk+1) * p(-1, 0, 0);
5270 A000(iii+1,jjj+1,kkk+1) * p(-1,-1,-1)
5271 + Ap00(iii+1,jjj+1,kkk+1) * p( 0,-1,-1)
5272 + A0p0(iii+1,jjj+1,kkk+1) * p(-1, 0,-1)
5273 + App0(iii+1,jjj+1,kkk+1) * p( 0, 0,-1)
5274 + A00p(iii+1,jjj+1,kkk+1) * p(-1,-1, 0)
5275 + Ap0p(iii+1,jjj+1,kkk+1) * p( 0,-1, 0)
5276 + A0pp(iii+1,jjj+1,kkk+1) * p(-1, 0, 0)
5277 + Appp(iii+1,jjj+1,kkk+1) * p( 0, 0, 0);
5279 ( restrict_from_000_to(iii,jjj,kkk) * ap( 0, 0, 0)
5280 + restrict_from_p00_to(iii,jjj,kkk) * ap(+1, 0, 0)
5281 + restrict_from_0p0_to(iii,jjj,kkk) * ap( 0,+1, 0)
5282 + restrict_from_pp0_to(iii,jjj,kkk) * ap(+1,+1, 0)
5283 + restrict_from_00p_to(iii,jjj,kkk) * ap( 0, 0,+1)
5284 + restrict_from_p0p_to(iii,jjj,kkk) * ap(+1, 0,+1)
5285 + restrict_from_0pp_to(iii,jjj,kkk) * ap( 0,+1,+1)
5286 + restrict_from_ppp_to(iii,jjj,kkk) * ap(+1,+1,+1));
5292 p( 0,-1,-1) = interp_from_0pp_to(iii-2,jjj+1,kkk+1);
5293 p(+1,-1,-1) = interp_from_mpp_to(iii-1,jjj+1,kkk+1);
5294 p( 0, 0,-1) = interp_from_00p_to(iii-2,jjj+2,kkk+1);
5295 p(+1, 0,-1) = interp_from_m0p_to(iii-1,jjj+2,kkk+1);
5296 p( 0,-1, 0) = interp_from_0p0_to(iii-2,jjj+1,kkk+2);
5297 p(+1,-1, 0) = interp_from_mp0_to(iii-1,jjj+1,kkk+2);
5298 p( 0, 0, 0) = Real(1.);
5299 p(+1, 0, 0) = interp_from_m00_to(iii-1,jjj+2,kkk+2);
5301 Ampp(iii-1,jjj,kkk) * p( 0,-1,-1)
5302 + A0pp(iii-1,jjj,kkk) * p(+1,-1,-1);
5304 Ampp(iii,jjj,kkk) * p(+1,-1,-1);
5306 Am0p(iii-1,jjj+1,kkk) * p( 0,-1,-1)
5307 + A00p(iii-1,jjj+1,kkk) * p(+1,-1,-1)
5308 + Ampp(iii-1,jjj+1,kkk) * p( 0, 0,-1)
5309 + A0pp(iii-1,jjj+1,kkk) * p(+1, 0,-1);
5311 Am0p(iii,jjj+1,kkk) * p(+1,-1,-1)
5312 + Ampp(iii,jjj+1,kkk) * p(+1, 0,-1);
5314 Amp0(iii-1,jjj,kkk+1) * p( 0,-1,-1)
5315 + A0p0(iii-1,jjj,kkk+1) * p(+1,-1,-1)
5316 + Ampp(iii-1,jjj,kkk+1) * p( 0,-1, 0)
5317 + A0pp(iii-1,jjj,kkk+1) * p(+1,-1, 0);
5319 Amp0(iii,jjj,kkk+1) * p(+1,-1,-1)
5320 + Ampp(iii,jjj,kkk+1) * p(+1,-1, 0);
5322 Am00(iii-1,jjj+1,kkk+1) * p( 0,-1,-1)
5323 + A000(iii-1,jjj+1,kkk+1) * p(+1,-1,-1)
5324 + Amp0(iii-1,jjj+1,kkk+1) * p( 0, 0,-1)
5325 + A0p0(iii-1,jjj+1,kkk+1) * p(+1, 0,-1)
5326 + Am0p(iii-1,jjj+1,kkk+1) * p( 0,-1, 0)
5327 + A00p(iii-1,jjj+1,kkk+1) * p(+1,-1, 0)
5328 + Ampp(iii-1,jjj+1,kkk+1) * p( 0, 0, 0)
5329 + A0pp(iii-1,jjj+1,kkk+1) * p(+1, 0, 0);
5331 Am00(iii,jjj+1,kkk+1) * p(+1,-1,-1)
5332 + Amp0(iii,jjj+1,kkk+1) * p(+1, 0,-1)
5333 + Am0p(iii,jjj+1,kkk+1) * p(+1,-1, 0)
5334 + Ampp(iii,jjj+1,kkk+1) * p(+1, 0, 0);
5336 ( restrict_from_m00_to(iii,jjj,kkk) * ap(-1, 0, 0)
5337 + restrict_from_000_to(iii,jjj,kkk) * ap( 0, 0, 0)
5338 + restrict_from_mp0_to(iii,jjj,kkk) * ap(-1,+1, 0)
5339 + restrict_from_0p0_to(iii,jjj,kkk) * ap( 0,+1, 0)
5340 + restrict_from_m0p_to(iii,jjj,kkk) * ap(-1, 0,+1)
5341 + restrict_from_00p_to(iii,jjj,kkk) * ap( 0, 0,+1)
5342 + restrict_from_mpp_to(iii,jjj,kkk) * ap(-1,+1,+1)
5343 + restrict_from_0pp_to(iii,jjj,kkk) * ap( 0,+1,+1));
5349 p(-1, 0,-1) = interp_from_p0p_to(iii+1,jjj-2,kkk+1);
5350 p( 0, 0,-1) = interp_from_00p_to(iii+2,jjj-2,kkk+1);
5351 p(-1,+1,-1) = interp_from_pmp_to(iii+1,jjj-1,kkk+1);
5352 p( 0,+1,-1) = interp_from_0mp_to(iii+2,jjj-1,kkk+1);
5353 p(-1, 0, 0) = interp_from_p00_to(iii+1,jjj-2,kkk+2);
5354 p( 0, 0, 0) = Real(1.);
5355 p(-1,+1, 0) = interp_from_pm0_to(iii+1,jjj-1,kkk+2);
5356 p( 0,+1, 0) = interp_from_0m0_to(iii+2,jjj-1,kkk+2);
5358 Apmp(iii,jjj-1,kkk) * p(-1, 0,-1)
5359 + Ap0p(iii,jjj-1,kkk) * p(-1,+1,-1);
5361 A0mp(iii+1,jjj-1,kkk) * p(-1, 0,-1)
5362 + Apmp(iii+1,jjj-1,kkk) * p( 0, 0,-1)
5363 + A00p(iii+1,jjj-1,kkk) * p(-1,+1,-1)
5364 + Ap0p(iii+1,jjj-1,kkk) * p( 0,+1,-1);
5366 Apmp(iii,jjj,kkk) * p(-1,+1,-1);
5368 A0mp(iii+1,jjj,kkk) * p(-1,+1,-1)
5369 + Apmp(iii+1,jjj,kkk) * p( 0,+1,-1);
5371 Apm0(iii,jjj-1,kkk+1) * p(-1, 0,-1)
5372 + Ap00(iii,jjj-1,kkk+1) * p(-1,+1,-1)
5373 + Apmp(iii,jjj-1,kkk+1) * p(-1, 0, 0)
5374 + Ap0p(iii,jjj-1,kkk+1) * p(-1,+1, 0);
5376 A0m0(iii+1,jjj-1,kkk+1) * p(-1, 0,-1)
5377 + Apm0(iii+1,jjj-1,kkk+1) * p( 0, 0,-1)
5378 + A000(iii+1,jjj-1,kkk+1) * p(-1,+1,-1)
5379 + Ap00(iii+1,jjj-1,kkk+1) * p( 0,+1,-1)
5380 + A0mp(iii+1,jjj-1,kkk+1) * p(-1, 0, 0)
5381 + Apmp(iii+1,jjj-1,kkk+1) * p( 0, 0, 0)
5382 + A00p(iii+1,jjj-1,kkk+1) * p(-1,+1, 0)
5383 + Ap0p(iii+1,jjj-1,kkk+1) * p( 0,+1, 0);
5385 Apm0(iii,jjj,kkk+1) * p(-1,+1,-1)
5386 + Apmp(iii,jjj,kkk+1) * p(-1,+1, 0);
5388 A0m0(iii+1,jjj,kkk+1) * p(-1,+1,-1)
5389 + Apm0(iii+1,jjj,kkk+1) * p( 0,+1,-1)
5390 + A0mp(iii+1,jjj,kkk+1) * p(-1,+1, 0)
5391 + Apmp(iii+1,jjj,kkk+1) * p( 0,+1, 0);
5393 ( restrict_from_0m0_to(iii,jjj,kkk) * ap( 0,-1, 0)
5394 + restrict_from_pm0_to(iii,jjj,kkk) * ap(+1,-1, 0)
5395 + restrict_from_000_to(iii,jjj,kkk) * ap( 0, 0, 0)
5396 + restrict_from_p00_to(iii,jjj,kkk) * ap(+1, 0, 0)
5397 + restrict_from_0mp_to(iii,jjj,kkk) * ap( 0,-1,+1)
5398 + restrict_from_pmp_to(iii,jjj,kkk) * ap(+1,-1,+1)
5399 + restrict_from_00p_to(iii,jjj,kkk) * ap( 0, 0,+1)
5400 + restrict_from_p0p_to(iii,jjj,kkk) * ap(+1, 0,+1));
5406 p( 0, 0,-1) = interp_from_00p_to(iii-2,jjj-2,kkk+1);
5407 p(+1, 0,-1) = interp_from_m0p_to(iii-1,jjj-2,kkk+1);
5408 p( 0,+1,-1) = interp_from_0mp_to(iii-2,jjj-1,kkk+1);
5409 p(+1,+1,-1) = interp_from_mmp_to(iii-1,jjj-1,kkk+1);
5410 p( 0, 0, 0) = Real(1.);
5411 p(+1, 0, 0) = interp_from_m00_to(iii-1,jjj-2,kkk+2);
5412 p( 0,+1, 0) = interp_from_0m0_to(iii-2,jjj-1,kkk+2);
5413 p(+1,+1, 0) = interp_from_mm0_to(iii-1,jjj-1,kkk+2);
5415 Ammp(iii-1,jjj-1,kkk) * p( 0, 0,-1)
5416 + A0mp(iii-1,jjj-1,kkk) * p(+1, 0,-1)
5417 + Am0p(iii-1,jjj-1,kkk) * p( 0,+1,-1)
5418 + A00p(iii-1,jjj-1,kkk) * p(+1,+1,-1);
5420 Ammp(iii,jjj-1,kkk) * p(+1, 0,-1)
5421 + Am0p(iii,jjj-1,kkk) * p(+1,+1,-1);
5423 Ammp(iii-1,jjj,kkk) * p( 0,+1,-1)
5424 + A0mp(iii-1,jjj,kkk) * p(+1,+1,-1);
5426 Ammp(iii,jjj,kkk) * p(+1,+1,-1);
5428 Amm0(iii-1,jjj-1,kkk+1) * p( 0, 0,-1)
5429 + A0m0(iii-1,jjj-1,kkk+1) * p(+1, 0,-1)
5430 + Am00(iii-1,jjj-1,kkk+1) * p( 0,+1,-1)
5431 + A000(iii-1,jjj-1,kkk+1) * p(+1,+1,-1)
5432 + Ammp(iii-1,jjj-1,kkk+1) * p( 0, 0, 0)
5433 + A0mp(iii-1,jjj-1,kkk+1) * p(+1, 0, 0)
5434 + Am0p(iii-1,jjj-1,kkk+1) * p( 0,+1, 0)
5435 + A00p(iii-1,jjj-1,kkk+1) * p(+1,+1, 0);
5437 Amm0(iii,jjj-1,kkk+1) * p(+1, 0,-1)
5438 + Am00(iii,jjj-1,kkk+1) * p(+1,+1,-1)
5439 + Ammp(iii,jjj-1,kkk+1) * p(+1, 0, 0)
5440 + Am0p(iii,jjj-1,kkk+1) * p(+1,+1, 0);
5442 Amm0(iii-1,jjj,kkk+1) * p( 0,+1,-1)
5443 + A0m0(iii-1,jjj,kkk+1) * p(+1,+1,-1)
5444 + Ammp(iii-1,jjj,kkk+1) * p( 0,+1, 0)
5445 + A0mp(iii-1,jjj,kkk+1) * p(+1,+1, 0);
5447 Amm0(iii,jjj,kkk+1) * p(+1,+1,-1)
5448 + Ammp(iii,jjj,kkk+1) * p(+1,+1, 0);
5450 ( restrict_from_mm0_to(iii,jjj,kkk) * ap(-1,-1, 0)
5451 + restrict_from_0m0_to(iii,jjj,kkk) * ap( 0,-1, 0)
5452 + restrict_from_m00_to(iii,jjj,kkk) * ap(-1, 0, 0)
5453 + restrict_from_000_to(iii,jjj,kkk) * ap( 0, 0, 0)
5454 + restrict_from_mmp_to(iii,jjj,kkk) * ap(-1,-1,+1)
5455 + restrict_from_0mp_to(iii,jjj,kkk) * ap( 0,-1,+1)
5456 + restrict_from_m0p_to(iii,jjj,kkk) * ap(-1, 0,+1)
5457 + restrict_from_00p_to(iii,jjj,kkk) * ap( 0, 0,+1));
5459 csten(i,j,k,
ist_ppp) = Real(0.25)*(cs1+cs2+cs3+cs4);
5464 Array4<Real const>
const& sten) noexcept
5466 using namespace nodelap_detail;
5468 return x(i ,j ,k ) * sten(i ,j ,k ,
ist_000)
5470 +
x(i-1,j ,k ) * sten(i-1,j ,k ,
ist_p00)
5471 +
x(i+1,j ,k ) * sten(i ,j ,k ,
ist_p00)
5473 +
x(i ,j-1,k ) * sten(i ,j-1,k ,
ist_0p0)
5474 +
x(i ,j+1,k ) * sten(i ,j ,k ,
ist_0p0)
5476 +
x(i ,j ,k-1) * sten(i ,j ,k-1,
ist_00p)
5477 +
x(i ,j ,k+1) * sten(i ,j ,k ,
ist_00p)
5479 +
x(i-1,j-1,k ) * sten(i-1,j-1,k ,
ist_pp0)
5480 +
x(i+1,j-1,k ) * sten(i ,j-1,k ,
ist_pp0)
5481 +
x(i-1,j+1,k ) * sten(i-1,j ,k ,
ist_pp0)
5482 +
x(i+1,j+1,k ) * sten(i ,j ,k ,
ist_pp0)
5484 +
x(i-1,j ,k-1) * sten(i-1,j ,k-1,
ist_p0p)
5485 +
x(i+1,j ,k-1) * sten(i ,j ,k-1,
ist_p0p)
5486 +
x(i-1,j ,k+1) * sten(i-1,j ,k ,
ist_p0p)
5487 +
x(i+1,j ,k+1) * sten(i ,j ,k ,
ist_p0p)
5489 +
x(i ,j-1,k-1) * sten(i ,j-1,k-1,
ist_0pp)
5490 +
x(i ,j+1,k-1) * sten(i ,j ,k-1,
ist_0pp)
5491 +
x(i ,j-1,k+1) * sten(i ,j-1,k ,
ist_0pp)
5492 +
x(i ,j+1,k+1) * sten(i ,j ,k ,
ist_0pp)
5494 +
x(i-1,j-1,k-1) * sten(i-1,j-1,k-1,
ist_ppp)
5495 +
x(i+1,j-1,k-1) * sten(i ,j-1,k-1,
ist_ppp)
5496 +
x(i-1,j+1,k-1) * sten(i-1,j ,k-1,
ist_ppp)
5497 +
x(i+1,j+1,k-1) * sten(i ,j ,k-1,
ist_ppp)
5498 +
x(i-1,j-1,k+1) * sten(i-1,j-1,k ,
ist_ppp)
5499 +
x(i+1,j-1,k+1) * sten(i ,j-1,k ,
ist_ppp)
5500 +
x(i-1,j+1,k+1) * sten(i-1,j ,k ,
ist_ppp)
5501 +
x(i+1,j+1,k+1) * sten(i ,j ,k ,
ist_ppp);
5506 Array4<Real const>
const& sten, Array4<int const>
const& msk) noexcept
5517 Array4<Real const>
const& rhs,
5518 Array4<Real const>
const& sten,
5519 Array4<int const>
const& msk) noexcept
5521 using namespace nodelap_detail;
5524 sol(i,j,k) = Real(0.0);
5525 }
else if (sten(i,j,k,
ist_000) != Real(0.0)) {
5527 sol(i,j,k) += (rhs(i,j,k) - Ax) / sten(i,j,k,
ist_000);
5533 Array4<Real const>
const& rhs,
5534 Array4<Real const>
const& sten,
5535 Array4<int const>
const& msk) noexcept
5545 Array4<Real const>
const&
crse, Array4<Real const>
const& sten,
5546 Array4<int const>
const& msk) noexcept
5548 using namespace nodelap_detail;
5550 if (!msk(i,j,k) && sten(i,j,k,
ist_000) != Real(0.0)) {
5554 bool ieven = ic*2 == i;
5555 bool jeven = jc*2 == j;
5556 bool keven = kc*2 == k;
5558 if (ieven && jeven && keven) {
5559 fv =
crse(ic,jc,kc);
5560 }
else if (ieven && jeven) {
5563 if (w1 == Real(0.0) && w2 == Real(0.0)) {
5564 fv = Real(0.5)*(
crse(ic,jc,kc)+
crse(ic,jc,kc+1));
5566 fv = (w1*
crse(ic,jc,kc) + w2*
crse(ic,jc,kc+1)) / (w1+w2);
5568 }
else if (ieven && keven) {
5571 if (w1 == Real(0.0) && w2 == Real(0.0)) {
5572 fv = Real(0.5)*(
crse(ic,jc,kc)+
crse(ic,jc+1,kc));
5574 fv = (w1*
crse(ic,jc,kc) + w2*
crse(ic,jc+1,kc)) / (w1+w2);
5576 }
else if (jeven && keven) {
5579 if (w1 == Real(0.0) && w2 == Real(0.0)) {
5580 fv = Real(0.5)*(
crse(ic,jc,kc)+
crse(ic+1,jc,kc));
5582 fv = (w1*
crse(ic,jc,kc) + w2*
crse(ic+1,jc,kc)) / (w1+w2);
5593 Real wmm =
std::abs(sten(i,j-1,k-1,
ist_0pp)) * (Real(1.0) + w1m + w2m);
5594 Real wpm =
std::abs(sten(i,j ,k-1,
ist_0pp)) * (Real(1.0) + w1p + w2m);
5595 Real wmp =
std::abs(sten(i,j-1,k ,
ist_0pp)) * (Real(1.0) + w1m + w2p);
5597 fv = (wmm*
crse(ic,jc,kc) + wpm*
crse(ic,jc+1,kc)
5598 + wmp*
crse(ic,jc,kc+1) + wpp*
crse(ic,jc+1,kc+1))
5599 / (wmm+wpm+wmp+wpp+
eps);
5609 Real wmm =
std::abs(sten(i-1,j,k-1,
ist_p0p)) * (Real(1.0) + w1m + w2m);
5610 Real wpm =
std::abs(sten(i ,j,k-1,
ist_p0p)) * (Real(1.0) + w1p + w2m);
5611 Real wmp =
std::abs(sten(i-1,j,k ,
ist_p0p)) * (Real(1.0) + w1m + w2p);
5613 fv = (wmm*
crse(ic,jc,kc) + wpm*
crse(ic+1,jc,kc)
5614 + wmp*
crse(ic,jc,kc+1) + wpp*
crse(ic+1,jc,kc+1))
5615 / (wmm+wpm+wmp+wpp+
eps);
5625 Real wmm =
std::abs(sten(i-1,j-1,k,
ist_pp0)) * (Real(1.0) + w1m + w2m);
5626 Real wpm =
std::abs(sten(i ,j-1,k,
ist_pp0)) * (Real(1.0) + w1p + w2m);
5627 Real wmp =
std::abs(sten(i-1,j ,k,
ist_pp0)) * (Real(1.0) + w1m + w2p);
5629 fv = (wmm*
crse(ic,jc,kc) + wpm*
crse(ic+1,jc,kc)
5630 + wmp*
crse(ic,jc+1,kc) + wpp*
crse(ic+1,jc+1,kc))
5631 / (wmm+wpm+wmp+wpp+
eps);
5633 Real wmmm = Real(1.0);
5634 Real wpmm = Real(1.0);
5635 Real wmpm = Real(1.0);
5636 Real wppm = Real(1.0);
5637 Real wmmp = Real(1.0);
5638 Real wpmp = Real(1.0);
5639 Real wmpp = Real(1.0);
5640 Real wppp = Real(1.0);
5782 fv = (wmmm*
crse(ic,jc ,kc ) + wpmm*
crse(ic+1,jc ,kc )
5783 + wmpm*
crse(ic,jc+1,kc ) + wppm*
crse(ic+1,jc+1,kc )
5784 + wmmp*
crse(ic,jc ,kc+1) + wpmp*
crse(ic+1,jc ,kc+1)
5785 + wmpp*
crse(ic,jc+1,kc+1) + wppp*
crse(ic+1,jc+1,kc+1))
5786 / (wmmm + wpmm + wmpm + wppm + wmmp + wpmp + wmpp + wppp +
eps);
5795 Array4<Real const>
const&
fine, Array4<Real const>
const& sten,
5796 Array4<int const>
const& msk) noexcept
5798 using namespace nodelap_detail;
5803 if (msk(ii,jj,kk)) {
5804 crse(i,j,k) = Real(0.0);
5807 Real cv =
fine(ii,jj,kk);
5816 if (sten_lo == Real(0.0) && sten_hi == Real(0.0)) {
5817 cv += Real(0.5)*
fine(ii-1,jj,kk);
5819 cv +=
fine(ii-1,jj,kk) * sten_hi / (sten_lo + sten_hi);
5829 if (sten_lo == Real(0.0) && sten_hi == Real(0.0)) {
5830 cv += Real(0.5)*
fine(ii+1,jj,kk);
5832 cv +=
fine(ii+1,jj,kk) * sten_lo / (sten_lo + sten_hi);
5842 if (sten_lo == Real(0.0) && sten_hi == Real(0.0)) {
5843 cv += Real(0.5)*
fine(ii,jj-1,kk);
5845 cv +=
fine(ii,jj-1,kk) * sten_hi / (sten_lo + sten_hi);
5855 if (sten_lo == Real(0.0) && sten_hi == Real(0.0)) {
5856 cv += Real(0.5)*
fine(ii,jj+1,kk);
5858 cv +=
fine(ii,jj+1,kk) * sten_lo / (sten_lo + sten_hi);
5868 if (sten_lo == Real(0.0) && sten_hi == Real(0.0)) {
5869 cv += Real(0.5)*
fine(ii,jj,kk-1);
5871 cv +=
fine(ii,jj,kk-1)*sten_hi / (sten_lo + sten_hi);
5881 if (sten_lo == Real(0.0) && sten_hi == Real(0.0)) {
5882 cv += Real(0.5)*
fine(ii,jj,kk+1);
5884 cv +=
fine(ii,jj,kk+1)*sten_lo / (sten_lo + sten_hi);
5904 Real wmm =
std::abs(sten(ii-2,jj-2,kk,
ist_pp0)) * (Real(1.0) + w1m + w2m);
5905 Real wpm =
std::abs(sten(ii-1,jj-2,kk,
ist_pp0)) * (Real(1.0) + w1p + w2m);
5906 Real wmp =
std::abs(sten(ii-2,jj-1,kk,
ist_pp0)) * (Real(1.0) + w1m + w2p);
5907 Real wpp =
std::abs(sten(ii-1,jj-1,kk,
ist_pp0)) * (Real(1.0) + w1p + w2p);
5908 cv +=
fine(ii-1,jj-1,kk)*wpp/(wmm+wpm+wmp+wpp+
eps);
5930 cv +=
fine(ii+1,jj-1,kk)*wmp/(wmm+wpm+wmp+wpp+
eps);
5952 cv +=
fine(ii-1,jj+1,kk)*wpm/(wmm+wpm+wmp+wpp+
eps);
5974 cv +=
fine(ii+1,jj+1,kk)*wmm/(wmm+wpm+wmp+wpp+
eps);
5997 cv +=
fine(ii-1,jj,kk-1)*wpp/(wmm+wpm+wmp+wpp+
eps);
6019 cv +=
fine(ii+1,jj,kk-1)*wmp/(wmm+wpm+wmp+wpp+
eps);
6041 cv +=
fine(ii-1,jj,kk+1)*wpm/(wmm+wpm+wmp+wpp+
eps);
6063 cv +=
fine(ii+1,jj,kk+1)*wmm/(wmm+wpm+wmp+wpp+
eps);
6086 cv +=
fine(ii,jj-1,kk-1)*wpp/(wmm+wpm+wmp+wpp+
eps);
6108 cv +=
fine(ii,jj+1,kk-1)*wmp/(wmm+wpm+wmp+wpp+
eps);
6130 cv +=
fine(ii,jj-1,kk+1)*wpm/(wmm+wpm+wmp+wpp+
eps);
6152 cv +=
fine(ii,jj+1,kk+1)*wmm/(wmm+wpm+wmp+wpp+
eps);
6158 Real wmmm = Real(1.0)
6184 cv += wmmm*
fine(ii+1,jj+1,kk+1)*sten(ii+1,jj+1,kk+1,
ist_inv);
6186 Real wpmm = Real(1.0)
6212 cv += wpmm*
fine(ii-1,jj+1,kk+1)*sten(ii-1,jj+1,kk+1,
ist_inv);
6214 Real wmpm = Real(1.0)
6240 cv += wmpm*
fine(ii+1,jj-1,kk+1)*sten(ii+1,jj-1,kk+1,
ist_inv);
6242 Real wppm = Real(1.0)
6268 cv += wppm*
fine(ii-1,jj-1,kk+1)*sten(ii-1,jj-1,kk+1,
ist_inv);
6270 Real wmmp = Real(1.0)
6296 cv += wmmp*
fine(ii+1,jj+1,kk-1)*sten(ii+1,jj+1,kk-1,
ist_inv);
6298 Real wpmp = Real(1.0)
6324 cv += wpmp*
fine(ii-1,jj+1,kk-1)*sten(ii-1,jj+1,kk-1,
ist_inv);
6326 Real wmpp = Real(1.0)
6352 cv += wmpp*
fine(ii+1,jj-1,kk-1)*sten(ii+1,jj-1,kk-1,
ist_inv);
6354 Real wppp = Real(1.0)
6380 cv += wppp*
fine(ii-1,jj-1,kk-1)*sten(ii-1,jj-1,kk-1,
ist_inv);
6382 crse(i,j,k) = cv * Real(0.125);
6388 namespace nodelap_detail {
6390 constexpr
int i_S_x = 0;
6391 constexpr
int i_S_y = 1;
6392 constexpr
int i_S_z = 2;
6393 constexpr
int i_S_x2 = 3;
6394 constexpr
int i_S_y2 = 4;
6395 constexpr
int i_S_z2 = 5;
6409 constexpr
int n_Sintg = 19;
6411 constexpr
int i_c_xmym = 0;
6412 constexpr
int i_c_xmyb = 1;
6413 constexpr
int i_c_xmyp = 2;
6414 constexpr
int i_c_xbym = 3;
6415 constexpr
int i_c_xbyb = 4;
6416 constexpr
int i_c_xbyp = 5;
6417 constexpr
int i_c_xpym = 6;
6418 constexpr
int i_c_xpyb = 7;
6419 constexpr
int i_c_xpyp = 8;
6420 constexpr
int i_c_xmzm = 9;
6421 constexpr
int i_c_xmzb = 10;
6422 constexpr
int i_c_xmzp = 11;
6423 constexpr
int i_c_xbzm = 12;
6424 constexpr
int i_c_xbzb = 13;
6425 constexpr
int i_c_xbzp = 14;
6426 constexpr
int i_c_xpzm = 15;
6427 constexpr
int i_c_xpzb = 16;
6428 constexpr
int i_c_xpzp = 17;
6429 constexpr
int i_c_ymzm = 18;
6430 constexpr
int i_c_ymzb = 19;
6431 constexpr
int i_c_ymzp = 20;
6432 constexpr
int i_c_ybzm = 21;
6433 constexpr
int i_c_ybzb = 22;
6434 constexpr
int i_c_ybzp = 23;
6435 constexpr
int i_c_ypzm = 24;
6436 constexpr
int i_c_ypzb = 25;
6437 constexpr
int i_c_ypzp = 26;
6438 constexpr
int n_conn = 27;
6440 constexpr
int i_B_x = 0;
6441 constexpr
int i_B_y = 1;
6442 constexpr
int i_B_z = 2;
6452 void mlndlap_set_connection (
int i,
int j,
int k, Array4<Real>
const& conn,
6453 Array4<Real const>
const& intg, Array4<Real const>
const& vol,
6454 Array4<EBCellFlag const>
const& flag) noexcept
6456 using namespace nodelap_detail;
6458 if (flag(i,j,k).isCovered()) {
6459 for (
int n = 0; n < n_conn; ++n) { conn(i,j,k,n) = Real(0.); }
6460 }
else if (flag(i,j,k).isRegular() || vol(i,j,k) >=
almostone) {
6461 for (
int n = 0; n < n_conn; ++n) { conn(i,j,k,n) = Real(1.); }
6464 conn(i,j,k,i_c_xmym) = Real(0.5625)*vol(i,j,k)
6465 + Real(2.25)*(-intg(i,j,k,
i_S_x ) - intg(i,j,k,
i_S_y)
6471 conn(i,j,k,i_c_xmyb) = Real(1.125)*vol(i,j,k)
6476 conn(i,j,k,i_c_xmyp) = Real(0.5625)*vol(i,j,k)
6477 + Real(2.25)*(-intg(i,j,k,
i_S_x ) + intg(i,j,k,
i_S_y)
6483 conn(i,j,k,i_c_xbym) = Real(1.125)*vol(i,j,k)
6488 conn(i,j,k,i_c_xbyb) = Real(2.25)*vol(i,j,k)
6493 conn(i,j,k,i_c_xbyp) = Real(1.125)*vol(i,j,k)
6498 conn(i,j,k,i_c_xpym) = Real(0.5625)*vol(i,j,k)
6499 + Real(2.25)*( intg(i,j,k,
i_S_x ) - intg(i,j,k,
i_S_y)
6505 conn(i,j,k,i_c_xpyb) = Real(1.125)*vol(i,j,k)
6510 conn(i,j,k,i_c_xpyp) = Real(0.5625)*vol(i,j,k)
6511 + Real(2.25)*( intg(i,j,k,
i_S_x ) + intg(i,j,k,
i_S_y)
6517 conn(i,j,k,i_c_xmzm) = Real(0.5625)*vol(i,j,k)
6518 + Real(2.25)*(-intg(i,j,k,
i_S_x) - intg(i,j,k,
i_S_z)
6524 conn(i,j,k,i_c_xmzb) = Real(1.125)*vol(i,j,k)
6529 conn(i,j,k,i_c_xmzp) = Real(0.5625)*vol(i,j,k)
6530 + Real(2.25)*(-intg(i,j,k,
i_S_x ) + intg(i,j,k,
i_S_z)
6536 conn(i,j,k,i_c_xbzm) = Real(1.125)*vol(i,j,k)
6541 conn(i,j,k,i_c_xbzb) = Real(2.25)*vol(i,j,k)
6546 conn(i,j,k,i_c_xbzp) = Real(1.125)*vol(i,j,k)
6551 conn(i,j,k,i_c_xpzm) = Real(0.5625)*vol(i,j,k)
6552 + Real(2.25)*( intg(i,j,k,
i_S_x ) - intg(i,j,k,
i_S_z)
6558 conn(i,j,k,i_c_xpzb) = Real(1.125)*vol(i,j,k)
6563 conn(i,j,k,i_c_xpzp) = Real(0.5625)*vol(i,j,k)
6564 + Real(2.25)*( intg(i,j,k,
i_S_x ) + intg(i,j,k,
i_S_z)
6570 conn(i,j,k,i_c_ymzm) = Real(0.5625)*vol(i,j,k)
6571 + Real(2.25)*(-intg(i,j,k,
i_S_y) - intg(i,j,k,
i_S_z)
6577 conn(i,j,k,i_c_ymzb) = Real(1.125)*vol(i,j,k)
6582 conn(i,j,k,i_c_ymzp) = Real(0.5625)*vol(i,j,k)
6583 + Real(2.25)*(-intg(i,j,k,
i_S_y ) + intg(i,j,k,
i_S_z)
6589 conn(i,j,k,i_c_ybzm) = Real(1.125)*vol(i,j,k)
6594 conn(i,j,k,i_c_ybzb) = Real(2.25)*vol(i,j,k)
6599 conn(i,j,k,i_c_ybzp) = Real(1.125)*vol(i,j,k)
6604 conn(i,j,k,i_c_ypzm) = Real(0.5625)*vol(i,j,k)
6605 + Real(2.25)*( intg(i,j,k,
i_S_y ) - intg(i,j,k,
i_S_z)
6611 conn(i,j,k,i_c_ypzb) = Real(1.125)*vol(i,j,k)
6616 conn(i,j,k,i_c_ypzp) = Real(0.5625)*vol(i,j,k)
6617 + Real(2.25)*( intg(i,j,k,
i_S_y ) + intg(i,j,k,
i_S_z)
6625 void mlndlap_set_stencil_eb (
int i,
int j,
int k, Array4<Real>
const& sten,
6626 Array4<Real const>
const& sig, Array4<Real const>
const& conn,
6627 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
6629 using namespace nodelap_detail;
6631 Real facx = Real(1./36.)*dxinv[0]*dxinv[0];
6632 Real facy = Real(1./36.)*dxinv[1]*dxinv[1];
6633 Real facz = Real(1./36.)*dxinv[2]*dxinv[2];
6637 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) ) +
6638 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) ) +
6639 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) ) +
6640 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) ) );
6644 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) ) +
6645 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) ) +
6646 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) ) +
6647 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) ) );
6651 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) ) +
6652 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) ) +
6653 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) ) +
6654 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) ) );
6658 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) ) +
6659 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) ) );
6663 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) ) +
6664 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) ) );
6668 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) ) +
6669 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) ) );
6672 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) );
6676 void mlndlap_divu_eb (
int i,
int j,
int k, Array4<Real>
const& rhs, Array4<Real const>
const& vel,
6677 Array4<Real const>
const& vfrac, Array4<Real const>
const& intg,
6678 Array4<int const>
const& msk, GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
6679 Box const& nodal_domain,
6680 GpuArray<LinOpBCType, AMREX_SPACEDIM>
const& bclo,
6681 GpuArray<LinOpBCType, AMREX_SPACEDIM>
const& bchi) noexcept
6683 using namespace nodelap_detail;
6685 Real facx = Real(0.25)*dxinv[0];
6686 Real facy = Real(0.25)*dxinv[1];
6687 Real facz = Real(0.25)*dxinv[2];
6694 Real zero_ilo = Real(1.0);
6695 Real zero_ihi = Real(1.0);
6696 Real zero_jlo = Real(1.0);
6697 Real zero_jhi = Real(1.0);
6698 Real zero_klo = Real(1.0);
6699 Real zero_khi = Real(1.0);
6703 if ((bclo[0] == LinOpBCType::Neumann || bclo[0] == LinOpBCType::inflow)
6706 zero_ilo = Real(0.0);
6708 if ((bchi[0] == LinOpBCType::Neumann || bchi[0] == LinOpBCType::inflow)
6711 zero_ihi = Real(0.0);
6713 if ((bclo[1] == LinOpBCType::Neumann || bclo[1] == LinOpBCType::inflow)
6716 zero_jlo = Real(0.0);
6718 if ((bchi[1] == LinOpBCType::Neumann || bchi[1] == LinOpBCType::inflow)
6721 zero_jhi = Real(0.0);
6723 if ((bclo[2] == LinOpBCType::Neumann || bclo[2] == LinOpBCType::inflow)
6726 zero_klo = Real(0.0);
6728 if ((bchi[2] == LinOpBCType::Neumann || bchi[2] == LinOpBCType::inflow)
6731 zero_khi = Real(0.0);
6735 vel(i-1,j-1,k ,0)*( -vfrac(i-1,j-1,k )
6736 -Real(2.)*intg(i-1,j-1,k ,
i_S_y)
6737 +Real(2.)*intg(i-1,j-1,k ,
i_S_z)
6738 +Real(4.)*intg(i-1,j-1,k ,
i_S_y_z))*zero_jlo*zero_khi
6739 +vel(i ,j-1,k ,0)*( vfrac(i ,j-1,k )
6740 +Real(2.)*intg(i ,j-1,k ,
i_S_y)
6741 -Real(2.)*intg(i ,j-1,k ,
i_S_z)
6742 -Real(4.)*intg(i ,j-1,k ,
i_S_y_z))*zero_jlo*zero_khi
6743 +vel(i-1,j ,k ,0)*( -vfrac(i-1,j ,k )
6744 +Real(2.)*intg(i-1,j ,k ,
i_S_y)
6745 +Real(2.)*intg(i-1,j ,k ,
i_S_z)
6746 -Real(4.)*intg(i-1,j ,k ,
i_S_y_z))*zero_jhi*zero_khi
6747 +vel(i ,j ,k ,0)*( vfrac(i ,j ,k )
6748 -Real(2.)*intg(i ,j ,k ,
i_S_y)
6749 -Real(2.)*intg(i ,j ,k ,
i_S_z)
6750 +Real(4.)*intg(i ,j ,k ,
i_S_y_z))*zero_jhi*zero_khi
6751 +vel(i-1,j-1,k-1,0)*( -vfrac(i-1,j-1,k-1)
6752 -Real(2.)*intg(i-1,j-1,k-1,
i_S_y)
6753 -Real(2.)*intg(i-1,j-1,k-1,
i_S_z)
6754 -Real(4.)*intg(i-1,j-1,k-1,
i_S_y_z))*zero_jlo*zero_klo
6755 +vel(i ,j-1,k-1,0)*( vfrac(i ,j-1,k-1)
6756 +Real(2.)*intg(i ,j-1,k-1,
i_S_y)
6757 +Real(2.)*intg(i ,j-1,k-1,
i_S_z)
6758 +Real(4.)*intg(i ,j-1,k-1,
i_S_y_z))*zero_jlo*zero_klo
6759 +vel(i-1,j ,k-1,0)*( -vfrac(i-1,j ,k-1)
6760 +Real(2.)*intg(i-1,j ,k-1,
i_S_y)
6761 -Real(2.)*intg(i-1,j ,k-1,
i_S_z)
6762 +Real(4.)*intg(i-1,j ,k-1,
i_S_y_z))*zero_jhi*zero_klo
6763 +vel(i ,j ,k-1,0)*( vfrac(i ,j ,k-1)
6764 -Real(2.)*intg(i ,j ,k-1,
i_S_y)
6765 +Real(2.)*intg(i ,j ,k-1,
i_S_z)
6766 -Real(4.)*intg(i ,j ,k-1,
i_S_y_z))*zero_jhi*zero_klo )
6768 vel(i-1,j-1,k ,1)*( -vfrac(i-1,j-1,k )
6769 -Real(2.)*intg(i-1,j-1,k ,
i_S_x)
6770 +Real(2.)*intg(i-1,j-1,k ,
i_S_z)
6771 +Real(4.)*intg(i-1,j-1,k ,
i_S_x_z))*zero_ilo*zero_khi
6772 +vel(i ,j-1,k ,1)*( -vfrac(i ,j-1,k )
6773 +Real(2.)*intg(i ,j-1,k ,
i_S_x)
6774 +Real(2.)*intg(i ,j-1,k ,
i_S_z)
6775 -Real(4.)*intg(i ,j-1,k ,
i_S_x_z))*zero_ihi*zero_khi
6776 +vel(i-1,j ,k ,1)*( vfrac(i-1,j ,k )
6777 +Real(2.)*intg(i-1,j ,k ,
i_S_x)
6778 -Real(2.)*intg(i-1,j ,k ,
i_S_z)
6779 -Real(4.)*intg(i-1,j ,k ,
i_S_x_z))*zero_ilo*zero_khi
6780 +vel(i ,j ,k ,1)*( vfrac(i ,j ,k )
6781 -Real(2.)*intg(i ,j ,k ,
i_S_x)
6782 -Real(2.)*intg(i ,j ,k ,
i_S_z)
6783 +Real(4.)*intg(i ,j ,k ,
i_S_x_z))*zero_ihi*zero_khi
6784 +vel(i-1,j-1,k-1,1)*( -vfrac(i-1,j-1,k-1)
6785 -Real(2.)*intg(i-1,j-1,k-1,
i_S_x)
6786 -Real(2.)*intg(i-1,j-1,k-1,
i_S_z)
6787 -Real(4.)*intg(i-1,j-1,k-1,
i_S_x_z))*zero_ilo*zero_klo
6788 +vel(i ,j-1,k-1,1)*( -vfrac(i ,j-1,k-1)
6789 +Real(2.)*intg(i ,j-1,k-1,
i_S_x)
6790 -Real(2.)*intg(i ,j-1,k-1,
i_S_z)
6791 +Real(4.)*intg(i ,j-1,k-1,
i_S_x_z))*zero_ihi*zero_klo
6792 +vel(i-1,j ,k-1,1)*( vfrac(i-1,j ,k-1)
6793 +Real(2.)*intg(i-1,j ,k-1,
i_S_x)
6794 +Real(2.)*intg(i-1,j ,k-1,
i_S_z)
6795 +Real(4.)*intg(i-1,j ,k-1,
i_S_x_z))*zero_ilo*zero_klo
6796 +vel(i ,j ,k-1,1)*( vfrac(i ,j ,k-1)
6797 -Real(2.)*intg(i ,j ,k-1,
i_S_x)
6798 +Real(2.)*intg(i ,j ,k-1,
i_S_z)
6799 -Real(4.)*intg(i ,j ,k-1,
i_S_x_z))*zero_ihi*zero_klo )
6801 vel(i-1,j-1,k ,2)*( vfrac(i-1,j-1,k )
6802 +Real(2.)*intg(i-1,j-1,k ,
i_S_x)
6803 +Real(2.)*intg(i-1,j-1,k ,
i_S_y)
6804 +Real(4.)*intg(i-1,j-1,k ,
i_S_x_y))*zero_ilo*zero_jlo
6805 +vel(i ,j-1,k ,2)*( vfrac(i ,j-1,k )
6806 -Real(2.)*intg(i ,j-1,k ,
i_S_x)
6807 +Real(2.)*intg(i ,j-1,k ,
i_S_y)
6808 -Real(4.)*intg(i ,j-1,k ,
i_S_x_y))*zero_ihi*zero_jlo
6809 +vel(i-1,j ,k ,2)*( vfrac(i-1,j ,k )
6810 +Real(2.)*intg(i-1,j ,k ,
i_S_x)
6811 -Real(2.)*intg(i-1,j ,k ,
i_S_y)
6812 -Real(4.)*intg(i-1,j ,k ,
i_S_x_y))*zero_ilo*zero_jhi
6813 +vel(i ,j ,k ,2)*( vfrac(i ,j ,k )
6814 -Real(2.)*intg(i ,j ,k ,
i_S_x)
6815 -Real(2.)*intg(i ,j ,k ,
i_S_y)
6816 +Real(4.)*intg(i ,j ,k ,
i_S_x_y))*zero_ihi*zero_jhi
6817 +vel(i-1,j-1,k-1,2)*( -vfrac(i-1,j-1,k-1)
6818 -Real(2.)*intg(i-1,j-1,k-1,
i_S_x)
6819 -Real(2.)*intg(i-1,j-1,k-1,
i_S_y)
6820 -Real(4.)*intg(i-1,j-1,k-1,
i_S_x_y))*zero_ilo*zero_jlo
6821 +vel(i ,j-1,k-1,2)*( -vfrac(i ,j-1,k-1)
6822 +Real(2.)*intg(i ,j-1,k-1,
i_S_x)
6823 -Real(2.)*intg(i ,j-1,k-1,
i_S_y)
6824 +Real(4.)*intg(i ,j-1,k-1,
i_S_x_y))*zero_ihi*zero_jlo
6825 +vel(i-1,j ,k-1,2)*( -vfrac(i-1,j ,k-1)
6826 -Real(2.)*intg(i-1,j ,k-1,
i_S_x)
6827 +Real(2.)*intg(i-1,j ,k-1,
i_S_y)
6828 +Real(4.)*intg(i-1,j ,k-1,
i_S_x_y))*zero_ilo*zero_jhi
6829 +vel(i ,j ,k-1,2)*( -vfrac(i ,j ,k-1)
6830 +Real(2.)*intg(i ,j ,k-1,
i_S_x)
6831 +Real(2.)*intg(i ,j ,k-1,
i_S_y)
6832 -Real(4.)*intg(i ,j ,k-1,
i_S_x_y))*zero_ihi*zero_jhi );
6834 rhs(i,j,k) = Real(0.);
6839 void add_eb_flow_contribution (
int i,
int j,
int k, Array4<Real>
const& rhs,
6840 Array4<int const>
const& msk, GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
6841 Array4<Real const>
const& bareaarr,
6842 Array4<Real const>
const& sintg,
6843 Array4<Real const>
const& eb_vel_dot_n) noexcept
6845 using namespace nodelap_detail;
6847 Real fac_eb = Real(0.125) * dxinv[0];
6850 rhs(i,j,k) += fac_eb*(
6851 eb_vel_dot_n(i-1,j-1,k )*( bareaarr(i-1,j-1,k)
6852 +Real(2.)*sintg(i-1,j-1,k ,
i_B_x)
6853 +Real(2.)*sintg(i-1,j-1,k ,
i_B_y)
6854 +Real(4.)*sintg(i-1,j-1,k ,
i_B_x_y)
6855 -Real(2.)*sintg(i-1,j-1,k ,
i_B_z)
6856 -Real(4.)*sintg(i-1,j-1,k ,
i_B_y_z)
6857 -Real(4.)*sintg(i-1,j-1,k ,
i_B_x_z)
6858 -Real(8.)*sintg(i-1,j-1,k ,
i_B_xyz))
6859 +eb_vel_dot_n(i ,j-1,k )*( bareaarr(i ,j-1,k)
6860 -Real(2.)*sintg(i ,j-1,k ,
i_B_x)
6861 +Real(2.)*sintg(i ,j-1,k ,
i_B_y)
6862 -Real(4.)*sintg(i ,j-1,k ,
i_B_x_y)
6863 -Real(2.)*sintg(i ,j-1,k ,
i_B_z)
6864 -Real(4.)*sintg(i ,j-1,k ,
i_B_y_z)
6865 +Real(4.)*sintg(i ,j-1,k ,
i_B_x_z)
6866 +Real(8.)*sintg(i ,j-1,k ,
i_B_xyz))
6867 +eb_vel_dot_n(i-1,j ,k )*( bareaarr(i-1,j ,k)
6868 +Real(2.)*sintg(i-1,j ,k ,
i_B_x)
6869 -Real(2.)*sintg(i-1,j ,k ,
i_B_y)
6870 -Real(4.)*sintg(i-1,j ,k ,
i_B_x_y)
6871 -Real(2.)*sintg(i-1,j ,k ,
i_B_z)
6872 +Real(4.)*sintg(i-1,j ,k ,
i_B_y_z)
6873 -Real(4.)*sintg(i-1,j ,k ,
i_B_x_z)
6874 +Real(8.)*sintg(i-1,j ,k ,
i_B_xyz))
6875 +eb_vel_dot_n(i ,j ,k )*( bareaarr(i ,j ,k)
6876 -Real(2.)*sintg(i ,j ,k ,
i_B_x)
6877 -Real(2.)*sintg(i ,j ,k ,
i_B_y)
6878 +Real(4.)*sintg(i ,j ,k ,
i_B_x_y)
6879 -Real(2.)*sintg(i ,j ,k ,
i_B_z)
6880 +Real(4.)*sintg(i ,j ,k ,
i_B_y_z)
6881 +Real(4.)*sintg(i ,j ,k ,
i_B_x_z)
6882 -Real(8.)*sintg(i ,j ,k ,
i_B_xyz))
6883 +eb_vel_dot_n(i-1,j-1,k-1)*( bareaarr(i-1,j-1,k-1)
6884 +Real(2.)*sintg(i-1,j-1,k-1,
i_B_x)
6885 +Real(2.)*sintg(i-1,j-1,k-1,
i_B_y)
6886 +Real(4.)*sintg(i-1,j-1,k-1,
i_B_x_y)
6887 +Real(2.)*sintg(i-1,j-1,k-1,
i_B_z)
6888 +Real(4.)*sintg(i-1,j-1,k-1,
i_B_y_z)
6889 +Real(4.)*sintg(i-1,j-1,k-1,
i_B_x_z)
6890 +Real(8.)*sintg(i-1,j-1,k-1,
i_B_xyz))
6891 +eb_vel_dot_n(i ,j-1,k-1)*( bareaarr(i ,j-1,k-1)
6892 -Real(2.)*sintg(i ,j-1,k-1,
i_B_x)
6893 +Real(2.)*sintg(i ,j-1,k-1,
i_B_y)
6894 -Real(4.)*sintg(i ,j-1,k-1,
i_B_x_y)
6895 +Real(2.)*sintg(i ,j-1,k-1,
i_B_z)
6896 +Real(4.)*sintg(i ,j-1,k-1,
i_B_y_z)
6897 -Real(4.)*sintg(i ,j-1,k-1,
i_B_x_z)
6898 -Real(8.)*sintg(i ,j-1,k-1,
i_B_xyz))
6899 +eb_vel_dot_n(i-1,j ,k-1)*( bareaarr(i-1,j ,k-1)
6900 +Real(2.)*sintg(i-1,j ,k-1,
i_B_x)
6901 -Real(2.)*sintg(i-1,j ,k-1,
i_B_y)
6902 -Real(4.)*sintg(i-1,j ,k-1,
i_B_x_y)
6903 +Real(2.)*sintg(i-1,j ,k-1,
i_B_z)
6904 -Real(4.)*sintg(i-1,j ,k-1,
i_B_y_z)
6905 +Real(4.)*sintg(i-1,j ,k-1,
i_B_x_z)
6906 -Real(8.)*sintg(i-1,j ,k-1,
i_B_xyz))
6907 +eb_vel_dot_n(i ,j ,k-1)*( bareaarr(i ,j ,k-1)
6908 -Real(2.)*sintg(i ,j ,k-1,
i_B_x)
6909 -Real(2.)*sintg(i ,j ,k-1,
i_B_y)
6910 +Real(4.)*sintg(i ,j ,k-1,
i_B_x_y)
6911 +Real(2.)*sintg(i ,j ,k-1,
i_B_z)
6912 -Real(4.)*sintg(i ,j ,k-1,
i_B_y_z)
6913 -Real(4.)*sintg(i ,j ,k-1,
i_B_x_z)
6914 +Real(8.)*sintg(i ,j ,k-1,
i_B_xyz)));
6919 void mlndlap_mknewu_eb (
int i,
int j,
int k, Array4<Real>
const& u, Array4<Real const>
const& p,
6920 Array4<Real const>
const& sig, Array4<Real const>
const& vfrac,
6921 Array4<Real const>
const& intg, GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
6923 using namespace nodelap_detail;
6925 if (vfrac(i,j,k) == Real(0.)) {
6926 u(i,j,k,0) = u(i,j,k,1) = u(i,j,k,2) = Real(0.);
6928 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 )
6929 -p(i,j,k+1)+p(i+1,j,k+1)-p(i,j+1,k+1)+p(i+1,j+1,k+1));
6930 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 )
6931 -p(i,j,k+1)-p(i+1,j,k+1)+p(i,j+1,k+1)+p(i+1,j+1,k+1));
6932 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 )
6933 +p(i,j,k+1)+p(i+1,j,k+1)+p(i,j+1,k+1)+p(i+1,j+1,k+1));
6935 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)
6936 +p(i+1,j+1,k ) - p(i,j+1,k ) - p(i+1,j,k ) + p(i,j,k ) ) / vfrac(i,j,k);
6938 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)
6939 -p(i+1,j+1,k ) + p(i,j+1,k ) - p(i+1,j,k ) + p(i,j,k ) ) / vfrac(i,j,k);
6941 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)
6942 -p(i+1,j+1,k ) - p(i,j+1,k ) + p(i+1,j,k ) + p(i,j,k ) ) / vfrac(i,j,k);
6944 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)
6945 -p(i+1,j+1,k ) + p(i,j+1,k ) + p(i+1,j,k ) - p(i,j,k ) ) / vfrac(i,j,k);
6947 u(i,j,k,0) -= sig(i,j,k)*dxinv[0]*(dpdx + Real(0.5)*intg(i,j,k,
i_S_y )*dpp_xy +
6948 Real(0.5)*intg(i,j,k,
i_S_z )*dpp_xz +
6949 intg(i,j,k,
i_S_y_z)*dpp_xyz );
6950 u(i,j,k,1) -= sig(i,j,k)*dxinv[1]*(dpdy + Real(0.5)*intg(i,j,k,
i_S_x )*dpp_xy +
6951 Real(0.5)*intg(i,j,k,
i_S_z )*dpp_yz +
6952 intg(i,j,k,
i_S_x_z)*dpp_xyz );
6953 u(i,j,k,2) -= sig(i,j,k)*dxinv[2]*(dpdz + Real(0.5)*intg(i,j,k,
i_S_x )*dpp_xz +
6954 Real(0.5)*intg(i,j,k,
i_S_y )*dpp_yz +
6955 intg(i,j,k,
i_S_x_y)*dpp_xyz );
6960 void mlndlap_mknewu_eb_c (
int i,
int j,
int k, Array4<Real>
const& u, Array4<Real const>
const& p,
6961 Real sig, Array4<Real const>
const& vfrac,
6962 Array4<Real const>
const& intg, GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
6964 using namespace nodelap_detail;
6966 if (vfrac(i,j,k) == Real(0.)) {
6967 u(i,j,k,0) = u(i,j,k,1) = u(i,j,k,2) = Real(0.);
6969 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 )
6970 -p(i,j,k+1)+p(i+1,j,k+1)-p(i,j+1,k+1)+p(i+1,j+1,k+1));
6971 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 )
6972 -p(i,j,k+1)-p(i+1,j,k+1)+p(i,j+1,k+1)+p(i+1,j+1,k+1));
6973 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 )
6974 +p(i,j,k+1)+p(i+1,j,k+1)+p(i,j+1,k+1)+p(i+1,j+1,k+1));
6976 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)
6977 +p(i+1,j+1,k ) - p(i,j+1,k ) - p(i+1,j,k ) + p(i,j,k ) ) / vfrac(i,j,k);
6979 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)
6980 -p(i+1,j+1,k ) + p(i,j+1,k ) - p(i+1,j,k ) + p(i,j,k ) ) / vfrac(i,j,k);
6982 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)
6983 -p(i+1,j+1,k ) - p(i,j+1,k ) + p(i+1,j,k ) + p(i,j,k ) ) / vfrac(i,j,k);
6985 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)
6986 -p(i+1,j+1,k ) + p(i,j+1,k ) + p(i+1,j,k ) - p(i,j,k ) ) / vfrac(i,j,k);
6988 u(i,j,k,0) -= sig*dxinv[0]*(dpdx + Real(0.5)*intg(i,j,k,
i_S_y )*dpp_xy +
6989 Real(0.5)*intg(i,j,k,
i_S_z )*dpp_xz +
6990 intg(i,j,k,
i_S_y_z)*dpp_xyz );
6991 u(i,j,k,1) -= sig*dxinv[1]*(dpdy + Real(0.5)*intg(i,j,k,
i_S_x )*dpp_xy +
6992 Real(0.5)*intg(i,j,k,
i_S_z )*dpp_yz +
6993 intg(i,j,k,
i_S_x_z)*dpp_xyz );
6994 u(i,j,k,2) -= sig*dxinv[2]*(dpdz + Real(0.5)*intg(i,j,k,
i_S_x )*dpp_xz +
6995 Real(0.5)*intg(i,j,k,
i_S_y )*dpp_yz +
6996 intg(i,j,k,
i_S_x_y)*dpp_xyz );
7001 Real mlndlap_rhcc_eb (
int i,
int j,
int k, Array4<Real const>
const& rhcc,
7002 Array4<Real const>
const& vfrac, Array4<Real const>
const& intg,
7003 Array4<int const>
const& msk) noexcept
7005 using namespace nodelap_detail;
7010 ( Real(0.125) * vfrac(i ,j ,k )
7011 + Real(0.25) * (-intg(i ,j ,k ,
i_S_x)
7012 -intg(i ,j ,k ,
i_S_y)
7013 -intg(i ,j ,k ,
i_S_z))
7014 + Real(0.5) * ( intg(i ,j ,k ,
i_S_x_y)
7020 ( Real(0.125) * vfrac(i-1,j ,k )
7021 + Real(0.25) * ( intg(i-1,j ,k ,
i_S_x)
7022 -intg(i-1,j ,k ,
i_S_y)
7023 -intg(i-1,j ,k ,
i_S_z))
7024 + Real(0.5) * ( -intg(i-1,j ,k ,
i_S_x_y)
7030 ( Real(0.125) * vfrac(i ,j-1,k )
7031 + Real(0.25) * (-intg(i ,j-1,k ,
i_S_x)
7032 +intg(i ,j-1,k ,
i_S_y)
7033 -intg(i ,j-1,k ,
i_S_z))
7034 + Real(0.5) * ( -intg(i ,j-1,k ,
i_S_x_y)
7039 + rhcc(i-1,j-1,k ) *
7040 ( Real(0.125) * vfrac(i-1,j-1,k )
7041 + Real(0.25) * ( intg(i-1,j-1,k ,
i_S_x)
7042 +intg(i-1,j-1,k ,
i_S_y)
7043 -intg(i-1,j-1,k ,
i_S_z))
7044 + Real(0.5) * ( intg(i-1,j-1,k ,
i_S_x_y)
7047 + ( -intg(i-1,j-1,k ,
i_S_xyz)))
7050 ( Real(0.125) * vfrac(i ,j ,k-1)
7051 + Real(0.25) * (-intg(i ,j ,k-1,
i_S_x)
7052 -intg(i ,j ,k-1,
i_S_y)
7053 +intg(i ,j ,k-1,
i_S_z))
7054 + Real(0.5) * ( intg(i ,j ,k-1,
i_S_x_y)
7059 + rhcc(i-1,j ,k-1) *
7060 ( Real(0.125) * vfrac(i-1,j ,k-1)
7061 + Real(0.25) * ( intg(i-1,j ,k-1,
i_S_x)
7062 -intg(i-1,j ,k-1,
i_S_y)
7063 +intg(i-1,j ,k-1,
i_S_z))
7064 + Real(0.5) * ( -intg(i-1,j ,k-1,
i_S_x_y)
7067 + ( -intg(i-1,j ,k-1,
i_S_xyz)))
7069 + rhcc(i ,j-1,k-1) *
7070 ( Real(0.125) * vfrac(i ,j-1,k-1)
7071 + Real(0.25) * (-intg(i ,j-1,k-1,
i_S_x)
7072 +intg(i ,j-1,k-1,
i_S_y)
7073 +intg(i ,j-1,k-1,
i_S_z))
7074 + Real(0.5) * ( -intg(i ,j-1,k-1,
i_S_x_y)
7077 + ( -intg(i ,j-1,k-1,
i_S_xyz)))
7079 + rhcc(i-1,j-1,k-1) *
7080 ( Real(0.125) * vfrac(i-1,j-1,k-1)
7081 + Real(0.25) * ( intg(i-1,j-1,k-1,
i_S_x)
7082 +intg(i-1,j-1,k-1,
i_S_y)
7083 +intg(i-1,j-1,k-1,
i_S_z))
7084 + Real(0.5) * ( intg(i-1,j-1,k-1,
i_S_x_y)
7087 + ( intg(i-1,j-1,k-1,
i_S_xyz)));
7095 #if defined(AMREX_USE_HYPRE)
7097 template <
typename HypreInt,
typename AtomicInt>
7098 void mlndlap_fillijmat_sten_cpu (
Box const& ndbx,
7099 Array4<AtomicInt const>
const& gid,
7100 Array4<int const>
const& lid,
7101 HypreInt* ncols, HypreInt* cols,
7103 Array4<Real const>
const& sten) noexcept
7115 HypreInt nelems = 0;
7118 if (lid(i,j,k) >= 0)
7120 cols[nelems] = gid(i,j,k);
7121 mat[nelems] = sten(i,j,k,
ist_000);
7125 if (gid(i-1,j-1,k-1) < gidmax) {
7126 cols[nelems] = gid(i-1,j-1,k-1);
7127 mat[nelems] = sten(i-1,j-1,k-1,
ist_ppp);
7131 if (gid(i,j-1,k-1) < gidmax) {
7132 cols[nelems] = gid(i,j-1,k-1);
7133 mat[nelems] = sten(i,j-1,k-1,
ist_0pp);
7137 if (gid(i+1,j-1,k-1) < gidmax) {
7138 cols[nelems] = gid(i+1,j-1,k-1);
7139 mat[nelems] = sten(i,j-1,k-1,
ist_ppp);
7143 if (gid(i-1,j,k-1) < gidmax) {
7144 cols[nelems] = gid(i-1,j,k-1);
7145 mat[nelems] = sten(i-1,j,k-1,
ist_p0p);
7149 if (gid(i,j,k-1) < gidmax) {
7150 cols[nelems] = gid(i,j,k-1);
7151 mat[nelems] = sten(i,j,k-1,
ist_00p);
7155 if (gid(i+1,j,k-1) < gidmax) {
7156 cols[nelems] = gid(i+1,j,k-1);
7157 mat[nelems] = sten(i,j,k-1,
ist_p0p);
7161 if (gid(i-1,j+1,k-1) < gidmax) {
7162 cols[nelems] = gid(i-1,j+1,k-1);
7163 mat[nelems] = sten(i-1,j,k-1,
ist_ppp);
7167 if (gid(i,j+1,k-1) < gidmax) {
7168 cols[nelems] = gid(i,j+1,k-1);
7169 mat[nelems] = sten(i,j,k-1,
ist_0pp);
7173 if (gid(i+1,j+1,k-1) < gidmax) {
7174 cols[nelems] = gid(i+1,j+1,k-1);
7175 mat[nelems] = sten(i,j,k-1,
ist_ppp);
7179 if (gid(i-1,j-1,k) < gidmax) {
7180 cols[nelems] = gid(i-1,j-1,k);
7181 mat[nelems] = sten(i-1,j-1,k,
ist_pp0);
7185 if (gid(i,j-1,k) < gidmax) {
7186 cols[nelems] = gid(i,j-1,k);
7187 mat[nelems] = sten(i,j-1,k,
ist_0p0);
7191 if (gid(i+1,j-1,k) < gidmax) {
7192 cols[nelems] = gid(i+1,j-1,k);
7193 mat[nelems] = sten(i,j-1,k,
ist_pp0);
7197 if (gid(i-1,j,k) < gidmax) {
7198 cols[nelems] = gid(i-1,j,k);
7199 mat[nelems] = sten(i-1,j,k,
ist_p00);
7203 if (gid(i+1,j,k) < gidmax) {
7204 cols[nelems] = gid(i+1,j,k);
7205 mat[nelems] = sten(i,j,k,
ist_p00);
7209 if (gid(i-1,j+1,k) < gidmax) {
7210 cols[nelems] = gid(i-1,j+1,k);
7211 mat[nelems] = sten(i-1,j,k,
ist_pp0);
7215 if (gid(i,j+1,k) < gidmax) {
7216 cols[nelems] = gid(i,j+1,k);
7217 mat[nelems] = sten(i,j,k,
ist_0p0);
7221 if (gid(i+1,j+1,k) < gidmax) {
7222 cols[nelems] = gid(i+1,j+1,k);
7223 mat[nelems] = sten(i,j,k,
ist_pp0);
7227 if (gid(i-1,j-1,k+1) < gidmax) {
7228 cols[nelems] = gid(i-1,j-1,k+1);
7229 mat[nelems] = sten(i-1,j-1,k,
ist_ppp);
7233 if (gid(i,j-1,k+1) < gidmax) {
7234 cols[nelems] = gid(i,j-1,k+1);
7235 mat[nelems] = sten(i,j-1,k,
ist_0pp);
7239 if (gid(i+1,j-1,k+1) < gidmax) {
7240 cols[nelems] = gid(i+1,j-1,k+1);
7241 mat[nelems] = sten(i,j-1,k,
ist_ppp);
7245 if (gid(i-1,j,k+1) < gidmax) {
7246 cols[nelems] = gid(i-1,j,k+1);
7247 mat[nelems] = sten(i-1,j,k,
ist_p0p);
7251 if (gid(i,j,k+1) < gidmax) {
7252 cols[nelems] = gid(i,j,k+1);
7253 mat[nelems] = sten(i,j,k,
ist_00p);
7257 if (gid(i+1,j,k+1) < gidmax) {
7258 cols[nelems] = gid(i+1,j,k+1);
7259 mat[nelems] = sten(i,j,k,
ist_p0p);
7263 if (gid(i-1,j+1,k+1) < gidmax) {
7264 cols[nelems] = gid(i-1,j+1,k+1);
7265 mat[nelems] = sten(i-1,j,k,
ist_ppp);
7269 if (gid(i,j+1,k+1) < gidmax) {
7270 cols[nelems] = gid(i,j+1,k+1);
7271 mat[nelems] = sten(i,j,k,
ist_0pp);
7275 if (gid(i+1,j+1,k+1) < gidmax) {
7276 cols[nelems] = gid(i+1,j+1,k+1);
7277 mat[nelems] = sten(i,j,k,
ist_ppp);
7281 ncols[lid(i,j,k)] = nelems - nelems_old;
7286 template <
typename HypreInt,
typename AtomicInt>
7287 void mlndlap_fillijmat_aa_cpu (
Box const& ndbx,
7288 Array4<AtomicInt const>
const& gid,
7289 Array4<int const>
const& lid,
7290 HypreInt* ncols, HypreInt* cols,
7292 Array4<Real const>
const& sig,
7293 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
7294 Box const& ccdom) noexcept
7296 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
7297 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
7298 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
7299 Real fxyz = facx + facy + facz;
7300 Real fmx2y2z = -facx + Real(2.0)*facy + Real(2.0)*facz;
7301 Real f2xmy2z = Real(2.0)*facx - facy + Real(2.0)*facz;
7302 Real f2x2ymz = Real(2.0)*facx + Real(2.0)*facy - facz;
7303 Real f4xm2ym2z = Real(4.0)*facx - Real(2.0)*facy - Real(2.0)*facz;
7304 Real fm2x4ym2z = -Real(2.0)*facx + Real(4.0)*facy - Real(2.0)*facz;
7305 Real fm2xm2y4z = -Real(2.0)*facx - Real(2.0)*facy + Real(4.0)*facz;
7310 HypreInt nelems = 0;
7313 if (lid(i,j,k) >= 0)
7315 HypreInt nelems_old = nelems;
7316 cols[nelems_old] = gid(i,j,k);
7320 if (nddom.contains(i-1,j-1,k-1)) {
7321 Real tmp = sig(i-1,j-1,k-1) * fxyz;
7323 if ( gid(i-1,j-1,k-1) < gidmax) {
7324 cols[nelems] = gid(i-1,j-1,k-1);
7330 if (nddom.contains(i,j-1,k-1)) {
7331 Real tmp = Real(0.);
7332 if (ccdom.contains(i-1,j-1,k-1)) {
7333 tmp += sig(i-1,j-1,k-1) * fmx2y2z;
7335 if (ccdom.contains(i,j-1,k-1)) {
7336 tmp += sig(i,j-1,k-1) * fmx2y2z;
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 = sig(i ,j-1,k-1) * fxyz;
7349 if (gid(i+1,j-1,k-1) < gidmax) {
7350 cols[nelems] = gid(i+1,j-1,k-1);
7356 if (nddom.contains(i-1,j,k-1)) {
7357 Real tmp = Real(0.);
7358 if (ccdom.contains(i-1,j-1,k-1)) {
7359 tmp += sig(i-1,j-1,k-1) * f2xmy2z;
7361 if (ccdom.contains(i-1,j,k-1)) {
7362 tmp += sig(i-1,j,k-1) * f2xmy2z;
7365 if (gid(i-1,j,k-1) < gidmax) {
7366 cols[nelems] = gid(i-1,j,k-1);
7372 if (nddom.contains(i,j,k-1) && fm2xm2y4z != Real(0.0)) {
7373 Real tmp = Real(0.);
7374 if (ccdom.contains(i-1,j-1,k-1)) {
7375 tmp += sig(i-1,j-1,k-1) * fm2xm2y4z;
7377 if (ccdom.contains(i,j-1,k-1)) {
7378 tmp += sig(i,j-1,k-1) * fm2xm2y4z;
7380 if (ccdom.contains(i-1,j,k-1)) {
7381 tmp += sig(i-1,j,k-1) * fm2xm2y4z;
7383 if (ccdom.contains(i,j,k-1)) {
7384 tmp += sig(i,j,k-1) * fm2xm2y4z;
7387 if (gid(i,j,k-1) < gidmax) {
7388 cols[nelems] = gid(i,j,k-1);
7394 if (nddom.contains(i+1,j,k-1)) {
7395 Real tmp = Real(0.);
7396 if (ccdom.contains(i ,j-1,k-1)) {
7397 tmp += sig(i ,j-1,k-1) * f2xmy2z;
7399 if (ccdom.contains(i ,j,k-1)) {
7400 tmp += sig(i ,j,k-1) * f2xmy2z;
7403 if (gid(i+1,j,k-1) < gidmax) {
7404 cols[nelems] = gid(i+1,j,k-1);
7410 if (nddom.contains(i-1,j+1,k-1)) {
7411 Real tmp = sig(i-1,j ,k-1) * fxyz;
7413 if (gid(i-1,j+1,k-1) < gidmax) {
7414 cols[nelems] = gid(i-1,j+1,k-1);
7420 if (nddom.contains(i,j+1,k-1)) {
7421 Real tmp = Real(0.);
7422 if (ccdom.contains(i-1,j ,k-1)) {
7423 tmp += sig(i-1,j ,k-1) * fmx2y2z;
7425 if (ccdom.contains(i,j ,k-1)) {
7426 tmp += sig(i,j ,k-1) * fmx2y2z;
7429 if (gid(i,j+1,k-1) < gidmax) {
7430 cols[nelems] = gid(i,j+1,k-1);
7436 if (nddom.contains(i+1,j+1,k-1)) {
7437 Real tmp = sig(i ,j ,k-1) * fxyz;
7439 if (gid(i+1,j+1,k-1) < gidmax) {
7440 cols[nelems] = gid(i+1,j+1,k-1);
7446 if (nddom.contains(i-1,j-1,k)) {
7447 Real tmp = Real(0.);
7448 if (ccdom.contains(i-1,j-1,k-1)) {
7449 tmp += sig(i-1,j-1,k-1) * f2x2ymz;
7451 if (ccdom.contains(i-1,j-1,k)) {
7452 tmp += sig(i-1,j-1,k) * f2x2ymz;
7455 if (gid(i-1,j-1,k) < gidmax) {
7456 cols[nelems] = gid(i-1,j-1,k);
7462 if (nddom.contains(i,j-1,k) && fm2x4ym2z != Real(0.0)) {
7463 Real tmp = Real(0.);
7464 if (ccdom.contains(i-1,j-1,k-1)) {
7465 tmp += sig(i-1,j-1,k-1) * fm2x4ym2z;
7467 if (ccdom.contains(i,j-1,k-1)) {
7468 tmp += sig(i,j-1,k-1) * fm2x4ym2z;
7470 if (ccdom.contains(i-1,j-1,k)) {
7471 tmp += sig(i-1,j-1,k) * fm2x4ym2z;
7473 if (ccdom.contains(i,j-1,k)) {
7474 tmp += sig(i,j-1,k) * fm2x4ym2z;
7477 if (gid(i,j-1,k) < gidmax) {
7478 cols[nelems] = gid(i,j-1,k);
7484 if (nddom.contains(i+1,j-1,k)) {
7485 Real tmp = Real(0.);
7486 if (ccdom.contains(i ,j-1,k-1)) {
7487 tmp += sig(i ,j-1,k-1) * f2x2ymz;
7489 if (ccdom.contains(i ,j-1,k)) {
7490 tmp += sig(i ,j-1,k) * f2x2ymz;
7493 if (gid(i+1,j-1,k) < gidmax) {
7494 cols[nelems] = gid(i+1,j-1,k);
7500 if (nddom.contains(i-1,j,k) && f4xm2ym2z != Real(0.0)) {
7501 Real tmp = Real(0.);
7502 if (ccdom.contains(i-1,j-1,k-1)) {
7503 tmp += sig(i-1,j-1,k-1) * f4xm2ym2z;
7505 if (ccdom.contains(i-1,j,k-1)) {
7506 tmp += sig(i-1,j,k-1) * f4xm2ym2z;
7508 if (ccdom.contains(i-1,j-1,k)) {
7509 tmp += sig(i-1,j-1,k) * f4xm2ym2z;
7511 if (ccdom.contains(i-1,j,k)) {
7512 tmp += sig(i-1,j,k) * f4xm2ym2z;
7515 if (gid(i-1,j,k) < gidmax) {
7516 cols[nelems] = gid(i-1,j,k);
7522 if (nddom.contains(i+1,j,k) && f4xm2ym2z != Real(0.0)) {
7523 Real tmp = Real(0.);
7524 if (ccdom.contains(i ,j-1,k-1)) {
7525 tmp += sig(i ,j-1,k-1) * f4xm2ym2z;
7527 if (ccdom.contains(i ,j,k-1)) {
7528 tmp += sig(i ,j,k-1) * f4xm2ym2z;
7530 if (ccdom.contains(i ,j-1,k)) {
7531 tmp += sig(i ,j-1,k) * f4xm2ym2z;
7533 if (ccdom.contains(i ,j,k)) {
7534 tmp += sig(i ,j,k) * f4xm2ym2z;
7537 if (gid(i+1,j,k) < gidmax) {
7538 cols[nelems] = gid(i+1,j,k);
7544 if (nddom.contains(i-1,j+1,k)) {
7545 Real tmp = Real(0.);
7546 if (ccdom.contains(i-1,j ,k-1)) {
7547 tmp += sig(i-1,j ,k-1) * f2x2ymz;
7549 if (ccdom.contains(i-1,j ,k)) {
7550 tmp += sig(i-1,j ,k) * f2x2ymz;
7553 if (gid(i-1,j+1,k) < gidmax) {
7554 cols[nelems] = gid(i-1,j+1,k);
7560 if (nddom.contains(i,j+1,k) && fm2x4ym2z != Real(0.0)) {
7561 Real tmp = Real(0.);
7562 if (ccdom.contains(i-1,j ,k-1)) {
7563 tmp += sig(i-1,j ,k-1) * fm2x4ym2z;
7565 if (ccdom.contains(i,j ,k-1)) {
7566 tmp += sig(i,j ,k-1) * fm2x4ym2z;
7568 if (ccdom.contains(i-1,j ,k)) {
7569 tmp += sig(i-1,j ,k) * fm2x4ym2z;
7571 if (ccdom.contains(i,j ,k)) {
7572 tmp += sig(i,j ,k) * fm2x4ym2z;
7575 if (gid(i,j+1,k) < gidmax) {
7576 cols[nelems] = gid(i,j+1,k);
7582 if (nddom.contains(i+1,j+1,k)) {
7583 Real tmp = Real(0.);
7584 if (ccdom.contains(i ,j ,k-1)) {
7585 tmp += sig(i ,j ,k-1) * f2x2ymz;
7587 if (ccdom.contains(i ,j ,k)) {
7588 tmp += sig(i ,j ,k) * f2x2ymz;
7591 if (gid(i+1,j+1,k) < gidmax) {
7592 cols[nelems] = gid(i+1,j+1,k);
7598 if (nddom.contains(i-1,j-1,k+1)) {
7599 Real tmp = sig(i-1,j-1,k ) * fxyz;
7601 if (gid(i-1,j-1,k+1) < gidmax) {
7602 cols[nelems] = gid(i-1,j-1,k+1);
7608 if (nddom.contains(i,j-1,k+1)) {
7609 Real tmp = Real(0.);
7610 if (ccdom.contains(i-1,j-1,k )) {
7611 tmp += sig(i-1,j-1,k ) * fmx2y2z;
7613 if (ccdom.contains(i,j-1,k )) {
7614 tmp += sig(i,j-1,k ) * fmx2y2z;
7617 if (gid(i,j-1,k+1) < gidmax) {
7618 cols[nelems] = gid(i,j-1,k+1);
7624 if (nddom.contains(i+1,j-1,k+1)) {
7625 Real tmp = sig(i ,j-1,k ) * fxyz;
7627 if (gid(i+1,j-1,k+1) < gidmax) {
7628 cols[nelems] = gid(i+1,j-1,k+1);
7634 if (nddom.contains(i-1,j,k+1)) {
7635 Real tmp = Real(0.);
7636 if (ccdom.contains(i-1,j-1,k )) {
7637 tmp += sig(i-1,j-1,k ) * f2xmy2z;
7639 if (ccdom.contains(i-1,j,k )) {
7640 tmp += sig(i-1,j,k ) * f2xmy2z;
7643 if (gid(i-1,j,k+1) < gidmax) {
7644 cols[nelems] = gid(i-1,j,k+1);
7650 if (nddom.contains(i,j,k+1) && fm2xm2y4z != Real(0.0)) {
7651 Real tmp = Real(0.);
7652 if (ccdom.contains(i-1,j-1,k )) {
7653 tmp += sig(i-1,j-1,k ) * fm2xm2y4z;
7655 if (ccdom.contains(i,j-1,k )) {
7656 tmp += sig(i,j-1,k ) * fm2xm2y4z;
7658 if (ccdom.contains(i-1,j,k )) {
7659 tmp += sig(i-1,j,k ) * fm2xm2y4z;
7661 if (ccdom.contains(i,j,k )) {
7662 tmp += sig(i,j,k ) * fm2xm2y4z;
7665 if (gid(i,j,k+1) < gidmax) {
7666 cols[nelems] = gid(i,j,k+1);
7672 if (nddom.contains(i+1,j,k+1)) {
7673 Real tmp = Real(0.);
7674 if (ccdom.contains(i ,j-1,k )) {
7675 tmp += sig(i ,j-1,k ) * f2xmy2z;
7677 if (ccdom.contains(i ,j,k )) {
7678 tmp += sig(i ,j,k ) * f2xmy2z;
7681 if (gid(i+1,j,k+1) < gidmax) {
7682 cols[nelems] = gid(i+1,j,k+1);
7688 if (nddom.contains(i-1,j+1,k+1)) {
7689 Real tmp = sig(i-1,j ,k ) * fxyz;
7691 if (gid(i-1,j+1,k+1) < gidmax) {
7692 cols[nelems] = gid(i-1,j+1,k+1);
7698 if (nddom.contains(i,j+1,k+1)) {
7699 Real tmp = Real(0.);
7700 if (ccdom.contains(i-1,j ,k )) {
7701 tmp += sig(i-1,j ,k ) * fmx2y2z;
7703 if (ccdom.contains(i,j ,k )) {
7704 tmp += sig(i,j ,k ) * fmx2y2z;
7707 if (gid(i,j+1,k+1) < gidmax) {
7708 cols[nelems] = gid(i,j+1,k+1);
7714 if (nddom.contains(i+1,j+1,k+1)) {
7715 Real tmp = sig(i ,j ,k ) * fxyz;
7717 if (gid(i+1,j+1,k+1) < gidmax) {
7718 cols[nelems] = gid(i+1,j+1,k+1);
7724 mat[nelems_old] = m0;
7725 ncols[lid(i,j,k)] = nelems - nelems_old;
7730 template <
typename HypreInt,
typename AtomicInt>
7731 void mlndlap_fillijmat_ha_cpu (
Box const& ndbx,
7732 Array4<AtomicInt const>
const& gid,
7733 Array4<int const>
const& lid,
7734 HypreInt* ncols, HypreInt* cols,
7736 Array4<Real const>
const& sx,
7737 Array4<Real const>
const& sy,
7738 Array4<Real const>
const& sz,
7739 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
7740 Box const& ccdom) noexcept
7742 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
7743 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
7744 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
7749 HypreInt nelems = 0;
7752 if (lid(i,j,k) >= 0)
7754 HypreInt nelems_old = nelems;
7755 cols[nelems_old] = gid(i,j,k);
7759 if (nddom.contains(i-1,j-1,k-1)) {
7760 Real tmp = sx(i-1,j-1,k-1) * facx
7761 + sy(i-1,j-1,k-1) * facy
7762 + sz(i-1,j-1,k-1) * facz;
7764 if ( gid(i-1,j-1,k-1) < gidmax) {
7765 cols[nelems] = gid(i-1,j-1,k-1);
7771 if (nddom.contains(i,j-1,k-1)) {
7772 Real tmp = Real(0.);
7773 if (ccdom.contains(i-1,j-1,k-1)) {
7774 tmp += - sx(i-1,j-1,k-1) * facx
7775 + sy(i-1,j-1,k-1) * facy * Real(2.0)
7776 + sz(i-1,j-1,k-1) * facz * Real(2.0);
7778 if (ccdom.contains(i,j-1,k-1)) {
7779 tmp += - sx(i,j-1,k-1) * facx
7780 + sy(i,j-1,k-1) * facy * Real(2.0)
7781 + sz(i,j-1,k-1) * facz * Real(2.0);
7784 if (gid(i,j-1,k-1) < gidmax) {
7785 cols[nelems] = gid(i,j-1,k-1);
7791 if (nddom.contains(i+1,j-1,k-1)) {
7792 Real tmp = sx(i ,j-1,k-1) * facx
7793 + sy(i ,j-1,k-1) * facy
7794 + sz(i ,j-1,k-1) * facz;
7796 if (gid(i+1,j-1,k-1) < gidmax) {
7797 cols[nelems] = gid(i+1,j-1,k-1);
7803 if (nddom.contains(i-1,j,k-1)) {
7804 Real tmp = Real(0.);
7805 if (ccdom.contains(i-1,j-1,k-1)) {
7806 tmp += sx(i-1,j-1,k-1) * facx * Real(2.0)
7807 - sy(i-1,j-1,k-1) * facy
7808 + sz(i-1,j-1,k-1) * facz * Real(2.0);
7810 if (ccdom.contains(i-1,j,k-1)) {
7811 tmp += sx(i-1,j,k-1) * facx * Real(2.0)
7812 - sy(i-1,j,k-1) * facy
7813 + sz(i-1,j,k-1) * facz * Real(2.0);
7816 if (gid(i-1,j,k-1) < gidmax) {
7817 cols[nelems] = gid(i-1,j,k-1);
7823 if (nddom.contains(i,j,k-1)) {
7824 Real tmp = Real(0.);
7825 if (ccdom.contains(i-1,j-1,k-1)) {
7826 tmp += - sx(i-1,j-1,k-1) * facx * Real(2.0)
7827 - sy(i-1,j-1,k-1) * facy * Real(2.0)
7828 + sz(i-1,j-1,k-1) * facz * Real(4.0);
7830 if (ccdom.contains(i,j-1,k-1)) {
7831 tmp += - sx(i,j-1,k-1) * facx * Real(2.0)
7832 - sy(i,j-1,k-1) * facy * Real(2.0)
7833 + sz(i,j-1,k-1) * facz * Real(4.0);
7836 if (ccdom.contains(i-1,j,k-1)) {
7837 tmp += - sx(i-1,j,k-1) * facx * Real(2.0)
7838 - sy(i-1,j,k-1) * facy * Real(2.0)
7839 + sz(i-1,j,k-1) * facz * Real(4.0);
7841 if (ccdom.contains(i,j,k-1)) {
7842 tmp += - sx(i,j,k-1) * facx * Real(2.0)
7843 - sy(i,j,k-1) * facy * Real(2.0)
7844 + sz(i,j,k-1) * facz * Real(4.0);
7847 if (gid(i,j,k-1) < gidmax && tmp != Real(0.0)) {
7848 cols[nelems] = gid(i,j,k-1);
7854 if (nddom.contains(i+1,j,k-1)) {
7855 Real tmp = Real(0.);
7856 if (ccdom.contains(i ,j-1,k-1)) {
7857 tmp += sx(i ,j-1,k-1) * facx * Real(2.0)
7858 - sy(i ,j-1,k-1) * facy
7859 + sz(i ,j-1,k-1) * facz * Real(2.0);
7861 if (ccdom.contains(i ,j,k-1)) {
7862 tmp += sx(i ,j,k-1) * facx * Real(2.0)
7863 - sy(i ,j,k-1) * facy
7864 + sz(i ,j,k-1) * facz * Real(2.0);
7867 if (gid(i+1,j,k-1) < gidmax) {
7868 cols[nelems] = gid(i+1,j,k-1);
7874 if (nddom.contains(i-1,j+1,k-1)) {
7875 Real tmp = sx(i-1,j ,k-1) * facx
7876 + sy(i-1,j ,k-1) * facy
7877 + sz(i-1,j ,k-1) * facz;
7879 if (gid(i-1,j+1,k-1) < gidmax) {
7880 cols[nelems] = gid(i-1,j+1,k-1);
7886 if (nddom.contains(i,j+1,k-1)) {
7887 Real tmp = Real(0.);
7888 if (ccdom.contains(i-1,j ,k-1)) {
7889 tmp += - sx(i-1,j ,k-1) * facx
7890 + sy(i-1,j ,k-1) * facy * Real(2.0)
7891 + sz(i-1,j ,k-1) * facz * Real(2.0);
7893 if (ccdom.contains(i,j ,k-1)) {
7894 tmp += - sx(i,j ,k-1) * facx
7895 + sy(i,j ,k-1) * facy * Real(2.0)
7896 + sz(i,j ,k-1) * facz * Real(2.0);
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)) {
7907 Real tmp = sx(i ,j ,k-1) * facx
7908 + sy(i ,j ,k-1) * facy
7909 + sz(i ,j ,k-1) * facz;
7911 if (gid(i+1,j+1,k-1) < gidmax) {
7912 cols[nelems] = gid(i+1,j+1,k-1);
7918 if (nddom.contains(i-1,j-1,k)) {
7919 Real tmp = Real(0.);
7920 if (ccdom.contains(i-1,j-1,k-1)) {
7921 tmp += sx(i-1,j-1,k-1) * facx * Real(2.0)
7922 + sy(i-1,j-1,k-1) * facy * Real(2.0)
7923 - sz(i-1,j-1,k-1) * facz;
7925 if (ccdom.contains(i-1,j-1,k)) {
7926 tmp += sx(i-1,j-1,k) * facx * Real(2.0)
7927 + sy(i-1,j-1,k) * facy * Real(2.0)
7928 - sz(i-1,j-1,k) * facz;
7931 if (gid(i-1,j-1,k) < gidmax) {
7932 cols[nelems] = gid(i-1,j-1,k);
7938 if (nddom.contains(i,j-1,k)) {
7939 Real tmp = Real(0.);
7940 if (ccdom.contains(i-1,j-1,k-1)) {
7941 tmp += - sx(i-1,j-1,k-1) * facx * Real(2.0)
7942 + sy(i-1,j-1,k-1) * facy * Real(4.0)
7943 - sz(i-1,j-1,k-1) * facz * Real(2.0);
7945 if (ccdom.contains(i,j-1,k-1)) {
7946 tmp += - sx(i,j-1,k-1) * facx * Real(2.0)
7947 + sy(i,j-1,k-1) * facy * Real(4.0)
7948 - sz(i,j-1,k-1) * facz * Real(2.0);
7950 if (ccdom.contains(i-1,j-1,k)) {
7951 tmp += - sx(i-1,j-1,k) * facx * Real(2.0)
7952 + sy(i-1,j-1,k) * facy * Real(4.0)
7953 - sz(i-1,j-1,k) * facz * Real(2.0);
7955 if (ccdom.contains(i,j-1,k)) {
7956 tmp += - sx(i,j-1,k) * facx * Real(2.0)
7957 + sy(i,j-1,k) * facy * Real(4.0)
7958 - sz(i,j-1,k) * facz * Real(2.0);
7961 if (gid(i,j-1,k) < gidmax && tmp != Real(0.0)) {
7962 cols[nelems] = gid(i,j-1,k);
7968 if (nddom.contains(i+1,j-1,k)) {
7969 Real tmp = Real(0.);
7970 if (ccdom.contains(i ,j-1,k-1)) {
7971 tmp += sx(i ,j-1,k-1) * facx * Real(2.0)
7972 + sy(i ,j-1,k-1) * facy * Real(2.0)
7973 - sz(i ,j-1,k-1) * facz;
7975 if (ccdom.contains(i ,j-1,k)) {
7976 tmp += sx(i ,j-1,k) * facx * Real(2.0)
7977 + sy(i ,j-1,k) * facy * Real(2.0)
7978 - sz(i ,j-1,k) * facz;
7981 if (gid(i+1,j-1,k) < gidmax) {
7982 cols[nelems] = gid(i+1,j-1,k);
7988 if (nddom.contains(i-1,j,k)) {
7989 Real tmp = Real(0.);
7990 if (ccdom.contains(i-1,j-1,k-1)) {
7991 tmp += sx(i-1,j-1,k-1) * facx * Real(4.0)
7992 - sy(i-1,j-1,k-1) * facy * Real(2.0)
7993 - sz(i-1,j-1,k-1) * facz * Real(2.0);
7995 if (ccdom.contains(i-1,j,k-1)) {
7996 tmp += sx(i-1,j,k-1) * facx * Real(4.0)
7997 - sy(i-1,j,k-1) * facy * Real(2.0)
7998 - sz(i-1,j,k-1) * facz * Real(2.0);
8000 if (ccdom.contains(i-1,j-1,k)) {
8001 tmp += sx(i-1,j-1,k) * facx * Real(4.0)
8002 - sy(i-1,j-1,k) * facy * Real(2.0)
8003 - sz(i-1,j-1,k) * facz * Real(2.0);
8005 if (ccdom.contains(i-1,j,k)) {
8006 tmp += sx(i-1,j,k) * facx * Real(4.0)
8007 - sy(i-1,j,k) * facy * Real(2.0)
8008 - sz(i-1,j,k) * facz * Real(2.0);
8011 if (gid(i-1,j,k) < gidmax && tmp != Real(0.0)) {
8012 cols[nelems] = gid(i-1,j,k);
8018 if (nddom.contains(i+1,j,k)) {
8019 Real tmp = Real(0.);
8020 if (ccdom.contains(i ,j-1,k-1)) {
8021 tmp += sx(i ,j-1,k-1) * facx * Real(4.0)
8022 - sy(i ,j-1,k-1) * facy * Real(2.0)
8023 - sz(i ,j-1,k-1) * facz * Real(2.0);
8025 if (ccdom.contains(i ,j,k-1)) {
8026 tmp += sx(i ,j,k-1) * facx * Real(4.0)
8027 - sy(i ,j,k-1) * facy * Real(2.0)
8028 - sz(i ,j,k-1) * facz * Real(2.0);
8030 if (ccdom.contains(i ,j-1,k)) {
8031 tmp += sx(i ,j-1,k) * facx * Real(4.0)
8032 - sy(i ,j-1,k) * facy * Real(2.0)
8033 - sz(i ,j-1,k) * facz * Real(2.0);
8035 if (ccdom.contains(i ,j,k)) {
8036 tmp += sx(i ,j,k) * facx * Real(4.0)
8037 - sy(i ,j,k) * facy * Real(2.0)
8038 - sz(i ,j,k) * facz * Real(2.0);
8041 if (gid(i+1,j,k) < gidmax && tmp != Real(0.0)) {
8042 cols[nelems] = gid(i+1,j,k);
8048 if (nddom.contains(i-1,j+1,k)) {
8049 Real tmp = Real(0.);
8050 if (ccdom.contains(i-1,j ,k-1)) {
8051 tmp += sx(i-1,j ,k-1) * facx * Real(2.0)
8052 + sy(i-1,j ,k-1) * facy * Real(2.0)
8053 - sz(i-1,j ,k-1) * facz;
8055 if (ccdom.contains(i-1,j ,k)) {
8056 tmp += sx(i-1,j ,k) * facx * Real(2.0)
8057 + sy(i-1,j ,k) * facy * Real(2.0)
8058 - sz(i-1,j ,k) * facz;
8061 if (gid(i-1,j+1,k) < gidmax) {
8062 cols[nelems] = gid(i-1,j+1,k);
8068 if (nddom.contains(i,j+1,k)) {
8069 Real tmp = Real(0.);
8070 if (ccdom.contains(i-1,j ,k-1)) {
8071 tmp += - sx(i-1,j ,k-1) * facx * Real(2.0)
8072 + sy(i-1,j ,k-1) * facy * Real(4.0)
8073 - sz(i-1,j ,k-1) * facz * Real(2.0);
8075 if (ccdom.contains(i,j ,k-1)) {
8076 tmp += - sx(i,j ,k-1) * facx * Real(2.0)
8077 + sy(i,j ,k-1) * facy * Real(4.0)
8078 - sz(i,j ,k-1) * facz * Real(2.0);
8080 if (ccdom.contains(i-1,j ,k)) {
8081 tmp += - sx(i-1,j ,k) * facx * Real(2.0)
8082 + sy(i-1,j ,k) * facy * Real(4.0)
8083 - sz(i-1,j ,k) * facz * Real(2.0);
8085 if (ccdom.contains(i,j ,k)) {
8086 tmp += - sx(i,j ,k) * facx * Real(2.0)
8087 + sy(i,j ,k) * facy * Real(4.0)
8088 - sz(i,j ,k) * facz * Real(2.0);
8091 if (gid(i,j+1,k) < gidmax && tmp != Real(0.0)) {
8092 cols[nelems] = gid(i,j+1,k);
8098 if (nddom.contains(i+1,j+1,k)) {
8099 Real tmp = Real(0.);
8100 if (ccdom.contains(i ,j ,k-1)) {
8101 tmp += sx(i ,j ,k-1) * facx * Real(2.0)
8102 + sy(i ,j ,k-1) * facy * Real(2.0)
8103 - sz(i ,j ,k-1) * facz;
8105 if (ccdom.contains(i ,j ,k)) {
8106 tmp += sx(i ,j ,k) * facx * Real(2.0)
8107 + sy(i ,j ,k) * facy * Real(2.0)
8108 - sz(i ,j ,k) * facz;
8111 if (gid(i+1,j+1,k) < gidmax) {
8112 cols[nelems] = gid(i+1,j+1,k);
8118 if (nddom.contains(i-1,j-1,k+1)) {
8119 Real tmp = sx(i-1,j-1,k ) * facx
8120 + sy(i-1,j-1,k ) * facy
8121 + sz(i-1,j-1,k ) * facz;
8123 if (gid(i-1,j-1,k+1) < gidmax) {
8124 cols[nelems] = gid(i-1,j-1,k+1);
8130 if (nddom.contains(i,j-1,k+1)) {
8131 Real tmp = Real(0.);
8132 if (ccdom.contains(i-1,j-1,k )) {
8133 tmp += - sx(i-1,j-1,k ) * facx
8134 + sy(i-1,j-1,k ) * facy * Real(2.0)
8135 + sz(i-1,j-1,k ) * facz * Real(2.0);
8137 if (ccdom.contains(i,j-1,k )) {
8138 tmp += - sx(i,j-1,k ) * facx
8139 + sy(i,j-1,k ) * facy * Real(2.0)
8140 + sz(i,j-1,k ) * facz * Real(2.0);
8143 if (gid(i,j-1,k+1) < gidmax) {
8144 cols[nelems] = gid(i,j-1,k+1);
8150 if (nddom.contains(i+1,j-1,k+1)) {
8151 Real tmp = sx(i ,j-1,k ) * facx
8152 + sy(i ,j-1,k ) * facy
8153 + sz(i ,j-1,k ) * facz;
8155 if (gid(i+1,j-1,k+1) < gidmax) {
8156 cols[nelems] = gid(i+1,j-1,k+1);
8162 if (nddom.contains(i-1,j,k+1)) {
8163 Real tmp = Real(0.);
8164 if (ccdom.contains(i-1,j-1,k )) {
8165 tmp += sx(i-1,j-1,k ) * facx * Real(2.0)
8166 - sy(i-1,j-1,k ) * facy
8167 + sz(i-1,j-1,k ) * facz * Real(2.0);
8169 if (ccdom.contains(i-1,j,k )) {
8170 tmp += sx(i-1,j,k ) * facx * Real(2.0)
8171 - sy(i-1,j,k ) * facy
8172 + sz(i-1,j,k ) * facz * Real(2.0);
8175 if (gid(i-1,j,k+1) < gidmax) {
8176 cols[nelems] = gid(i-1,j,k+1);
8182 if (nddom.contains(i,j,k+1)) {
8183 Real tmp = Real(0.);
8184 if (ccdom.contains(i-1,j-1,k )) {
8185 tmp += - sx(i-1,j-1,k ) * facx * Real(2.0)
8186 - sy(i-1,j-1,k ) * facy * Real(2.0)
8187 + sz(i-1,j-1,k ) * facz * Real(4.0);
8189 if (ccdom.contains(i,j-1,k )) {
8190 tmp += - sx(i,j-1,k ) * facx * Real(2.0)
8191 - sy(i,j-1,k ) * facy * Real(2.0)
8192 + sz(i,j-1,k ) * facz * Real(4.0);
8194 if (ccdom.contains(i-1,j,k )) {
8195 tmp += - sx(i-1,j,k ) * facx * Real(2.0)
8196 - sy(i-1,j,k ) * facy * Real(2.0)
8197 + sz(i-1,j,k ) * facz * Real(4.0);
8199 if (ccdom.contains(i,j,k )) {
8200 tmp += - sx(i,j,k ) * facx * Real(2.0)
8201 - sy(i,j,k ) * facy * Real(2.0)
8202 + sz(i,j,k ) * facz * Real(4.0);
8205 if (gid(i,j,k+1) < gidmax && tmp != Real(0.0)) {
8206 cols[nelems] = gid(i,j,k+1);
8212 if (nddom.contains(i+1,j,k+1)) {
8213 Real tmp = Real(0.);
8214 if (ccdom.contains(i ,j-1,k )) {
8215 tmp += sx(i ,j-1,k ) * facx * Real(2.0)
8216 - sy(i ,j-1,k ) * facy
8217 + sz(i ,j-1,k ) * facz * Real(2.0);
8219 if (ccdom.contains(i ,j,k )) {
8220 tmp += sx(i ,j,k ) * facx * Real(2.0)
8221 - sy(i ,j,k ) * facy
8222 + sz(i ,j,k ) * facz * Real(2.0);
8225 if (gid(i+1,j,k+1) < gidmax) {
8226 cols[nelems] = gid(i+1,j,k+1);
8232 if (nddom.contains(i-1,j+1,k+1)) {
8233 Real tmp = sx(i-1,j ,k ) * facx
8234 + sy(i-1,j ,k ) * facy
8235 + sz(i-1,j ,k ) * facz;
8237 if (gid(i-1,j+1,k+1) < gidmax) {
8238 cols[nelems] = gid(i-1,j+1,k+1);
8244 if (nddom.contains(i,j+1,k+1)) {
8245 Real tmp = Real(0.);
8246 if (ccdom.contains(i-1,j ,k )) {
8247 tmp += - sx(i-1,j ,k ) * facx
8248 + sy(i-1,j ,k ) * facy * Real(2.0)
8249 + sz(i-1,j ,k ) * facz * Real(2.0);
8251 if (ccdom.contains(i,j ,k )) {
8252 tmp += - sx(i,j ,k ) * facx
8253 + sy(i,j ,k ) * facy * Real(2.0)
8254 + sz(i,j ,k ) * facz * Real(2.0);
8257 if (gid(i,j+1,k+1) < gidmax) {
8258 cols[nelems] = gid(i,j+1,k+1);
8264 if (nddom.contains(i+1,j+1,k+1)) {
8265 Real tmp = sx(i ,j ,k ) * facx
8266 + sy(i ,j ,k ) * facy
8267 + sz(i ,j ,k ) * facz;
8269 if (gid(i+1,j+1,k+1) < gidmax) {
8270 cols[nelems] = gid(i+1,j+1,k+1);
8276 mat[nelems_old] = m0;
8277 ncols[lid(i,j,k)] = nelems - nelems_old;
8282 template <
typename HypreInt,
typename AtomicInt>
8283 void mlndlap_fillijmat_cs_cpu (
Box const& ndbx,
8284 Array4<AtomicInt const>
const& gid,
8285 Array4<int const>
const& lid,
8286 HypreInt* ncols, HypreInt* cols,
8289 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
8290 Box const& ccdom) noexcept
8292 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0] * sigma;
8293 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1] * sigma;
8294 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2] * sigma;
8295 Real fxyz = facx + facy + facz;
8296 Real fmx2y2z = -facx + Real(2.0)*facy + Real(2.0)*facz;
8297 Real f2xmy2z = Real(2.0)*facx - facy + Real(2.0)*facz;
8298 Real f2x2ymz = Real(2.0)*facx + Real(2.0)*facy - facz;
8299 Real f4xm2ym2z = Real(4.0)*facx - Real(2.0)*facy - Real(2.0)*facz;
8300 Real fm2x4ym2z = -Real(2.0)*facx + Real(4.0)*facy - Real(2.0)*facz;
8301 Real fm2xm2y4z = -Real(2.0)*facx - Real(2.0)*facy + Real(4.0)*facz;
8306 HypreInt nelems = 0;
8309 if (lid(i,j,k) >= 0)
8311 HypreInt nelems_old = nelems;
8312 cols[nelems_old] = gid(i,j,k);
8316 if (nddom.contains(i-1,j-1,k-1)) {
8319 if ( gid(i-1,j-1,k-1) < gidmax) {
8320 cols[nelems] = gid(i-1,j-1,k-1);
8326 if (nddom.contains(i,j-1,k-1)) {
8327 Real tmp = Real(0.);
8328 if (ccdom.contains(i-1,j-1,k-1)) {
8331 if (ccdom.contains(i,j-1,k-1)) {
8335 if (gid(i,j-1,k-1) < gidmax) {
8336 cols[nelems] = gid(i,j-1,k-1);
8342 if (nddom.contains(i+1,j-1,k-1)) {
8345 if (gid(i+1,j-1,k-1) < gidmax) {
8346 cols[nelems] = gid(i+1,j-1,k-1);
8352 if (nddom.contains(i-1,j,k-1)) {
8353 Real tmp = Real(0.);
8354 if (ccdom.contains(i-1,j-1,k-1)) {
8357 if (ccdom.contains(i-1,j,k-1)) {
8361 if (gid(i-1,j,k-1) < gidmax) {
8362 cols[nelems] = gid(i-1,j,k-1);
8368 if (nddom.contains(i,j,k-1) && fm2xm2y4z != Real(0.0)) {
8369 Real tmp = Real(0.);
8370 if (ccdom.contains(i-1,j-1,k-1)) {
8373 if (ccdom.contains(i,j-1,k-1)) {
8376 if (ccdom.contains(i-1,j,k-1)) {
8379 if (ccdom.contains(i,j,k-1)) {
8383 if (gid(i,j,k-1) < gidmax) {
8384 cols[nelems] = gid(i,j,k-1);
8390 if (nddom.contains(i+1,j,k-1)) {
8391 Real tmp = Real(0.);
8392 if (ccdom.contains(i ,j-1,k-1)) {
8395 if (ccdom.contains(i ,j,k-1)) {
8399 if (gid(i+1,j,k-1) < gidmax) {
8400 cols[nelems] = gid(i+1,j,k-1);
8406 if (nddom.contains(i-1,j+1,k-1)) {
8409 if (gid(i-1,j+1,k-1) < gidmax) {
8410 cols[nelems] = gid(i-1,j+1,k-1);
8416 if (nddom.contains(i,j+1,k-1)) {
8417 Real tmp = Real(0.);
8418 if (ccdom.contains(i-1,j ,k-1)) {
8421 if (ccdom.contains(i,j ,k-1)) {
8425 if (gid(i,j+1,k-1) < gidmax) {
8426 cols[nelems] = gid(i,j+1,k-1);
8432 if (nddom.contains(i+1,j+1,k-1)) {
8435 if (gid(i+1,j+1,k-1) < gidmax) {
8436 cols[nelems] = gid(i+1,j+1,k-1);
8442 if (nddom.contains(i-1,j-1,k)) {
8443 Real tmp = Real(0.);
8444 if (ccdom.contains(i-1,j-1,k-1)) {
8447 if (ccdom.contains(i-1,j-1,k)) {
8451 if (gid(i-1,j-1,k) < gidmax) {
8452 cols[nelems] = gid(i-1,j-1,k);
8458 if (nddom.contains(i,j-1,k) && fm2x4ym2z != Real(0.0)) {
8459 Real tmp = Real(0.);
8460 if (ccdom.contains(i-1,j-1,k-1)) {
8463 if (ccdom.contains(i,j-1,k-1)) {
8466 if (ccdom.contains(i-1,j-1,k)) {
8469 if (ccdom.contains(i,j-1,k)) {
8473 if (gid(i,j-1,k) < gidmax) {
8474 cols[nelems] = gid(i,j-1,k);
8480 if (nddom.contains(i+1,j-1,k)) {
8481 Real tmp = Real(0.);
8482 if (ccdom.contains(i ,j-1,k-1)) {
8485 if (ccdom.contains(i ,j-1,k)) {
8489 if (gid(i+1,j-1,k) < gidmax) {
8490 cols[nelems] = gid(i+1,j-1,k);
8496 if (nddom.contains(i-1,j,k) && f4xm2ym2z != Real(0.0)) {
8497 Real tmp = Real(0.);
8498 if (ccdom.contains(i-1,j-1,k-1)) {
8501 if (ccdom.contains(i-1,j,k-1)) {
8504 if (ccdom.contains(i-1,j-1,k)) {
8507 if (ccdom.contains(i-1,j,k)) {
8511 if (gid(i-1,j,k) < gidmax) {
8512 cols[nelems] = gid(i-1,j,k);
8518 if (nddom.contains(i+1,j,k) && f4xm2ym2z != Real(0.0)) {
8519 Real tmp = Real(0.);
8520 if (ccdom.contains(i ,j-1,k-1)) {
8523 if (ccdom.contains(i ,j,k-1)) {
8526 if (ccdom.contains(i ,j-1,k)) {
8529 if (ccdom.contains(i ,j,k)) {
8533 if (gid(i+1,j,k) < gidmax) {
8534 cols[nelems] = gid(i+1,j,k);
8540 if (nddom.contains(i-1,j+1,k)) {
8541 Real tmp = Real(0.);
8542 if (ccdom.contains(i-1,j ,k-1)) {
8545 if (ccdom.contains(i-1,j ,k)) {
8549 if (gid(i-1,j+1,k) < gidmax) {
8550 cols[nelems] = gid(i-1,j+1,k);
8556 if (nddom.contains(i,j+1,k) && fm2x4ym2z != Real(0.0)) {
8557 Real tmp = Real(0.);
8558 if (ccdom.contains(i-1,j ,k-1)) {
8561 if (ccdom.contains(i,j ,k-1)) {
8564 if (ccdom.contains(i-1,j ,k)) {
8567 if (ccdom.contains(i,j ,k)) {
8571 if (gid(i,j+1,k) < gidmax) {
8572 cols[nelems] = gid(i,j+1,k);
8578 if (nddom.contains(i+1,j+1,k)) {
8579 Real tmp = Real(0.);
8580 if (ccdom.contains(i ,j ,k-1)) {
8583 if (ccdom.contains(i ,j ,k)) {
8587 if (gid(i+1,j+1,k) < gidmax) {
8588 cols[nelems] = gid(i+1,j+1,k);
8594 if (nddom.contains(i-1,j-1,k+1)) {
8597 if (gid(i-1,j-1,k+1) < gidmax) {
8598 cols[nelems] = gid(i-1,j-1,k+1);
8604 if (nddom.contains(i,j-1,k+1)) {
8605 Real tmp = Real(0.);
8606 if (ccdom.contains(i-1,j-1,k )) {
8609 if (ccdom.contains(i,j-1,k )) {
8613 if (gid(i,j-1,k+1) < gidmax) {
8614 cols[nelems] = gid(i,j-1,k+1);
8620 if (nddom.contains(i+1,j-1,k+1)) {
8623 if (gid(i+1,j-1,k+1) < gidmax) {
8624 cols[nelems] = gid(i+1,j-1,k+1);
8630 if (nddom.contains(i-1,j,k+1)) {
8631 Real tmp = Real(0.);
8632 if (ccdom.contains(i-1,j-1,k )) {
8635 if (ccdom.contains(i-1,j,k )) {
8639 if (gid(i-1,j,k+1) < gidmax) {
8640 cols[nelems] = gid(i-1,j,k+1);
8646 if (nddom.contains(i,j,k+1) && fm2xm2y4z != Real(0.0)) {
8647 Real tmp = Real(0.);
8648 if (ccdom.contains(i-1,j-1,k )) {
8651 if (ccdom.contains(i,j-1,k )) {
8654 if (ccdom.contains(i-1,j,k )) {
8657 if (ccdom.contains(i,j,k )) {
8661 if (gid(i,j,k+1) < gidmax) {
8662 cols[nelems] = gid(i,j,k+1);
8668 if (nddom.contains(i+1,j,k+1)) {
8669 Real tmp = Real(0.);
8670 if (ccdom.contains(i ,j-1,k )) {
8673 if (ccdom.contains(i ,j,k )) {
8677 if (gid(i+1,j,k+1) < gidmax) {
8678 cols[nelems] = gid(i+1,j,k+1);
8684 if (nddom.contains(i-1,j+1,k+1)) {
8687 if (gid(i-1,j+1,k+1) < gidmax) {
8688 cols[nelems] = gid(i-1,j+1,k+1);
8694 if (nddom.contains(i,j+1,k+1)) {
8695 Real tmp = Real(0.);
8696 if (ccdom.contains(i-1,j ,k )) {
8699 if (ccdom.contains(i,j ,k )) {
8703 if (gid(i,j+1,k+1) < gidmax) {
8704 cols[nelems] = gid(i,j+1,k+1);
8710 if (nddom.contains(i+1,j+1,k+1)) {
8713 if (gid(i+1,j+1,k+1) < gidmax) {
8714 cols[nelems] = gid(i+1,j+1,k+1);
8720 mat[nelems_old] = m0;
8721 ncols[lid(i,j,k)] = nelems - nelems_old;
8726 #ifdef AMREX_USE_GPU
8728 template <
typename HypreInt,
typename AtomicInt>
8730 void mlndlap_fillijmat_sten_gpu (
const int ps,
const int i,
const int j,
const int k,
8732 Array4<AtomicInt const>
const& gid,
8733 Array4<int const>
const& lid,
8734 HypreInt* ncols, HypreInt* cols,
8736 Array4<Real const>
const& sten) noexcept
8738 if (lid(i,j,k) >= 0)
8753 if (gid(i-1,j-1,k-1) < gidmax) {
8755 cols[ps] = gid(i-1,j-1,k-1);
8756 mat[ps] = sten(i-1,j-1,k-1,
ist_ppp);
8760 if (
offset != 0) {
return; }
8764 if (gid(i,j-1,k-1) < gidmax) {
8766 cols[ps] = gid(i,j-1,k-1);
8767 mat[ps] = sten(i,j-1,k-1,
ist_0pp);
8771 if (
offset != 0) {
return; }
8775 if (gid(i+1,j-1,k-1) < gidmax) {
8777 cols[ps] = gid(i+1,j-1,k-1);
8778 mat[ps] = sten(i,j-1,k-1,
ist_ppp);
8782 if (
offset != 0) {
return; }
8786 if (gid(i-1,j,k-1) < gidmax) {
8788 cols[ps] = gid(i-1,j,k-1);
8789 mat[ps] = sten(i-1,j,k-1,
ist_p0p);
8793 if (
offset != 0) {
return; }
8797 if (gid(i,j,k-1) < gidmax) {
8799 cols[ps] = gid(i,j,k-1);
8800 mat[ps] = sten(i,j,k-1,
ist_00p);
8804 if (
offset != 0) {
return; }
8808 if (gid(i+1,j,k-1) < gidmax) {
8810 cols[ps] = gid(i+1,j,k-1);
8811 mat[ps] = sten(i,j,k-1,
ist_p0p);
8815 if (
offset != 0) {
return; }
8819 if (gid(i-1,j+1,k-1) < gidmax) {
8821 cols[ps] = gid(i-1,j+1,k-1);
8822 mat[ps] = sten(i-1,j,k-1,
ist_ppp);
8826 if (
offset != 0) {
return; }
8830 if (gid(i,j+1,k-1) < gidmax) {
8832 cols[ps] = gid(i,j+1,k-1);
8833 mat[ps] = sten(i,j,k-1,
ist_0pp);
8837 if (
offset != 0) {
return; }
8841 if (gid(i+1,j+1,k-1) < gidmax) {
8843 cols[ps] = gid(i+1,j+1,k-1);
8844 mat[ps] = sten(i,j,k-1,
ist_ppp);
8848 if (
offset != 0) {
return; }
8852 if (gid(i-1,j-1,k) < gidmax) {
8854 cols[ps] = gid(i-1,j-1,k);
8855 mat[ps] = sten(i-1,j-1,k,
ist_pp0);
8859 if (
offset != 0) {
return; }
8863 if (gid(i,j-1,k) < gidmax) {
8865 cols[ps] = gid(i,j-1,k);
8866 mat[ps] = sten(i,j-1,k,
ist_0p0);
8870 if (
offset != 0) {
return; }
8874 if (gid(i+1,j-1,k) < gidmax) {
8876 cols[ps] = gid(i+1,j-1,k);
8877 mat[ps] = sten(i,j-1,k,
ist_pp0);
8881 if (
offset != 0) {
return; }
8885 if (gid(i-1,j,k) < gidmax) {
8887 cols[ps] = gid(i-1,j,k);
8888 mat[ps] = sten(i-1,j,k,
ist_p00);
8892 if (
offset != 0) {
return; }
8896 if (gid(i+1,j,k) < gidmax) {
8898 cols[ps] = gid(i+1,j,k);
8899 mat[ps] = sten(i,j,k,
ist_p00);
8903 if (
offset != 0) {
return; }
8907 if (gid(i-1,j+1,k) < gidmax) {
8909 cols[ps] = gid(i-1,j+1,k);
8910 mat[ps] = sten(i-1,j,k,
ist_pp0);
8914 if (
offset != 0) {
return; }
8918 if (gid(i,j+1,k) < gidmax) {
8920 cols[ps] = gid(i,j+1,k);
8921 mat[ps] = sten(i,j,k,
ist_0p0);
8925 if (
offset != 0) {
return; }
8929 if (gid(i+1,j+1,k) < gidmax) {
8931 cols[ps] = gid(i+1,j+1,k);
8932 mat[ps] = sten(i,j,k,
ist_pp0);
8936 if (
offset != 0) {
return; }
8940 if (gid(i-1,j-1,k+1) < gidmax) {
8942 cols[ps] = gid(i-1,j-1,k+1);
8943 mat[ps] = sten(i-1,j-1,k,
ist_ppp);
8947 if (
offset != 0) {
return; }
8951 if (gid(i,j-1,k+1) < gidmax) {
8953 cols[ps] = gid(i,j-1,k+1);
8954 mat[ps] = sten(i,j-1,k,
ist_0pp);
8958 if (
offset != 0) {
return; }
8962 if (gid(i+1,j-1,k+1) < gidmax) {
8964 cols[ps] = gid(i+1,j-1,k+1);
8965 mat[ps] = sten(i,j-1,k,
ist_ppp);
8969 if (
offset != 0) {
return; }
8973 if (gid(i-1,j,k+1) < gidmax) {
8975 cols[ps] = gid(i-1,j,k+1);
8976 mat[ps] = sten(i-1,j,k,
ist_p0p);
8980 if (
offset != 0) {
return; }
8984 if (gid(i,j,k+1) < gidmax) {
8986 cols[ps] = gid(i,j,k+1);
8987 mat[ps] = sten(i,j,k,
ist_00p);
8991 if (
offset != 0) {
return; }
8995 if (gid(i+1,j,k+1) < gidmax) {
8997 cols[ps] = gid(i+1,j,k+1);
8998 mat[ps] = sten(i,j,k,
ist_p0p);
9002 if (
offset != 0) {
return; }
9006 if (gid(i-1,j+1,k+1) < gidmax) {
9008 cols[ps] = gid(i-1,j+1,k+1);
9009 mat[ps] = sten(i-1,j,k,
ist_ppp);
9013 if (
offset != 0) {
return; }
9017 if (gid(i,j+1,k+1) < gidmax) {
9019 cols[ps] = gid(i,j+1,k+1);
9020 mat[ps] = sten(i,j,k,
ist_0pp);
9024 if (
offset != 0) {
return; }
9028 if (gid(i+1,j+1,k+1) < gidmax) {
9030 cols[ps] = gid(i+1,j+1,k+1);
9031 mat[ps] = sten(i,j,k,
ist_ppp);
9035 if (
offset != 0) {
return; }
9039 cols[ps] = gid(i,j,k);
9040 mat[ps] = sten(i,j,k,
ist_000);
9041 ncols[lid(i,j,k)] = nelems+1;
9045 template <
typename HypreInt,
typename AtomicInt>
9047 void mlndlap_fillijmat_aa_gpu (
const int ps,
const int i,
const int j,
const int k,
9049 Box const& ndbx, Array4<AtomicInt const>
const& gid,
9050 Array4<int const>
const& lid,
9051 HypreInt* ncols, HypreInt* cols,
9053 Array4<Real const>
const& sig,
9054 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
9055 Box const& ccdom) noexcept
9057 if (lid(i,j,k) >= 0)
9059 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
9060 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
9061 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
9062 Real fxyz = facx + facy + facz;
9063 Real fmx2y2z = -facx + Real(2.0)*facy + Real(2.0)*facz;
9064 Real f2xmy2z = Real(2.0)*facx - facy + Real(2.0)*facz;
9065 Real f2x2ymz = Real(2.0)*facx + Real(2.0)*facy - facz;
9066 Real f4xm2ym2z = Real(4.0)*facx - Real(2.0)*facy - Real(2.0)*facz;
9067 Real fm2x4ym2z = -Real(2.0)*facx + Real(4.0)*facy - Real(2.0)*facz;
9068 Real fm2xm2y4z = -Real(2.0)*facx - Real(2.0)*facy + Real(4.0)*facz;
9077 if (nddom.contains(i-1,j-1,k-1)) {
9078 Real tmp = sig(i-1,j-1,k-1) * fxyz;
9080 if ( gid(i-1,j-1,k-1) < gidmax) {
9082 cols[ps] = gid(i-1,j-1,k-1);
9088 if (
offset != 0) {
return; }
9092 if (nddom.contains(i,j-1,k-1)) {
9093 Real tmp = Real(0.);
9094 if (ccdom.contains(i-1,j-1,k-1)) {
9095 tmp += sig(i-1,j-1,k-1) * fmx2y2z;
9097 if (ccdom.contains(i,j-1,k-1)) {
9098 tmp += sig(i,j-1,k-1) * fmx2y2z;
9101 if (gid(i,j-1,k-1) < gidmax) {
9103 cols[ps] = gid(i,j-1,k-1);
9109 if (
offset != 0) {
return; }
9113 if (nddom.contains(i+1,j-1,k-1)) {
9114 Real tmp = sig(i ,j-1,k-1) * fxyz;
9116 if (gid(i+1,j-1,k-1) < gidmax) {
9118 cols[ps] = gid(i+1,j-1,k-1);
9124 if (
offset != 0) {
return; }
9128 if (nddom.contains(i-1,j,k-1)) {
9129 Real tmp = Real(0.);
9130 if (ccdom.contains(i-1,j-1,k-1)) {
9131 tmp += sig(i-1,j-1,k-1) * f2xmy2z;
9133 if (ccdom.contains(i-1,j,k-1)) {
9134 tmp += sig(i-1,j,k-1) * f2xmy2z;
9137 if (gid(i-1,j,k-1) < gidmax) {
9139 cols[ps] = gid(i-1,j,k-1);
9145 if (
offset != 0) {
return; }
9149 if (nddom.contains(i,j,k-1)) {
9150 Real tmp = Real(0.);
9151 if (ccdom.contains(i-1,j-1,k-1)) {
9152 tmp += sig(i-1,j-1,k-1) * fm2xm2y4z;
9154 if (ccdom.contains(i,j-1,k-1)) {
9155 tmp += sig(i,j-1,k-1) * fm2xm2y4z;
9157 if (ccdom.contains(i-1,j,k-1)) {
9158 tmp += sig(i-1,j,k-1) * fm2xm2y4z;
9160 if (ccdom.contains(i,j,k-1)) {
9161 tmp += sig(i,j,k-1) * fm2xm2y4z;
9164 if (gid(i,j,k-1) < gidmax) {
9166 cols[ps] = gid(i,j,k-1);
9172 if (
offset != 0) {
return; }
9176 if (nddom.contains(i+1,j,k-1)) {
9177 Real tmp = Real(0.);
9178 if (ccdom.contains(i ,j-1,k-1)) {
9179 tmp += sig(i ,j-1,k-1) * f2xmy2z;
9181 if (ccdom.contains(i ,j,k-1)) {
9182 tmp += sig(i ,j,k-1) * f2xmy2z;
9185 if (gid(i+1,j,k-1) < gidmax) {
9187 cols[ps] = gid(i+1,j,k-1);
9193 if (
offset != 0) {
return; }
9197 if (nddom.contains(i-1,j+1,k-1)) {
9198 Real tmp = sig(i-1,j ,k-1) * fxyz;
9200 if (gid(i-1,j+1,k-1) < gidmax) {
9202 cols[ps] = gid(i-1,j+1,k-1);
9208 if (
offset != 0) {
return; }
9212 if (nddom.contains(i,j+1,k-1)) {
9213 Real tmp = Real(0.);
9214 if (ccdom.contains(i-1,j ,k-1)) {
9215 tmp += sig(i-1,j ,k-1) * fmx2y2z;
9217 if (ccdom.contains(i,j ,k-1)) {
9218 tmp += sig(i,j ,k-1) * fmx2y2z;
9221 if (gid(i,j+1,k-1) < gidmax) {
9223 cols[ps] = gid(i,j+1,k-1);
9229 if (
offset != 0) {
return; }
9233 if (nddom.contains(i+1,j+1,k-1)) {
9234 Real tmp = sig(i ,j ,k-1) * fxyz;
9236 if (gid(i+1,j+1,k-1) < gidmax) {
9238 cols[ps] = gid(i+1,j+1,k-1);
9244 if (
offset != 0) {
return; }
9248 if (nddom.contains(i-1,j-1,k)) {
9249 Real tmp = Real(0.);
9250 if (ccdom.contains(i-1,j-1,k-1)) {
9251 tmp += sig(i-1,j-1,k-1) * f2x2ymz;
9253 if (ccdom.contains(i-1,j-1,k)) {
9254 tmp += sig(i-1,j-1,k) * f2x2ymz;
9257 if (gid(i-1,j-1,k) < gidmax) {
9259 cols[ps] = gid(i-1,j-1,k);
9265 if (
offset != 0) {
return; }
9269 if (nddom.contains(i,j-1,k)) {
9270 Real tmp = Real(0.);
9271 if (ccdom.contains(i-1,j-1,k-1)) {
9272 tmp += sig(i-1,j-1,k-1) * fm2x4ym2z;
9274 if (ccdom.contains(i,j-1,k-1)) {
9275 tmp += sig(i,j-1,k-1) * fm2x4ym2z;
9277 if (ccdom.contains(i-1,j-1,k)) {
9278 tmp += sig(i-1,j-1,k) * fm2x4ym2z;
9280 if (ccdom.contains(i,j-1,k)) {
9281 tmp += sig(i,j-1,k) * fm2x4ym2z;
9284 if (gid(i,j-1,k) < gidmax) {
9286 cols[ps] = gid(i,j-1,k);
9292 if (
offset != 0) {
return; }
9296 if (nddom.contains(i+1,j-1,k)) {
9297 Real tmp = Real(0.);
9298 if (ccdom.contains(i ,j-1,k-1)) {
9299 tmp += sig(i ,j-1,k-1) * f2x2ymz;
9301 if (ccdom.contains(i ,j-1,k)) {
9302 tmp += sig(i ,j-1,k) * f2x2ymz;
9305 if (gid(i+1,j-1,k) < gidmax) {
9307 cols[ps] = gid(i+1,j-1,k);
9313 if (
offset != 0) {
return; }
9317 if (nddom.contains(i-1,j,k)) {
9318 Real tmp = Real(0.);
9319 if (ccdom.contains(i-1,j-1,k-1)) {
9320 tmp += sig(i-1,j-1,k-1) * f4xm2ym2z;
9322 if (ccdom.contains(i-1,j,k-1)) {
9323 tmp += sig(i-1,j,k-1) * f4xm2ym2z;
9325 if (ccdom.contains(i-1,j-1,k)) {
9326 tmp += sig(i-1,j-1,k) * f4xm2ym2z;
9328 if (ccdom.contains(i-1,j,k)) {
9329 tmp += sig(i-1,j,k) * f4xm2ym2z;
9332 if (gid(i-1,j,k) < gidmax) {
9334 cols[ps] = gid(i-1,j,k);
9340 if (
offset != 0) {
return; }
9344 if (nddom.contains(i+1,j,k)) {
9345 Real tmp = Real(0.);
9346 if (ccdom.contains(i ,j-1,k-1)) {
9347 tmp += sig(i ,j-1,k-1) * f4xm2ym2z;
9349 if (ccdom.contains(i ,j,k-1)) {
9350 tmp += sig(i ,j,k-1) * f4xm2ym2z;
9352 if (ccdom.contains(i ,j-1,k)) {
9353 tmp += sig(i ,j-1,k) * f4xm2ym2z;
9355 if (ccdom.contains(i ,j,k)) {
9356 tmp += sig(i ,j,k) * f4xm2ym2z;
9359 if (gid(i+1,j,k) < gidmax) {
9361 cols[ps] = gid(i+1,j,k);
9367 if (
offset != 0) {
return; }
9371 if (nddom.contains(i-1,j+1,k)) {
9372 Real tmp = Real(0.);
9373 if (ccdom.contains(i-1,j ,k-1)) {
9374 tmp += sig(i-1,j ,k-1) * f2x2ymz;
9376 if (ccdom.contains(i-1,j ,k)) {
9377 tmp += sig(i-1,j ,k) * f2x2ymz;
9380 if (gid(i-1,j+1,k) < gidmax) {
9382 cols[ps] = gid(i-1,j+1,k);
9388 if (
offset != 0) {
return; }
9392 if (nddom.contains(i,j+1,k)) {
9393 Real tmp = Real(0.);
9394 if (ccdom.contains(i-1,j ,k-1)) {
9395 tmp += sig(i-1,j ,k-1) * fm2x4ym2z;
9397 if (ccdom.contains(i,j ,k-1)) {
9398 tmp += sig(i,j ,k-1) * fm2x4ym2z;
9400 if (ccdom.contains(i-1,j ,k)) {
9401 tmp += sig(i-1,j ,k) * fm2x4ym2z;
9403 if (ccdom.contains(i,j ,k)) {
9404 tmp += sig(i,j ,k) * fm2x4ym2z;
9407 if (gid(i,j+1,k) < gidmax) {
9409 cols[ps] = gid(i,j+1,k);
9415 if (
offset != 0) {
return; }
9419 if (nddom.contains(i+1,j+1,k)) {
9420 Real tmp = Real(0.);
9421 if (ccdom.contains(i ,j ,k-1)) {
9422 tmp += sig(i ,j ,k-1) * f2x2ymz;
9424 if (ccdom.contains(i ,j ,k)) {
9425 tmp += sig(i ,j ,k) * f2x2ymz;
9428 if (gid(i+1,j+1,k) < gidmax) {
9430 cols[ps] = gid(i+1,j+1,k);
9436 if (
offset != 0) {
return; }
9440 if (nddom.contains(i-1,j-1,k+1)) {
9441 Real tmp = sig(i-1,j-1,k ) * fxyz;
9443 if (gid(i-1,j-1,k+1) < gidmax) {
9445 cols[ps] = gid(i-1,j-1,k+1);
9451 if (
offset != 0) {
return; }
9455 if (nddom.contains(i,j-1,k+1)) {
9456 Real tmp = Real(0.);
9457 if (ccdom.contains(i-1,j-1,k )) {
9458 tmp += sig(i-1,j-1,k ) * fmx2y2z;
9460 if (ccdom.contains(i,j-1,k )) {
9461 tmp += sig(i,j-1,k ) * fmx2y2z;
9464 if (gid(i,j-1,k+1) < gidmax) {
9466 cols[ps] = gid(i,j-1,k+1);
9472 if (
offset != 0) {
return; }
9476 if (nddom.contains(i+1,j-1,k+1)) {
9477 Real tmp = sig(i ,j-1,k ) * fxyz;
9479 if (gid(i+1,j-1,k+1) < gidmax) {
9481 cols[ps] = gid(i+1,j-1,k+1);
9487 if (
offset != 0) {
return; }
9491 if (nddom.contains(i-1,j,k+1)) {
9492 Real tmp = Real(0.);
9493 if (ccdom.contains(i-1,j-1,k )) {
9494 tmp += sig(i-1,j-1,k ) * f2xmy2z;
9496 if (ccdom.contains(i-1,j,k )) {
9497 tmp += sig(i-1,j,k ) * f2xmy2z;
9500 if (gid(i-1,j,k+1) < gidmax) {
9502 cols[ps] = gid(i-1,j,k+1);
9508 if (
offset != 0) {
return; }
9512 if (nddom.contains(i,j,k+1)) {
9513 Real tmp = Real(0.);
9514 if (ccdom.contains(i-1,j-1,k )) {
9515 tmp += sig(i-1,j-1,k ) * fm2xm2y4z;
9517 if (ccdom.contains(i,j-1,k )) {
9518 tmp += sig(i,j-1,k ) * fm2xm2y4z;
9520 if (ccdom.contains(i-1,j,k )) {
9521 tmp += sig(i-1,j,k ) * fm2xm2y4z;
9523 if (ccdom.contains(i,j,k )) {
9524 tmp += sig(i,j,k ) * fm2xm2y4z;
9527 if (gid(i,j,k+1) < gidmax) {
9529 cols[ps] = gid(i,j,k+1);
9535 if (
offset != 0) {
return; }
9539 if (nddom.contains(i+1,j,k+1)) {
9540 Real tmp = Real(0.);
9541 if (ccdom.contains(i ,j-1,k )) {
9542 tmp += sig(i ,j-1,k ) * f2xmy2z;
9544 if (ccdom.contains(i ,j,k )) {
9545 tmp += sig(i ,j,k ) * f2xmy2z;
9548 if (gid(i+1,j,k+1) < gidmax) {
9550 cols[ps] = gid(i+1,j,k+1);
9556 if (
offset != 0) {
return; }
9560 if (nddom.contains(i-1,j+1,k+1)) {
9561 Real tmp = sig(i-1,j ,k ) * fxyz;
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,j+1,k+1)) {
9576 Real tmp = Real(0.);
9577 if (ccdom.contains(i-1,j ,k )) {
9578 tmp += sig(i-1,j ,k ) * fmx2y2z;
9580 if (ccdom.contains(i,j ,k )) {
9581 tmp += sig(i,j ,k ) * fmx2y2z;
9584 if (gid(i,j+1,k+1) < gidmax) {
9586 cols[ps] = gid(i,j+1,k+1);
9592 if (
offset != 0) {
return; }
9596 if (nddom.contains(i+1,j+1,k+1)) {
9597 Real tmp = sig(i ,j ,k ) * fxyz;
9599 if (gid(i+1,j+1,k+1) < gidmax) {
9601 cols[ps] = gid(i+1,j+1,k+1);
9607 if (
offset != 0) {
return; }
9611 cols[ps] = gid(i,j,k);
9613 ncols[lid(i,j,k)] = nelems+1;
9617 template <
typename HypreInt,
typename AtomicInt>
9619 void mlndlap_fillijmat_ha_gpu (
const int ps,
const int i,
const int j,
const int k,
9621 Box const& ndbx, Array4<AtomicInt const>
const& gid,
9622 Array4<int const>
const& lid,
9623 HypreInt* ncols, HypreInt* cols,
9625 Array4<Real const>
const& sx,
9626 Array4<Real const>
const& sy,
9627 Array4<Real const>
const& sz,
9628 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
9629 Box const& ccdom) noexcept
9631 if (lid(i,j,k) >= 0)
9633 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
9634 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
9635 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
9644 if (nddom.contains(i-1,j-1,k-1)) {
9645 Real tmp = sx(i-1,j-1,k-1) * facx
9646 + sy(i-1,j-1,k-1) * facy
9647 + sz(i-1,j-1,k-1) * facz;
9649 if ( gid(i-1,j-1,k-1) < gidmax) {
9651 cols[ps] = gid(i-1,j-1,k-1);
9657 if (
offset != 0) {
return; }
9661 if (nddom.contains(i,j-1,k-1)) {
9662 Real tmp = Real(0.);
9663 if (ccdom.contains(i-1,j-1,k-1)) {
9664 tmp += - sx(i-1,j-1,k-1) * facx
9665 + sy(i-1,j-1,k-1) * facy * Real(2.0)
9666 + sz(i-1,j-1,k-1) * facz * Real(2.0);
9668 if (ccdom.contains(i,j-1,k-1)) {
9669 tmp += - sx(i,j-1,k-1) * facx
9670 + sy(i,j-1,k-1) * facy * Real(2.0)
9671 + sz(i,j-1,k-1) * facz * Real(2.0);
9674 if (gid(i,j-1,k-1) < gidmax) {
9676 cols[ps] = gid(i,j-1,k-1);
9682 if (
offset != 0) {
return; }
9686 if (nddom.contains(i+1,j-1,k-1)) {
9687 Real tmp = sx(i ,j-1,k-1) * facx
9688 + sy(i ,j-1,k-1) * facy
9689 + sz(i ,j-1,k-1) * facz;
9691 if (gid(i+1,j-1,k-1) < gidmax) {
9693 cols[ps] = gid(i+1,j-1,k-1);
9699 if (
offset != 0) {
return; }
9703 if (nddom.contains(i-1,j,k-1)) {
9704 Real tmp = Real(0.);
9705 if (ccdom.contains(i-1,j-1,k-1)) {
9706 tmp += sx(i-1,j-1,k-1) * facx * Real(2.0)
9707 - sy(i-1,j-1,k-1) * facy
9708 + sz(i-1,j-1,k-1) * facz * Real(2.0);
9710 if (ccdom.contains(i-1,j,k-1)) {
9711 tmp += sx(i-1,j,k-1) * facx * Real(2.0)
9712 - sy(i-1,j,k-1) * facy
9713 + sz(i-1,j,k-1) * facz * Real(2.0);
9716 if (gid(i-1,j,k-1) < gidmax) {
9718 cols[ps] = gid(i-1,j,k-1);
9724 if (
offset != 0) {
return; }
9728 if (nddom.contains(i,j,k-1)) {
9729 Real tmp = Real(0.);
9730 if (ccdom.contains(i-1,j-1,k-1)) {
9731 tmp += - sx(i-1,j-1,k-1) * facx * Real(2.0)
9732 - sy(i-1,j-1,k-1) * facy * Real(2.0)
9733 + sz(i-1,j-1,k-1) * facz * Real(4.0);
9735 if (ccdom.contains(i,j-1,k-1)) {
9736 tmp += - sx(i,j-1,k-1) * facx * Real(2.0)
9737 - sy(i,j-1,k-1) * facy * Real(2.0)
9738 + sz(i,j-1,k-1) * facz * Real(4.0);
9741 if (ccdom.contains(i-1,j,k-1)) {
9742 tmp += - sx(i-1,j,k-1) * facx * Real(2.0)
9743 - sy(i-1,j,k-1) * facy * Real(2.0)
9744 + sz(i-1,j,k-1) * facz * Real(4.0);
9746 if (ccdom.contains(i,j,k-1)) {
9747 tmp += - sx(i,j,k-1) * facx * Real(2.0)
9748 - sy(i,j,k-1) * facy * Real(2.0)
9749 + sz(i,j,k-1) * facz * Real(4.0);
9752 if (gid(i,j,k-1) < gidmax) {
9754 cols[ps] = gid(i,j,k-1);
9760 if (
offset != 0) {
return; }
9764 if (nddom.contains(i+1,j,k-1)) {
9765 Real tmp = Real(0.);
9766 if (ccdom.contains(i ,j-1,k-1)) {
9767 tmp += sx(i ,j-1,k-1) * facx * Real(2.0)
9768 - sy(i ,j-1,k-1) * facy
9769 + sz(i ,j-1,k-1) * facz * Real(2.0);
9771 if (ccdom.contains(i ,j,k-1)) {
9772 tmp += sx(i ,j,k-1) * facx * Real(2.0)
9773 - sy(i ,j,k-1) * facy
9774 + sz(i ,j,k-1) * facz * Real(2.0);
9777 if (gid(i+1,j,k-1) < gidmax) {
9779 cols[ps] = gid(i+1,j,k-1);
9785 if (
offset != 0) {
return; }
9789 if (nddom.contains(i-1,j+1,k-1)) {
9790 Real tmp = sx(i-1,j ,k-1) * facx
9791 + sy(i-1,j ,k-1) * facy
9792 + sz(i-1,j ,k-1) * facz;
9794 if (gid(i-1,j+1,k-1) < gidmax) {
9796 cols[ps] = gid(i-1,j+1,k-1);
9802 if (
offset != 0) {
return; }
9806 if (nddom.contains(i,j+1,k-1)) {
9807 Real tmp = Real(0.);
9808 if (ccdom.contains(i-1,j ,k-1)) {
9809 tmp += - sx(i-1,j ,k-1) * facx
9810 + sy(i-1,j ,k-1) * facy * Real(2.0)
9811 + sz(i-1,j ,k-1) * facz * Real(2.0);
9813 if (ccdom.contains(i,j ,k-1)) {
9814 tmp += - sx(i,j ,k-1) * facx
9815 + sy(i,j ,k-1) * facy * Real(2.0)
9816 + sz(i,j ,k-1) * facz * Real(2.0);
9819 if (gid(i,j+1,k-1) < gidmax) {
9821 cols[ps] = gid(i,j+1,k-1);
9827 if (
offset != 0) {
return; }
9831 if (nddom.contains(i+1,j+1,k-1)) {
9832 Real tmp = sx(i ,j ,k-1) * facx
9833 + sy(i ,j ,k-1) * facy
9834 + sz(i ,j ,k-1) * facz;
9836 if (gid(i+1,j+1,k-1) < gidmax) {
9838 cols[ps] = gid(i+1,j+1,k-1);
9844 if (
offset != 0) {
return; }
9848 if (nddom.contains(i-1,j-1,k)) {
9849 Real tmp = Real(0.);
9850 if (ccdom.contains(i-1,j-1,k-1)) {
9851 tmp += sx(i-1,j-1,k-1) * facx * Real(2.0)
9852 + sy(i-1,j-1,k-1) * facy * Real(2.0)
9853 - sz(i-1,j-1,k-1) * facz;
9855 if (ccdom.contains(i-1,j-1,k)) {
9856 tmp += sx(i-1,j-1,k) * facx * Real(2.0)
9857 + sy(i-1,j-1,k) * facy * Real(2.0)
9858 - sz(i-1,j-1,k) * facz;
9861 if (gid(i-1,j-1,k) < gidmax) {
9863 cols[ps] = gid(i-1,j-1,k);
9869 if (
offset != 0) {
return; }
9873 if (nddom.contains(i,j-1,k)) {
9874 Real tmp = Real(0.);
9875 if (ccdom.contains(i-1,j-1,k-1)) {
9876 tmp += - sx(i-1,j-1,k-1) * facx * Real(2.0)
9877 + sy(i-1,j-1,k-1) * facy * Real(4.0)
9878 - sz(i-1,j-1,k-1) * facz * Real(2.0);
9880 if (ccdom.contains(i,j-1,k-1)) {
9881 tmp += - sx(i,j-1,k-1) * facx * Real(2.0)
9882 + sy(i,j-1,k-1) * facy * Real(4.0)
9883 - sz(i,j-1,k-1) * facz * Real(2.0);
9885 if (ccdom.contains(i-1,j-1,k)) {
9886 tmp += - sx(i-1,j-1,k) * facx * Real(2.0)
9887 + sy(i-1,j-1,k) * facy * Real(4.0)
9888 - sz(i-1,j-1,k) * facz * Real(2.0);
9890 if (ccdom.contains(i,j-1,k)) {
9891 tmp += - sx(i,j-1,k) * facx * Real(2.0)
9892 + sy(i,j-1,k) * facy * Real(4.0)
9893 - sz(i,j-1,k) * facz * Real(2.0);
9896 if (gid(i,j-1,k) < gidmax) {
9898 cols[ps] = gid(i,j-1,k);
9904 if (
offset != 0) {
return; }
9908 if (nddom.contains(i+1,j-1,k)) {
9909 Real tmp = Real(0.);
9910 if (ccdom.contains(i ,j-1,k-1)) {
9911 tmp += sx(i ,j-1,k-1) * facx * Real(2.0)
9912 + sy(i ,j-1,k-1) * facy * Real(2.0)
9913 - sz(i ,j-1,k-1) * facz;
9915 if (ccdom.contains(i ,j-1,k)) {
9916 tmp += sx(i ,j-1,k) * facx * Real(2.0)
9917 + sy(i ,j-1,k) * facy * Real(2.0)
9918 - sz(i ,j-1,k) * facz;
9921 if (gid(i+1,j-1,k) < gidmax) {
9923 cols[ps] = gid(i+1,j-1,k);
9929 if (
offset != 0) {
return; }
9933 if (nddom.contains(i-1,j,k)) {
9934 Real tmp = Real(0.);
9935 if (ccdom.contains(i-1,j-1,k-1)) {
9936 tmp += sx(i-1,j-1,k-1) * facx * Real(4.0)
9937 - sy(i-1,j-1,k-1) * facy * Real(2.0)
9938 - sz(i-1,j-1,k-1) * facz * Real(2.0);
9940 if (ccdom.contains(i-1,j,k-1)) {
9941 tmp += sx(i-1,j,k-1) * facx * Real(4.0)
9942 - sy(i-1,j,k-1) * facy * Real(2.0)
9943 - sz(i-1,j,k-1) * facz * Real(2.0);
9945 if (ccdom.contains(i-1,j-1,k)) {
9946 tmp += sx(i-1,j-1,k) * facx * Real(4.0)
9947 - sy(i-1,j-1,k) * facy * Real(2.0)
9948 - sz(i-1,j-1,k) * facz * Real(2.0);
9950 if (ccdom.contains(i-1,j,k)) {
9951 tmp += sx(i-1,j,k) * facx * Real(4.0)
9952 - sy(i-1,j,k) * facy * Real(2.0)
9953 - sz(i-1,j,k) * facz * Real(2.0);
9956 if (gid(i-1,j,k) < gidmax) {
9958 cols[ps] = gid(i-1,j,k);
9964 if (
offset != 0) {
return; }
9968 if (nddom.contains(i+1,j,k)) {
9969 Real tmp = Real(0.);
9970 if (ccdom.contains(i ,j-1,k-1)) {
9971 tmp += sx(i ,j-1,k-1) * facx * Real(4.0)
9972 - sy(i ,j-1,k-1) * facy * Real(2.0)
9973 - sz(i ,j-1,k-1) * facz * Real(2.0);
9975 if (ccdom.contains(i ,j,k-1)) {
9976 tmp += sx(i ,j,k-1) * facx * Real(4.0)
9977 - sy(i ,j,k-1) * facy * Real(2.0)
9978 - sz(i ,j,k-1) * facz * Real(2.0);
9980 if (ccdom.contains(i ,j-1,k)) {
9981 tmp += sx(i ,j-1,k) * facx * Real(4.0)
9982 - sy(i ,j-1,k) * facy * Real(2.0)
9983 - sz(i ,j-1,k) * facz * Real(2.0);
9985 if (ccdom.contains(i ,j,k)) {
9986 tmp += sx(i ,j,k) * facx * Real(4.0)
9987 - sy(i ,j,k) * facy * Real(2.0)
9988 - sz(i ,j,k) * facz * Real(2.0);
9991 if (gid(i+1,j,k) < gidmax) {
9993 cols[ps] = gid(i+1,j,k);
9999 if (
offset != 0) {
return; }
10003 if (nddom.contains(i-1,j+1,k)) {
10004 Real tmp = Real(0.);
10005 if (ccdom.contains(i-1,j ,k-1)) {
10006 tmp += sx(i-1,j ,k-1) * facx * Real(2.0)
10007 + sy(i-1,j ,k-1) * facy * Real(2.0)
10008 - sz(i-1,j ,k-1) * facz;
10010 if (ccdom.contains(i-1,j ,k)) {
10011 tmp += sx(i-1,j ,k) * facx * Real(2.0)
10012 + sy(i-1,j ,k) * facy * Real(2.0)
10013 - sz(i-1,j ,k) * facz;
10016 if (gid(i-1,j+1,k) < gidmax) {
10018 cols[ps] = gid(i-1,j+1,k);
10024 if (
offset != 0) {
return; }
10028 if (nddom.contains(i,j+1,k)) {
10029 Real tmp = Real(0.);
10030 if (ccdom.contains(i-1,j ,k-1)) {
10031 tmp += - sx(i-1,j ,k-1) * facx * Real(2.0)
10032 + sy(i-1,j ,k-1) * facy * Real(4.0)
10033 - sz(i-1,j ,k-1) * facz * Real(2.0);
10035 if (ccdom.contains(i,j ,k-1)) {
10036 tmp += - sx(i,j ,k-1) * facx * Real(2.0)
10037 + sy(i,j ,k-1) * facy * Real(4.0)
10038 - sz(i,j ,k-1) * facz * Real(2.0);
10040 if (ccdom.contains(i-1,j ,k)) {
10041 tmp += - sx(i-1,j ,k) * facx * Real(2.0)
10042 + sy(i-1,j ,k) * facy * Real(4.0)
10043 - sz(i-1,j ,k) * facz * Real(2.0);
10045 if (ccdom.contains(i,j ,k)) {
10046 tmp += - sx(i,j ,k) * facx * Real(2.0)
10047 + sy(i,j ,k) * facy * Real(4.0)
10048 - sz(i,j ,k) * facz * Real(2.0);
10051 if (gid(i,j+1,k) < gidmax) {
10053 cols[ps] = gid(i,j+1,k);
10059 if (
offset != 0) {
return; }
10063 if (nddom.contains(i+1,j+1,k)) {
10064 Real tmp = Real(0.);
10065 if (ccdom.contains(i ,j ,k-1)) {
10066 tmp += sx(i ,j ,k-1) * facx * Real(2.0)
10067 + sy(i ,j ,k-1) * facy * Real(2.0)
10068 - sz(i ,j ,k-1) * facz;
10070 if (ccdom.contains(i ,j ,k)) {
10071 tmp += sx(i ,j ,k) * facx * Real(2.0)
10072 + sy(i ,j ,k) * facy * Real(2.0)
10073 - sz(i ,j ,k) * facz;
10076 if (gid(i+1,j+1,k) < gidmax) {
10078 cols[ps] = gid(i+1,j+1,k);
10084 if (
offset != 0) {
return; }
10088 if (nddom.contains(i-1,j-1,k+1)) {
10089 Real tmp = sx(i-1,j-1,k ) * facx
10090 + sy(i-1,j-1,k ) * facy
10091 + sz(i-1,j-1,k ) * facz;
10093 if (gid(i-1,j-1,k+1) < gidmax) {
10095 cols[ps] = gid(i-1,j-1,k+1);
10101 if (
offset != 0) {
return; }
10105 if (nddom.contains(i,j-1,k+1)) {
10106 Real tmp = Real(0.);
10107 if (ccdom.contains(i-1,j-1,k )) {
10108 tmp += - sx(i-1,j-1,k ) * facx
10109 + sy(i-1,j-1,k ) * facy * Real(2.0)
10110 + sz(i-1,j-1,k ) * facz * Real(2.0);
10112 if (ccdom.contains(i,j-1,k )) {
10113 tmp += - sx(i,j-1,k ) * facx
10114 + sy(i,j-1,k ) * facy * Real(2.0)
10115 + sz(i,j-1,k ) * facz * Real(2.0);
10118 if (gid(i,j-1,k+1) < gidmax) {
10120 cols[ps] = gid(i,j-1,k+1);
10126 if (
offset != 0) {
return; }
10130 if (nddom.contains(i+1,j-1,k+1)) {
10131 Real tmp = sx(i ,j-1,k ) * facx
10132 + sy(i ,j-1,k ) * facy
10133 + sz(i ,j-1,k ) * facz;
10135 if (gid(i+1,j-1,k+1) < gidmax) {
10137 cols[ps] = gid(i+1,j-1,k+1);
10143 if (
offset != 0) {
return; }
10147 if (nddom.contains(i-1,j,k+1)) {
10148 Real tmp = Real(0.);
10149 if (ccdom.contains(i-1,j-1,k )) {
10150 tmp += sx(i-1,j-1,k ) * facx * Real(2.0)
10151 - sy(i-1,j-1,k ) * facy
10152 + sz(i-1,j-1,k ) * facz * Real(2.0);
10154 if (ccdom.contains(i-1,j,k )) {
10155 tmp += sx(i-1,j,k ) * facx * Real(2.0)
10156 - sy(i-1,j,k ) * facy
10157 + sz(i-1,j,k ) * facz * Real(2.0);
10160 if (gid(i-1,j,k+1) < gidmax) {
10162 cols[ps] = gid(i-1,j,k+1);
10168 if (
offset != 0) {
return; }
10172 if (nddom.contains(i,j,k+1)) {
10173 Real tmp = Real(0.);
10174 if (ccdom.contains(i-1,j-1,k )) {
10175 tmp += - sx(i-1,j-1,k ) * facx * Real(2.0)
10176 - sy(i-1,j-1,k ) * facy * Real(2.0)
10177 + sz(i-1,j-1,k ) * facz * Real(4.0);
10179 if (ccdom.contains(i,j-1,k )) {
10180 tmp += - sx(i,j-1,k ) * facx * Real(2.0)
10181 - sy(i,j-1,k ) * facy * Real(2.0)
10182 + sz(i,j-1,k ) * facz * Real(4.0);
10184 if (ccdom.contains(i-1,j,k )) {
10185 tmp += - sx(i-1,j,k ) * facx * Real(2.0)
10186 - sy(i-1,j,k ) * facy * Real(2.0)
10187 + sz(i-1,j,k ) * facz * Real(4.0);
10189 if (ccdom.contains(i,j,k )) {
10190 tmp += - sx(i,j,k ) * facx * Real(2.0)
10191 - sy(i,j,k ) * facy * Real(2.0)
10192 + sz(i,j,k ) * facz * Real(4.0);
10195 if (gid(i,j,k+1) < gidmax) {
10197 cols[ps] = gid(i,j,k+1);
10203 if (
offset != 0) {
return; }
10207 if (nddom.contains(i+1,j,k+1)) {
10208 Real tmp = Real(0.);
10209 if (ccdom.contains(i ,j-1,k )) {
10210 tmp += sx(i ,j-1,k ) * facx * Real(2.0)
10211 - sy(i ,j-1,k ) * facy
10212 + sz(i ,j-1,k ) * facz * Real(2.0);
10214 if (ccdom.contains(i ,j,k )) {
10215 tmp += sx(i ,j,k ) * facx * Real(2.0)
10216 - sy(i ,j,k ) * facy
10217 + sz(i ,j,k ) * facz * Real(2.0);
10220 if (gid(i+1,j,k+1) < gidmax) {
10222 cols[ps] = gid(i+1,j,k+1);
10228 if (
offset != 0) {
return; }
10232 if (nddom.contains(i-1,j+1,k+1)) {
10233 Real tmp = sx(i-1,j ,k ) * facx
10234 + sy(i-1,j ,k ) * facy
10235 + sz(i-1,j ,k ) * facz;
10237 if (gid(i-1,j+1,k+1) < gidmax) {
10239 cols[ps] = gid(i-1,j+1,k+1);
10245 if (
offset != 0) {
return; }
10249 if (nddom.contains(i,j+1,k+1)) {
10250 Real tmp = Real(0.);
10251 if (ccdom.contains(i-1,j ,k )) {
10252 tmp += - sx(i-1,j ,k ) * facx
10253 + sy(i-1,j ,k ) * facy * Real(2.0)
10254 + sz(i-1,j ,k ) * facz * Real(2.0);
10256 if (ccdom.contains(i,j ,k )) {
10257 tmp += - sx(i,j ,k ) * facx
10258 + sy(i,j ,k ) * facy * Real(2.0)
10259 + sz(i,j ,k ) * facz * Real(2.0);
10262 if (gid(i,j+1,k+1) < gidmax) {
10264 cols[ps] = gid(i,j+1,k+1);
10270 if (
offset != 0) {
return; }
10274 if (nddom.contains(i+1,j+1,k+1)) {
10275 Real tmp = sx(i ,j ,k ) * facx
10276 + sy(i ,j ,k ) * facy
10277 + sz(i ,j ,k ) * facz;
10279 if (gid(i+1,j+1,k+1) < gidmax) {
10281 cols[ps] = gid(i+1,j+1,k+1);
10287 if (
offset != 0) {
return; }
10291 cols[ps] = gid(i,j,k);
10293 ncols[lid(i,j,k)] = nelems+1;
10297 template <
typename HypreInt,
typename AtomicInt>
10299 void mlndlap_fillijmat_cs_gpu (
const int ps,
const int i,
const int j,
const int k,
10301 Box const& ndbx, Array4<AtomicInt const>
const& gid,
10302 Array4<int const>
const& lid,
10303 HypreInt* ncols, HypreInt* cols,
10305 Real sigma, GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
10306 Box const& ccdom) noexcept
10308 if (lid(i,j,k) >= 0)
10310 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0] * sigma;
10311 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1] * sigma;
10312 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2] * sigma;
10313 Real fxyz = facx + facy + facz;
10314 Real fmx2y2z = -facx + Real(2.0)*facy + Real(2.0)*facz;
10315 Real f2xmy2z = Real(2.0)*facx - facy + Real(2.0)*facz;
10316 Real f2x2ymz = Real(2.0)*facx + Real(2.0)*facy - facz;
10317 Real f4xm2ym2z = Real(4.0)*facx - Real(2.0)*facy - Real(2.0)*facz;
10318 Real fm2x4ym2z = -Real(2.0)*facx + Real(4.0)*facy - Real(2.0)*facz;
10319 Real fm2xm2y4z = -Real(2.0)*facx - Real(2.0)*facy + Real(4.0)*facz;
10325 Real m0 = Real(0.);
10328 if (nddom.contains(i-1,j-1,k-1)) {
10331 if ( gid(i-1,j-1,k-1) < gidmax) {
10333 cols[ps] = gid(i-1,j-1,k-1);
10339 if (
offset != 0) {
return; }
10343 if (nddom.contains(i,j-1,k-1)) {
10344 Real tmp = Real(0.);
10345 if (ccdom.contains(i-1,j-1,k-1)) {
10348 if (ccdom.contains(i,j-1,k-1)) {
10352 if (gid(i,j-1,k-1) < gidmax) {
10354 cols[ps] = gid(i,j-1,k-1);
10360 if (
offset != 0) {
return; }
10364 if (nddom.contains(i+1,j-1,k-1)) {
10367 if (gid(i+1,j-1,k-1) < gidmax) {
10369 cols[ps] = gid(i+1,j-1,k-1);
10375 if (
offset != 0) {
return; }
10379 if (nddom.contains(i-1,j,k-1)) {
10380 Real tmp = Real(0.);
10381 if (ccdom.contains(i-1,j-1,k-1)) {
10384 if (ccdom.contains(i-1,j,k-1)) {
10388 if (gid(i-1,j,k-1) < gidmax) {
10390 cols[ps] = gid(i-1,j,k-1);
10396 if (
offset != 0) {
return; }
10400 if (nddom.contains(i,j,k-1)) {
10401 Real tmp = Real(0.);
10402 if (ccdom.contains(i-1,j-1,k-1)) {
10405 if (ccdom.contains(i,j-1,k-1)) {
10408 if (ccdom.contains(i-1,j,k-1)) {
10411 if (ccdom.contains(i,j,k-1)) {
10415 if (gid(i,j,k-1) < gidmax) {
10417 cols[ps] = gid(i,j,k-1);
10423 if (
offset != 0) {
return; }
10427 if (nddom.contains(i+1,j,k-1)) {
10428 Real tmp = Real(0.);
10429 if (ccdom.contains(i ,j-1,k-1)) {
10432 if (ccdom.contains(i ,j,k-1)) {
10436 if (gid(i+1,j,k-1) < gidmax) {
10438 cols[ps] = gid(i+1,j,k-1);
10444 if (
offset != 0) {
return; }
10448 if (nddom.contains(i-1,j+1,k-1)) {
10451 if (gid(i-1,j+1,k-1) < gidmax) {
10453 cols[ps] = gid(i-1,j+1,k-1);
10459 if (
offset != 0) {
return; }
10463 if (nddom.contains(i,j+1,k-1)) {
10464 Real tmp = Real(0.);
10465 if (ccdom.contains(i-1,j ,k-1)) {
10468 if (ccdom.contains(i,j ,k-1)) {
10472 if (gid(i,j+1,k-1) < gidmax) {
10474 cols[ps] = gid(i,j+1,k-1);
10480 if (
offset != 0) {
return; }
10484 if (nddom.contains(i+1,j+1,k-1)) {
10487 if (gid(i+1,j+1,k-1) < gidmax) {
10489 cols[ps] = gid(i+1,j+1,k-1);
10495 if (
offset != 0) {
return; }
10499 if (nddom.contains(i-1,j-1,k)) {
10500 Real tmp = Real(0.);
10501 if (ccdom.contains(i-1,j-1,k-1)) {
10504 if (ccdom.contains(i-1,j-1,k)) {
10508 if (gid(i-1,j-1,k) < gidmax) {
10510 cols[ps] = gid(i-1,j-1,k);
10516 if (
offset != 0) {
return; }
10520 if (nddom.contains(i,j-1,k)) {
10521 Real tmp = Real(0.);
10522 if (ccdom.contains(i-1,j-1,k-1)) {
10525 if (ccdom.contains(i,j-1,k-1)) {
10528 if (ccdom.contains(i-1,j-1,k)) {
10531 if (ccdom.contains(i,j-1,k)) {
10535 if (gid(i,j-1,k) < gidmax) {
10537 cols[ps] = gid(i,j-1,k);
10543 if (
offset != 0) {
return; }
10547 if (nddom.contains(i+1,j-1,k)) {
10548 Real tmp = Real(0.);
10549 if (ccdom.contains(i ,j-1,k-1)) {
10552 if (ccdom.contains(i ,j-1,k)) {
10556 if (gid(i+1,j-1,k) < gidmax) {
10558 cols[ps] = gid(i+1,j-1,k);
10564 if (
offset != 0) {
return; }
10568 if (nddom.contains(i-1,j,k)) {
10569 Real tmp = Real(0.);
10570 if (ccdom.contains(i-1,j-1,k-1)) {
10573 if (ccdom.contains(i-1,j,k-1)) {
10576 if (ccdom.contains(i-1,j-1,k)) {
10579 if (ccdom.contains(i-1,j,k)) {
10583 if (gid(i-1,j,k) < gidmax) {
10585 cols[ps] = gid(i-1,j,k);
10591 if (
offset != 0) {
return; }
10595 if (nddom.contains(i+1,j,k)) {
10596 Real tmp = Real(0.);
10597 if (ccdom.contains(i ,j-1,k-1)) {
10600 if (ccdom.contains(i ,j,k-1)) {
10603 if (ccdom.contains(i ,j-1,k)) {
10606 if (ccdom.contains(i ,j,k)) {
10610 if (gid(i+1,j,k) < gidmax) {
10612 cols[ps] = gid(i+1,j,k);
10618 if (
offset != 0) {
return; }
10622 if (nddom.contains(i-1,j+1,k)) {
10623 Real tmp = Real(0.);
10624 if (ccdom.contains(i-1,j ,k-1)) {
10627 if (ccdom.contains(i-1,j ,k)) {
10631 if (gid(i-1,j+1,k) < gidmax) {
10633 cols[ps] = gid(i-1,j+1,k);
10639 if (
offset != 0) {
return; }
10643 if (nddom.contains(i,j+1,k)) {
10644 Real tmp = Real(0.);
10645 if (ccdom.contains(i-1,j ,k-1)) {
10648 if (ccdom.contains(i,j ,k-1)) {
10651 if (ccdom.contains(i-1,j ,k)) {
10654 if (ccdom.contains(i,j ,k)) {
10658 if (gid(i,j+1,k) < gidmax) {
10660 cols[ps] = gid(i,j+1,k);
10666 if (
offset != 0) {
return; }
10670 if (nddom.contains(i+1,j+1,k)) {
10671 Real tmp = Real(0.);
10672 if (ccdom.contains(i ,j ,k-1)) {
10675 if (ccdom.contains(i ,j ,k)) {
10679 if (gid(i+1,j+1,k) < gidmax) {
10681 cols[ps] = gid(i+1,j+1,k);
10687 if (
offset != 0) {
return; }
10691 if (nddom.contains(i-1,j-1,k+1)) {
10694 if (gid(i-1,j-1,k+1) < gidmax) {
10696 cols[ps] = gid(i-1,j-1,k+1);
10702 if (
offset != 0) {
return; }
10706 if (nddom.contains(i,j-1,k+1)) {
10707 Real tmp = Real(0.);
10708 if (ccdom.contains(i-1,j-1,k )) {
10711 if (ccdom.contains(i,j-1,k )) {
10715 if (gid(i,j-1,k+1) < gidmax) {
10717 cols[ps] = gid(i,j-1,k+1);
10723 if (
offset != 0) {
return; }
10727 if (nddom.contains(i+1,j-1,k+1)) {
10730 if (gid(i+1,j-1,k+1) < gidmax) {
10732 cols[ps] = gid(i+1,j-1,k+1);
10738 if (
offset != 0) {
return; }
10742 if (nddom.contains(i-1,j,k+1)) {
10743 Real tmp = Real(0.);
10744 if (ccdom.contains(i-1,j-1,k )) {
10747 if (ccdom.contains(i-1,j,k )) {
10751 if (gid(i-1,j,k+1) < gidmax) {
10753 cols[ps] = gid(i-1,j,k+1);
10759 if (
offset != 0) {
return; }
10763 if (nddom.contains(i,j,k+1)) {
10764 Real tmp = Real(0.);
10765 if (ccdom.contains(i-1,j-1,k )) {
10768 if (ccdom.contains(i,j-1,k )) {
10771 if (ccdom.contains(i-1,j,k )) {
10774 if (ccdom.contains(i,j,k )) {
10778 if (gid(i,j,k+1) < gidmax) {
10780 cols[ps] = gid(i,j,k+1);
10786 if (
offset != 0) {
return; }
10790 if (nddom.contains(i+1,j,k+1)) {
10791 Real tmp = Real(0.);
10792 if (ccdom.contains(i ,j-1,k )) {
10795 if (ccdom.contains(i ,j,k )) {
10799 if (gid(i+1,j,k+1) < gidmax) {
10801 cols[ps] = gid(i+1,j,k+1);
10807 if (
offset != 0) {
return; }
10811 if (nddom.contains(i-1,j+1,k+1)) {
10814 if (gid(i-1,j+1,k+1) < gidmax) {
10816 cols[ps] = gid(i-1,j+1,k+1);
10822 if (
offset != 0) {
return; }
10826 if (nddom.contains(i,j+1,k+1)) {
10827 Real tmp = Real(0.);
10828 if (ccdom.contains(i-1,j ,k )) {
10831 if (ccdom.contains(i,j ,k )) {
10835 if (gid(i,j+1,k+1) < gidmax) {
10837 cols[ps] = gid(i,j+1,k+1);
10843 if (
offset != 0) {
return; }
10847 if (nddom.contains(i+1,j+1,k+1)) {
10850 if (gid(i+1,j+1,k+1) < gidmax) {
10852 cols[ps] = gid(i+1,j+1,k+1);
10858 if (
offset != 0) {
return; }
10862 cols[ps] = gid(i,j,k);
10864 ncols[lid(i,j,k)] = nelems+1;
10875 return (i%2) + (j%2)*2 + (k%2)*4;
10887 sol(i,j,k) = Real(0.0);
10889 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
10890 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
10891 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
10893 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)
10894 +sx(i-1,j-1,k )+sx(i,j-1,k )+sx(i-1,j,k )+sx(i,j,k ))
10895 +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)
10896 +sy(i-1,j-1,k )+sy(i,j-1,k )+sy(i-1,j,k )+sy(i,j,k ))
10897 +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)
10898 +sz(i-1,j-1,k )+sz(i,j-1,k )+sz(i-1,j,k )+sz(i,j,k )));
10899 Real Ax = sol(i,j,k)*s0
10900 + sol(i-1,j-1,k-1)*(facx*sx(i-1,j-1,k-1)
10901 +facy*sy(i-1,j-1,k-1)
10902 +facz*sz(i-1,j-1,k-1))
10903 + sol(i+1,j-1,k-1)*(facx*sx(i ,j-1,k-1)
10904 +facy*sy(i ,j-1,k-1)
10905 +facz*sz(i ,j-1,k-1))
10906 + sol(i-1,j+1,k-1)*(facx*sx(i-1,j ,k-1)
10907 +facy*sy(i-1,j ,k-1)
10908 +facz*sz(i-1,j ,k-1))
10909 + sol(i+1,j+1,k-1)*(facx*sx(i ,j ,k-1)
10910 +facy*sy(i ,j ,k-1)
10911 +facz*sz(i ,j ,k-1))
10912 + sol(i-1,j-1,k+1)*(facx*sx(i-1,j-1,k )
10913 +facy*sy(i-1,j-1,k )
10914 +facz*sz(i-1,j-1,k ))
10915 + sol(i+1,j-1,k+1)*(facx*sx(i ,j-1,k )
10916 +facy*sy(i ,j-1,k )
10917 +facz*sz(i ,j-1,k ))
10918 + sol(i-1,j+1,k+1)*(facx*sx(i-1,j ,k )
10919 +facy*sy(i-1,j ,k )
10920 +facz*sz(i-1,j ,k ))
10921 + sol(i+1,j+1,k+1)*(facx*sx(i ,j ,k )
10923 +facz*sz(i ,j ,k ))
10924 +sol(i ,j-1,k-1)*( -facx*(sx(i-1,j-1,k-1)+sx(i,j-1,k-1))
10925 +Real(2.0)*facy*(sy(i-1,j-1,k-1)+sy(i,j-1,k-1))
10926 +Real(2.0)*facz*(sz(i-1,j-1,k-1)+sz(i,j-1,k-1)))
10927 +sol(i ,j+1,k-1)*( -facx*(sx(i-1,j ,k-1)+sx(i,j ,k-1))
10928 +Real(2.0)*facy*(sy(i-1,j ,k-1)+sy(i,j ,k-1))
10929 +Real(2.0)*facz*(sz(i-1,j ,k-1)+sz(i,j ,k-1)))
10930 +sol(i ,j-1,k+1)*( -facx*(sx(i-1,j-1,k )+sx(i,j-1,k ))
10931 +Real(2.0)*facy*(sy(i-1,j-1,k )+sy(i,j-1,k ))
10932 +Real(2.0)*facz*(sz(i-1,j-1,k )+sz(i,j-1,k )))
10933 +sol(i ,j+1,k+1)*( -facx*(sx(i-1,j ,k )+sx(i,j ,k ))
10934 +Real(2.0)*facy*(sy(i-1,j ,k )+sy(i,j ,k ))
10935 +Real(2.0)*facz*(sz(i-1,j ,k )+sz(i,j ,k )))
10936 +sol(i-1,j ,k-1)*( Real(2.0)*facx*(sx(i-1,j-1,k-1)+sx(i-1,j,k-1))
10937 -facy*(sy(i-1,j-1,k-1)+sy(i-1,j,k-1))
10938 +Real(2.0)*facz*(sz(i-1,j-1,k-1)+sz(i-1,j,k-1)))
10939 +sol(i+1,j ,k-1)*( Real(2.0)*facx*(sx(i ,j-1,k-1)+sx(i ,j,k-1))
10940 -facy*(sy(i ,j-1,k-1)+sy(i ,j,k-1))
10941 +Real(2.0)*facz*(sz(i ,j-1,k-1)+sz(i ,j,k-1)))
10942 +sol(i-1,j ,k+1)*( Real(2.0)*facx*(sx(i-1,j-1,k )+sx(i-1,j,k ))
10943 -facy*(sy(i-1,j-1,k )+sy(i-1,j,k ))
10944 +Real(2.0)*facz*(sz(i-1,j-1,k )+sz(i-1,j,k )))
10945 +sol(i+1,j ,k+1)*( Real(2.0)*facx*(sx(i ,j-1,k )+sx(i ,j,k ))
10946 -facy*(sy(i ,j-1,k )+sy(i ,j,k ))
10947 +Real(2.0)*facz*(sz(i ,j-1,k )+sz(i ,j,k )))
10948 +sol(i-1,j-1,k )*( Real(2.0)*facx*(sx(i-1,j-1,k-1)+sx(i-1,j-1,k))
10949 +Real(2.0)*facy*(sy(i-1,j-1,k-1)+sy(i-1,j-1,k))
10950 -facz*(sz(i-1,j-1,k-1)+sz(i-1,j-1,k)))
10951 +sol(i+1,j-1,k )*( Real(2.0)*facx*(sx(i ,j-1,k-1)+sx(i ,j-1,k))
10952 +Real(2.0)*facy*(sy(i ,j-1,k-1)+sy(i ,j-1,k))
10953 -facz*(sz(i ,j-1,k-1)+sz(i ,j-1,k)))
10954 +sol(i-1,j+1,k )*( Real(2.0)*facx*(sx(i-1,j ,k-1)+sx(i-1,j ,k))
10955 +Real(2.0)*facy*(sy(i-1,j ,k-1)+sy(i-1,j ,k))
10956 -facz*(sz(i-1,j ,k-1)+sz(i-1,j ,k)))
10957 +sol(i+1,j+1,k )*( Real(2.0)*facx*(sx(i ,j ,k-1)+sx(i ,j ,k))
10958 +Real(2.0)*facy*(sy(i ,j ,k-1)+sy(i ,j ,k))
10959 -facz*(sz(i ,j ,k-1)+sz(i ,j ,k)))
10960 + 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))
10961 -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))
10962 -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)))
10963 + 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))
10964 -facy*(sy(i ,j-1,k-1)+sy(i ,j,k-1)+sy(i ,j-1,k)+sy(i ,j,k))
10965 -facz*(sz(i ,j-1,k-1)+sz(i ,j,k-1)+sz(i ,j-1,k)+sz(i ,j,k)))
10966 + 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))
10967 +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))
10968 -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)))
10969 + 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))
10970 +Real(2.0)*facy*(sy(i-1,j ,k-1)+sy(i,j ,k-1)+sy(i-1,j ,k)+sy(i,j ,k))
10971 -facz*(sz(i-1,j ,k-1)+sz(i,j ,k-1)+sz(i-1,j ,k)+sz(i,j ,k)))
10972 + 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))
10973 -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))
10974 +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)))
10975 + 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 ))
10976 -facy*(sy(i-1,j-1,k )+sy(i,j-1,k )+sy(i-1,j,k )+sy(i,j,k ))
10977 +Real(2.0)*facz*(sz(i-1,j-1,k )+sz(i,j-1,k )+sz(i-1,j,k )+sz(i,j,k )));
10979 sol(i,j,k) += (rhs(i,j,k) - Ax) / s0;
10986 Array4<Real const>
const& rhs, Array4<Real const>
const& sig,
10987 Array4<int const>
const& msk,
10988 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
int color) noexcept
10992 sol(i,j,k) = Real(0.0);
10994 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
10995 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
10996 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
10997 Real fxyz = facx + facy + facz;
10998 Real fmx2y2z = -facx + Real(2.0)*facy + Real(2.0)*facz;
10999 Real f2xmy2z = Real(2.0)*facx - facy + Real(2.0)*facz;
11000 Real f2x2ymz = Real(2.0)*facx + Real(2.0)*facy - facz;
11001 Real f4xm2ym2z = Real(4.0)*facx - Real(2.0)*facy - Real(2.0)*facz;
11002 Real fm2x4ym2z = -Real(2.0)*facx + Real(4.0)*facy - Real(2.0)*facz;
11003 Real fm2xm2y4z = -Real(2.0)*facx - Real(2.0)*facy + Real(4.0)*facz;
11005 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)
11006 +sig(i-1,j-1,k )+sig(i,j-1,k )+sig(i-1,j,k )+sig(i,j,k ));
11007 Real Ax = sol(i,j,k)*s0
11008 + fxyz*(sol(i-1,j-1,k-1)*sig(i-1,j-1,k-1)
11009 + sol(i+1,j-1,k-1)*sig(i ,j-1,k-1)
11010 + sol(i-1,j+1,k-1)*sig(i-1,j ,k-1)
11011 + sol(i+1,j+1,k-1)*sig(i ,j ,k-1)
11012 + sol(i-1,j-1,k+1)*sig(i-1,j-1,k )
11013 + sol(i+1,j-1,k+1)*sig(i ,j-1,k )
11014 + sol(i-1,j+1,k+1)*sig(i-1,j ,k )
11015 + sol(i+1,j+1,k+1)*sig(i ,j ,k ))
11016 + fmx2y2z*(sol(i ,j-1,k-1)*(sig(i-1,j-1,k-1)+sig(i,j-1,k-1))
11017 + sol(i ,j+1,k-1)*(sig(i-1,j ,k-1)+sig(i,j ,k-1))
11018 + sol(i ,j-1,k+1)*(sig(i-1,j-1,k )+sig(i,j-1,k ))
11019 + sol(i ,j+1,k+1)*(sig(i-1,j ,k )+sig(i,j ,k )))
11020 + f2xmy2z*(sol(i-1,j ,k-1)*(sig(i-1,j-1,k-1)+sig(i-1,j,k-1))
11021 + sol(i+1,j ,k-1)*(sig(i ,j-1,k-1)+sig(i ,j,k-1))
11022 + sol(i-1,j ,k+1)*(sig(i-1,j-1,k )+sig(i-1,j,k ))
11023 + sol(i+1,j ,k+1)*(sig(i ,j-1,k )+sig(i ,j,k )))
11024 + f2x2ymz*(sol(i-1,j-1,k )*(sig(i-1,j-1,k-1)+sig(i-1,j-1,k))
11025 + sol(i+1,j-1,k )*(sig(i ,j-1,k-1)+sig(i ,j-1,k))
11026 + sol(i-1,j+1,k )*(sig(i-1,j ,k-1)+sig(i-1,j ,k))
11027 + sol(i+1,j+1,k )*(sig(i ,j ,k-1)+sig(i ,j ,k)))
11028 + 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))
11029 + 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)))
11030 + 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))
11031 + 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)))
11032 + 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))
11033 + 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 )));
11035 sol(i,j,k) += (rhs(i,j,k) - Ax) / s0;
11042 Array4<Real const>
const& rhs, Real sig,
11043 Array4<int const>
const& msk,
11044 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
int color) noexcept
11048 sol(i,j,k) = Real(0.0);
11050 Real facx = Real(1.0/36.0)*dxinv[0]*dxinv[0];
11051 Real facy = Real(1.0/36.0)*dxinv[1]*dxinv[1];
11052 Real facz = Real(1.0/36.0)*dxinv[2]*dxinv[2];
11053 Real fxyz = facx + facy + facz;
11054 Real fmx2y2z = -facx + Real(2.0)*facy + Real(2.0)*facz;
11055 Real f2xmy2z = Real(2.0)*facx - facy + Real(2.0)*facz;
11056 Real f2x2ymz = Real(2.0)*facx + Real(2.0)*facy - facz;
11057 Real f4xm2ym2z = Real(4.0)*facx - Real(2.0)*facy - Real(2.0)*facz;
11058 Real fm2x4ym2z = -Real(2.0)*facx + Real(4.0)*facy - Real(2.0)*facz;
11059 Real fm2xm2y4z = -Real(2.0)*facx - Real(2.0)*facy + Real(4.0)*facz;
11061 Real s0 = Real(-4.0)*fxyz*Real(8.);
11062 Real Ax = sol(i,j,k)*s0
11063 + fxyz*(sol(i-1,j-1,k-1)
11070 + sol(i+1,j+1,k+1))
11071 + fmx2y2z*(sol(i ,j-1,k-1)*Real(2.)
11072 + sol(i ,j+1,k-1)*Real(2.)
11073 + sol(i ,j-1,k+1)*Real(2.)
11074 + sol(i ,j+1,k+1)*Real(2.))
11075 + f2xmy2z*(sol(i-1,j ,k-1)*Real(2.)
11076 + sol(i+1,j ,k-1)*Real(2.)
11077 + sol(i-1,j ,k+1)*Real(2.)
11078 + sol(i+1,j ,k+1)*Real(2.))
11079 + f2x2ymz*(sol(i-1,j-1,k )*Real(2.)
11080 + sol(i+1,j-1,k )*Real(2.)
11081 + sol(i-1,j+1,k )*Real(2.)
11082 + sol(i+1,j+1,k )*Real(2.))
11083 + f4xm2ym2z*(sol(i-1,j,k)*Real(4.)
11084 + sol(i+1,j,k)*Real(4.))
11085 + fm2x4ym2z*(sol(i,j-1,k)*Real(4.)
11086 + sol(i,j+1,k)*Real(4.))
11087 + fm2xm2y4z*(sol(i,j,k-1)*Real(4.)
11088 + sol(i,j,k+1)*Real(4.));
11090 sol(i,j,k) += (rhs(i,j,k) - Ax*sig) / (s0*sig);
11097 Array4<Real const>
const& rhs,
11098 Array4<Real const>
const& sten,
11099 Array4<int const>
const& msk,
int color) noexcept
#define AMREX_PRAGMA_SIMD
Definition: AMReX_Extension.H:80
#define AMREX_FORCE_INLINE
Definition: AMReX_Extension.H:119
#define AMREX_HOST_DEVICE_FOR_3D(...)
Definition: AMReX_GpuLaunch.nolint.H:50
#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
if(!(yy_init))
Definition: amrex_iparser.lex.nolint.H:935
AMREX_GPU_HOST_DEVICE BoxND & growHi(int idir, int n_cell=1) noexcept
Grow the BoxND on the high end by n_cell cells in direction idir. NOTE: n_cell negative shrinks the B...
Definition: AMReX_Box.H:659
AMREX_GPU_HOST_DEVICE BoxND & growLo(int idir, int n_cell=1) noexcept
Grow the BoxND on the low end by n_cell cells in direction idir. NOTE: n_cell negative shrinks the Bo...
Definition: AMReX_Box.H:648
HYPRE_Int Int
Definition: AMReX_HypreNodeLap.H:36
#define abs(x)
Definition: complex-type.h:85
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:2753
constexpr int ist_pp0
Definition: AMReX_MLNodeLap_3D_K.H:2757
constexpr int fine_cell
Definition: AMReX_MLNodeLap_K.H:57
constexpr int ist_p00
Definition: AMReX_MLNodeLap_3D_K.H:2754
constexpr int fine_node
Definition: AMReX_MLNodeLap_K.H:60
constexpr int ist_ppp
Definition: AMReX_MLNodeLap_3D_K.H:2760
constexpr int ist_00p
Definition: AMReX_MLNodeLap_3D_K.H:2756
constexpr int crse_node
Definition: AMReX_MLNodeLap_K.H:58
constexpr int crse_cell
Definition: AMReX_MLNodeLap_K.H:56
constexpr int ist_p0p
Definition: AMReX_MLNodeLap_3D_K.H:2758
constexpr int ist_inv
Definition: AMReX_MLNodeLap_3D_K.H:2761
constexpr int ist_0p0
Definition: AMReX_MLNodeLap_3D_K.H:2755
constexpr int crse_fine_node
Definition: AMReX_MLNodeLap_K.H:59
constexpr double eps
Definition: AMReX_MLNodeLap_K.H:64
constexpr int n_sten
Definition: AMReX_MLNodeLap_3D_K.H:2762
constexpr int ist_0pp
Definition: AMReX_MLNodeLap_3D_K.H:2759
constexpr Real almostone
Definition: AMReX_MLNodeLap_K.H:66
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:158
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:585
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:1991
void mlndlap_bc_doit(Box const &vbx, Array4< T > const &a, Box const &domain, GpuArray< bool, AMREX_SPACEDIM > const &bflo, GpuArray< bool, AMREX_SPACEDIM > const &bfhi) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:110
AMREX_ATTRIBUTE_FLATTEN_FOR void LoopOnCpu(Dim3 lo, Dim3 hi, F const &f) noexcept
Definition: AMReX_Loop.H:354
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_set_nodal_mask(int i, int, int, Array4< int > const &nmsk, Array4< int const > const &cmsk) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:8
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:1473
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:1183
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:224
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:377
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:1745
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:331
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:198
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:103
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:2006
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:567
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:157
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:299
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:172
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:247
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:231
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< dim > grow(const BoxND< dim > &b, int i) noexcept
Grow BoxND in all directions by given amount.
Definition: AMReX_Box.H:1211
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:555
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:392
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:546
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:276
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:516
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:190
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:1373
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_restriction(int i, int, int, Array4< Real > const &crse, Array4< Real const > const &fine, Array4< int const > const &msk) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:340
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:491
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:429
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_semi_restriction(int, int, int, Array4< Real > const &, Array4< Real const > const &, Array4< int const > const &, int) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:385
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:540
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:898
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:81
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:143
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:1010
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:410
IntVectND< AMREX_SPACEDIM > IntVect
Definition: AMReX_BaseFwd.H:30
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:528
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:443
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:497
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:560
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:638
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:607
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:471
AMREX_GPU_HOST_DEVICE AMREX_ATTRIBUTE_FLATTEN_FOR void LoopConcurrent(Dim3 lo, Dim3 hi, F const &f) noexcept
Definition: AMReX_Loop.H:149
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:573
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:617
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:1782
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:1159
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:1415
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:907
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:579
void Abort(const std::string &msg)
Print out message to cerr and exit via abort().
Definition: AMReX.cpp:221
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:508
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_set_dirichlet_mask(Box const &bx, Array4< int > const &dmsk, Array4< int const > const &omsk, Box const &dom, GpuArray< LinOpBCType, AMREX_SPACEDIM > const &bclo, GpuArray< LinOpBCType, AMREX_SPACEDIM > const &bchi) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:24
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:180
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:94
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndlap_set_dot_mask(Box const &bx, Array4< Real > const &dmsk, Array4< int const > const &omsk, Box const &dom, GpuArray< LinOpBCType, AMREX_SPACEDIM > const &bclo, GpuArray< LinOpBCType, AMREX_SPACEDIM > const &bchi) noexcept
Definition: AMReX_MLNodeLap_1D_K.H:51
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:309
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:435
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:1459
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:889
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:550
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:1823
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:458
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:481
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:1768
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:1246
Definition: AMReX_Array4.H:61