1 #ifndef AMREX_ML_CURL_CURL_K_H_
2 #define AMREX_ML_CURL_CURL_K_H_
3 #include <AMReX_Config.H>
192 #if (AMREX_SPACEDIM == 2)
206 #if (AMREX_SPACEDIM == 2)
218 #if (AMREX_SPACEDIM == 2)
239 }
else if (dim == 1) {
276 #if (AMREX_SPACEDIM == 3)
278 bool zlo_is_symmetric (
int k)
const
284 bool zhi_is_symmetric (
int k)
const
292 #if (AMREX_SPACEDIM == 2)
301 }
else if (dir == 1) {
304 return (side == 0) ? zlo_is_symmetric(idx) : zhi_is_symmetric(idx);
319 #if (AMREX_SPACEDIM == 2)
321 Real dyy = adxinv[1] * adxinv[1];
322 Real dxy = adxinv[0] * adxinv[1];
323 Real ccex = ex(i ,j ,k ) * dyy * Real(2.0)
324 - dyy * (ex(i ,j-1,k ) +
326 + dxy * (ey(i ,j-1,k )
331 Real dyy = adxinv[1] * adxinv[1];
332 Real dzz = adxinv[2] * adxinv[2];
333 Real dxy = adxinv[0] * adxinv[1];
334 Real dxz = adxinv[0] * adxinv[2];
335 Real ccex = ex(i ,j ,k ) * (dyy+dzz)*Real(2.0)
336 - dyy * (ex(i ,j-1,k ) +
338 - dzz * (ex(i ,j ,k+1) +
340 + dxy * (ey(i ,j-1,k )
344 + dxz * (ez(i ,j ,k-1)
349 Ax(i,j,k) = ccex + beta * ex(i,j,k);
359 #if (AMREX_SPACEDIM == 2)
361 Real dxx = adxinv[0] * adxinv[0];
362 Real dxy = adxinv[0] * adxinv[1];
363 Real ccey = ey(i ,j ,k ) * dxx * Real(2.0)
364 - dxx * (ey(i-1,j ,k ) +
366 + dxy * (ex(i-1,j ,k )
371 Real dxx = adxinv[0] * adxinv[0];
372 Real dzz = adxinv[2] * adxinv[2];
373 Real dxy = adxinv[0] * adxinv[1];
374 Real dyz = adxinv[1] * adxinv[2];
375 Real ccey = ey(i ,j ,k ) * (dxx+dzz)*Real(2.0)
376 - dxx * (ey(i-1,j ,k ) +
378 - dzz * (ey(i ,j ,k-1) +
380 + dxy * (ex(i-1,j ,k )
384 + dyz * (ez(i ,j ,k-1)
389 Ay(i,j,k) = ccey + beta * ey(i,j,k);
399 #if (AMREX_SPACEDIM == 2)
401 Real dxx = adxinv[0] * adxinv[0];
402 Real dyy = adxinv[1] * adxinv[1];
403 Real ccez = ez(i ,j ,k ) * (dxx+dyy)*Real(2.0)
404 - dxx * (ez(i-1,j ,k ) +
406 - dyy * (ez(i ,j-1,k ) +
409 Real dxx = adxinv[0] * adxinv[0];
410 Real dyy = adxinv[1] * adxinv[1];
411 Real dxz = adxinv[0] * adxinv[2];
412 Real dyz = adxinv[1] * adxinv[2];
413 Real ccez = ez(i ,j ,k ) * (dxx+dyy)*Real(2.0)
414 - dxx * (ez(i-1,j ,k ) +
416 - dyy * (ez(i ,j-1,k ) +
418 + dxz * (ex(i-1,j ,k )
422 + dyz * (ey(i ,j-1,k )
427 Az(i,j,k) = ccez + beta * ez(i,j,k);
438 #
if (AMREX_SPACEDIM == 2)
448 int my_color = i%2 + 2*(j%2);
450 my_color = 3 - my_color;
453 #if (AMREX_SPACEDIM == 2)
455 Real dxx = adxinv[0] * adxinv[0];
456 Real dyy = adxinv[1] * adxinv[1];
458 if (((my_color == 0 || my_color == 3) && (color == 0 || color == 3)) ||
459 ((my_color == 1 || my_color == 2) && (color == 1 || color == 2)))
461 Real gamma = (dxx+dyy)*Real(2.0) + beta;
462 Real ccez = - dxx * (ez(i-1,j ,k ) +
464 - dyy * (ez(i ,j-1,k ) +
466 Real res = rhsz(i,j,k) - (gamma*ez(i,j,k) + ccez);
467 constexpr Real omega = Real(1.15);
468 ez(i,j,k) += omega/gamma * res;
471 if (my_color != color) {
return; }
473 Real dxy = adxinv[0]*adxinv[1];
476 {rhsx(i-1,j,k) - (-dyy * ( ex(i-1,j-1,k ) +
478 + dxy * ( ey(i-1,j-1,k )
480 rhsx(i ,j,k) - (-dyy * ( ex(i ,j-1,k ) +
482 + dxy * (-ey(i+1,j-1,k )
484 rhsy(i,j-1,k) - (-dxx * ( ey(i-1,j-1,k ) +
486 + dxy * ( ex(i-1,j-1,k )
488 rhsy(i,j ,k) - (-dxx * ( ey(i-1,j ,k ) +
490 + dxy * (-ex(i-1,j+1,k )
506 lusolver(
x.data(),
b.data());
507 ex(i-1,j ,k ) =
x[0];
509 ey(i ,j-1,k ) =
x[2];
514 if (my_color != color) {
return; }
516 Real dxx = adxinv[0]*adxinv[0];
517 Real dyy = adxinv[1]*adxinv[1];
518 Real dzz = adxinv[2]*adxinv[2];
519 Real dxy = adxinv[0]*adxinv[1];
520 Real dxz = adxinv[0]*adxinv[2];
521 Real dyz = adxinv[1]*adxinv[2];
524 {rhsx(i-1,j,k) - (-dyy * ( ex(i-1,j-1,k ) +
526 - dzz * ( ex(i-1,j ,k+1) +
528 + dxy * ( ey(i-1,j-1,k )
530 + dxz * ( ez(i-1,j ,k-1)
532 rhsx(i ,j,k) - (-dyy * ( ex(i ,j-1,k ) +
534 - dzz * ( ex(i ,j ,k+1) +
536 + dxy * (-ey(i+1,j-1,k )
538 + dxz * (-ez(i+1,j ,k-1)
540 rhsy(i,j-1,k) - (-dxx * ( ey(i-1,j-1,k ) +
542 - dzz * ( ey(i ,j-1,k-1) +
544 + dxy * ( ex(i-1,j-1,k )
546 + dyz * ( ez(i ,j-1,k-1)
548 rhsy(i,j ,k) - (-dxx * ( ey(i-1,j ,k ) +
550 - dzz * ( ey(i ,j ,k-1) +
552 + dxy * (-ex(i-1,j+1,k )
554 + dyz * (-ez(i ,j+1,k-1)
556 rhsz(i,j,k-1) - (-dxx * ( ez(i-1,j ,k-1) +
558 - dyy * ( ez(i ,j-1,k-1) +
560 + dxz * ( ex(i-1,j ,k-1)
562 + dyz * ( ey(i ,j-1,k-1)
564 rhsz(i,j,k ) - (-dxx * ( ez(i-1,j ,k ) +
566 - dyy * ( ez(i ,j-1,k ) +
568 + dxz * (-ex(i-1,j ,k+1)
570 + dyz * (-ey(i ,j-1,k+1)
585 if (sinfo.zlo_is_symmetric(k)) {
587 }
else if (sinfo.zhi_is_symmetric(k)) {
592 lusolver(
x.data(),
b.data());
593 ex(i-1,j ,k ) =
x[0];
595 ey(i ,j-1,k ) =
x[2];
597 ez(i ,j ,k-1) =
x[4];
621 int my_color = i%2 + 2*(j%2);
623 my_color = 3 - my_color;
626 #if (AMREX_SPACEDIM == 2)
628 Real dxx = adxinv[0] * adxinv[0];
629 Real dyy = adxinv[1] * adxinv[1];
631 if (((my_color == 0 || my_color == 3) && (color == 0 || color == 3)) ||
632 ((my_color == 1 || my_color == 2) && (color == 1 || color == 2)))
634 Real gamma = (dxx+dyy)*Real(2.0) + betaz(i,j,k);
635 Real ccez = - dxx * (ez(i-1,j ,k ) +
637 - dyy * (ez(i ,j-1,k ) +
639 Real res = rhsz(i,j,k) - (gamma*ez(i,j,k) + ccez);
640 constexpr Real omega = Real(1.15);
641 ez(i,j,k) += omega/gamma * res;
644 if (my_color != color) {
return; }
646 Real dxy = adxinv[0]*adxinv[1];
649 {rhsx(i-1,j,k) - (-dyy * ( ex(i-1,j-1,k ) +
651 + dxy * ( ey(i-1,j-1,k )
653 rhsx(i ,j,k) - (-dyy * ( ex(i ,j-1,k ) +
655 + dxy * (-ey(i+1,j-1,k )
657 rhsy(i,j-1,k) - (-dxx * ( ey(i-1,j-1,k ) +
659 + dxy * ( ex(i-1,j-1,k )
661 rhsy(i,j ,k) - (-dxx * ( ey(i-1,j ,k ) +
663 + dxy * (-ex(i-1,j+1,k )
670 beta[0] = beta[1] = betax(i,j,k);
673 beta[0] = beta[1] = betax(i-1,j,k);
675 beta[0] = betax(i-1,j,k);
676 beta[1] = betax(i ,j,k);
681 beta[2] = beta[3] = betay(i,j,k);
684 beta[2] = beta[3] = betay(i,j-1,k);
686 beta[2] = betay(i,j-1,k);
687 beta[3] = betay(i,j ,k);
691 Real diagInv[4] = {Real(1.0) / (dyy*Real(2.0) + beta[0]),
692 Real(1.0) / (dyy*Real(2.0) + beta[1]),
693 Real(1.0) / (dxx*Real(2.0) + beta[2]),
694 Real(1.0) / (dxx*Real(2.0) + beta[3])};
698 for (
int m = 0; m < 4; ++m) { z[m] =
r[m] * diagInv[m]; }
703 Av[0] = (dyy*Real(2.0) + beta[0]) * v[0] - dxy * v[2] + dxy * v[3];
704 Av[1] = (dyy*Real(2.0) + beta[1]) * v[1] + dxy * v[2] - dxy * v[3];
705 Av[2] = -dxy * v[0] + dxy * v[1] + (dxx*Real(2.0) + beta[2]) * v[2];
706 Av[3] = dxy * v[0] - dxy * v[1] + (dxx*Real(2.0) + beta[3]) * v[3];
708 Real sol[4] = {0, 0, 0, 0};
709 pcg_solve<4>(sol,
b.data(), mat, precond, 8, Real(1.e-8));
710 ex(i-1,j ,k ) = sol[0];
711 ex(i ,j ,k ) = sol[1];
712 ey(i ,j-1,k ) = sol[2];
713 ey(i ,j ,k ) = sol[3];
716 ({dyy*Real(2.0) + beta[0],
722 dyy*Real(2.0) + beta[1],
728 dxx*Real(2.0) + beta[2],
734 dxx*Real(2.0) + beta[3]});
735 lusolver(beta.
data(),
b.data());
736 ex(i-1,j ,k ) = beta[0];
737 ex(i ,j ,k ) = beta[1];
738 ey(i ,j-1,k ) = beta[2];
739 ey(i ,j ,k ) = beta[3];
744 if (my_color != color) {
return; }
746 Real dxx = adxinv[0]*adxinv[0];
747 Real dyy = adxinv[1]*adxinv[1];
748 Real dzz = adxinv[2]*adxinv[2];
749 Real dxy = adxinv[0]*adxinv[1];
750 Real dxz = adxinv[0]*adxinv[2];
751 Real dyz = adxinv[1]*adxinv[2];
754 {rhsx(i-1,j,k) - (-dyy * ( ex(i-1,j-1,k ) +
756 - dzz * ( ex(i-1,j ,k+1) +
758 + dxy * ( ey(i-1,j-1,k )
760 + dxz * ( ez(i-1,j ,k-1)
762 rhsx(i ,j,k) - (-dyy * ( ex(i ,j-1,k ) +
764 - dzz * ( ex(i ,j ,k+1) +
766 + dxy * (-ey(i+1,j-1,k )
768 + dxz * (-ez(i+1,j ,k-1)
770 rhsy(i,j-1,k) - (-dxx * ( ey(i-1,j-1,k ) +
772 - dzz * ( ey(i ,j-1,k-1) +
774 + dxy * ( ex(i-1,j-1,k )
776 + dyz * ( ez(i ,j-1,k-1)
778 rhsy(i,j ,k) - (-dxx * ( ey(i-1,j ,k ) +
780 - dzz * ( ey(i ,j ,k-1) +
782 + dxy * (-ex(i-1,j+1,k )
784 + dyz * (-ez(i ,j+1,k-1)
786 rhsz(i,j,k-1) - (-dxx * ( ez(i-1,j ,k-1) +
788 - dyy * ( ez(i ,j-1,k-1) +
790 + dxz * ( ex(i-1,j ,k-1)
792 + dyz * ( ey(i ,j-1,k-1)
794 rhsz(i,j,k ) - (-dxx * ( ez(i-1,j ,k ) +
796 - dyy * ( ez(i ,j-1,k ) +
798 + dxz * (-ex(i-1,j ,k+1)
800 + dyz * (-ey(i ,j-1,k+1)
807 beta[0] = beta[1] = betax(i,j,k);
810 beta[0] = beta[1] = betax(i-1,j,k);
812 beta[0] = betax(i-1,j,k);
813 beta[1] = betax(i ,j,k);
818 beta[2] = beta[3] = betay(i,j,k);
821 beta[2] = beta[3] = betay(i,j-1,k);
823 beta[2] = betay(i,j-1,k);
824 beta[3] = betay(i,j ,k);
827 if (sinfo.zlo_is_symmetric(k)) {
829 beta[4] = beta[5] = betaz(i,j,k);
830 }
else if (sinfo.zhi_is_symmetric(k)) {
832 beta[4] = beta[5] = betaz(i,j,k-1);
834 beta[4] = betaz(i,j,k-1);
835 beta[5] = betaz(i,j,k );
839 Real diagInv[6] = {Real(1.0) / ((dyy+dzz)*Real(2.0) + beta[0]),
840 Real(1.0) / ((dyy+dzz)*Real(2.0) + beta[1]),
841 Real(1.0) / ((dxx+dzz)*Real(2.0) + beta[2]),
842 Real(1.0) / ((dxx+dzz)*Real(2.0) + beta[3]),
843 Real(1.0) / ((dxx+dyy)*Real(2.0) + beta[4]),
844 Real(1.0) / ((dxx+dyy)*Real(2.0) + beta[5])};
848 for (
int m = 0; m < 6; ++m) { z[m] =
r[m] * diagInv[m]; }
853 Av[0] = ((dyy+dzz)*Real(2.0) + beta[0]) * v[0] - dxy * v[2]
854 + dxy * v[3] - dxz * v[4] + dxz * v[5];
855 Av[1] = ((dyy+dzz)*Real(2.0) + beta[1]) * v[1] + dxy * v[2]
856 - dxy * v[3] + dxz * v[4] - dxz * v[5];
857 Av[2] = -dxy * v[0] + dxy * v[1] + ((dxx+dzz)*Real(2.0) + beta[2]) * v[2]
858 - dyz * v[4] + dyz * v[5];
859 Av[3] = dxy * v[0] - dxy * v[1] + ((dxx+dzz)*Real(2.0) + beta[3]) * v[3]
860 + dyz * v[4] - dyz * v[5];
861 Av[4] = -dxz * v[0] + dxz * v[1] - dyz * v[2] + dyz * v[3]
862 + ((dxx+dyy)*Real(2.0) + beta[4]) * v[4];
863 Av[5] = dxz * v[0] - dxz * v[1] + dyz * v[2] - dyz * v[3]
864 + ((dxx+dyy)*Real(2.0) + beta[5]) * v[5];
866 Real sol[6] = {0, 0, 0, 0, 0, 0};
867 pcg_solve<6>(sol,
b.data(), mat, precond, 8, Real(1.e-8));
868 ex(i-1,j ,k ) = sol[0];
869 ex(i ,j ,k ) = sol[1];
870 ey(i ,j-1,k ) = sol[2];
871 ey(i ,j ,k ) = sol[3];
872 ez(i ,j ,k-1) = sol[4];
873 ez(i ,j ,k ) = sol[5];
876 ({(dyy+dzz)*Real(2.0) + beta[0],
884 (dyy+dzz)*Real(2.0) + beta[1],
892 (dxx+dzz)*Real(2.0) + beta[2],
900 (dxx+dzz)*Real(2.0) + beta[3],
908 (dxx+dyy)*Real(2.0) + beta[4],
916 (dxx+dyy)*Real(2.0) + beta[5]});
917 lusolver(beta.
data(),
b.data());
918 ex(i-1,j ,k ) = beta[0];
919 ex(i ,j ,k ) = beta[1];
920 ey(i ,j-1,k ) = beta[2];
921 ey(i ,j ,k ) = beta[3];
922 ez(i ,j ,k-1) = beta[4];
923 ez(i ,j ,k ) = beta[5];
937 bool j_is_odd = (jc*2 != j);
938 bool k_is_odd = (kc*2 != k);
939 if (j_is_odd && k_is_odd) {
940 fine(i,j,k) += Real(0.25) *
941 (
crse(ic,jc,kc ) +
crse(ic,jc+1,kc ) +
942 crse(ic,jc,kc+1) +
crse(ic,jc+1,kc+1));
943 }
else if (j_is_odd) {
944 fine(i,j,k) += Real(0.5) * (
crse(ic,jc,kc) +
crse(ic,jc+1,kc));
945 }
else if (k_is_odd) {
946 fine(i,j,k) += Real(0.5) * (
crse(ic,jc,kc) +
crse(ic,jc,kc+1));
950 }
else if (dir == 1) {
951 bool i_is_odd = (ic*2 != i);
952 bool k_is_odd = (kc*2 != k);
953 if (i_is_odd && k_is_odd) {
954 fine(i,j,k) += Real(0.25) *
955 (
crse(ic ,jc,kc ) +
crse(ic+1,jc,kc ) +
956 crse(ic ,jc,kc+1) +
crse(ic+1,jc,kc+1));
957 }
else if (i_is_odd) {
958 fine(i,j,k) += Real(0.5) * (
crse(ic,jc,kc) +
crse(ic+1,jc,kc));
959 }
else if (k_is_odd) {
960 fine(i,j,k) += Real(0.5) * (
crse(ic,jc,kc) +
crse(ic,jc,kc+1));
965 bool i_is_odd = (ic*2 != i);
966 bool j_is_odd = (jc*2 != j);
967 if (i_is_odd && j_is_odd) {
968 fine(i,j,k) += Real(0.25) *
969 (
crse(ic ,jc ,kc) +
crse(ic+1,jc ,kc) +
970 crse(ic ,jc+1,kc) +
crse(ic+1,jc+1,kc));
971 }
else if (i_is_odd) {
972 fine(i,j,k) += Real(0.5) * (
crse(ic,jc,kc) +
crse(ic+1,jc,kc));
973 }
else if (j_is_odd) {
974 fine(i,j,k) += Real(0.5) * (
crse(ic,jc,kc) +
crse(ic,jc+1,kc));
991 crse(i,j,k) = Real(0.0);
995 #if (AMREX_SPACEDIM == 3)
997 crse(i,j,k) = Real(1./32.) * (
fine(ii ,jj-1,kk-1) +
998 fine(ii ,jj ,kk-1) * Real(2.0) +
999 fine(ii ,jj+1,kk-1) +
1000 fine(ii ,jj-1,kk ) * Real(2.0) +
1001 fine(ii ,jj ,kk ) * Real(4.0) +
1002 fine(ii ,jj+1,kk ) * Real(2.0) +
1003 fine(ii ,jj-1,kk+1) +
1004 fine(ii ,jj ,kk+1) * Real(2.0) +
1005 fine(ii ,jj+1,kk+1) +
1006 fine(ii+1,jj-1,kk-1) +
1007 fine(ii+1,jj ,kk-1) * Real(2.0) +
1008 fine(ii+1,jj+1,kk-1) +
1009 fine(ii+1,jj-1,kk ) * Real(2.0) +
1010 fine(ii+1,jj ,kk ) * Real(4.0) +
1011 fine(ii+1,jj+1,kk ) * Real(2.0) +
1012 fine(ii+1,jj-1,kk+1) +
1013 fine(ii+1,jj ,kk+1) * Real(2.0) +
1014 fine(ii+1,jj+1,kk+1) );
1015 }
else if (dir == 1) {
1016 crse(i,j,k) = Real(1./32.) * (
fine(ii-1,jj ,kk-1) +
1017 fine(ii ,jj ,kk-1) * Real(2.0) +
1018 fine(ii+1,jj ,kk-1) +
1019 fine(ii-1,jj ,kk ) * Real(2.0) +
1020 fine(ii ,jj ,kk ) * Real(4.0) +
1021 fine(ii+1,jj ,kk ) * Real(2.0) +
1022 fine(ii-1,jj ,kk+1) +
1023 fine(ii ,jj ,kk+1) * Real(2.0) +
1024 fine(ii+1,jj ,kk+1) +
1025 fine(ii-1,jj+1,kk-1) +
1026 fine(ii ,jj+1,kk-1) * Real(2.0) +
1027 fine(ii+1,jj+1,kk-1) +
1028 fine(ii-1,jj+1,kk ) * Real(2.0) +
1029 fine(ii ,jj+1,kk ) * Real(4.0) +
1030 fine(ii+1,jj+1,kk ) * Real(2.0) +
1031 fine(ii-1,jj+1,kk+1) +
1032 fine(ii ,jj+1,kk+1) * Real(2.0) +
1033 fine(ii+1,jj+1,kk+1) );
1035 crse(i,j,k) = Real(1./32.) * (
fine(ii-1,jj-1,kk ) +
1036 fine(ii ,jj-1,kk ) * Real(2.0) +
1037 fine(ii+1,jj-1,kk ) +
1038 fine(ii-1,jj ,kk ) * Real(2.0) +
1039 fine(ii ,jj ,kk ) * Real(4.0) +
1040 fine(ii+1,jj ,kk ) * Real(2.0) +
1041 fine(ii-1,jj+1,kk ) +
1042 fine(ii ,jj+1,kk ) * Real(2.0) +
1043 fine(ii+1,jj+1,kk ) +
1044 fine(ii-1,jj-1,kk+1) +
1045 fine(ii ,jj-1,kk+1) * Real(2.0) +
1046 fine(ii+1,jj-1,kk+1) +
1047 fine(ii-1,jj ,kk+1) * Real(2.0) +
1048 fine(ii ,jj ,kk+1) * Real(4.0) +
1049 fine(ii+1,jj ,kk+1) * Real(2.0) +
1050 fine(ii-1,jj+1,kk+1) +
1051 fine(ii ,jj+1,kk+1) * Real(2.0) +
1052 fine(ii+1,jj+1,kk+1) );
1056 crse(i,j,0) = Real(0.125) * (
fine(ii ,jj-1,0) +
1057 fine(ii ,jj ,0) * Real(2.0) +
1060 fine(ii+1,jj ,0) * Real(2.0) +
1061 fine(ii+1,jj+1,0) );
1062 }
else if (dir == 1) {
1063 crse(i,j,0) = Real(0.125) * (
fine(ii-1,jj ,0) +
1064 fine(ii ,jj ,0) * Real(2.0) +
1067 fine(ii ,jj+1,0) * Real(2.0) +
1068 fine(ii+1,jj+1,0) );
1070 crse(i,j,0) = Real(1./16.)*(
fine(ii-1,jj-1,0) + Real(2.)*
fine(ii ,jj-1,0) +
fine(ii+1,jj-1,0)
1071 + Real(2.)*
fine(ii-1,jj ,0) + Real(4.)*
fine(ii ,jj ,0) + Real(2.)*
fine(ii+1,jj ,0)
1072 +
fine(ii-1,jj+1,0) + Real(2.)*
fine(ii ,jj+1,0) +
fine(ii+1,jj+1,0));
1094 a(i,j,k) = sign * a(i+
offset,j,k);
1095 }
else if (
idir == 1) {
1096 a(i,j,k) = sign * a(i,j+
offset,k);
1098 a(i,j,k) = sign * a(i,j,k+
offset);
#define AMREX_FORCE_INLINE
Definition: AMReX_Extension.H:119
#define AMREX_RESTRICT
Definition: AMReX_Extension.H:37
#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
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool cellCentered() const noexcept
True if the IndexTypeND is CELL based in all directions.
Definition: AMReX_IndexType.H:101
Definition: AMReX_LUSolver.H:16
Encapsulation of the Orientation of the Faces of a Box.
Definition: AMReX_Orientation.H:29
AMREX_GPU_HOST_DEVICE int coordDir() const noexcept
Returns the coordinate direction.
Definition: AMReX_Orientation.H:83
AMREX_GPU_HOST_DEVICE bool isLow() const noexcept
Returns true if Orientation is low.
Definition: AMReX_Orientation.H:89
Definition: AMReX_Amr.cpp:49
CurlCurlStateType
Definition: AMReX_MLCurlCurl_K.H:310
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void mlcurlcurl_gs4(int i, int j, int k, Array4< Real > const &ex, Array4< Real > const &ey, Array4< Real > const &ez, Array4< Real const > const &rhsx, Array4< Real const > const &rhsy, Array4< Real const > const &rhsz, GpuArray< Real, AMREX_SPACEDIM > const &adxinv, int color, Array4< Real const > const &betax, Array4< Real const > const &betay, Array4< Real const > const &betaz, CurlCurlDirichletInfo const &dinfo, CurlCurlSymmetryInfo const &sinfo)
Definition: AMReX_MLCurlCurl_K.H:604
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void mlcurlcurl_interpadd(int dir, int i, int j, int k, Array4< Real > const &fine, Array4< Real const > const &crse)
Definition: AMReX_MLCurlCurl_K.H:929
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void mlcurlcurl_adotx_y(int i, int j, int k, Array4< Real > const &Ay, Array4< Real const > const &ex, Array4< Real const > const &ey, Array4< Real const > const &ez, Real beta, GpuArray< Real, AMREX_SPACEDIM > const &adxinv)
Definition: AMReX_MLCurlCurl_K.H:353
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void ignore_unused(const Ts &...)
This shuts up the compiler about unused variables.
Definition: AMReX.H:111
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void mlcurlcurl_bc_symmetry(int i, int j, int k, Orientation face, IndexType it, Array4< Real > const &a)
Definition: AMReX_MLCurlCurl_K.H:1080
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void mlcurlcurl_adotx_z(int i, int j, int k, Array4< Real > const &Az, Array4< Real const > const &ex, Array4< Real const > const &ey, Array4< Real const > const &ez, Real beta, GpuArray< Real, AMREX_SPACEDIM > const &adxinv)
Definition: AMReX_MLCurlCurl_K.H:393
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void mlcurlcurl_adotx_x(int i, int j, int k, Array4< Real > const &Ax, Array4< Real const > const &ex, Array4< Real const > const &ey, Array4< Real const > const &ez, Real beta, GpuArray< Real, AMREX_SPACEDIM > const &adxinv)
Definition: AMReX_MLCurlCurl_K.H:313
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 void mlcurlcurl_gs4_lu(int i, int j, int k, Array4< Real > const &ex, Array4< Real > const &ey, Array4< Real > const &ez, Array4< Real const > const &rhsx, Array4< Real const > const &rhsy, Array4< Real const > const &rhsz, GpuArray< Real, AMREX_SPACEDIM > const &adxinv, int color, LUSolver< AMREX_SPACEDIM *2, Real > const &lusolver, CurlCurlDirichletInfo const &dinfo, CurlCurlSymmetryInfo const &sinfo)
Definition: AMReX_MLCurlCurl_K.H:431
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void mlcurlcurl_restriction(int dir, int i, int j, int k, Array4< Real > const &crse, Array4< Real const > const &fine, CurlCurlDirichletInfo const &dinfo)
Definition: AMReX_MLCurlCurl_K.H:982
Definition: AMReX_Array4.H:61
Definition: AMReX_MLCurlCurl_K.H:185
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool is_dirichlet_node(int i, int j, int k) const
Definition: AMReX_MLCurlCurl_K.H:190
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool is_dirichlet_edge(int dim, int i, int j, int k) const
Definition: AMReX_MLCurlCurl_K.H:235
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool is_dirichlet_z_edge(int i, int j, int) const
Definition: AMReX_MLCurlCurl_K.H:228
IntVect dirichlet_hi
Definition: AMReX_MLCurlCurl_K.H:187
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool is_dirichlet_y_edge(int i, int, int k) const
Definition: AMReX_MLCurlCurl_K.H:216
IntVect dirichlet_lo
Definition: AMReX_MLCurlCurl_K.H:186
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool is_dirichlet_x_edge(int, int j, int k) const
Definition: AMReX_MLCurlCurl_K.H:204
Definition: AMReX_MLCurlCurl_K.H:248
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool xlo_is_symmetric(int i) const
Definition: AMReX_MLCurlCurl_K.H:253
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool ylo_is_symmetric(int j) const
Definition: AMReX_MLCurlCurl_K.H:265
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool xhi_is_symmetric(int i) const
Definition: AMReX_MLCurlCurl_K.H:259
IntVect symmetry_hi
Definition: AMReX_MLCurlCurl_K.H:250
IntVect symmetry_lo
Definition: AMReX_MLCurlCurl_K.H:249
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool yhi_is_symmetric(int j) const
Definition: AMReX_MLCurlCurl_K.H:271
bool is_symmetric(int dir, int side, int idx) const
Definition: AMReX_MLCurlCurl_K.H:290
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T * data() const noexcept
Definition: AMReX_Array.H:56