1 #ifndef AMREX_ML_EB_TENSOR_3D_K_H_
2 #define AMREX_ML_EB_TENSOR_3D_K_H_
3 #include <AMReX_Config.H>
13 int khip,
int khim,
int klop,
int klom) noexcept
15 return Real(0.5)*dzi * ((vel(i ,j,khip,n)-vel(i ,j,khim,n))*whi +
16 (vel(i-1,j,klop,n)-vel(i-1,j,klom,n))*wlo);
23 int khip,
int khim,
int klop,
int klom) noexcept
25 return Real(0.5)*dzi * ((vel(i,j ,khip,n)-vel(i,j ,khim,n))*whi +
26 (vel(i,j-1,klop,n)-vel(i,j-1,klom,n))*wlo);
33 int ihip,
int ihim,
int ilop,
int ilom) noexcept
35 return Real(0.5)*dxi * ((vel(ihip,j,k ,n)-vel(ihim,j,k ,n))*whi +
36 (vel(ilop,j,k-1,n)-vel(ilom,j,k-1,n))*wlo);
43 int jhip,
int jhim,
int jlop,
int jlom) noexcept
45 return Real(0.5)*dyi * ((vel(i,jhip,k ,n)-vel(i,jhim,k ,n))*whi +
46 (vel(i,jlop,k-1,n)-vel(i,jlom,k-1,n))*wlo);
51 Array4<Real const>
const& vel,
52 Array4<Real const>
const& etax,
53 Array4<Real const>
const& kapx,
54 Array4<Real const>
const& apx,
55 Array4<EBCellFlag const>
const& flag,
56 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
58 const Real dyi = dxinv[1];
59 const Real dzi = dxinv[2];
62 constexpr Real twoThirds = 2./3.;
64 for (
int k = lo.z; k <= hi.z; ++k) {
65 for (
int j = lo.y; j <= hi.y; ++j) {
67 for (
int i = lo.x; i <= hi.x; ++i) {
68 if (apx(i,j,k) == Real(0.0))
70 fx(i,j,k,0) = Real(0.0);
71 fx(i,j,k,1) = Real(0.0);
72 fx(i,j,k,2) = Real(0.0);
76 int jhip = j + flag(i ,j,k).isConnected(0, 1,0);
77 int jhim = j - flag(i ,j,k).isConnected(0,-1,0);
78 int jlop = j + flag(i-1,j,k).isConnected(0, 1,0);
79 int jlom = j - flag(i-1,j,k).isConnected(0,-1,0);
83 whi,wlo,jhip,jhim,jlop,jlom);
85 whi,wlo,jhip,jhim,jlop,jlom);
86 int khip = k + flag(i ,j,k).isConnected(0,0, 1);
87 int khim = k - flag(i ,j,k).isConnected(0,0,-1);
88 int klop = k + flag(i-1,j,k).isConnected(0,0, 1);
89 int klom = k - flag(i-1,j,k).isConnected(0,0,-1);
93 whi,wlo,khip,khim,klop,klom);
95 whi,wlo,khip,khim,klop,klom);
96 Real divu = dvdy + dwdz;
97 Real xif = kapx(i,j,k);
98 Real mun = Real(0.75)*(etax(i,j,k,0)-xif);
99 Real mut = etax(i,j,k,1);
100 fx(i,j,k,0) = -mun*(-twoThirds*divu) - xif*divu;
101 fx(i,j,k,1) = -mut*dudy;
102 fx(i,j,k,2) = -mut*dudz;
111 Array4<Real const>
const& vel,
112 Array4<Real const>
const& etay,
113 Array4<Real const>
const& kapy,
114 Array4<Real const>
const& apy,
115 Array4<EBCellFlag const>
const& flag,
116 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
118 const Real dxi = dxinv[0];
119 const Real dzi = dxinv[2];
122 constexpr Real twoThirds = 2./3.;
124 for (
int k = lo.z; k <= hi.z; ++k) {
125 for (
int j = lo.y; j <= hi.y; ++j) {
127 for (
int i = lo.x; i <= hi.x; ++i) {
128 if (apy(i,j,k) == Real(0.0))
130 fy(i,j,k,0) = Real(0.0);
131 fy(i,j,k,1) = Real(0.0);
132 fy(i,j,k,2) = Real(0.0);
136 int ihip = i + flag(i,j ,k).isConnected( 1,0,0);
137 int ihim = i - flag(i,j ,k).isConnected(-1,0,0);
138 int ilop = i + flag(i,j-1,k).isConnected( 1,0,0);
139 int ilom = i - flag(i,j-1,k).isConnected(-1,0,0);
143 whi,wlo,ihip,ihim,ilop,ilom);
145 whi,wlo,ihip,ihim,ilop,ilom);
146 int khip = k + flag(i,j ,k).isConnected(0,0, 1);
147 int khim = k - flag(i,j ,k).isConnected(0,0,-1);
148 int klop = k + flag(i,j-1,k).isConnected(0,0, 1);
149 int klom = k - flag(i,j-1,k).isConnected(0,0,-1);
153 whi,wlo,khip,khim,klop,klom);
155 whi,wlo,khip,khim,klop,klom);
156 Real divu = dudx + dwdz;
157 Real xif = kapy(i,j,k);
158 Real mun = Real(0.75)*(etay(i,j,k,1)-xif);
159 Real mut = etay(i,j,k,0);
160 fy(i,j,k,0) = -mut*dvdx;
161 fy(i,j,k,1) = -mun*(-twoThirds*divu) - xif*divu;
162 fy(i,j,k,2) = -mut*dvdz;
178 const Real dxi = dxinv[0];
179 const Real dyi = dxinv[1];
182 constexpr Real twoThirds = 2./3.;
184 for (
int k = lo.z; k <= hi.z; ++k) {
185 for (
int j = lo.y; j <= hi.y; ++j) {
187 for (
int i = lo.x; i <= hi.x; ++i) {
188 if (apz(i,j,k) == Real(0.0))
190 fz(i,j,k,0) = Real(0.0);
191 fz(i,j,k,1) = Real(0.0);
192 fz(i,j,k,2) = Real(0.0);
196 int ihip = i + flag(i,j,k ).isConnected( 1,0,0);
197 int ihim = i - flag(i,j,k ).isConnected(-1,0,0);
198 int ilop = i + flag(i,j,k-1).isConnected( 1,0,0);
199 int ilom = i - flag(i,j,k-1).isConnected(-1,0,0);
203 whi,wlo,ihip,ihim,ilop,ilom);
205 whi,wlo,ihip,ihim,ilop,ilom);
206 int jhip = j + flag(i,j,k ).isConnected(0, 1,0);
207 int jhim = j - flag(i,j,k ).isConnected(0,-1,0);
208 int jlop = j + flag(i,j,k-1).isConnected(0, 1,0);
209 int jlom = j - flag(i,j,k-1).isConnected(0,-1,0);
213 whi,wlo,jhip,jhim,jlop,jlom);
215 whi,wlo,jhip,jhim,jlop,jlom);
216 Real divu = dudx + dvdy;
217 Real xif = kapz(i,j,k);
218 Real mun = Real(0.75)*(etaz(i,j,k,2)-xif);
219 Real mut = etaz(i,j,k,0);
221 fz(i,j,k,0) = -mut*dwdx;
222 fz(i,j,k,1) = -mut*dwdy;
223 fz(i,j,k,2) = -mun*(-twoThirds*divu) - xif*divu;
237 0,AMREX_SPACEDIM>
const& bct,
240 int khip,
int khim,
int klop,
int klom) noexcept
246 ddz = (bvxlo(i-1,j,k ,n) * Real(-1.5) +
247 bvxlo(i-1,j,k+1,n) * Real(2.) +
248 bvxlo(i-1,j,k+2,n) * Real(-0.5)) * dzi;
249 }
else if (k == dhi.z) {
250 ddz = -(bvxlo(i-1,j,k ,n) * Real(-1.5) +
251 bvxlo(i-1,j,k-1,n) * Real(2.) +
252 bvxlo(i-1,j,k-2,n) * Real(-0.5)) * dzi;
254 ddz = wlo*dzi*(bvxlo(i-1,j,klop,n)-bvxlo(i-1,j,klom,n));
257 ddz = whi*dzi*(vel(i,j,khip,n)-vel(i,j,khim,n));
261 }
else if (i == dhi.x+1) {
264 ddz = (bvxhi(i,j,k ,n) * Real(-1.5) +
265 bvxhi(i,j,k+1,n) * Real(2.) +
266 bvxhi(i,j,k+2,n) * Real(-0.5)) * dzi;
267 }
else if (k == dhi.z) {
268 ddz = -(bvxhi(i,j,k ,n) * Real(-1.5) +
269 bvxhi(i,j,k-1,n) * Real(2.) +
270 bvxhi(i,j,k-2,n) * Real(-0.5)) * dzi;
272 ddz = whi*dzi*(bvxhi(i,j,khip,n)-bvxhi(i,j,khim,n));
275 ddz = wlo*dzi*(vel(i-1,j,klop,n)-vel(i-1,j,klom,n));
280 ddz =
mlebtensor_dz_on_xface(i,j,k,n,vel,dzi,whi,wlo,khip,khim,klop,klom);
292 0,AMREX_SPACEDIM>
const& bct,
295 int khip,
int khim,
int klop,
int klom) noexcept
301 ddz = (bvylo(i,j-1,k ,n) * Real(-1.5) +
302 bvylo(i,j-1,k+1,n) * Real(2.) +
303 bvylo(i,j-1,k+2,n) * Real(-0.5)) * dzi;
304 }
else if (k == dhi.z) {
305 ddz = -(bvylo(i,j-1,k ,n) * Real(-1.5) +
306 bvylo(i,j-1,k-1,n) * Real(2.) +
307 bvylo(i,j-1,k-2,n) * Real(-0.5)) * dzi;
309 ddz = wlo*dzi*(bvylo(i,j-1,klop,n)-bvylo(i,j-1,klom,n));
312 ddz = whi*dzi*(vel(i,j,khip,n)-vel(i,j,khim,n));
316 }
else if (j == dhi.y+1) {
319 ddz = (bvyhi(i,j,k ,n) * Real(-1.5) +
320 bvyhi(i,j,k+1,n) * Real(2.) +
321 bvyhi(i,j,k+2,n) * Real(-0.5)) * dzi;
322 }
else if (k == dhi.z) {
323 ddz = -(bvyhi(i,j,k ,n) * Real(-1.5) +
324 bvyhi(i,j,k-1,n) * Real(2.) +
325 bvyhi(i,j,k-2,n) * Real(-0.5)) * dzi;
327 ddz = whi*dzi*(bvyhi(i,j,khip,n)-bvyhi(i,j,khim,n));
330 ddz = wlo*dzi*(vel(i,j-1,klop,n)-vel(i,j-1,klom,n));
335 ddz =
mlebtensor_dz_on_yface(i,j,k,n,vel,dzi,whi,wlo,khip,khim,klop,klom);
347 0,AMREX_SPACEDIM>
const& bct,
350 int ihip,
int ihim,
int ilop,
int ilom) noexcept
356 ddx = (bvzlo(i ,j,k-1,n) * Real(-1.5) +
357 bvzlo(i+1,j,k-1,n) * Real(2.) +
358 bvzlo(i+2,j,k-1,n) * Real(-0.5)) * dxi;
359 }
else if (i == dhi.x) {
360 ddx = -(bvzlo(i ,j,k-1,n) * Real(-1.5) +
361 bvzlo(i-1,j,k-1,n) * Real(2.) +
362 bvzlo(i-2,j,k-1,n) * Real(-0.5)) * dxi;
364 ddx = wlo*dxi*(bvzlo(ilop,j,k-1,n)-bvzlo(ilom,j,k-1,n));
367 ddx = whi*dxi*(vel(ihip,j,k,n)-vel(ihim,j,k,n));
371 }
else if (k == dhi.z+1) {
374 ddx = (bvzhi(i ,j,k,n) * Real(-1.5) +
375 bvzhi(i+1,j,k,n) * Real(2.) +
376 bvzhi(i+2,j,k,n) * Real(-0.5)) * dxi;
377 }
else if (i == dhi.x) {
378 ddx = -(bvzhi(i ,j,k,n) * Real(-1.5) +
379 bvzhi(i-1,j,k,n) * Real(2.) +
380 bvzhi(i-2,j,k,n) * Real(-0.5)) * dxi;
382 ddx = whi*dxi*(bvzhi(ihip,j,k,n)-bvzhi(ihim,j,k,n));
385 ddx = wlo*dxi*(vel(ilop,j,k-1,n)-vel(ilom,j,k-1,n));
390 ddx =
mlebtensor_dx_on_zface(i,j,k,n,vel,dxi,whi,wlo,ihip,ihim,ilop,ilom);
403 0,AMREX_SPACEDIM>
const& bct,
406 int jhip,
int jhim,
int jlop,
int jlom) noexcept
412 ddy = (bvzlo(i,j ,k-1,n) * Real(-1.5) +
413 bvzlo(i,j+1,k-1,n) * Real(2.) +
414 bvzlo(i,j+2,k-1,n) * Real(-0.5)) * dyi;
415 }
else if (j == dhi.y) {
416 ddy = -(bvzlo(i,j ,k-1,n) * Real(-1.5) +
417 bvzlo(i,j-1,k-1,n) * Real(2.) +
418 bvzlo(i,j-2,k-1,n) * Real(-0.5)) * dyi;
420 ddy = wlo*dyi*(bvzlo(i,jlop,k-1,n)-bvzlo(i,jlom,k-1,n));
423 ddy = whi*dyi*(vel(i,jhip,k,n)-vel(i,jhim,k,n));
427 }
else if (k == dhi.z+1) {
430 ddy = (bvzhi(i,j ,k,n) * Real(-1.5) +
431 bvzhi(i,j+1,k,n) * Real(2.) +
432 bvzhi(i,j+2,k,n) * Real(-0.5)) * dyi;
433 }
else if (j == dhi.y) {
434 ddy = -(bvzhi(i,j ,k,n) * Real(-1.5) +
435 bvzhi(i,j-1,k,n) * Real(2.) +
436 bvzhi(i,j-2,k,n) * Real(-0.5)) * dyi;
438 ddy = whi*dyi*(bvzhi(i,jhip,k,n)-bvzhi(i,jhim,k,n));
441 ddy = wlo*dyi*(vel(i,jlop,k-1,n)-vel(i,jlom,k-1,n));
446 ddy =
mlebtensor_dy_on_zface(i,j,k,n,vel,dyi,whi,wlo,jhip,jhim,jlop,jlom);
453 Array4<Real const>
const& vel,
454 Array4<Real const>
const& etax,
455 Array4<Real const>
const& kapx,
456 Array4<Real const>
const& apx,
457 Array4<EBCellFlag const>
const& flag,
458 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
459 Array4<Real const>
const& bvxlo,
460 Array4<Real const>
const& bvxhi,
463 0,AMREX_SPACEDIM>
const& bct,
464 Dim3
const& dlo, Dim3
const& dhi) noexcept
467 const Real dyi = dxinv[1];
468 const Real dzi = dxinv[2];
471 constexpr Real twoThirds = 2./3.;
473 for (
int k = lo.z; k <= hi.z; ++k) {
474 for (
int j = lo.y; j <= hi.y; ++j) {
476 for (
int i = lo.x; i <= hi.x; ++i) {
477 if (apx(i,j,k) == Real(0.0))
479 fx(i,j,k,0) = Real(0.0);
480 fx(i,j,k,1) = Real(0.0);
481 fx(i,j,k,2) = Real(0.0);
485 int jhip = j + flag(i ,j,k).isConnected(0, 1,0);
486 int jhim = j - flag(i ,j,k).isConnected(0,-1,0);
487 int jlop = j + flag(i-1,j,k).isConnected(0, 1,0);
488 int jlom = j - flag(i-1,j,k).isConnected(0,-1,0);
492 bvxlo,bvxhi,bct,dlo,dhi,
493 whi,wlo,jhip,jhim,jlop,jlom);
495 bvxlo,bvxhi,bct,dlo,dhi,
496 whi,wlo,jhip,jhim,jlop,jlom);
497 int khip = k + flag(i ,j,k).isConnected(0,0, 1);
498 int khim = k - flag(i ,j,k).isConnected(0,0,-1);
499 int klop = k + flag(i-1,j,k).isConnected(0,0, 1);
500 int klom = k - flag(i-1,j,k).isConnected(0,0,-1);
504 bvxlo,bvxhi,bct,dlo,dhi,
505 whi,wlo,khip,khim,klop,klom);
507 bvxlo,bvxhi,bct,dlo,dhi,
508 whi,wlo,khip,khim,klop,klom);
509 Real divu = dvdy + dwdz;
510 Real xif = kapx(i,j,k);
511 Real mun = Real(0.75)*(etax(i,j,k,0)-xif);
512 Real mut = etax(i,j,k,1);
513 fx(i,j,k,0) = -mun*(-twoThirds*divu) - xif*divu;
514 fx(i,j,k,1) = -mut*dudy;
515 fx(i,j,k,2) = -mut*dudz;
524 Array4<Real const>
const& vel,
525 Array4<Real const>
const& etay,
526 Array4<Real const>
const& kapy,
527 Array4<Real const>
const& apy,
528 Array4<EBCellFlag const>
const& flag,
529 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
530 Array4<Real const>
const& bvylo,
531 Array4<Real const>
const& bvyhi,
534 0,AMREX_SPACEDIM>
const& bct,
535 Dim3
const& dlo, Dim3
const& dhi) noexcept
537 const Real dxi = dxinv[0];
538 const Real dzi = dxinv[2];
541 constexpr Real twoThirds = 2./3.;
543 for (
int k = lo.z; k <= hi.z; ++k) {
544 for (
int j = lo.y; j <= hi.y; ++j) {
546 for (
int i = lo.x; i <= hi.x; ++i) {
547 if (apy(i,j,k) == Real(0.0))
549 fy(i,j,k,0) = Real(0.0);
550 fy(i,j,k,1) = Real(0.0);
551 fy(i,j,k,2) = Real(0.0);
555 int ihip = i + flag(i,j ,k).isConnected( 1,0,0);
556 int ihim = i - flag(i,j ,k).isConnected(-1,0,0);
557 int ilop = i + flag(i,j-1,k).isConnected( 1,0,0);
558 int ilom = i - flag(i,j-1,k).isConnected(-1,0,0);
562 bvylo,bvyhi,bct,dlo,dhi,
563 whi,wlo,ihip,ihim,ilop,ilom);
565 bvylo,bvyhi,bct,dlo,dhi,
566 whi,wlo,ihip,ihim,ilop,ilom);
567 int khip = k + flag(i,j ,k).isConnected(0,0, 1);
568 int khim = k - flag(i,j ,k).isConnected(0,0,-1);
569 int klop = k + flag(i,j-1,k).isConnected(0,0, 1);
570 int klom = k - flag(i,j-1,k).isConnected(0,0,-1);
574 bvylo,bvyhi,bct,dlo,dhi,
575 whi,wlo,khip,khim,klop,klom);
577 bvylo,bvyhi,bct,dlo,dhi,
578 whi,wlo,khip,khim,klop,klom);
579 Real divu = dudx + dwdz;
580 Real xif = kapy(i,j,k);
581 Real mun = Real(0.75)*(etay(i,j,k,1)-xif);
582 Real mut = etay(i,j,k,0);
583 fy(i,j,k,0) = -mut*dvdx;
584 fy(i,j,k,1) = -mun*(-twoThirds*divu) - xif*divu;
585 fy(i,j,k,2) = -mut*dvdz;
604 0,AMREX_SPACEDIM>
const& bct,
605 Dim3 const& dlo,
Dim3 const& dhi) noexcept
607 const Real dxi = dxinv[0];
608 const Real dyi = dxinv[1];
611 constexpr Real twoThirds = 2./3.;
613 for (
int k = lo.z; k <= hi.z; ++k) {
614 for (
int j = lo.y; j <= hi.y; ++j) {
616 for (
int i = lo.x; i <= hi.x; ++i) {
617 if (apz(i,j,k) == Real(0.0))
619 fz(i,j,k,0) = Real(0.0);
620 fz(i,j,k,1) = Real(0.0);
621 fz(i,j,k,2) = Real(0.0);
625 int ihip = i + flag(i,j,k ).isConnected( 1,0,0);
626 int ihim = i - flag(i,j,k ).isConnected(-1,0,0);
627 int ilop = i + flag(i,j,k-1).isConnected( 1,0,0);
628 int ilom = i - flag(i,j,k-1).isConnected(-1,0,0);
632 bvzlo,bvzhi,bct,dlo,dhi,
633 whi,wlo,ihip,ihim,ilop,ilom);
635 bvzlo,bvzhi,bct,dlo,dhi,
636 whi,wlo,ihip,ihim,ilop,ilom);
637 int jhip = j + flag(i,j,k ).isConnected(0, 1,0);
638 int jhim = j - flag(i,j,k ).isConnected(0,-1,0);
639 int jlop = j + flag(i,j,k-1).isConnected(0, 1,0);
640 int jlom = j - flag(i,j,k-1).isConnected(0,-1,0);
644 bvzlo,bvzhi,bct,dlo,dhi,
645 whi,wlo,jhip,jhim,jlop,jlom);
647 bvzlo,bvzhi,bct,dlo,dhi,
648 whi,wlo,jhip,jhim,jlop,jlom);
649 Real divu = dudx + dvdy;
650 Real xif = kapz(i,j,k);
651 Real mun = Real(0.75)*(etaz(i,j,k,2)-xif);
652 Real mut = etaz(i,j,k,0);
654 fz(i,j,k,0) = -mut*dwdx;
655 fz(i,j,k,1) = -mut*dwdy;
656 fz(i,j,k,2) = -mun*(-twoThirds*divu) - xif*divu;
682 bool is_dirichlet,
bool is_inhomog,
684 Real bscalar) noexcept
686 const Real dxi = dxinv[0];
687 const Real dyi = dxinv[1];
688 const Real dzi = dxinv[2];
692 for (
int k = lo.z; k <= hi.z; ++k) {
693 for (
int j = lo.y; j <= hi.y; ++j) {
695 for (
int i = lo.x; i <= hi.x; ++i) {
696 if (flag(i,j,k).isRegular())
698 Ax(i,j,k,0) += bscalar*(dxi*(fx(i+1,j ,k ,0) - fx(i,j,k,0))
699 + dyi*(fy(i ,j+1,k ,0) - fy(i,j,k,0))
700 + dzi*(fz(i ,j ,k+1,0) - fz(i,j,k,0)));
701 Ax(i,j,k,1) += bscalar*(dxi*(fx(i+1,j ,k ,1) - fx(i,j,k,1))
702 + dyi*(fy(i ,j+1,k ,1) - fy(i,j,k,1))
703 + dzi*(fz(i ,j ,k+1,1) - fz(i,j,k,1)));
704 Ax(i,j,k,2) += bscalar*(dxi*(fx(i+1,j ,k ,2) - fx(i,j,k,2))
705 + dyi*(fy(i ,j+1,k ,2) - fy(i,j,k,2))
706 + dzi*(fz(i ,j ,k+1,2) - fz(i,j,k,2)));
708 else if (flag(i,j,k).isSingleValued())
710 Real fxm_0 = fx(i,j,k,0);
711 Real fxm_1 = fx(i,j,k,1);
712 Real fxm_2 = fx(i,j,k,2);
713 if (apx(i,j,k) > Real(0.0) && apx(i,j,k) < Real(1.0)) {
714 int jj = j + (fcx(i,j,k,0) >= Real(0.0) ? 1 : -1);
715 int kk = k + (fcx(i,j,k,1) >= Real(0.0) ? 1 : -1);
716 Real fracy = (ccm(i-1,jj,k) || ccm(i,jj,k)) ?
std::abs(fcx(i,j,k,0)) : Real(0.0);
717 Real fracz = (ccm(i-1,j,kk) || ccm(i,j,kk)) ?
std::abs(fcx(i,j,k,1)) : Real(0.0);
718 fxm_0 = (Real(1.0)-fracy)*(Real(1.0)-fracz) *fxm_0
719 + fracy*(Real(1.0)-fracz) * fx(i,jj,k ,0)
720 + fracz*(Real(1.0)-fracy) * fx(i,j ,kk,0)
721 + fracy* fracz * fx(i,jj,kk,0);
722 fxm_1 = (Real(1.0)-fracy)*(Real(1.0)-fracz) *fxm_1
723 + fracy*(Real(1.0)-fracz) * fx(i,jj,k ,1)
724 + fracz*(Real(1.0)-fracy) * fx(i,j ,kk,1)
725 + fracy* fracz * fx(i,jj,kk,1);
726 fxm_2 = (Real(1.0)-fracy)*(Real(1.0)-fracz) *fxm_2
727 + fracy*(Real(1.0)-fracz) * fx(i,jj,k ,2)
728 + fracz*(Real(1.0)-fracy) * fx(i,j ,kk,2)
729 + fracy* fracz * fx(i,jj,kk,2);
732 Real fxp_0 = fx(i+1,j,k,0);
733 Real fxp_1 = fx(i+1,j,k,1);
734 Real fxp_2 = fx(i+1,j,k,2);
735 if (apx(i+1,j,k) > Real(0.0) && apx(i+1,j,k) < Real(1.0)) {
736 int jj = j + (fcx(i+1,j,k,0) >= Real(0.0) ? 1 : -1);
737 int kk = k + (fcx(i+1,j,k,1) >= Real(0.0) ? 1 : -1);
738 Real fracy = (ccm(i,jj,k) || ccm(i+1,jj,k)) ?
std::abs(fcx(i+1,j,k,0)) : Real(0.0);
739 Real fracz = (ccm(i,j,kk) || ccm(i+1,j,kk)) ?
std::abs(fcx(i+1,j,k,1)) : Real(0.0);
740 fxp_0 = (Real(1.0)-fracy)*(Real(1.0)-fracz) * fxp_0
741 + fracy*(Real(1.0)-fracz) * fx(i+1,jj,k ,0)
742 + fracz*(Real(1.0)-fracy) * fx(i+1,j ,kk,0)
743 + fracy* fracz * fx(i+1,jj,kk,0);
744 fxp_1 = (Real(1.0)-fracy)*(Real(1.0)-fracz) *fxp_1
745 + fracy*(Real(1.0)-fracz) * fx(i+1,jj,k ,1)
746 + fracz*(Real(1.0)-fracy) * fx(i+1,j ,kk,1)
747 + fracy* fracz * fx(i+1,jj,kk,1);
748 fxp_2 = (Real(1.0)-fracy)*(Real(1.0)-fracz) *fxp_2
749 + fracy*(Real(1.0)-fracz) * fx(i+1,jj,k ,2)
750 + fracz*(Real(1.0)-fracy) * fx(i+1,j ,kk,2)
751 + fracy* fracz * fx(i+1,jj,kk,2);
754 Real fym_0 = fy(i,j,k,0);
755 Real fym_1 = fy(i,j,k,1);
756 Real fym_2 = fy(i,j,k,2);
757 if (apy(i,j,k) > Real(0.0) && apy(i,j,k) < Real(1.0)) {
758 int ii = i + (fcy(i,j,k,0) >= Real(0.0) ? 1 : -1);
759 int kk = k + (fcy(i,j,k,1) >= Real(0.0) ? 1 : -1);
760 Real fracx = (ccm(ii,j-1,k) || ccm(ii,j,k)) ?
std::abs(fcy(i,j,k,0)) : Real(0.0);
761 Real fracz = (ccm(i,j-1,kk) || ccm(i,j,kk)) ?
std::abs(fcy(i,j,k,1)) : Real(0.0);
762 fym_0 = (Real(1.0)-fracx)*(Real(1.0)-fracz) *fym_0
763 + fracx*(Real(1.0)-fracz) * fy(ii,j,k ,0)
764 + fracz*(Real(1.0)-fracx) * fy(i ,j,kk,0)
765 + fracx* fracz * fy(ii,j,kk,0);
766 fym_1 = (Real(1.0)-fracx)*(Real(1.0)-fracz) *fym_1
767 + fracx*(Real(1.0)-fracz) * fy(ii,j,k ,1)
768 + fracz*(Real(1.0)-fracx) * fy(i ,j,kk,1)
769 + fracx* fracz * fy(ii,j,kk,1);
770 fym_2 = (Real(1.0)-fracx)*(Real(1.0)-fracz) *fym_2
771 + fracx*(Real(1.0)-fracz) * fy(ii,j,k ,2)
772 + fracz*(Real(1.0)-fracx) * fy(i ,j,kk,2)
773 + fracx* fracz * fy(ii,j,kk,2);
776 Real fyp_0 = fy(i,j+1,k,0);
777 Real fyp_1 = fy(i,j+1,k,1);
778 Real fyp_2 = fy(i,j+1,k,2);
779 if (apy(i,j+1,k) > Real(0.0) && apy(i,j+1,k) < Real(1.0)) {
780 int ii = i + (fcy(i,j+1,k,0) >= Real(0.0) ? 1 : -1);
781 int kk = k + (fcy(i,j+1,k,1) >= Real(0.0) ? 1 : -1);
782 Real fracx = (ccm(ii,j,k) || ccm(ii,j+1,k)) ?
std::abs(fcy(i,j+1,k,0)) : Real(0.0);
783 Real fracz = (ccm(i,j,kk) || ccm(i,j+1,kk)) ?
std::abs(fcy(i,j+1,k,1)) : Real(0.0);
784 fyp_0 = (Real(1.0)-fracx)*(Real(1.0)-fracz) * fyp_0
785 + fracx*(Real(1.0)-fracz) * fy(ii,j+1,k ,0)
786 + fracz*(Real(1.0)-fracx) * fy(i ,j+1,kk,0)
787 + fracx* fracz * fy(ii,j+1,kk,0);
788 fyp_1 = (Real(1.0)-fracx)*(Real(1.0)-fracz) *fyp_1
789 + fracx*(Real(1.0)-fracz) * fy(ii,j+1,k ,1)
790 + fracz*(Real(1.0)-fracx) * fy(i ,j+1,kk,1)
791 + fracx* fracz * fy(ii,j+1,kk,1);
792 fyp_2 = (Real(1.0)-fracx)*(Real(1.0)-fracz) *fyp_2
793 + fracx*(Real(1.0)-fracz) * fy(ii,j+1,k ,2)
794 + fracz*(Real(1.0)-fracx) * fy(i ,j+1,kk,2)
795 + fracx* fracz * fy(ii,j+1,kk,2);
798 Real fzm_0 = fz(i,j,k,0);
799 Real fzm_1 = fz(i,j,k,1);
800 Real fzm_2 = fz(i,j,k,2);
801 if (apz(i,j,k) > Real(0.0) && apz(i,j,k) < Real(1.0)) {
802 int ii = i + (fcz(i,j,k,0) >= Real(0.0) ? 1 : -1);
803 int jj = j + (fcz(i,j,k,1) >= Real(0.0) ? 1 : -1);
804 Real fracx = (ccm(ii,j,k-1) || ccm(ii,j,k)) ?
std::abs(fcz(i,j,k,0)) : Real(0.0);
805 Real fracy = (ccm(i,jj,k-1) || ccm(i,jj,k)) ?
std::abs(fcz(i,j,k,1)) : Real(0.0);
806 fzm_0 = (Real(1.0)-fracx)*(Real(1.0)-fracy) *fzm_0
807 + fracx*(Real(1.0)-fracy) * fz(ii,j ,k,0)
808 + fracy*(Real(1.0)-fracx) * fz(i ,jj,k,0)
809 + fracx* fracy * fz(ii,jj,k,0);
810 fzm_1 = (Real(1.0)-fracx)*(Real(1.0)-fracy) *fzm_1
811 + fracx*(Real(1.0)-fracy) * fz(ii,j ,k,1)
812 + fracy*(Real(1.0)-fracx) * fz(i ,jj,k,1)
813 + fracx* fracy * fz(ii,jj,k,1);
814 fzm_2 = (Real(1.0)-fracx)*(Real(1.0)-fracy) *fzm_2
815 + fracx*(Real(1.0)-fracy) * fz(ii,j ,k,2)
816 + fracy*(Real(1.0)-fracx) * fz(i ,jj,k,2)
817 + fracx* fracy * fz(ii,jj,k,2);
820 Real fzp_0 = fz(i,j,k+1,0);
821 Real fzp_1 = fz(i,j,k+1,1);
822 Real fzp_2 = fz(i,j,k+1,2);
823 if (apz(i,j,k+1) > Real(0.0) && apz(i,j,k+1) < Real(1.0)) {
824 int ii = i + (fcz(i,j,k+1,0) >= Real(0.0) ? 1 : -1);
825 int jj = j + (fcz(i,j,k+1,1) >= Real(0.0) ? 1 : -1);
826 Real fracx = (ccm(ii,j,k) || ccm(ii,j,k+1)) ?
std::abs(fcz(i,j,k+1,0)) : Real(0.0);
827 Real fracy = (ccm(i,jj,k) || ccm(i,jj,k+1)) ?
std::abs(fcz(i,j,k+1,1)) : Real(0.0);
828 fzp_0 = (Real(1.0)-fracx)*(Real(1.0)-fracy) * fzp_0
829 + fracx*(Real(1.0)-fracy) * fz(ii,j ,k+1,0)
830 + fracy*(Real(1.0)-fracx) * fz(i ,jj,k+1,0)
831 + fracx* fracy * fz(ii,jj,k+1,0);
832 fzp_1 = (Real(1.0)-fracx)*(Real(1.0)-fracy) *fzp_1
833 + fracx*(Real(1.0)-fracy) * fz(ii,j ,k+1,1)
834 + fracy*(Real(1.0)-fracx) * fz(i ,jj,k+1,1)
835 + fracx* fracy * fz(ii,jj,k+1,1);
836 fzp_2 = (Real(1.0)-fracx)*(Real(1.0)-fracy) *fzp_2
837 + fracx*(Real(1.0)-fracy) * fz(ii,j ,k+1,2)
838 + fracy*(Real(1.0)-fracx) * fz(i ,jj,k+1,2)
839 + fracx* fracy * fz(ii,jj,k+1,2);
842 Real kappa = vol(i,j,k);
843 Real feb_0 = Real(0.0);
844 Real feb_1 = Real(0.0);
845 Real feb_2 = Real(0.0);
849 Real dapx = apx(i+1,j,k)-apx(i,j,k);
850 Real dapy = apy(i,j+1,k)-apy(i,j,k);
851 Real dapz = apz(i,j,k+1)-apz(i,j,k);
852 Real anorminv = Real(1.0)/
std::sqrt(dapx*dapx+dapy*dapy+dapz*dapz);
853 Real anrmx = -dapx * anorminv;
854 Real anrmy = -dapy * anorminv;
855 Real anrmz = -dapz * anorminv;
857 Real velb_0 = 0, velb_1 = 0, velb_2 = 0;
860 velb_0 = velb(i,j,k,0);
861 velb_1 = velb(i,j,k,1);
862 velb_2 = velb(i,j,k,2);
865 Real dx_eb =
amrex::max(Real(0.3), (kappa*kappa-Real(0.25))/(Real(2.)*kappa));
869 Real dginv = Real(1.0)/dg;
870 Real gx = bc(i,j,k,0) - dg*anrmx;
871 Real gy = bc(i,j,k,1) - dg*anrmy;
872 Real gz = bc(i,j,k,2) - dg*anrmz;
873 int isx = (anrmx > Real(0.0)) ? 1 : -1;
874 int isy = (anrmy > Real(0.0)) ? 1 : -1;
875 int isz = (anrmz > Real(0.0)) ? 1 : -1;
880 gx *=
static_cast<Real
>(isx);
881 gy *=
static_cast<Real
>(isy);
882 gz *=
static_cast<Real
>(isz);
886 Real gxyz = gx*gy*gz;
887 Real oneggg = Real(1.0)+gx+gy+gz+gxy+gxz+gyz+gxyz;
889 Real velg = oneggg * vel(i ,j ,k ,0)
890 + (-gz - gxz - gyz - gxyz) * vel(i ,j ,kk,0)
891 + (-gy - gxy - gyz - gxyz) * vel(i ,jj,k ,0)
892 + (gyz + gxyz) * vel(i ,jj,kk,0)
893 + (-gx - gxy - gxz - gxyz) * vel(ii,j ,k ,0)
894 + (gxz + gxyz) * vel(ii,j ,kk,0)
895 + (gxy + gxyz) * vel(ii,jj,k ,0)
896 + (-gxyz) * vel(ii,jj,kk,0);
897 Real dudn = (velb_0-velg) * dginv;
899 velg = oneggg * vel(i ,j ,k ,1)
900 + (-gz - gxz - gyz - gxyz) * vel(i ,j ,kk,1)
901 + (-gy - gxy - gyz - gxyz) * vel(i ,jj,k ,1)
902 + (gyz + gxyz) * vel(i ,jj,kk,1)
903 + (-gx - gxy - gxz - gxyz) * vel(ii,j ,k ,1)
904 + (gxz + gxyz) * vel(ii,j ,kk,1)
905 + (gxy + gxyz) * vel(ii,jj,k ,1)
906 + (-gxyz) * vel(ii,jj,kk,1);
907 Real dvdn = (velb_1-velg) * dginv;
909 velg = oneggg * vel(i ,j ,k ,2)
910 + (-gz - gxz - gyz - gxyz) * vel(i ,j ,kk,2)
911 + (-gy - gxy - gyz - gxyz) * vel(i ,jj,k ,2)
912 + (gyz + gxyz) * vel(i ,jj,kk,2)
913 + (-gx - gxy - gxz - gxyz) * vel(ii,j ,k ,2)
914 + (gxz + gxyz) * vel(ii,j ,kk,2)
915 + (gxy + gxyz) * vel(ii,jj,k ,2)
916 + (-gxyz) * vel(ii,jj,kk,2);
917 Real dwdn = (velb_2-velg) * dginv;
920 Real dudx = dudn * anrmx;
921 Real dudy = dudn * anrmy;
922 Real dudz = dudn * anrmz;
923 Real dvdx = dvdn * anrmx;
924 Real dvdy = dvdn * anrmy;
925 Real dvdz = dvdn * anrmz;
926 Real dwdx = dwdn * anrmx;
927 Real dwdy = dwdn * anrmy;
928 Real dwdz = dwdn * anrmz;
929 Real divu = dudx + dvdy + dwdz;
930 Real xi = kapb(i,j,k);
931 Real mu = etab(i,j,k);
932 Real tautmp = (xi-Real(2./3.)*mu)*divu;
934 Real tauxx = mu*dudx + tautmp;
935 Real tauyx = mu*dvdx;
936 Real tauzx = mu*dwdx;
937 Real tauyy = mu*dvdy + tautmp;
938 Real tauxy = mu*dudy;
939 Real tauzy = mu*dwdy;
940 Real tauzz = mu*dwdz + tautmp;
941 Real tauxz = mu*dudz;
942 Real tauyz = mu*dvdz;
944 feb_0 = dxi*(dapx*tauxx + dapy*tauyx + dapz*tauzx);
945 feb_1 = dxi*(dapx*tauxy + dapy*tauyy + dapz*tauzy);
946 feb_2 = dxi*(dapx*tauxz + dapy*tauyz + dapz*tauzz);
949 Real volinv = bscalar / kappa;
950 Ax(i,j,k,0) += volinv * (dxi*(apx(i+1,j,k)*fxp_0-apx(i,j,k)*fxm_0)
951 +dyi*(apy(i,j+1,k)*fyp_0-apy(i,j,k)*fym_0)
952 +dzi*(apz(i,j,k+1)*fzp_0-apz(i,j,k)*fzm_0)
954 Ax(i,j,k,1) += volinv * (dxi*(apx(i+1,j,k)*fxp_1-apx(i,j,k)*fxm_1)
955 +dyi*(apy(i,j+1,k)*fyp_1-apy(i,j,k)*fym_1)
956 +dzi*(apz(i,j,k+1)*fzp_1-apz(i,j,k)*fzm_1)
958 Ax(i,j,k,2) += volinv * (dxi*(apx(i+1,j,k)*fxp_2-apx(i,j,k)*fxm_2)
959 +dyi*(apy(i,j+1,k)*fyp_2-apy(i,j,k)*fym_2)
960 +dzi*(apz(i,j,k+1)*fzp_2-apz(i,j,k)*fzm_2)
970 Array4<Real>
const& Ax,
971 Array4<Real const>
const& fx,
972 Array4<Real const>
const& ap,
973 Real bscalar) noexcept
978 for (
int k = lo.z; k <= hi.z; ++k) {
979 for (
int j = lo.y; j <= hi.y; ++j) {
981 for (
int i = lo.x; i <= hi.x; ++i) {
982 if (ap(i,j,k) != Real(0.0)) {
983 for (
int n=0; n<AMREX_SPACEDIM; n++) {
984 Ax(i,j,k,n) += bscalar*fx(i,j,k,n);
996 Array4<Real const>
const& fx, Array4<Real const>
const& apx,
997 Array4<Real const>
const& fcx,
998 Real
const bscalar, Array4<int const>
const& ccm,
999 int face_only,
Box const& xbox) noexcept
1001 int lof = xbox.smallEnd(0);
1002 int hif = xbox.bigEnd(0);
1005 if (!face_only || lof == i || hif == i) {
1006 if (apx(i,j,k) == Real(1.0)) {
1007 for (
int n=0; n<AMREX_SPACEDIM; n++) {
1008 Ax(i,j,k,n) += bscalar*fx(i,j,k,n);
1011 else if (apx(i,j,k) != Real(0.0)) {
1012 Real fxm_0 = fx(i,j,k,0);
1013 Real fxm_1 = fx(i,j,k,1);
1014 Real fxm_2 = fx(i,j,k,2);
1016 int jj = j + (fcx(i,j,k,0) >= Real(0.0) ? 1 : -1);
1017 int kk = k + (fcx(i,j,k,1) >= Real(0.0) ? 1 : -1);
1018 Real fracy = (ccm(i-1,jj,k) || ccm(i,jj,k)) ?
std::abs(fcx(i,j,k,0)) : Real(0.0);
1019 Real fracz = (ccm(i-1,j,kk) || ccm(i,j,kk)) ?
std::abs(fcx(i,j,k,1)) : Real(0.0);
1020 fxm_0 = (Real(1.0)-fracy)*(Real(1.0)-fracz) *fxm_0
1021 + fracy*(Real(1.0)-fracz) * fx(i,jj,k ,0)
1022 + fracz*(Real(1.0)-fracy) * fx(i,j ,kk,0)
1023 + fracy* fracz * fx(i,jj,kk,0);
1024 fxm_1 = (Real(1.0)-fracy)*(Real(1.0)-fracz) *fxm_1
1025 + fracy*(Real(1.0)-fracz) * fx(i,jj,k ,1)
1026 + fracz*(Real(1.0)-fracy) * fx(i,j ,kk,1)
1027 + fracy* fracz * fx(i,jj,kk,1);
1028 fxm_2 = (Real(1.0)-fracy)*(Real(1.0)-fracz) *fxm_2
1029 + fracy*(Real(1.0)-fracz) * fx(i,jj,k ,2)
1030 + fracz*(Real(1.0)-fracy) * fx(i,j ,kk,2)
1031 + fracy* fracz * fx(i,jj,kk,2);
1033 Ax(i,j,k,0) += bscalar*fxm_0;
1034 Ax(i,j,k,1) += bscalar*fxm_1;
1035 Ax(i,j,k,2) += bscalar*fxm_2;
1043 Array4<Real const>
const& fy, Array4<Real const>
const& apy,
1044 Array4<Real const>
const& fcy,
1045 Real
const bscalar, Array4<int const>
const& ccm,
1046 int face_only,
Box const& ybox) noexcept
1048 int lof = ybox.smallEnd(1);
1049 int hif = ybox.bigEnd(1);
1052 if (!face_only || lof == j || hif == j) {
1053 if (apy(i,j,k) == Real(1.0)) {
1054 for (
int n=0; n<AMREX_SPACEDIM; n++) {
1055 Ay(i,j,k,n) += bscalar*fy(i,j,k,n);
1057 }
else if (apy(i,j,k) != 0) {
1058 Real fym_0 = fy(i,j,k,0);
1059 Real fym_1 = fy(i,j,k,1);
1060 Real fym_2 = fy(i,j,k,2);
1062 int ii = i + (fcy(i,j,k,0) >= Real(0.0) ? 1 : -1);
1063 int kk = k + (fcy(i,j,k,1) >= Real(0.0) ? 1 : -1);
1064 Real fracx = (ccm(ii,j-1,k) || ccm(ii,j,k)) ?
std::abs(fcy(i,j,k,0)) : Real(0.0);
1065 Real fracz = (ccm(i,j-1,kk) || ccm(i,j,kk)) ?
std::abs(fcy(i,j,k,1)) : Real(0.0);
1066 fym_0 = (Real(1.0)-fracx)*(Real(1.0)-fracz) *fym_0
1067 + fracx*(Real(1.0)-fracz) * fy(ii,j,k ,0)
1068 + fracz*(Real(1.0)-fracx) * fy(i ,j,kk,0)
1069 + fracx* fracz * fy(ii,j,kk,0);
1070 fym_1 = (Real(1.0)-fracx)*(Real(1.0)-fracz) *fym_1
1071 + fracx*(Real(1.0)-fracz) * fy(ii,j,k ,1)
1072 + fracz*(Real(1.0)-fracx) * fy(i ,j,kk,1)
1073 + fracx* fracz * fy(ii,j,kk,1);
1074 fym_2 = (Real(1.0)-fracx)*(Real(1.0)-fracz) *fym_2
1075 + fracx*(Real(1.0)-fracz) * fy(ii,j,k ,2)
1076 + fracz*(Real(1.0)-fracx) * fy(i ,j,kk,2)
1077 + fracx* fracz * fy(ii,j,kk,2);
1079 Ay(i,j,k,0) += bscalar*fym_0;
1080 Ay(i,j,k,1) += bscalar*fym_1;
1081 Ay(i,j,k,2) += bscalar*fym_2;
1093 int face_only,
Box const& zbox) noexcept
1095 int lof = zbox.smallEnd(2);
1096 int hif = zbox.bigEnd(2);
1099 if (!face_only || lof == k || hif == k) {
1100 if (apz(i,j,k) == Real(1.0)) {
1101 for (
int n=0; n<AMREX_SPACEDIM; n++) {
1102 Az(i,j,k,n) += bscalar*fz(i,j,k,n);
1105 else if (apz(i,j,k) != 0.) {
1106 Real fzm_0 = fz(i,j,k,0);
1107 Real fzm_1 = fz(i,j,k,1);
1108 Real fzm_2 = fz(i,j,k,2);
1110 int ii = i + (fcz(i,j,k,0) >= Real(0.0) ? 1 : -1);
1111 int jj = j + (fcz(i,j,k,1) >= Real(0.0) ? 1 : -1);
1112 Real fracx = (ccm(ii,j,k-1) || ccm(ii,j,k)) ?
std::abs(fcz(i,j,k,0)) : Real(0.0);
1113 Real fracy = (ccm(i,jj,k-1) || ccm(i,jj,k)) ?
std::abs(fcz(i,j,k,1)) : Real(0.0);
1114 fzm_0 = (Real(1.0)-fracx)*(Real(1.0)-fracy) *fzm_0
1115 + fracx*(Real(1.0)-fracy) * fz(ii,j ,k,0)
1116 + fracy*(Real(1.0)-fracx) * fz(i ,jj,k,0)
1117 + fracx* fracy * fz(ii,jj,k,0);
1118 fzm_1 = (Real(1.0)-fracx)*(Real(1.0)-fracy) *fzm_1
1119 + fracx*(Real(1.0)-fracy) * fz(ii,j ,k,1)
1120 + fracy*(Real(1.0)-fracx) * fz(i ,jj,k,1)
1121 + fracx* fracy * fz(ii,jj,k,1);
1122 fzm_2 = (Real(1.0)-fracx)*(Real(1.0)-fracy) *fzm_2
1123 + fracx*(Real(1.0)-fracy) * fz(ii,j ,k,2)
1124 + fracy*(Real(1.0)-fracx) * fz(i ,jj,k,2)
1125 + fracx* fracy * fz(ii,jj,k,2);
1127 Az(i,j,k,0) += bscalar*fzm_0;
1128 Az(i,j,k,1) += bscalar*fzm_1;
1129 Az(i,j,k,2) += bscalar*fzm_2;
1138 Array4<Real const>
const& vel, Array4<Real const>
const& apx,
1139 Array4<EBCellFlag const>
const& flag,
1140 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
1142 const Real dxi = dxinv[0];
1143 const Real dyi = dxinv[1];
1144 const Real dzi = dxinv[2];
1148 for (
int k = lo.z; k <= hi.z; ++k) {
1149 for (
int j = lo.y; j <= hi.y; ++j) {
1151 for (
int i = lo.x; i <= hi.x; ++i) {
1152 if (apx(i,j,k) == Real(0.0))
1154 fx(i,j,k,0) = Real(0.0);
1155 fx(i,j,k,1) = Real(0.0);
1156 fx(i,j,k,2) = Real(0.0);
1157 fx(i,j,k,3) = Real(0.0);
1158 fx(i,j,k,4) = Real(0.0);
1159 fx(i,j,k,5) = Real(0.0);
1160 fx(i,j,k,6) = Real(0.0);
1161 fx(i,j,k,7) = Real(0.0);
1162 fx(i,j,k,8) = Real(0.0);
1166 Real dudx = (vel(i,j,k,0) - vel(i-1,j,k,0))*dxi;
1167 Real dvdx = (vel(i,j,k,1) - vel(i-1,j,k,1))*dxi;
1168 Real dwdx = (vel(i,j,k,2) - vel(i-1,j,k,2))*dxi;
1170 int jhip = j + flag(i ,j,k).isConnected(0, 1,0);
1171 int jhim = j - flag(i ,j,k).isConnected(0,-1,0);
1172 int jlop = j + flag(i-1,j,k).isConnected(0, 1,0);
1173 int jlom = j - flag(i-1,j,k).isConnected(0,-1,0);
1177 whi,wlo,jhip,jhim,jlop,jlom);
1179 whi,wlo,jhip,jhim,jlop,jlom);
1181 whi,wlo,jhip,jhim,jlop,jlom);
1183 int khip = k + flag(i ,j,k).isConnected(0,0, 1);
1184 int khim = k - flag(i ,j,k).isConnected(0,0,-1);
1185 int klop = k + flag(i-1,j,k).isConnected(0,0, 1);
1186 int klom = k - flag(i-1,j,k).isConnected(0,0,-1);
1190 whi,wlo,khip,khim,klop,klom);
1192 whi,wlo,khip,khim,klop,klom);
1194 whi,wlo,khip,khim,klop,klom);
1213 Array4<Real const>
const& vel, Array4<Real const>
const& apy,
1214 Array4<EBCellFlag const>
const& flag,
1215 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
1217 const Real dxi = dxinv[0];
1218 const Real dyi = dxinv[1];
1219 const Real dzi = dxinv[2];
1223 for (
int k = lo.z; k <= hi.z; ++k) {
1224 for (
int j = lo.y; j <= hi.y; ++j) {
1226 for (
int i = lo.x; i <= hi.x; ++i) {
1227 if (apy(i,j,k) == Real(0.0))
1229 fy(i,j,k,0) = Real(0.0);
1230 fy(i,j,k,1) = Real(0.0);
1231 fy(i,j,k,2) = Real(0.0);
1232 fy(i,j,k,3) = Real(0.0);
1233 fy(i,j,k,4) = Real(0.0);
1234 fy(i,j,k,5) = Real(0.0);
1235 fy(i,j,k,6) = Real(0.0);
1236 fy(i,j,k,7) = Real(0.0);
1237 fy(i,j,k,8) = Real(0.0);
1241 int ihip = i + flag(i,j ,k).isConnected( 1,0,0);
1242 int ihim = i - flag(i,j ,k).isConnected(-1,0,0);
1243 int ilop = i + flag(i,j-1,k).isConnected( 1,0,0);
1244 int ilom = i - flag(i,j-1,k).isConnected(-1,0,0);
1248 whi,wlo,ihip,ihim,ilop,ilom);
1250 whi,wlo,ihip,ihim,ilop,ilom);
1252 whi,wlo,ihip,ihim,ilop,ilom);
1254 Real dudy = (vel(i,j,k,0) - vel(i,j-1,k,0))*dyi;
1255 Real dvdy = (vel(i,j,k,1) - vel(i,j-1,k,1))*dyi;
1256 Real dwdy = (vel(i,j,k,2) - vel(i,j-1,k,2))*dyi;
1258 int khip = k + flag(i,j ,k).isConnected(0,0, 1);
1259 int khim = k - flag(i,j ,k).isConnected(0,0,-1);
1260 int klop = k + flag(i,j-1,k).isConnected(0,0, 1);
1261 int klom = k - flag(i,j-1,k).isConnected(0,0,-1);
1265 whi,wlo,khip,khim,klop,klom);
1267 whi,wlo,khip,khim,klop,klom);
1269 whi,wlo,khip,khim,klop,klom);
1292 const Real dxi = dxinv[0];
1293 const Real dyi = dxinv[1];
1294 const Real dzi = dxinv[2];
1298 for (
int k = lo.z; k <= hi.z; ++k) {
1299 for (
int j = lo.y; j <= hi.y; ++j) {
1301 for (
int i = lo.x; i <= hi.x; ++i) {
1302 if (apz(i,j,k) == Real(0.0))
1304 fz(i,j,k,0) = Real(0.0);
1305 fz(i,j,k,1) = Real(0.0);
1306 fz(i,j,k,2) = Real(0.0);
1307 fz(i,j,k,3) = Real(0.0);
1308 fz(i,j,k,4) = Real(0.0);
1309 fz(i,j,k,5) = Real(0.0);
1310 fz(i,j,k,6) = Real(0.0);
1311 fz(i,j,k,7) = Real(0.0);
1312 fz(i,j,k,8) = Real(0.0);
1316 int ihip = i + flag(i,j,k ).isConnected( 1,0,0);
1317 int ihim = i - flag(i,j,k ).isConnected(-1,0,0);
1318 int ilop = i + flag(i,j,k-1).isConnected( 1,0,0);
1319 int ilom = i - flag(i,j,k-1).isConnected(-1,0,0);
1323 whi,wlo,ihip,ihim,ilop,ilom);
1325 whi,wlo,ihip,ihim,ilop,ilom);
1327 whi,wlo,ihip,ihim,ilop,ilom);
1329 int jhip = j + flag(i,j,k ).isConnected(0, 1,0);
1330 int jhim = j - flag(i,j,k ).isConnected(0,-1,0);
1331 int jlop = j + flag(i,j,k-1).isConnected(0, 1,0);
1332 int jlom = j - flag(i,j,k-1).isConnected(0,-1,0);
1336 whi,wlo,jhip,jhim,jlop,jlom);
1338 whi,wlo,jhip,jhim,jlop,jlom);
1340 whi,wlo,jhip,jhim,jlop,jlom);
1342 Real dudz = (vel(i,j,k,0) - vel(i,j,k-1,0))*dzi;
1343 Real dvdz = (vel(i,j,k,1) - vel(i,j,k-1,1))*dzi;
1344 Real dwdz = (vel(i,j,k,2) - vel(i,j,k-1,2))*dzi;
1363 Array4<Real const>
const& vel,
1364 Array4<Real const>
const& apx,
1365 Array4<EBCellFlag const>
const& flag,
1366 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
1367 Array4<Real const>
const& bvxlo,
1368 Array4<Real const>
const& bvxhi,
1371 0,AMREX_SPACEDIM>
const& bct,
1372 Dim3
const& dlo, Dim3
const& dhi) noexcept
1374 const Real dxi = dxinv[0];
1375 const Real dyi = dxinv[1];
1376 const Real dzi = dxinv[2];
1380 for (
int k = lo.z; k <= hi.z; ++k) {
1381 for (
int j = lo.y; j <= hi.y; ++j) {
1382 for (
int i = lo.x; i <= hi.x; ++i) {
1383 if (apx(i,j,k) == Real(0.0))
1385 fx(i,j,k,0) = Real(0.0);
1386 fx(i,j,k,1) = Real(0.0);
1387 fx(i,j,k,2) = Real(0.0);
1388 fx(i,j,k,3) = Real(0.0);
1389 fx(i,j,k,4) = Real(0.0);
1390 fx(i,j,k,5) = Real(0.0);
1391 fx(i,j,k,6) = Real(0.0);
1392 fx(i,j,k,7) = Real(0.0);
1393 fx(i,j,k,8) = Real(0.0);
1397 Real dudx = (vel(i,j,k,0) - vel(i-1,j,k,0))*dxi;
1398 Real dvdx = (vel(i,j,k,1) - vel(i-1,j,k,1))*dxi;
1399 Real dwdx = (vel(i,j,k,2) - vel(i-1,j,k,2))*dxi;
1401 int jhip = j + flag(i ,j,k).isConnected(0, 1,0);
1402 int jhim = j - flag(i ,j,k).isConnected(0,-1,0);
1403 int jlop = j + flag(i-1,j,k).isConnected(0, 1,0);
1404 int jlom = j - flag(i-1,j,k).isConnected(0,-1,0);
1408 bvxlo,bvxhi,bct,dlo,dhi,
1409 whi,wlo,jhip,jhim,jlop,jlom);
1411 bvxlo,bvxhi,bct,dlo,dhi,
1412 whi,wlo,jhip,jhim,jlop,jlom);
1414 bvxlo,bvxhi,bct,dlo,dhi,
1415 whi,wlo,jhip,jhim,jlop,jlom);
1417 int khip = k + flag(i ,j,k).isConnected(0,0, 1);
1418 int khim = k - flag(i ,j,k).isConnected(0,0,-1);
1419 int klop = k + flag(i-1,j,k).isConnected(0,0, 1);
1420 int klom = k - flag(i-1,j,k).isConnected(0,0,-1);
1424 bvxlo,bvxhi,bct,dlo,dhi,
1425 whi,wlo,khip,khim,klop,klom);
1427 bvxlo,bvxhi,bct,dlo,dhi,
1428 whi,wlo,khip,khim,klop,klom);
1430 bvxlo,bvxhi,bct,dlo,dhi,
1431 whi,wlo,khip,khim,klop,klom);
1450 Array4<Real const>
const& vel,
1451 Array4<Real const>
const& apy,
1452 Array4<EBCellFlag const>
const& flag,
1453 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
1454 Array4<Real const>
const& bvylo,
1455 Array4<Real const>
const& bvyhi,
1458 0,AMREX_SPACEDIM>
const& bct,
1459 Dim3
const& dlo, Dim3
const& dhi) noexcept
1461 const Real dxi = dxinv[0];
1462 const Real dyi = dxinv[1];
1463 const Real dzi = dxinv[2];
1467 for (
int k = lo.z; k <= hi.z; ++k) {
1468 for (
int j = lo.y; j <= hi.y; ++j) {
1469 for (
int i = lo.x; i <= hi.x; ++i) {
1470 if (apy(i,j,k) == Real(0.0))
1472 fy(i,j,k,0) = Real(0.0);
1473 fy(i,j,k,1) = Real(0.0);
1474 fy(i,j,k,2) = Real(0.0);
1475 fy(i,j,k,3) = Real(0.0);
1476 fy(i,j,k,4) = Real(0.0);
1477 fy(i,j,k,5) = Real(0.0);
1478 fy(i,j,k,6) = Real(0.0);
1479 fy(i,j,k,7) = Real(0.0);
1480 fy(i,j,k,8) = Real(0.0);
1484 int ihip = i + flag(i,j ,k).isConnected( 1,0,0);
1485 int ihim = i - flag(i,j ,k).isConnected(-1,0,0);
1486 int ilop = i + flag(i,j-1,k).isConnected( 1,0,0);
1487 int ilom = i - flag(i,j-1,k).isConnected(-1,0,0);
1491 bvylo,bvyhi,bct,dlo,dhi,
1492 whi,wlo,ihip,ihim,ilop,ilom);
1494 bvylo,bvyhi,bct,dlo,dhi,
1495 whi,wlo,ihip,ihim,ilop,ilom);
1497 bvylo,bvyhi,bct,dlo,dhi,
1498 whi,wlo,ihip,ihim,ilop,ilom);
1500 Real dudy = (vel(i,j,k,0) - vel(i,j-1,k,0))*dyi;
1501 Real dvdy = (vel(i,j,k,1) - vel(i,j-1,k,1))*dyi;
1502 Real dwdy = (vel(i,j,k,2) - vel(i,j-1,k,2))*dyi;
1504 int khip = k + flag(i,j ,k).isConnected(0,0, 1);
1505 int khim = k - flag(i,j ,k).isConnected(0,0,-1);
1506 int klop = k + flag(i,j-1,k).isConnected(0,0, 1);
1507 int klom = k - flag(i,j-1,k).isConnected(0,0,-1);
1511 bvylo,bvyhi,bct,dlo,dhi,
1512 whi,wlo,khip,khim,klop,klom);
1514 bvylo,bvyhi,bct,dlo,dhi,
1515 whi,wlo,khip,khim,klop,klom);
1517 bvylo,bvyhi,bct,dlo,dhi,
1518 whi,wlo,khip,khim,klop,klom);
1545 0,AMREX_SPACEDIM>
const& bct,
1546 Dim3 const& dlo,
Dim3 const& dhi) noexcept
1548 const Real dxi = dxinv[0];
1549 const Real dyi = dxinv[1];
1550 const Real dzi = dxinv[2];
1554 for (
int k = lo.z; k <= hi.z; ++k) {
1555 for (
int j = lo.y; j <= hi.y; ++j) {
1556 for (
int i = lo.x; i <= hi.x; ++i) {
1557 if (apz(i,j,k) == Real(0.0))
1559 fz(i,j,k,0) = Real(0.0);
1560 fz(i,j,k,1) = Real(0.0);
1561 fz(i,j,k,2) = Real(0.0);
1562 fz(i,j,k,3) = Real(0.0);
1563 fz(i,j,k,4) = Real(0.0);
1564 fz(i,j,k,5) = Real(0.0);
1565 fz(i,j,k,6) = Real(0.0);
1566 fz(i,j,k,7) = Real(0.0);
1567 fz(i,j,k,8) = Real(0.0);
1571 int ihip = i + flag(i,j,k ).isConnected( 1,0,0);
1572 int ihim = i - flag(i,j,k ).isConnected(-1,0,0);
1573 int ilop = i + flag(i,j,k-1).isConnected( 1,0,0);
1574 int ilom = i - flag(i,j,k-1).isConnected(-1,0,0);
1578 bvzlo,bvzhi,bct,dlo,dhi,
1579 whi,wlo,ihip,ihim,ilop,ilom);
1581 bvzlo,bvzhi,bct,dlo,dhi,
1582 whi,wlo,ihip,ihim,ilop,ilom);
1584 bvzlo,bvzhi,bct,dlo,dhi,
1585 whi,wlo,ihip,ihim,ilop,ilom);
1587 int jhip = j + flag(i,j,k ).isConnected(0, 1,0);
1588 int jhim = j - flag(i,j,k ).isConnected(0,-1,0);
1589 int jlop = j + flag(i,j,k-1).isConnected(0, 1,0);
1590 int jlom = j - flag(i,j,k-1).isConnected(0,-1,0);
1594 bvzlo,bvzhi,bct,dlo,dhi,
1595 whi,wlo,jhip,jhim,jlop,jlom);
1597 bvzlo,bvzhi,bct,dlo,dhi,
1598 whi,wlo,jhip,jhim,jlop,jlom);
1600 bvzlo,bvzhi,bct,dlo,dhi,
1601 whi,wlo,jhip,jhim,jlop,jlom);
1603 Real dudz = (vel(i,j,k,0) - vel(i,j,k-1,0))*dzi;
1604 Real dvdz = (vel(i,j,k,1) - vel(i,j,k-1,1))*dzi;
1605 Real dwdz = (vel(i,j,k,2) - vel(i,j,k-1,2))*dzi;
1624 Array4<Real const>
const& vel, Array4<Real const>
const& apx,
1625 Array4<EBCellFlag const>
const& flag,
1626 Array4<int const>
const& ccm,
1627 Array4<Real const>
const& fcx,
1628 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
1630 const Real dxi = dxinv[0];
1631 const Real dyi = dxinv[1];
1632 const Real dzi = dxinv[2];
1636 for (
int k = lo.z; k <= hi.z; ++k) {
1637 for (
int j = lo.y; j <= hi.y; ++j) {
1639 for (
int i = lo.x; i <= hi.x; ++i) {
1640 if (apx(i,j,k) == Real(0.0))
1642 fx(i,j,k,0) = Real(0.0);
1643 fx(i,j,k,1) = Real(0.0);
1644 fx(i,j,k,2) = Real(0.0);
1645 fx(i,j,k,3) = Real(0.0);
1646 fx(i,j,k,4) = Real(0.0);
1647 fx(i,j,k,5) = Real(0.0);
1648 fx(i,j,k,6) = Real(0.0);
1649 fx(i,j,k,7) = Real(0.0);
1650 fx(i,j,k,8) = Real(0.0);
1654 Real dudx = (vel(i,j,k,0) - vel(i-1,j,k,0))*dxi;
1655 Real dvdx = (vel(i,j,k,1) - vel(i-1,j,k,1))*dxi;
1656 Real dwdx = (vel(i,j,k,2) - vel(i-1,j,k,2))*dxi;
1657 if (apx(i,j,k) < Real(1.0)) {
1658 int jj = j + (fcx(i,j,k,0) >= Real(0.0) ? 1 : -1);
1659 int kk = k + (fcx(i,j,k,1) >= Real(0.0) ? 1 : -1);
1660 Real fracy = (ccm(i-1,jj,k) || ccm(i,jj,k)) ?
std::abs(fcx(i,j,k,0)) : Real(0.0);
1661 Real fracz = (ccm(i-1,j,kk) || ccm(i,j,kk)) ?
std::abs(fcx(i,j,k,1)) : Real(0.0);
1662 dudx = (Real(1.0)-fracy)*(Real(1.0)-fracz) * dudx
1663 + fracy*(Real(1.0)-fracz) * (vel(i,jj,k ,0) - vel(i-1,jj,k ,0))*dxi
1664 + fracz*(Real(1.0)-fracy) * (vel(i,j ,kk,0) - vel(i-1,j ,kk,0))*dxi
1665 + fracy* fracz * (vel(i,jj,kk,0) - vel(i-1,jj,kk,0))*dxi;
1666 dvdx = (Real(1.0)-fracy)*(Real(1.0)-fracz) * dvdx
1667 + fracy*(Real(1.0)-fracz) * (vel(i,jj,k ,1) - vel(i-1,jj,k ,1))*dxi
1668 + fracz*(Real(1.0)-fracy) * (vel(i,j ,kk,1) - vel(i-1,j ,kk,1))*dxi
1669 + fracy* fracz * (vel(i,jj,kk,1) - vel(i-1,jj,kk,1))*dxi;
1670 dwdx = (Real(1.0)-fracy)*(Real(1.0)-fracz) * dwdx
1671 + fracy*(Real(1.0)-fracz) * (vel(i,jj,k ,2) - vel(i-1,jj,k ,2))*dxi
1672 + fracz*(Real(1.0)-fracy) * (vel(i,j ,kk,2) - vel(i-1,j ,kk,2))*dxi
1673 + fracy* fracz * (vel(i,jj,kk,2) - vel(i-1,jj,kk,2))*dxi;
1676 int jhip = j + flag(i ,j,k).isConnected(0, 1,0);
1677 int jhim = j - flag(i ,j,k).isConnected(0,-1,0);
1678 int jlop = j + flag(i-1,j,k).isConnected(0, 1,0);
1679 int jlom = j - flag(i-1,j,k).isConnected(0,-1,0);
1683 whi,wlo,jhip,jhim,jlop,jlom);
1685 whi,wlo,jhip,jhim,jlop,jlom);
1687 whi,wlo,jhip,jhim,jlop,jlom);
1689 int khip = k + flag(i ,j,k).isConnected(0,0, 1);
1690 int khim = k - flag(i ,j,k).isConnected(0,0,-1);
1691 int klop = k + flag(i-1,j,k).isConnected(0,0, 1);
1692 int klom = k - flag(i-1,j,k).isConnected(0,0,-1);
1696 whi,wlo,khip,khim,klop,klom);
1698 whi,wlo,khip,khim,klop,klom);
1700 whi,wlo,khip,khim,klop,klom);
1719 Array4<Real const>
const& vel, Array4<Real const>
const& apy,
1720 Array4<EBCellFlag const>
const& flag,
1721 Array4<int const>
const& ccm,
1722 Array4<Real const>
const& fcy,
1723 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv) noexcept
1725 const Real dxi = dxinv[0];
1726 const Real dyi = dxinv[1];
1727 const Real dzi = dxinv[2];
1731 for (
int k = lo.z; k <= hi.z; ++k) {
1732 for (
int j = lo.y; j <= hi.y; ++j) {
1734 for (
int i = lo.x; i <= hi.x; ++i) {
1735 if (apy(i,j,k) == Real(0.0))
1737 fy(i,j,k,0) = Real(0.0);
1738 fy(i,j,k,1) = Real(0.0);
1739 fy(i,j,k,2) = Real(0.0);
1740 fy(i,j,k,3) = Real(0.0);
1741 fy(i,j,k,4) = Real(0.0);
1742 fy(i,j,k,5) = Real(0.0);
1743 fy(i,j,k,6) = Real(0.0);
1744 fy(i,j,k,7) = Real(0.0);
1745 fy(i,j,k,8) = Real(0.0);
1749 int ihip = i + flag(i,j ,k).isConnected( 1,0,0);
1750 int ihim = i - flag(i,j ,k).isConnected(-1,0,0);
1751 int ilop = i + flag(i,j-1,k).isConnected( 1,0,0);
1752 int ilom = i - flag(i,j-1,k).isConnected(-1,0,0);
1756 whi,wlo,ihip,ihim,ilop,ilom);
1758 whi,wlo,ihip,ihim,ilop,ilom);
1760 whi,wlo,ihip,ihim,ilop,ilom);
1762 Real dudy = (vel(i,j,k,0) - vel(i,j-1,k,0))*dyi;
1763 Real dvdy = (vel(i,j,k,1) - vel(i,j-1,k,1))*dyi;
1764 Real dwdy = (vel(i,j,k,2) - vel(i,j-1,k,2))*dyi;
1765 if (apy(i,j,k) < Real(1.0)) {
1766 int ii = i + (fcy(i,j,k,0) >= Real(0.0) ? 1 : -1);
1767 int kk = k + (fcy(i,j,k,1) >= Real(0.0) ? 1 : -1);
1768 Real fracx = (ccm(ii,j-1,k) || ccm(ii,j,k)) ?
std::abs(fcy(i,j,k,0)) : Real(0.0);
1769 Real fracz = (ccm(i,j-1,kk) || ccm(i,j,kk)) ?
std::abs(fcy(i,j,k,1)) : Real(0.0);
1770 dudy = (Real(1.0)-fracx)*(Real(1.0)-fracz) * dudy
1771 + fracx*(Real(1.0)-fracz) * (vel(ii,j,k ,0) - vel(ii,j-1,k ,0))*dyi
1772 + fracz*(Real(1.0)-fracx) * (vel(i ,j,kk,0) - vel(i ,j-1,kk,0))*dyi
1773 + fracx* fracz * (vel(ii,j,kk,0) - vel(ii,j-1,kk,0))*dyi;
1774 dvdy = (Real(1.0)-fracx)*(Real(1.0)-fracz) * dvdy
1775 + fracx*(Real(1.0)-fracz) * (vel(ii,j,k ,1) - vel(ii,j-1,k ,1))*dyi
1776 + fracz*(Real(1.0)-fracx) * (vel(i ,j,kk,1) - vel(i ,j-1,kk,1))*dyi
1777 + fracx* fracz * (vel(ii,j,kk,1) - vel(ii,j-1,kk,1))*dyi;
1778 dwdy = (Real(1.0)-fracx)*(Real(1.0)-fracz) * dwdy
1779 + fracx*(Real(1.0)-fracz) * (vel(ii,j,k ,2) - vel(ii,j-1,k ,2))*dyi
1780 + fracz*(Real(1.0)-fracx) * (vel(i ,j,kk,2) - vel(i ,j-1,kk,2))*dyi
1781 + fracx* fracz * (vel(ii,j,kk,2) - vel(ii,j-1,kk,2))*dyi;
1784 int khip = k + flag(i,j ,k).isConnected(0,0, 1);
1785 int khim = k - flag(i,j ,k).isConnected(0,0,-1);
1786 int klop = k + flag(i,j-1,k).isConnected(0,0, 1);
1787 int klom = k - flag(i,j-1,k).isConnected(0,0,-1);
1791 whi,wlo,khip,khim,klop,klom);
1793 whi,wlo,khip,khim,klop,klom);
1795 whi,wlo,khip,khim,klop,klom);
1820 const Real dxi = dxinv[0];
1821 const Real dyi = dxinv[1];
1822 const Real dzi = dxinv[2];
1826 for (
int k = lo.z; k <= hi.z; ++k) {
1827 for (
int j = lo.y; j <= hi.y; ++j) {
1829 for (
int i = lo.x; i <= hi.x; ++i) {
1830 if (apz(i,j,k) == Real(0.0))
1832 fz(i,j,k,0) = Real(0.0);
1833 fz(i,j,k,1) = Real(0.0);
1834 fz(i,j,k,2) = Real(0.0);
1835 fz(i,j,k,3) = Real(0.0);
1836 fz(i,j,k,4) = Real(0.0);
1837 fz(i,j,k,5) = Real(0.0);
1838 fz(i,j,k,6) = Real(0.0);
1839 fz(i,j,k,7) = Real(0.0);
1840 fz(i,j,k,8) = Real(0.0);
1844 int ihip = i + flag(i,j,k ).isConnected( 1,0,0);
1845 int ihim = i - flag(i,j,k ).isConnected(-1,0,0);
1846 int ilop = i + flag(i,j,k-1).isConnected( 1,0,0);
1847 int ilom = i - flag(i,j,k-1).isConnected(-1,0,0);
1851 whi,wlo,ihip,ihim,ilop,ilom);
1853 whi,wlo,ihip,ihim,ilop,ilom);
1855 whi,wlo,ihip,ihim,ilop,ilom);
1857 int jhip = j + flag(i,j,k ).isConnected(0, 1,0);
1858 int jhim = j - flag(i,j,k ).isConnected(0,-1,0);
1859 int jlop = j + flag(i,j,k-1).isConnected(0, 1,0);
1860 int jlom = j - flag(i,j,k-1).isConnected(0,-1,0);
1864 whi,wlo,jhip,jhim,jlop,jlom);
1866 whi,wlo,jhip,jhim,jlop,jlom);
1868 whi,wlo,jhip,jhim,jlop,jlom);
1870 Real dudz = (vel(i,j,k,0) - vel(i,j,k-1,0))*dzi;
1871 Real dvdz = (vel(i,j,k,1) - vel(i,j,k-1,1))*dzi;
1872 Real dwdz = (vel(i,j,k,2) - vel(i,j,k-1,2))*dzi;
1873 if (apz(i,j,k) < Real(1.0)) {
1874 int ii = i + (fcz(i,j,k,0) >= Real(0.0) ? 1 : -1);
1875 int jj = j + (fcz(i,j,k,1) >= Real(0.0) ? 1 : -1);
1876 Real fracx = (ccm(ii,j,k-1) || ccm(ii,j,k)) ?
std::abs(fcz(i,j,k,0)) : Real(0.0);
1877 Real fracy = (ccm(i,jj,k-1) || ccm(i,jj,k)) ?
std::abs(fcz(i,j,k,1)) : Real(0.0);
1878 dudz = (Real(1.0)-fracx)*(Real(1.0)-fracy) * dudz
1879 + fracx*(Real(1.0)-fracy) * (vel(ii,j ,k,0) - vel(ii,j ,k-1,0))*dzi
1880 + fracy*(Real(1.0)-fracx) * (vel(i ,jj,k,0) - vel(i ,jj,k-1,0))*dzi
1881 + fracx* fracy * (vel(ii,jj,k,0) - vel(ii,jj,k-1,0))*dzi;
1882 dvdz = (Real(1.0)-fracx)*(Real(1.0)-fracy) * dvdz
1883 + fracx*(Real(1.0)-fracy) * (vel(ii,j ,k,1) - vel(ii,j ,k-1,1))*dzi
1884 + fracy*(Real(1.0)-fracx) * (vel(i ,jj,k,1) - vel(i ,jj,k-1,1))*dzi
1885 + fracx* fracy * (vel(ii,jj,k,1) - vel(ii,jj,k-1,1))*dzi;
1886 dwdz = (Real(1.0)-fracx)*(Real(1.0)-fracy) * dwdz
1887 + fracx*(Real(1.0)-fracy) * (vel(ii,j ,k,2) - vel(ii,j ,k-1,2))*dzi
1888 + fracy*(Real(1.0)-fracx) * (vel(i ,jj,k,2) - vel(i ,jj,k-1,2))*dzi
1889 + fracx* fracy * (vel(ii,jj,k,2) - vel(ii,jj,k-1,2))*dzi;
1909 Array4<Real const>
const& vel,
1910 Array4<Real const>
const& apx,
1911 Array4<EBCellFlag const>
const& flag,
1912 Array4<int const>
const& ccm,
1913 Array4<Real const>
const& fcx,
1914 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
1915 Array4<Real const>
const& bvxlo,
1916 Array4<Real const>
const& bvxhi,
1919 0,AMREX_SPACEDIM>
const& bct,
1920 Dim3
const& dlo, Dim3
const& dhi) noexcept
1922 const Real dxi = dxinv[0];
1923 const Real dyi = dxinv[1];
1924 const Real dzi = dxinv[2];
1928 for (
int k = lo.z; k <= hi.z; ++k) {
1929 for (
int j = lo.y; j <= hi.y; ++j) {
1930 for (
int i = lo.x; i <= hi.x; ++i) {
1931 if (apx(i,j,k) == Real(0.0))
1933 fx(i,j,k,0) = Real(0.0);
1934 fx(i,j,k,1) = Real(0.0);
1935 fx(i,j,k,2) = Real(0.0);
1936 fx(i,j,k,3) = Real(0.0);
1937 fx(i,j,k,4) = Real(0.0);
1938 fx(i,j,k,5) = Real(0.0);
1939 fx(i,j,k,6) = Real(0.0);
1940 fx(i,j,k,7) = Real(0.0);
1941 fx(i,j,k,8) = Real(0.0);
1945 Real dudx = (vel(i,j,k,0) - vel(i-1,j,k,0))*dxi;
1946 Real dvdx = (vel(i,j,k,1) - vel(i-1,j,k,1))*dxi;
1947 Real dwdx = (vel(i,j,k,2) - vel(i-1,j,k,2))*dxi;
1948 if (apx(i,j,k) < Real(1.0)) {
1949 int jj = j + (fcx(i,j,k,0) >= Real(0.0) ? 1 : -1);
1950 int kk = k + (fcx(i,j,k,1) >= Real(0.0) ? 1 : -1);
1951 Real fracy = (ccm(i-1,jj,k) || ccm(i,jj,k)) ?
std::abs(fcx(i,j,k,0)) : Real(0.0);
1952 Real fracz = (ccm(i-1,j,kk) || ccm(i,j,kk)) ?
std::abs(fcx(i,j,k,1)) : Real(0.0);
1953 dudx = (Real(1.0)-fracy)*(Real(1.0)-fracz) * dudx
1954 + fracy*(Real(1.0)-fracz) * (vel(i,jj,k ,0) - vel(i-1,jj,k ,0))*dxi
1955 + fracz*(Real(1.0)-fracy) * (vel(i,j ,kk,0) - vel(i-1,j ,kk,0))*dxi
1956 + fracy* fracz * (vel(i,jj,kk,0) - vel(i-1,jj,kk,0))*dxi;
1957 dvdx = (Real(1.0)-fracy)*(Real(1.0)-fracz) * dvdx
1958 + fracy*(Real(1.0)-fracz) * (vel(i,jj,k ,1) - vel(i-1,jj,k ,1))*dxi
1959 + fracz*(Real(1.0)-fracy) * (vel(i,j ,kk,1) - vel(i-1,j ,kk,1))*dxi
1960 + fracy* fracz * (vel(i,jj,kk,1) - vel(i-1,jj,kk,1))*dxi;
1961 dwdx = (Real(1.0)-fracy)*(Real(1.0)-fracz) * dwdx
1962 + fracy*(Real(1.0)-fracz) * (vel(i,jj,k ,2) - vel(i-1,jj,k ,2))*dxi
1963 + fracz*(Real(1.0)-fracy) * (vel(i,j ,kk,2) - vel(i-1,j ,kk,2))*dxi
1964 + fracy* fracz * (vel(i,jj,kk,2) - vel(i-1,jj,kk,2))*dxi;
1967 int jhip = j + flag(i ,j,k).isConnected(0, 1,0);
1968 int jhim = j - flag(i ,j,k).isConnected(0,-1,0);
1969 int jlop = j + flag(i-1,j,k).isConnected(0, 1,0);
1970 int jlom = j - flag(i-1,j,k).isConnected(0,-1,0);
1974 bvxlo,bvxhi,bct,dlo,dhi,
1975 whi,wlo,jhip,jhim,jlop,jlom);
1977 bvxlo,bvxhi,bct,dlo,dhi,
1978 whi,wlo,jhip,jhim,jlop,jlom);
1980 bvxlo,bvxhi,bct,dlo,dhi,
1981 whi,wlo,jhip,jhim,jlop,jlom);
1983 int khip = k + flag(i ,j,k).isConnected(0,0, 1);
1984 int khim = k - flag(i ,j,k).isConnected(0,0,-1);
1985 int klop = k + flag(i-1,j,k).isConnected(0,0, 1);
1986 int klom = k - flag(i-1,j,k).isConnected(0,0,-1);
1990 bvxlo,bvxhi,bct,dlo,dhi,
1991 whi,wlo,khip,khim,klop,klom);
1993 bvxlo,bvxhi,bct,dlo,dhi,
1994 whi,wlo,khip,khim,klop,klom);
1996 bvxlo,bvxhi,bct,dlo,dhi,
1997 whi,wlo,khip,khim,klop,klom);
2016 Array4<Real const>
const& vel,
2017 Array4<Real const>
const& apy,
2018 Array4<EBCellFlag const>
const& flag,
2019 Array4<int const>
const& ccm,
2020 Array4<Real const>
const& fcy,
2021 GpuArray<Real,AMREX_SPACEDIM>
const& dxinv,
2022 Array4<Real const>
const& bvylo,
2023 Array4<Real const>
const& bvyhi,
2026 0,AMREX_SPACEDIM>
const& bct,
2027 Dim3
const& dlo, Dim3
const& dhi) noexcept
2029 const Real dxi = dxinv[0];
2030 const Real dyi = dxinv[1];
2031 const Real dzi = dxinv[2];
2035 for (
int k = lo.z; k <= hi.z; ++k) {
2036 for (
int j = lo.y; j <= hi.y; ++j) {
2037 for (
int i = lo.x; i <= hi.x; ++i) {
2038 if (apy(i,j,k) == Real(0.0))
2040 fy(i,j,k,0) = Real(0.0);
2041 fy(i,j,k,1) = Real(0.0);
2042 fy(i,j,k,2) = Real(0.0);
2043 fy(i,j,k,3) = Real(0.0);
2044 fy(i,j,k,4) = Real(0.0);
2045 fy(i,j,k,5) = Real(0.0);
2046 fy(i,j,k,6) = Real(0.0);
2047 fy(i,j,k,7) = Real(0.0);
2048 fy(i,j,k,8) = Real(0.0);
2052 int ihip = i + flag(i,j ,k).isConnected( 1,0,0);
2053 int ihim = i - flag(i,j ,k).isConnected(-1,0,0);
2054 int ilop = i + flag(i,j-1,k).isConnected( 1,0,0);
2055 int ilom = i - flag(i,j-1,k).isConnected(-1,0,0);
2059 bvylo,bvyhi,bct,dlo,dhi,
2060 whi,wlo,ihip,ihim,ilop,ilom);
2062 bvylo,bvyhi,bct,dlo,dhi,
2063 whi,wlo,ihip,ihim,ilop,ilom);
2065 bvylo,bvyhi,bct,dlo,dhi,
2066 whi,wlo,ihip,ihim,ilop,ilom);
2068 Real dudy = (vel(i,j,k,0) - vel(i,j-1,k,0))*dyi;
2069 Real dvdy = (vel(i,j,k,1) - vel(i,j-1,k,1))*dyi;
2070 Real dwdy = (vel(i,j,k,2) - vel(i,j-1,k,2))*dyi;
2071 if (apy(i,j,k) < Real(1.0)) {
2072 int ii = i + (fcy(i,j,k,0) >= Real(0.0) ? 1 : -1);
2073 int kk = k + (fcy(i,j,k,1) >= Real(0.0) ? 1 : -1);
2074 Real fracx = (ccm(ii,j-1,k) || ccm(ii,j,k)) ?
std::abs(fcy(i,j,k,0)) : Real(0.0);
2075 Real fracz = (ccm(i,j-1,kk) || ccm(i,j,kk)) ?
std::abs(fcy(i,j,k,1)) : Real(0.0);
2076 dudy = (Real(1.0)-fracx)*(Real(1.0)-fracz) * dudy
2077 + fracx*(Real(1.0)-fracz) * (vel(ii,j,k ,0) - vel(ii,j-1,k ,0))*dyi
2078 + fracz*(Real(1.0)-fracx) * (vel(i ,j,kk,0) - vel(i ,j-1,kk,0))*dyi
2079 + fracx* fracz * (vel(ii,j,kk,0) - vel(ii,j-1,kk,0))*dyi;
2080 dvdy = (Real(1.0)-fracx)*(Real(1.0)-fracz) * dvdy
2081 + fracx*(Real(1.0)-fracz) * (vel(ii,j,k ,1) - vel(ii,j-1,k ,1))*dyi
2082 + fracz*(Real(1.0)-fracx) * (vel(i ,j,kk,1) - vel(i ,j-1,kk,1))*dyi
2083 + fracx* fracz * (vel(ii,j,kk,1) - vel(ii,j-1,kk,1))*dyi;
2084 dwdy = (Real(1.0)-fracx)*(Real(1.0)-fracz) * dwdy
2085 + fracx*(Real(1.0)-fracz) * (vel(ii,j,k ,2) - vel(ii,j-1,k ,2))*dyi
2086 + fracz*(Real(1.0)-fracx) * (vel(i ,j,kk,2) - vel(i ,j-1,kk,2))*dyi
2087 + fracx* fracz * (vel(ii,j,kk,2) - vel(ii,j-1,kk,2))*dyi;
2090 int khip = k + flag(i,j ,k).isConnected(0,0, 1);
2091 int khim = k - flag(i,j ,k).isConnected(0,0,-1);
2092 int klop = k + flag(i,j-1,k).isConnected(0,0, 1);
2093 int klom = k - flag(i,j-1,k).isConnected(0,0,-1);
2097 bvylo,bvyhi,bct,dlo,dhi,
2098 whi,wlo,khip,khim,klop,klom);
2100 bvylo,bvyhi,bct,dlo,dhi,
2101 whi,wlo,khip,khim,klop,klom);
2103 bvylo,bvyhi,bct,dlo,dhi,
2104 whi,wlo,khip,khim,klop,klom);
2133 0,AMREX_SPACEDIM>
const& bct,
2134 Dim3 const& dlo,
Dim3 const& dhi) noexcept
2136 const Real dxi = dxinv[0];
2137 const Real dyi = dxinv[1];
2138 const Real dzi = dxinv[2];
2142 for (
int k = lo.z; k <= hi.z; ++k) {
2143 for (
int j = lo.y; j <= hi.y; ++j) {
2144 for (
int i = lo.x; i <= hi.x; ++i) {
2145 if (apz(i,j,k) == Real(0.0))
2147 fz(i,j,k,0) = Real(0.0);
2148 fz(i,j,k,1) = Real(0.0);
2149 fz(i,j,k,2) = Real(0.0);
2150 fz(i,j,k,3) = Real(0.0);
2151 fz(i,j,k,4) = Real(0.0);
2152 fz(i,j,k,5) = Real(0.0);
2153 fz(i,j,k,6) = Real(0.0);
2154 fz(i,j,k,7) = Real(0.0);
2155 fz(i,j,k,8) = Real(0.0);
2159 int ihip = i + flag(i,j,k ).isConnected( 1,0,0);
2160 int ihim = i - flag(i,j,k ).isConnected(-1,0,0);
2161 int ilop = i + flag(i,j,k-1).isConnected( 1,0,0);
2162 int ilom = i - flag(i,j,k-1).isConnected(-1,0,0);
2166 bvzlo,bvzhi,bct,dlo,dhi,
2167 whi,wlo,ihip,ihim,ilop,ilom);
2169 bvzlo,bvzhi,bct,dlo,dhi,
2170 whi,wlo,ihip,ihim,ilop,ilom);
2172 bvzlo,bvzhi,bct,dlo,dhi,
2173 whi,wlo,ihip,ihim,ilop,ilom);
2175 int jhip = j + flag(i,j,k ).isConnected(0, 1,0);
2176 int jhim = j - flag(i,j,k ).isConnected(0,-1,0);
2177 int jlop = j + flag(i,j,k-1).isConnected(0, 1,0);
2178 int jlom = j - flag(i,j,k-1).isConnected(0,-1,0);
2182 bvzlo,bvzhi,bct,dlo,dhi,
2183 whi,wlo,jhip,jhim,jlop,jlom);
2185 bvzlo,bvzhi,bct,dlo,dhi,
2186 whi,wlo,jhip,jhim,jlop,jlom);
2188 bvzlo,bvzhi,bct,dlo,dhi,
2189 whi,wlo,jhip,jhim,jlop,jlom);
2191 Real dudz = (vel(i,j,k,0) - vel(i,j,k-1,0))*dzi;
2192 Real dvdz = (vel(i,j,k,1) - vel(i,j,k-1,1))*dzi;
2193 Real dwdz = (vel(i,j,k,2) - vel(i,j,k-1,2))*dzi;
2194 if (apz(i,j,k) < Real(1.0)) {
2195 int ii = i + (fcz(i,j,k,0) >= Real(0.0) ? 1 : -1);
2196 int jj = j + (fcz(i,j,k,1) >= Real(0.0) ? 1 : -1);
2197 Real fracx = (ccm(ii,j,k-1) || ccm(ii,j,k)) ?
std::abs(fcz(i,j,k,0)) : Real(0.0);
2198 Real fracy = (ccm(i,jj,k-1) || ccm(i,jj,k)) ?
std::abs(fcz(i,j,k,1)) : Real(0.0);
2199 dudz = (Real(1.0)-fracx)*(Real(1.0)-fracy) * dudz
2200 + fracx*(Real(1.0)-fracy) * (vel(ii,j ,k,0) - vel(ii,j ,k-1,0))*dzi
2201 + fracy*(Real(1.0)-fracx) * (vel(i ,jj,k,0) - vel(i ,jj,k-1,0))*dzi
2202 + fracx* fracy * (vel(ii,jj,k,0) - vel(ii,jj,k-1,0))*dzi;
2203 dvdz = (Real(1.0)-fracx)*(Real(1.0)-fracy) * dvdz
2204 + fracx*(Real(1.0)-fracy) * (vel(ii,j ,k,1) - vel(ii,j ,k-1,1))*dzi
2205 + fracy*(Real(1.0)-fracx) * (vel(i ,jj,k,1) - vel(i ,jj,k-1,1))*dzi
2206 + fracx* fracy * (vel(ii,jj,k,1) - vel(ii,jj,k-1,1))*dzi;
2207 dwdz = (Real(1.0)-fracx)*(Real(1.0)-fracy) * dwdz
2208 + fracx*(Real(1.0)-fracy) * (vel(ii,j ,k,2) - vel(ii,j ,k-1,2))*dzi
2209 + fracy*(Real(1.0)-fracx) * (vel(i ,jj,k,2) - vel(i ,jj,k-1,2))*dzi
2210 + fracx* fracy * (vel(ii,jj,k,2) - vel(ii,jj,k-1,2))*dzi;
#define AMREX_PRAGMA_SIMD
Definition: AMReX_Extension.H:80
#define AMREX_FORCE_INLINE
Definition: AMReX_Extension.H:119
#define AMREX_GPU_HOST_DEVICE
Definition: AMReX_GpuQualifiers.H:20
#define AMREX_LO_NEUMANN
Definition: AMReX_LO_BCTYPES.H:6
#define AMREX_LO_DIRICHLET
Definition: AMReX_LO_BCTYPES.H:5
Maintain an identifier for boundary condition types.
Definition: AMReX_BoundCond.H:20
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int zhi() noexcept
Int value of the z-hi-face.
Definition: AMReX_Orientation.H:118
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int yhi() noexcept
Int value of the y-hi-face.
Definition: AMReX_Orientation.H:110
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int ylo() noexcept
Int value of the y-lo-face.
Definition: AMReX_Orientation.H:106
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int xlo() noexcept
Int value of the x-lo-face.
Definition: AMReX_Orientation.H:98
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int xhi() noexcept
Int value of the x-hi-face.
Definition: AMReX_Orientation.H:102
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int zlo() noexcept
Int value of the z-lo-face.
Definition: AMReX_Orientation.H:114
Definition: AMReX_Amr.cpp:49
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real mlebtensor_dx_on_zface(int, int j, int k, int n, Array4< Real const > const &vel, Real dxi, Real whi, Real wlo, int ihip, int ihim, int ilop, int ilom) noexcept
Definition: AMReX_MLEBTensor_3D_K.H:30
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real mlebtensor_weight(int d)
Definition: AMReX_MLEBTensor_K.H:10
BoxND< AMREX_SPACEDIM > Box
Definition: AMReX_BaseFwd.H:27
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 void mlebtensor_flux_z(Box const &box, Array4< Real > const &Az, Array4< Real const > const &fz, Array4< Real const > const &apz, Array4< Real const > const &fcz, Real const bscalar, Array4< int const > const &ccm, int face_only, Box const &zbox) noexcept
Definition: AMReX_MLEBTensor_3D_K.H:1089
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real mlebtensor_dz_on_yface(int i, int j, int, int n, Array4< Real const > const &vel, Real dzi, Real whi, Real wlo, int khip, int khim, int klop, int klom) noexcept
Definition: AMReX_MLEBTensor_3D_K.H:20
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlebtensor_vel_grads_fx(Box const &box, Array4< Real > const &fx, Array4< Real const > const &vel, Array4< Real const > const &apx, Array4< EBCellFlag const > const &flag, GpuArray< Real, AMREX_SPACEDIM > const &dxinv) noexcept
Definition: AMReX_MLEBTensor_2D_K.H:453
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T abs(const GpuComplex< T > &a_z) noexcept
Return the absolute value of a complex number.
Definition: AMReX_GpuComplex.H:356
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlebtensor_flux_y(Box const &box, Array4< Real > const &Ay, Array4< Real const > const &fy, Array4< Real const > const &apy, Array4< Real const > const &fcy, Real const bscalar, Array4< int const > const &ccm, int face_only, Box const &ybox) noexcept
Definition: AMReX_MLEBTensor_2D_K.H:419
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlebtensor_cross_terms_fy(Box const &box, Array4< Real > const &fy, Array4< Real const > const &vel, Array4< Real const > const &etay, Array4< Real const > const &kapy, Array4< Real const > const &apy, Array4< EBCellFlag const > const &flag, GpuArray< Real, AMREX_SPACEDIM > const &dxinv) noexcept
Definition: AMReX_MLEBTensor_2D_K.H:56
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlebtensor_cross_terms(Box const &box, Array4< Real > const &Ax, Array4< Real const > const &fx, Array4< Real const > const &fy, Array4< Real const > const &vel, Array4< Real const > const &velb, Array4< Real const > const &etab, Array4< Real const > const &kapb, Array4< int const > const &ccm, Array4< EBCellFlag const > const &flag, Array4< Real const > const &vol, Array4< Real const > const &apx, Array4< Real const > const &apy, Array4< Real const > const &fcx, Array4< Real const > const &fcy, Array4< Real const > const &bc, bool is_dirichlet, bool is_inhomog, GpuArray< Real, AMREX_SPACEDIM > const &dxinv, Real bscalar) noexcept
Definition: AMReX_MLEBTensor_2D_K.H:210
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlebtensor_vel_grads_fy(Box const &box, Array4< Real > const &fy, Array4< Real const > const &vel, Array4< Real const > const &apy, Array4< EBCellFlag const > const &flag, GpuArray< Real, AMREX_SPACEDIM > const &dxinv) noexcept
Definition: AMReX_MLEBTensor_2D_K.H:499
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Dim3 ubound(Array4< T > const &a) noexcept
Definition: AMReX_Array4.H:315
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Dim3 lbound(Array4< T > const &a) noexcept
Definition: AMReX_Array4.H:308
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real mlebtensor_dx_on_yface(int, int j, int k, int n, Array4< Real const > const &vel, Real dxi, Real whi, Real wlo, int ihip, int ihim, int ilop, int ilom) noexcept
Definition: AMReX_MLEBTensor_K.H:25
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real mlebtensor_dy_on_xface(int i, int, int k, int n, Array4< Real const > const &vel, Real dyi, Real whi, Real wlo, int jhip, int jhim, int jlop, int jlom) noexcept
Definition: AMReX_MLEBTensor_K.H:15
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlebtensor_cross_terms_fx(Box const &box, Array4< Real > const &fx, Array4< Real const > const &vel, Array4< Real const > const &etax, Array4< Real const > const &kapx, Array4< Real const > const &apx, Array4< EBCellFlag const > const &flag, GpuArray< Real, AMREX_SPACEDIM > const &dxinv) noexcept
Definition: AMReX_MLEBTensor_2D_K.H:10
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlebtensor_cross_terms_fz(Box const &box, Array4< Real > const &fz, Array4< Real const > const &vel, Array4< Real const > const &etaz, Array4< Real const > const &kapz, Array4< Real const > const &apz, Array4< EBCellFlag const > const &flag, GpuArray< Real, AMREX_SPACEDIM > const &dxinv) noexcept
Definition: AMReX_MLEBTensor_3D_K.H:170
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlebtensor_flux_x(Box const &box, Array4< Real > const &Ax, Array4< Real const > const &fx, Array4< Real const > const &apx, Array4< Real const > const &fcx, Real const bscalar, Array4< int const > const &ccm, int face_only, Box const &xbox) noexcept
Definition: AMReX_MLEBTensor_2D_K.H:385
AMREX_GPU_HOST_DEVICE AMREX_ATTRIBUTE_FLATTEN_FOR void LoopConcurrent(Dim3 lo, Dim3 hi, F const &f) noexcept
Definition: AMReX_Loop.H:150
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real mlebtensor_dy_on_zface(int i, int, int k, int n, Array4< Real const > const &vel, Real dyi, Real whi, Real wlo, int jhip, int jhim, int jlop, int jlom) noexcept
Definition: AMReX_MLEBTensor_3D_K.H:40
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real mlebtensor_dz_on_xface(int i, int j, int, int n, Array4< Real const > const &vel, Real dzi, Real whi, Real wlo, int khip, int khim, int klop, int klom) noexcept
Definition: AMReX_MLEBTensor_3D_K.H:10
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlebtensor_flux_0(Box const &box, Array4< Real > const &Ax, Array4< Real const > const &fx, Array4< Real const > const &ap, Real bscalar) noexcept
Definition: AMReX_MLEBTensor_2D_K.H:360
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlebtensor_vel_grads_fz(Box const &box, Array4< Real > const &fz, Array4< Real const > const &vel, Array4< Real const > const &apz, Array4< EBCellFlag const > const &flag, GpuArray< Real, AMREX_SPACEDIM > const &dxinv) noexcept
Definition: AMReX_MLEBTensor_3D_K.H:1287
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > sqrt(const GpuComplex< T > &a_z) noexcept
Return the square root of a complex number.
Definition: AMReX_GpuComplex.H:373
Definition: AMReX_Array.H:282
Definition: AMReX_Array4.H:61
Definition: AMReX_Dim3.H:12