Lines Matching refs:cnt

68   PetscInt i, k, cnt = 1;  in DMDASetBlockFills_Private2()  local
78 if (dd->ofillcols[i]) dd->ofillcols[i] = cnt++; in DMDASetBlockFills_Private2()
824 …y, i, j, slot, gxs, gys, gnx, gny, m, n, dim, s, *cols = NULL, k, nc, *rows = NULL, col, cnt, l, p; in DMCreateMatrix_DA_2d_MPISELL() local
859 cnt = 0; in DMCreateMatrix_DA_2d_MPISELL()
864 cols[cnt++] = k + nc * (slot + gnx * l + p); in DMCreateMatrix_DA_2d_MPISELL()
870 PetscCall(MatPreallocateSetLocal(ltog, nc, rows, ltog, cnt, cols, dnz, onz)); in DMCreateMatrix_DA_2d_MPISELL()
897 cnt = 0; in DMCreateMatrix_DA_2d_MPISELL()
902 cols[cnt++] = k + nc * (slot + gnx * l + p); in DMCreateMatrix_DA_2d_MPISELL()
908 PetscCall(MatSetValuesLocal(J, nc, rows, cnt, cols, values, INSERT_VALUES)); in DMCreateMatrix_DA_2d_MPISELL()
926 …PetscInt m, n, dim, s, *cols = NULL, k, nc, *rows = NULL, col, cnt, l, p, *dnz = NUL… in DMCreateMatrix_DA_3d_MPISELL() local
963 cnt = 0; in DMCreateMatrix_DA_3d_MPISELL()
969 cols[cnt++] = l + nc * (slot + ii + gnx * jj + gnx * gny * kk); in DMCreateMatrix_DA_3d_MPISELL()
976 PetscCall(MatPreallocateSetLocal(ltog, nc, rows, ltog, cnt, cols, dnz, onz)); in DMCreateMatrix_DA_3d_MPISELL()
1005 cnt = 0; in DMCreateMatrix_DA_3d_MPISELL()
1011 cols[cnt++] = l + nc * (slot + ii + gnx * jj + gnx * gny * kk); in DMCreateMatrix_DA_3d_MPISELL()
1018 PetscCall(MatSetValuesLocal(J, nc, rows, cnt, cols, values, INSERT_VALUES)); in DMCreateMatrix_DA_3d_MPISELL()
1036 …j, slot, gxs, gys, gnx, gny, m, n, dim, s, *cols = NULL, k, nc, *rows = NULL, col, cnt, l, p, M, N; in DMCreateMatrix_DA_2d_MPIAIJ() local
1078 cnt = 0; in DMCreateMatrix_DA_2d_MPIAIJ()
1083 cols[cnt++] = k + nc * (slot + gnx * l + p); in DMCreateMatrix_DA_2d_MPIAIJ()
1089 …if (removedups) PetscCall(MatPreallocateSetLocalRemoveDups(ltog, nc, rows, ltog, cnt, cols, dnz, o… in DMCreateMatrix_DA_2d_MPIAIJ()
1090 else PetscCall(MatPreallocateSetLocal(ltog, nc, rows, ltog, cnt, cols, dnz, onz)); in DMCreateMatrix_DA_2d_MPIAIJ()
1116 cnt = 0; in DMCreateMatrix_DA_2d_MPIAIJ()
1120 cols[cnt++] = nc * (slot + gnx * l + p); in DMCreateMatrix_DA_2d_MPIAIJ()
1122 cols[cnt] = 1 + cols[cnt - 1]; in DMCreateMatrix_DA_2d_MPIAIJ()
1123 cnt++; in DMCreateMatrix_DA_2d_MPIAIJ()
1129 PetscCall(MatSetValuesLocal(J, nc, rows, cnt, cols, NULL, INSERT_VALUES)); in DMCreateMatrix_DA_2d_MPIAIJ()
1148 PetscInt m, n, dim, s, *cols, k, nc, row, col, cnt, maxcnt = 0, l, p, M, N; in DMCreateMatrix_DA_2d_MPIAIJ_Fill() local
1192 cnt = 0; in DMCreateMatrix_DA_2d_MPIAIJ_Fill()
1197 …for (ifill_col = ofill[k]; ifill_col < ofill[k + 1]; ifill_col++) cols[cnt++] = ofill[ifill_col] +… in DMCreateMatrix_DA_2d_MPIAIJ_Fill()
1201 …for (ifill_col = dfill[k]; ifill_col < dfill[k + 1]; ifill_col++) cols[cnt++] = dfill[ifill_col] +… in DMCreateMatrix_DA_2d_MPIAIJ_Fill()
1203 …for (ifill_col = 0; ifill_col < nc; ifill_col++) cols[cnt++] = ifill_col + nc * (slot + gnx * l + … in DMCreateMatrix_DA_2d_MPIAIJ_Fill()
1209 maxcnt = PetscMax(maxcnt, cnt); in DMCreateMatrix_DA_2d_MPIAIJ_Fill()
1210 …if (removedups) PetscCall(MatPreallocateSetLocalRemoveDups(ltog, 1, &row, ltog, cnt, cols, dnz, on… in DMCreateMatrix_DA_2d_MPIAIJ_Fill()
1211 else PetscCall(MatPreallocateSetLocal(ltog, 1, &row, ltog, cnt, cols, dnz, onz)); in DMCreateMatrix_DA_2d_MPIAIJ_Fill()
1237 cnt = 0; in DMCreateMatrix_DA_2d_MPIAIJ_Fill()
1242 …for (ifill_col = ofill[k]; ifill_col < ofill[k + 1]; ifill_col++) cols[cnt++] = ofill[ifill_col] +… in DMCreateMatrix_DA_2d_MPIAIJ_Fill()
1246 …for (ifill_col = dfill[k]; ifill_col < dfill[k + 1]; ifill_col++) cols[cnt++] = dfill[ifill_col] +… in DMCreateMatrix_DA_2d_MPIAIJ_Fill()
1248 …for (ifill_col = 0; ifill_col < nc; ifill_col++) cols[cnt++] = ifill_col + nc * (slot + gnx * l + … in DMCreateMatrix_DA_2d_MPIAIJ_Fill()
1254 PetscCall(MatSetValuesLocal(J, 1, &row, cnt, cols, NULL, INSERT_VALUES)); in DMCreateMatrix_DA_2d_MPIAIJ_Fill()
1272 …PetscInt m, n, dim, s, *cols = NULL, k, nc, *rows = NULL, col, cnt, l, p, *dnz = NUL… in DMCreateMatrix_DA_3d_MPIAIJ() local
1319 cnt = 0; in DMCreateMatrix_DA_3d_MPIAIJ()
1325 cols[cnt++] = l + nc * (slot + ii + gnx * jj + gnx * gny * kk); in DMCreateMatrix_DA_3d_MPIAIJ()
1332 …if (removedups) PetscCall(MatPreallocateSetLocalRemoveDups(ltog, nc, rows, ltog, cnt, cols, dnz, o… in DMCreateMatrix_DA_3d_MPIAIJ()
1333 else PetscCall(MatPreallocateSetLocal(ltog, nc, rows, ltog, cnt, cols, dnz, onz)); in DMCreateMatrix_DA_3d_MPIAIJ()
1362 cnt = 0; in DMCreateMatrix_DA_3d_MPIAIJ()
1367 cols[cnt++] = nc * (slot + ii + gnx * jj + gnx * gny * kk); in DMCreateMatrix_DA_3d_MPIAIJ()
1369 cols[cnt] = 1 + cols[cnt - 1]; in DMCreateMatrix_DA_3d_MPIAIJ()
1370 cnt++; in DMCreateMatrix_DA_3d_MPIAIJ()
1378 PetscCall(MatSetValuesLocal(J, nc, rows, cnt, cols, NULL, INSERT_VALUES)); in DMCreateMatrix_DA_3d_MPIAIJ()
1398 PetscInt m, dim, s, *cols = NULL, nc, cnt, maxcnt = 0, *ocols; in DMCreateMatrix_DA_1d_MPIAIJ_Fill() local
1423 cnt = 0; in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1427 ocols[cnt] = ((rank == 0) ? 0 : (s - i) * (ofill[j + 1] - ofill[j])); in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1428 cols[cnt] = dfill[j + 1] - dfill[j] + (s + i) * (ofill[j + 1] - ofill[j]); in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1430 if (size > 1) ocols[cnt] += (s - i) * (ofill[j + 1] - ofill[j]); in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1431 else cols[cnt] += (s - i) * (ofill[j + 1] - ofill[j]); in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1433 maxcnt = PetscMax(maxcnt, ocols[cnt] + cols[cnt]); in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1434 cnt++; in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1439 cols[cnt] = dfill[j + 1] - dfill[j] + 2 * s * (ofill[j + 1] - ofill[j]); in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1440 maxcnt = PetscMax(maxcnt, ocols[cnt] + cols[cnt]); in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1441 cnt++; in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1447 ocols[cnt] = ((rank == (size - 1)) ? 0 : (i - nx + s + 1) * (ofill[j + 1] - ofill[j])); in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1448 cols[cnt] = dfill[j + 1] - dfill[j] + (s + nx - i - 1) * (ofill[j + 1] - ofill[j]); in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1450 if (size > 1) ocols[cnt] += (i - nx + s + 1) * (ofill[j + 1] - ofill[j]); in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1451 else cols[cnt] += (i - nx + s + 1) * (ofill[j + 1] - ofill[j]); in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1453 maxcnt = PetscMax(maxcnt, ocols[cnt] + cols[cnt]); in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1454 cnt++; in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1476 cnt = 0; in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1479 for (k = ofill[j]; k < ofill[j + 1]; k++) cols[cnt++] = (i - s + l) * nc + ofill[k]; in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1484 for (k = ofill[j]; k < ofill[j + 1]; k++) cols[cnt++] = (m + i - s - l) * nc + ofill[k]; in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1488 for (k = dfill[j]; k < dfill[j + 1]; k++) cols[cnt++] = i * nc + dfill[k]; in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1490 for (k = 0; k < nc; k++) cols[cnt++] = i * nc + k; in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1493 for (k = ofill[j]; k < ofill[j + 1]; k++) cols[cnt++] = (i + s - l) * nc + ofill[k]; in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1495 PetscCall(MatSetValues(J, 1, &row, cnt, cols, NULL, INSERT_VALUES)); in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1501 cnt = 0; in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1503 for (k = ofill[j]; k < ofill[j + 1]; k++) cols[cnt++] = (i - s + l) * nc + ofill[k]; in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1506 for (k = dfill[j]; k < dfill[j + 1]; k++) cols[cnt++] = i * nc + dfill[k]; in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1508 for (k = 0; k < nc; k++) cols[cnt++] = i * nc + k; in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1511 for (k = ofill[j]; k < ofill[j + 1]; k++) cols[cnt++] = (i + s - l) * nc + ofill[k]; in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1513 PetscCall(MatSetValues(J, 1, &row, cnt, cols, NULL, INSERT_VALUES)); in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1520 cnt = 0; in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1522 for (k = ofill[j]; k < ofill[j + 1]; k++) cols[cnt++] = (i - s + l) * nc + ofill[k]; in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1525 for (k = dfill[j]; k < dfill[j + 1]; k++) cols[cnt++] = i * nc + dfill[k]; in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1527 for (k = 0; k < nc; k++) cols[cnt++] = i * nc + k; in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1531 for (k = ofill[j]; k < ofill[j + 1]; k++) cols[cnt++] = (i + s - l) * nc + ofill[k]; in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1536 … for (k = ofill[j]; k < ofill[j + 1]; k++) cols[cnt++] = (i - s - l - m + 2) * nc + ofill[k]; in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1539 PetscCall(MatSetValues(J, 1, &row, cnt, cols, NULL, INSERT_VALUES)); in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1557 PetscInt m, dim, s, *cols = NULL, nc, *rows = NULL, col, cnt, l; in DMCreateMatrix_DA_1d_MPIAIJ() local
1594 cnt = 0; in DMCreateMatrix_DA_1d_MPIAIJ()
1596 cols[cnt++] = nc * (slot + i1); in DMCreateMatrix_DA_1d_MPIAIJ()
1598 cols[cnt] = 1 + cols[cnt - 1]; in DMCreateMatrix_DA_1d_MPIAIJ()
1599 cnt++; in DMCreateMatrix_DA_1d_MPIAIJ()
1604 PetscCall(MatSetValuesLocal(J, nc, rows, cnt, cols, NULL, INSERT_VALUES)); in DMCreateMatrix_DA_1d_MPIAIJ()
1621 PetscInt m, dim, s, *cols = NULL, nc, *rows = NULL, col, cnt, l; in DMCreateMatrix_DA_1d_SeqAIJ_NoPreallocation() local
1656 cnt = 0; in DMCreateMatrix_DA_1d_SeqAIJ_NoPreallocation()
1658 cols[cnt++] = nc * (slot + i1); in DMCreateMatrix_DA_1d_SeqAIJ_NoPreallocation()
1660 cols[cnt] = 1 + cols[cnt - 1]; in DMCreateMatrix_DA_1d_SeqAIJ_NoPreallocation()
1661 cnt++; in DMCreateMatrix_DA_1d_SeqAIJ_NoPreallocation()
1666 PetscCall(MatSetValuesLocal(J, nc, rows, cnt, cols, NULL, INSERT_VALUES)); in DMCreateMatrix_DA_1d_SeqAIJ_NoPreallocation()
1684 PetscInt m, n, dim, s, *cols, nc, col, cnt, *dnz, *onz; in DMCreateMatrix_DA_2d_MPIBAIJ() local
1719 cnt = 0; in DMCreateMatrix_DA_2d_MPIBAIJ()
1723 cols[cnt++] = slot + ii + gnx * jj; in DMCreateMatrix_DA_2d_MPIBAIJ()
1727 PetscCall(MatPreallocateSetLocalBlock(ltog, 1, &slot, ltog, cnt, cols, dnz, onz)); in DMCreateMatrix_DA_2d_MPIBAIJ()
1750 cnt = 0; in DMCreateMatrix_DA_2d_MPIBAIJ()
1754 cols[cnt++] = slot + ii + gnx * jj; in DMCreateMatrix_DA_2d_MPIBAIJ()
1758 PetscCall(MatSetValuesBlockedLocal(J, 1, &slot, cnt, cols, values, INSERT_VALUES)); in DMCreateMatrix_DA_2d_MPIBAIJ()
1776 PetscInt m, n, dim, s, *cols, k, nc, col, cnt, p, *dnz, *onz; in DMCreateMatrix_DA_3d_MPIBAIJ() local
1815 cnt = 0; in DMCreateMatrix_DA_3d_MPIBAIJ()
1820 cols[cnt++] = slot + ii + gnx * jj + gnx * gny * kk; in DMCreateMatrix_DA_3d_MPIBAIJ()
1825 PetscCall(MatPreallocateSetLocalBlock(ltog, 1, &slot, ltog, cnt, cols, dnz, onz)); in DMCreateMatrix_DA_3d_MPIBAIJ()
1854 cnt = 0; in DMCreateMatrix_DA_3d_MPIBAIJ()
1859 cols[cnt++] = slot + ii + gnx * jj + gnx * gny * kk; in DMCreateMatrix_DA_3d_MPIBAIJ()
1864 PetscCall(MatSetValuesBlockedLocal(J, 1, &slot, cnt, cols, values, INSERT_VALUES)); in DMCreateMatrix_DA_3d_MPIBAIJ()
1884 …L2GFilterUpperTriangular(ISLocalToGlobalMapping ltog, PetscInt *row, PetscInt *cnt, PetscInt col[]) in L2GFilterUpperTriangular() argument
1890 PetscCall(ISLocalToGlobalMappingApplyBlock(ltog, *cnt, col, col)); in L2GFilterUpperTriangular()
1891 for (i = 0, n = 0; i < *cnt; i++) { in L2GFilterUpperTriangular()
1894 *cnt = n; in L2GFilterUpperTriangular()
1901 PetscInt m, n, dim, s, *cols, nc, col, cnt, *dnz, *onz; in DMCreateMatrix_DA_2d_MPISBAIJ() local
1936 cnt = 0; in DMCreateMatrix_DA_2d_MPISBAIJ()
1939 if (st == DMDA_STENCIL_BOX || !ii || !jj) cols[cnt++] = slot + ii + gnx * jj; in DMCreateMatrix_DA_2d_MPISBAIJ()
1942 PetscCall(L2GFilterUpperTriangular(ltog, &slot, &cnt, cols)); in DMCreateMatrix_DA_2d_MPISBAIJ()
1943 PetscCall(MatPreallocateSymmetricSetBlock(slot, cnt, cols, dnz, onz)); in DMCreateMatrix_DA_2d_MPISBAIJ()
1968 cnt = 0; in DMCreateMatrix_DA_2d_MPISBAIJ()
1971 if (st == DMDA_STENCIL_BOX || !ii || !jj) cols[cnt++] = slot + ii + gnx * jj; in DMCreateMatrix_DA_2d_MPISBAIJ()
1974 PetscCall(L2GFilterUpperTriangular(ltog, &slot, &cnt, cols)); in DMCreateMatrix_DA_2d_MPISBAIJ()
1975 PetscCall(MatSetValuesBlocked(J, 1, &slot, cnt, cols, values, INSERT_VALUES)); in DMCreateMatrix_DA_2d_MPISBAIJ()
1993 PetscInt m, n, dim, s, *cols, k, nc, col, cnt, p, *dnz, *onz; in DMCreateMatrix_DA_3d_MPISBAIJ() local
2033 cnt = 0; in DMCreateMatrix_DA_3d_MPISBAIJ()
2037 …if (st == DMDA_STENCIL_BOX || (!ii && !jj) || (!jj && !kk) || (!ii && !kk)) cols[cnt++] = slot + i… in DMCreateMatrix_DA_3d_MPISBAIJ()
2041 PetscCall(L2GFilterUpperTriangular(ltog, &slot, &cnt, cols)); in DMCreateMatrix_DA_3d_MPISBAIJ()
2042 PetscCall(MatPreallocateSymmetricSetBlock(slot, cnt, cols, dnz, onz)); in DMCreateMatrix_DA_3d_MPISBAIJ()
2071 cnt = 0; in DMCreateMatrix_DA_3d_MPISBAIJ()
2075 … == DMDA_STENCIL_BOX || (!ii && !jj) || (!jj && !kk) || (!ii && !kk)) cols[cnt++] = slot + ii + gn… in DMCreateMatrix_DA_3d_MPISBAIJ()
2079 PetscCall(L2GFilterUpperTriangular(ltog, &slot, &cnt, cols)); in DMCreateMatrix_DA_3d_MPISBAIJ()
2080 PetscCall(MatSetValuesBlocked(J, 1, &slot, cnt, cols, values, INSERT_VALUES)); in DMCreateMatrix_DA_3d_MPISBAIJ()
2099 PetscInt m, n, dim, s, *cols, k, nc, row, col, cnt, maxcnt = 0, l, p, *dnz, *onz; in DMCreateMatrix_DA_3d_MPIAIJ_Fill() local
2150 cnt = 0; in DMCreateMatrix_DA_3d_MPIAIJ_Fill()
2156 …for (ifill_col = ofill[l]; ifill_col < ofill[l + 1]; ifill_col++) cols[cnt++] = ofill[ifill_col] +… in DMCreateMatrix_DA_3d_MPIAIJ_Fill()
2160 …for (ifill_col = dfill[l]; ifill_col < dfill[l + 1]; ifill_col++) cols[cnt++] = dfill[ifill_col] +… in DMCreateMatrix_DA_3d_MPIAIJ_Fill()
2162 …for (ifill_col = 0; ifill_col < nc; ifill_col++) cols[cnt++] = ifill_col + nc * (slot + ii + gnx *… in DMCreateMatrix_DA_3d_MPIAIJ_Fill()
2169 maxcnt = PetscMax(maxcnt, cnt); in DMCreateMatrix_DA_3d_MPIAIJ_Fill()
2170 …if (removedups) PetscCall(MatPreallocateSetLocalRemoveDups(ltog, 1, &row, ltog, cnt, cols, dnz, on… in DMCreateMatrix_DA_3d_MPIAIJ_Fill()
2171 else PetscCall(MatPreallocateSetLocal(ltog, 1, &row, ltog, cnt, cols, dnz, onz)); in DMCreateMatrix_DA_3d_MPIAIJ_Fill()
2201 cnt = 0; in DMCreateMatrix_DA_3d_MPIAIJ_Fill()
2207 …for (ifill_col = ofill[l]; ifill_col < ofill[l + 1]; ifill_col++) cols[cnt++] = ofill[ifill_col] +… in DMCreateMatrix_DA_3d_MPIAIJ_Fill()
2211 …for (ifill_col = dfill[l]; ifill_col < dfill[l + 1]; ifill_col++) cols[cnt++] = dfill[ifill_col] +… in DMCreateMatrix_DA_3d_MPIAIJ_Fill()
2213 …for (ifill_col = 0; ifill_col < nc; ifill_col++) cols[cnt++] = ifill_col + nc * (slot + ii + gnx *… in DMCreateMatrix_DA_3d_MPIAIJ_Fill()
2220 PetscCall(MatSetValuesLocal(J, 1, &row, cnt, cols, values, INSERT_VALUES)); in DMCreateMatrix_DA_3d_MPIAIJ_Fill()