Lines Matching refs:j
263 PetscInt i, j; in PhysicsCharacteristic_Conservative() local
267 for (j = 0; j < m; j++) Xi[i * m + j] = X[i * m + j] = (PetscScalar)(i == j); in PhysicsCharacteristic_Conservative()
477 PetscInt i, j, k, dof, xs, xm, Mx; in FVSample_2WaySplit() local
494 for (j = 0; j < N + 1; j++) { in FVSample_2WaySplit()
495 xj = xi + hs * (j - N / 2) / (PetscReal)N; in FVSample_2WaySplit()
497 for (k = 0; k < dof; k++) u[i * dof + k] += ((j == 0 || j == N) ? 0.5 : 1.0) * uj[k] / N; in FVSample_2WaySplit()
503 for (j = 0; j < N + 1; j++) { in FVSample_2WaySplit()
504 xj = xi + hf * (j - N / 2) / (PetscReal)N; in FVSample_2WaySplit()
506 for (k = 0; k < dof; k++) u[i * dof + k] += ((j == 0 || j == N) ? 0.5 : 1.0) * uj[k] / N; in FVSample_2WaySplit()
512 for (j = 0; j < N + 1; j++) { in FVSample_2WaySplit()
513 xj = xi + hs * (j - N / 2) / (PetscReal)N; in FVSample_2WaySplit()
515 for (k = 0; k < dof; k++) u[i * dof + k] += ((j == 0 || j == N) ? 0.5 : 1.0) * uj[k] / N; in FVSample_2WaySplit()
552 PetscInt i, j, k, Mx, dof, xs, xm, sf = ctx->sf, fs = ctx->fs; in FVRHSFunction_2WaySplit() local
576 for (j = 0; j < dof; j++) x[i * dof + j] = x[j]; in FVRHSFunction_2WaySplit()
579 for (j = 0; j < dof; j++) x[i * dof + j] = x[(xs + xm - 1) * dof + j]; in FVRHSFunction_2WaySplit()
588 for (j = 0; j < dof; j++) { in FVRHSFunction_2WaySplit()
589 if (ctx->physics2.bcinflowindex[j]) { in FVRHSFunction_2WaySplit()
590 for (i = -2; i < 0; i++) x[i * dof + j] = 2.0 * ctx->ub[j] - x[-(i + 1) * dof + j]; in FVRHSFunction_2WaySplit()
592 for (i = -2; i < 0; i++) x[i * dof + j] = x[j]; /* Outflow */ in FVRHSFunction_2WaySplit()
598 for (j = 0; j < dof; j++) { in FVRHSFunction_2WaySplit()
599 if (ctx->physics2.bcinflowindex[dof + j]) { in FVRHSFunction_2WaySplit()
600 …for (i = Mx; i < Mx + 2; i++) x[i * dof + j] = 2.0 * ctx->ub[dof + j] - x[(2 * Mx - (i + 1)) * dof… in FVRHSFunction_2WaySplit()
602 for (i = Mx; i < Mx + 2; i++) x[i * dof + j] = x[(Mx - 1) * dof + j]; /* Outflow */ in FVRHSFunction_2WaySplit()
617 for (j = 0; j < dof; j++) { in FVRHSFunction_2WaySplit()
619 jmpL = x[(i + 0) * dof + j] - x[(i - 1) * dof + j]; in FVRHSFunction_2WaySplit()
620 jmpR = x[(i + 1) * dof + j] - x[(i + 0) * dof + j]; in FVRHSFunction_2WaySplit()
622 cjmpL[k] += ctx->Rinv[k + j * dof] * jmpL; in FVRHSFunction_2WaySplit()
623 cjmpR[k] += ctx->Rinv[k + j * dof] * jmpR; in FVRHSFunction_2WaySplit()
631 for (j = 0; j < dof; j++) { in FVRHSFunction_2WaySplit()
633 for (k = 0; k < dof; k++) tmp += ctx->R[j + k * dof] * ctx->cslope[k]; in FVRHSFunction_2WaySplit()
634 slope[i * dof + j] = tmp; in FVRHSFunction_2WaySplit()
644 for (j = 0; j < dof; j++) { in FVRHSFunction_2WaySplit()
645 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hxs / 2; in FVRHSFunction_2WaySplit()
646 uR[j] = x[(i - 0) * dof + j] - slope[(i - 0) * dof + j] * hxs / 2; in FVRHSFunction_2WaySplit()
650 for (j = 0; j < dof; j++) f[(i - 1) * dof + j] -= ctx->flux[j] / hxs; in FVRHSFunction_2WaySplit()
653 for (j = 0; j < dof; j++) f[i * dof + j] += ctx->flux[j] / hxs; in FVRHSFunction_2WaySplit()
656 for (j = 0; j < dof; j++) { in FVRHSFunction_2WaySplit()
657 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hxs / 2; in FVRHSFunction_2WaySplit()
658 uR[j] = x[(i - 0) * dof + j] - slope[(i - 0) * dof + j] * hxf / 2; in FVRHSFunction_2WaySplit()
662 for (j = 0; j < dof; j++) f[(i - 1) * dof + j] -= ctx->flux[j] / hxs; in FVRHSFunction_2WaySplit()
665 for (j = 0; j < dof; j++) f[i * dof + j] += ctx->flux[j] / hxf; in FVRHSFunction_2WaySplit()
668 for (j = 0; j < dof; j++) { in FVRHSFunction_2WaySplit()
669 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hxf / 2; in FVRHSFunction_2WaySplit()
670 uR[j] = x[(i - 0) * dof + j] - slope[(i - 0) * dof + j] * hxf / 2; in FVRHSFunction_2WaySplit()
674 for (j = 0; j < dof; j++) f[(i - 1) * dof + j] -= ctx->flux[j] / hxf; in FVRHSFunction_2WaySplit()
677 for (j = 0; j < dof; j++) f[i * dof + j] += ctx->flux[j] / hxf; in FVRHSFunction_2WaySplit()
680 for (j = 0; j < dof; j++) { in FVRHSFunction_2WaySplit()
681 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hxf / 2; in FVRHSFunction_2WaySplit()
682 uR[j] = x[(i - 0) * dof + j] - slope[(i - 0) * dof + j] * hxs / 2; in FVRHSFunction_2WaySplit()
686 for (j = 0; j < dof; j++) f[(i - 1) * dof + j] -= ctx->flux[j] / hxf; in FVRHSFunction_2WaySplit()
689 for (j = 0; j < dof; j++) f[i * dof + j] += ctx->flux[j] / hxs; in FVRHSFunction_2WaySplit()
692 for (j = 0; j < dof; j++) { in FVRHSFunction_2WaySplit()
693 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hxs / 2; in FVRHSFunction_2WaySplit()
694 uR[j] = x[(i - 0) * dof + j] - slope[(i - 0) * dof + j] * hxs / 2; in FVRHSFunction_2WaySplit()
699 for (j = 0; j < dof; j++) f[(i - 1) * dof + j] -= ctx->flux[j] / hxs; in FVRHSFunction_2WaySplit()
702 for (j = 0; j < dof; j++) f[i * dof + j] += ctx->flux[j] / hxs; in FVRHSFunction_2WaySplit()
728 …PetscInt i, j, k, Mx, dof, xs, xm, islow = 0, sf = ctx->sf, fs = ctx->fs, lsbwidth = ctx->lsbw… in FVRHSFunctionslow_2WaySplit() local
750 for (j = 0; j < dof; j++) x[i * dof + j] = x[j]; in FVRHSFunctionslow_2WaySplit()
753 for (j = 0; j < dof; j++) x[i * dof + j] = x[(xs + xm - 1) * dof + j]; in FVRHSFunctionslow_2WaySplit()
761 for (j = 0; j < dof; j++) { in FVRHSFunctionslow_2WaySplit()
762 if (ctx->physics2.bcinflowindex[j] == PETSC_TRUE) { in FVRHSFunctionslow_2WaySplit()
763 for (i = -2; i < 0; i++) x[i * dof + j] = 2.0 * ctx->ub[j] - x[-(i + 1) * dof + j]; in FVRHSFunctionslow_2WaySplit()
765 for (i = -2; i < 0; i++) x[i * dof + j] = x[j]; /* Outflow */ in FVRHSFunctionslow_2WaySplit()
771 for (j = 0; j < dof; j++) { in FVRHSFunctionslow_2WaySplit()
772 if (ctx->physics2.bcinflowindex[dof + j] == PETSC_TRUE) { in FVRHSFunctionslow_2WaySplit()
773 …for (i = Mx; i < Mx + 2; i++) x[i * dof + j] = 2.0 * ctx->ub[dof + j] - x[(2 * Mx - (i + 1)) * dof… in FVRHSFunctionslow_2WaySplit()
775 for (i = Mx; i < Mx + 2; i++) x[i * dof + j] = x[(Mx - 1) * dof + j]; /* Outflow */ in FVRHSFunctionslow_2WaySplit()
790 for (j = 0; j < dof; j++) { in FVRHSFunctionslow_2WaySplit()
792 jmpL = x[(i + 0) * dof + j] - x[(i - 1) * dof + j]; in FVRHSFunctionslow_2WaySplit()
793 jmpR = x[(i + 1) * dof + j] - x[(i + 0) * dof + j]; in FVRHSFunctionslow_2WaySplit()
795 cjmpL[k] += ctx->Rinv[k + j * dof] * jmpL; in FVRHSFunctionslow_2WaySplit()
796 cjmpR[k] += ctx->Rinv[k + j * dof] * jmpR; in FVRHSFunctionslow_2WaySplit()
804 for (j = 0; j < dof; j++) { in FVRHSFunctionslow_2WaySplit()
806 for (k = 0; k < dof; k++) tmp += ctx->R[j + k * dof] * ctx->cslope[k]; in FVRHSFunctionslow_2WaySplit()
807 slope[i * dof + j] = tmp; in FVRHSFunctionslow_2WaySplit()
818 for (j = 0; j < dof; j++) { in FVRHSFunctionslow_2WaySplit()
819 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hxs / 2; in FVRHSFunctionslow_2WaySplit()
820 uR[j] = x[(i - 0) * dof + j] - slope[(i - 0) * dof + j] * hxs / 2; in FVRHSFunctionslow_2WaySplit()
825 for (j = 0; j < dof; j++) f[(islow - 1) * dof + j] -= ctx->flux[j] / hxs; in FVRHSFunctionslow_2WaySplit()
828 for (j = 0; j < dof; j++) f[islow * dof + j] += ctx->flux[j] / hxs; in FVRHSFunctionslow_2WaySplit()
833 for (j = 0; j < dof; j++) { in FVRHSFunctionslow_2WaySplit()
834 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hxs / 2; in FVRHSFunctionslow_2WaySplit()
835 uR[j] = x[(i - 0) * dof + j] - slope[(i - 0) * dof + j] * hxs / 2; in FVRHSFunctionslow_2WaySplit()
839 for (j = 0; j < dof; j++) f[(islow - 1) * dof + j] -= ctx->flux[j] / hxs; in FVRHSFunctionslow_2WaySplit()
843 for (j = 0; j < dof; j++) { in FVRHSFunctionslow_2WaySplit()
844 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hxs / 2; in FVRHSFunctionslow_2WaySplit()
845 uR[j] = x[(i - 0) * dof + j] - slope[(i - 0) * dof + j] * hxs / 2; in FVRHSFunctionslow_2WaySplit()
849 for (j = 0; j < dof; j++) f[islow * dof + j] += ctx->flux[j] / hxs; in FVRHSFunctionslow_2WaySplit()
854 for (j = 0; j < dof; j++) { in FVRHSFunctionslow_2WaySplit()
855 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hxs / 2; in FVRHSFunctionslow_2WaySplit()
856 uR[j] = x[(i - 0) * dof + j] - slope[(i - 0) * dof + j] * hxs / 2; in FVRHSFunctionslow_2WaySplit()
860 for (j = 0; j < dof; j++) f[(islow - 1) * dof + j] -= ctx->flux[j] / hxs; in FVRHSFunctionslow_2WaySplit()
863 for (j = 0; j < dof; j++) f[islow * dof + j] += ctx->flux[j] / hxs; in FVRHSFunctionslow_2WaySplit()
879 …PetscInt i, j, k, Mx, dof, xs, xm, islow = 0, sf = ctx->sf, fs = ctx->fs, lsbwidth = ctx->lsbw… in FVRHSFunctionslowbuffer_2WaySplit() local
901 for (j = 0; j < dof; j++) x[i * dof + j] = x[j]; in FVRHSFunctionslowbuffer_2WaySplit()
904 for (j = 0; j < dof; j++) x[i * dof + j] = x[(xs + xm - 1) * dof + j]; in FVRHSFunctionslowbuffer_2WaySplit()
912 for (j = 0; j < dof; j++) { in FVRHSFunctionslowbuffer_2WaySplit()
913 if (ctx->physics2.bcinflowindex[j] == PETSC_TRUE) { in FVRHSFunctionslowbuffer_2WaySplit()
914 for (i = -2; i < 0; i++) x[i * dof + j] = 2.0 * ctx->ub[j] - x[-(i + 1) * dof + j]; in FVRHSFunctionslowbuffer_2WaySplit()
916 for (i = -2; i < 0; i++) x[i * dof + j] = x[j]; /* Outflow */ in FVRHSFunctionslowbuffer_2WaySplit()
922 for (j = 0; j < dof; j++) { in FVRHSFunctionslowbuffer_2WaySplit()
923 if (ctx->physics2.bcinflowindex[dof + j] == PETSC_TRUE) { in FVRHSFunctionslowbuffer_2WaySplit()
924 …for (i = Mx; i < Mx + 2; i++) x[i * dof + j] = 2.0 * ctx->ub[dof + j] - x[(2 * Mx - (i + 1)) * dof… in FVRHSFunctionslowbuffer_2WaySplit()
926 for (i = Mx; i < Mx + 2; i++) x[i * dof + j] = x[(Mx - 1) * dof + j]; /* Outflow */ in FVRHSFunctionslowbuffer_2WaySplit()
941 for (j = 0; j < dof; j++) { in FVRHSFunctionslowbuffer_2WaySplit()
943 jmpL = x[(i + 0) * dof + j] - x[(i - 1) * dof + j]; in FVRHSFunctionslowbuffer_2WaySplit()
944 jmpR = x[(i + 1) * dof + j] - x[(i + 0) * dof + j]; in FVRHSFunctionslowbuffer_2WaySplit()
946 cjmpL[k] += ctx->Rinv[k + j * dof] * jmpL; in FVRHSFunctionslowbuffer_2WaySplit()
947 cjmpR[k] += ctx->Rinv[k + j * dof] * jmpR; in FVRHSFunctionslowbuffer_2WaySplit()
955 for (j = 0; j < dof; j++) { in FVRHSFunctionslowbuffer_2WaySplit()
957 for (k = 0; k < dof; k++) tmp += ctx->R[j + k * dof] * ctx->cslope[k]; in FVRHSFunctionslowbuffer_2WaySplit()
958 slope[i * dof + j] = tmp; in FVRHSFunctionslowbuffer_2WaySplit()
969 for (j = 0; j < dof; j++) { in FVRHSFunctionslowbuffer_2WaySplit()
970 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hxs / 2; in FVRHSFunctionslowbuffer_2WaySplit()
971 uR[j] = x[(i - 0) * dof + j] - slope[(i - 0) * dof + j] * hxs / 2; in FVRHSFunctionslowbuffer_2WaySplit()
975 for (j = 0; j < dof; j++) f[islow * dof + j] += ctx->flux[j] / hxs; in FVRHSFunctionslowbuffer_2WaySplit()
980 for (j = 0; j < dof; j++) { in FVRHSFunctionslowbuffer_2WaySplit()
981 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hxs / 2; in FVRHSFunctionslowbuffer_2WaySplit()
982 uR[j] = x[(i - 0) * dof + j] - slope[(i - 0) * dof + j] * hxs / 2; in FVRHSFunctionslowbuffer_2WaySplit()
986 for (j = 0; j < dof; j++) f[(islow - 1) * dof + j] -= ctx->flux[j] / hxs; in FVRHSFunctionslowbuffer_2WaySplit()
989 for (j = 0; j < dof; j++) f[islow * dof + j] += ctx->flux[j] / hxs; in FVRHSFunctionslowbuffer_2WaySplit()
994 for (j = 0; j < dof; j++) { in FVRHSFunctionslowbuffer_2WaySplit()
995 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hxs / 2; in FVRHSFunctionslowbuffer_2WaySplit()
996 uR[j] = x[(i - 0) * dof + j] - slope[(i - 0) * dof + j] * hxf / 2; in FVRHSFunctionslowbuffer_2WaySplit()
1000 for (j = 0; j < dof; j++) f[(islow - 1) * dof + j] -= ctx->flux[j] / hxs; in FVRHSFunctionslowbuffer_2WaySplit()
1004 for (j = 0; j < dof; j++) { in FVRHSFunctionslowbuffer_2WaySplit()
1005 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hxf / 2; in FVRHSFunctionslowbuffer_2WaySplit()
1006 uR[j] = x[(i - 0) * dof + j] - slope[(i - 0) * dof + j] * hxs / 2; in FVRHSFunctionslowbuffer_2WaySplit()
1010 for (j = 0; j < dof; j++) f[islow * dof + j] += ctx->flux[j] / hxs; in FVRHSFunctionslowbuffer_2WaySplit()
1015 for (j = 0; j < dof; j++) { in FVRHSFunctionslowbuffer_2WaySplit()
1016 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hxs / 2; in FVRHSFunctionslowbuffer_2WaySplit()
1017 uR[j] = x[(i - 0) * dof + j] - slope[(i - 0) * dof + j] * hxs / 2; in FVRHSFunctionslowbuffer_2WaySplit()
1021 for (j = 0; j < dof; j++) f[(islow - 1) * dof + j] -= ctx->flux[j] / hxs; in FVRHSFunctionslowbuffer_2WaySplit()
1024 for (j = 0; j < dof; j++) f[islow * dof + j] += ctx->flux[j] / hxs; in FVRHSFunctionslowbuffer_2WaySplit()
1029 for (j = 0; j < dof; j++) { in FVRHSFunctionslowbuffer_2WaySplit()
1030 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hxs / 2; in FVRHSFunctionslowbuffer_2WaySplit()
1031 uR[j] = x[(i - 0) * dof + j] - slope[(i - 0) * dof + j] * hxs / 2; in FVRHSFunctionslowbuffer_2WaySplit()
1035 for (j = 0; j < dof; j++) f[(islow - 1) * dof + j] -= ctx->flux[j] / hxs; in FVRHSFunctionslowbuffer_2WaySplit()
1050 PetscInt i, j, k, Mx, dof, xs, xm, ifast = 0, sf = ctx->sf, fs = ctx->fs; in FVRHSFunctionfast_2WaySplit() local
1072 for (j = 0; j < dof; j++) x[i * dof + j] = x[j]; in FVRHSFunctionfast_2WaySplit()
1075 for (j = 0; j < dof; j++) x[i * dof + j] = x[(xs + xm - 1) * dof + j]; in FVRHSFunctionfast_2WaySplit()
1083 for (j = 0; j < dof; j++) { in FVRHSFunctionfast_2WaySplit()
1084 if (ctx->physics2.bcinflowindex[j] == PETSC_TRUE) { in FVRHSFunctionfast_2WaySplit()
1085 for (i = -2; i < 0; i++) x[i * dof + j] = 2.0 * ctx->ub[j] - x[-(i + 1) * dof + j]; in FVRHSFunctionfast_2WaySplit()
1087 for (i = -2; i < 0; i++) x[i * dof + j] = x[j]; /* Outflow */ in FVRHSFunctionfast_2WaySplit()
1093 for (j = 0; j < dof; j++) { in FVRHSFunctionfast_2WaySplit()
1094 if (ctx->physics2.bcinflowindex[dof + j] == PETSC_TRUE) { in FVRHSFunctionfast_2WaySplit()
1095 …for (i = Mx; i < Mx + 2; i++) x[i * dof + j] = 2.0 * ctx->ub[dof + j] - x[(2 * Mx - (i + 1)) * dof… in FVRHSFunctionfast_2WaySplit()
1097 for (i = Mx; i < Mx + 2; i++) x[i * dof + j] = x[(Mx - 1) * dof + j]; /* Outflow */ in FVRHSFunctionfast_2WaySplit()
1110 for (j = 0; j < dof; j++) { in FVRHSFunctionfast_2WaySplit()
1112 jmpL = x[(i + 0) * dof + j] - x[(i - 1) * dof + j]; in FVRHSFunctionfast_2WaySplit()
1113 jmpR = x[(i + 1) * dof + j] - x[(i + 0) * dof + j]; in FVRHSFunctionfast_2WaySplit()
1115 cjmpL[k] += ctx->Rinv[k + j * dof] * jmpL; in FVRHSFunctionfast_2WaySplit()
1116 cjmpR[k] += ctx->Rinv[k + j * dof] * jmpR; in FVRHSFunctionfast_2WaySplit()
1124 for (j = 0; j < dof; j++) { in FVRHSFunctionfast_2WaySplit()
1126 for (k = 0; k < dof; k++) tmp += ctx->R[j + k * dof] * ctx->cslope[k]; in FVRHSFunctionfast_2WaySplit()
1127 slope[i * dof + j] = tmp; in FVRHSFunctionfast_2WaySplit()
1138 for (j = 0; j < dof; j++) { in FVRHSFunctionfast_2WaySplit()
1139 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hxs / 2; in FVRHSFunctionfast_2WaySplit()
1140 uR[j] = x[(i - 0) * dof + j] - slope[(i - 0) * dof + j] * hxf / 2; in FVRHSFunctionfast_2WaySplit()
1144 for (j = 0; j < dof; j++) f[ifast * dof + j] += ctx->flux[j] / hxf; in FVRHSFunctionfast_2WaySplit()
1149 for (j = 0; j < dof; j++) { in FVRHSFunctionfast_2WaySplit()
1150 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hxf / 2; in FVRHSFunctionfast_2WaySplit()
1151 uR[j] = x[(i - 0) * dof + j] - slope[(i - 0) * dof + j] * hxf / 2; in FVRHSFunctionfast_2WaySplit()
1155 for (j = 0; j < dof; j++) f[(ifast - 1) * dof + j] -= ctx->flux[j] / hxf; in FVRHSFunctionfast_2WaySplit()
1158 for (j = 0; j < dof; j++) f[ifast * dof + j] += ctx->flux[j] / hxf; in FVRHSFunctionfast_2WaySplit()
1163 for (j = 0; j < dof; j++) { in FVRHSFunctionfast_2WaySplit()
1164 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hxf / 2; in FVRHSFunctionfast_2WaySplit()
1165 uR[j] = x[(i - 0) * dof + j] - slope[(i - 0) * dof + j] * hxs / 2; in FVRHSFunctionfast_2WaySplit()
1169 for (j = 0; j < dof; j++) f[(ifast - 1) * dof + j] -= ctx->flux[j] / hxf; in FVRHSFunctionfast_2WaySplit()