Lines Matching refs:nc
189 PetscInt dim, m, n, p, nc; in DMCreateColoring_DA() local
219 PetscCall(DMDAGetInfo(da, &dim, NULL, NULL, NULL, &m, &n, &p, &nc, NULL, &bx, &by, &bz, NULL)); in DMCreateColoring_DA()
234 dd->xs = dd->xs / nc; in DMCreateColoring_DA()
235 dd->xe = dd->xe / nc; in DMCreateColoring_DA()
236 dd->Xs = dd->Xs / nc; in DMCreateColoring_DA()
237 dd->Xe = dd->Xe / nc; in DMCreateColoring_DA()
250 dd->w = nc; in DMCreateColoring_DA()
251 dd->xs = dd->xs * nc; in DMCreateColoring_DA()
252 dd->xe = dd->xe * nc; in DMCreateColoring_DA()
253 dd->Xs = dd->Xs * nc; in DMCreateColoring_DA()
254 dd->Xe = dd->Xe * nc; in DMCreateColoring_DA()
261 PetscInt xs, ys, nx, ny, i, j, ii, gxs, gys, gnx, gny, m, n, M, N, dim, s, k, nc, col; in DMCreateColoring_DA_2d_MPIAIJ() local
275 PetscCall(DMDAGetInfo(da, &dim, &m, &n, NULL, &M, &N, NULL, &nc, &s, &bx, &by, NULL, &st)); in DMCreateColoring_DA_2d_MPIAIJ()
287 PetscCall(PetscMalloc1(nc * nx * ny, &colors)); in DMCreateColoring_DA_2d_MPIAIJ()
291 …for (k = 0; k < nc; k++) PetscCall(ISColoringValueCast(k + nc * ((i % col) + col * (j % col)), col… in DMCreateColoring_DA_2d_MPIAIJ()
294 ncolors = nc + nc * (col - 1 + col * (col - 1)); in DMCreateColoring_DA_2d_MPIAIJ()
295 …PetscCall(ISColoringCreate(comm, ncolors, nc * nx * ny, colors, PETSC_OWN_POINTER, &dd->localcolor… in DMCreateColoring_DA_2d_MPIAIJ()
300 PetscCall(PetscMalloc1(nc * gnx * gny, &colors)); in DMCreateColoring_DA_2d_MPIAIJ()
304 for (k = 0; k < nc; k++) { in DMCreateColoring_DA_2d_MPIAIJ()
306 …PetscCall(ISColoringValueCast(k + nc * ((SetInRange(i, m) % col) + col * (SetInRange(j, n) % col))… in DMCreateColoring_DA_2d_MPIAIJ()
310 ncolors = nc + nc * (col - 1 + col * (col - 1)); in DMCreateColoring_DA_2d_MPIAIJ()
311 …PetscCall(ISColoringCreate(comm, ncolors, nc * gnx * gny, colors, PETSC_OWN_POINTER, &dd->ghostedc… in DMCreateColoring_DA_2d_MPIAIJ()
325 …PetscInt xs, ys, nx, ny, i, j, gxs, gys, gnx, gny, m, n, p, dim, s, k, nc, col, zs, gzs, i… in DMCreateColoring_DA_3d_MPIAIJ() local
338 PetscCall(DMDAGetInfo(da, &dim, &m, &n, &p, &M, &N, &P, &nc, &s, &bx, &by, &bz, &st)); in DMCreateColoring_DA_3d_MPIAIJ()
351 PetscCall(PetscMalloc1(nc * nx * ny * nz, &colors)); in DMCreateColoring_DA_3d_MPIAIJ()
356 …for (l = 0; l < nc; l++) PetscCall(ISColoringValueCast(l + nc * ((i % col) + col * (j % col) + col… in DMCreateColoring_DA_3d_MPIAIJ()
360 ncolors = nc + nc * (col - 1 + col * (col - 1) + col * col * (col - 1)); in DMCreateColoring_DA_3d_MPIAIJ()
361 …PetscCall(ISColoringCreate(comm, ncolors, nc * nx * ny * nz, colors, PETSC_OWN_POINTER, &dd->local… in DMCreateColoring_DA_3d_MPIAIJ()
366 PetscCall(PetscMalloc1(nc * gnx * gny * gnz, &colors)); in DMCreateColoring_DA_3d_MPIAIJ()
371 for (l = 0; l < nc; l++) { in DMCreateColoring_DA_3d_MPIAIJ()
373 …PetscCall(ISColoringValueCast(l + nc * ((SetInRange(i, m) % col) + col * (SetInRange(j, n) % col) … in DMCreateColoring_DA_3d_MPIAIJ()
378 ncolors = nc + nc * (col - 1 + col * (col - 1) + col * col * (col - 1)); in DMCreateColoring_DA_3d_MPIAIJ()
379 …PetscCall(ISColoringCreate(comm, ncolors, nc * gnx * gny * gnz, colors, PETSC_OWN_POINTER, &dd->gh… in DMCreateColoring_DA_3d_MPIAIJ()
390 PetscInt xs, nx, i, i1, gxs, gnx, l, m, M, dim, s, nc, col; in DMCreateColoring_DA_1d_MPIAIJ() local
402 PetscCall(DMDAGetInfo(da, &dim, &m, NULL, NULL, &M, NULL, NULL, &nc, &s, &bx, NULL, NULL, NULL)); in DMCreateColoring_DA_1d_MPIAIJ()
412 PetscCall(PetscMalloc1(nc * nx, &colors)); in DMCreateColoring_DA_1d_MPIAIJ()
415 for (i = 0; i < nc; i++) tc += (PetscInt)(dd->ofillcols[i] > 0); in DMCreateColoring_DA_1d_MPIAIJ()
418 for (l = 0; l < nc; l++) { in DMCreateColoring_DA_1d_MPIAIJ()
420 … PetscCall(ISColoringValueCast(nc - 1 + tc * ((i % col) - 1) + dd->ofillcols[l], colors + i1++)); in DMCreateColoring_DA_1d_MPIAIJ()
426 ncolors = nc + 2 * s * tc; in DMCreateColoring_DA_1d_MPIAIJ()
430 … for (l = 0; l < nc; l++) PetscCall(ISColoringValueCast(l + nc * (i % col), colors + i1++)); in DMCreateColoring_DA_1d_MPIAIJ()
432 ncolors = nc + nc * (col - 1); in DMCreateColoring_DA_1d_MPIAIJ()
434 …PetscCall(ISColoringCreate(comm, ncolors, nc * nx, colors, PETSC_OWN_POINTER, &dd->localcoloring)); in DMCreateColoring_DA_1d_MPIAIJ()
439 PetscCall(PetscMalloc1(nc * gnx, &colors)); in DMCreateColoring_DA_1d_MPIAIJ()
442 for (l = 0; l < nc; l++) { in DMCreateColoring_DA_1d_MPIAIJ()
444 PetscCall(ISColoringValueCast(l + nc * (SetInRange(i, m) % col), colors + i1++)); in DMCreateColoring_DA_1d_MPIAIJ()
447 ncolors = nc + nc * (col - 1); in DMCreateColoring_DA_1d_MPIAIJ()
448 …PetscCall(ISColoringCreate(comm, ncolors, nc * gnx, colors, PETSC_OWN_POINTER, &dd->ghostedcolorin… in DMCreateColoring_DA_1d_MPIAIJ()
459 PetscInt xs, ys, nx, ny, i, j, ii, gxs, gys, gnx, gny, m, n, dim, s, k, nc; in DMCreateColoring_DA_2d_5pt_MPIAIJ() local
471 PetscCall(DMDAGetInfo(da, &dim, &m, &n, NULL, NULL, NULL, NULL, &nc, &s, &bx, &by, NULL, NULL)); in DMCreateColoring_DA_2d_5pt_MPIAIJ()
478 PetscCall(PetscMalloc1(nc * nx * ny, &colors)); in DMCreateColoring_DA_2d_5pt_MPIAIJ()
482 …for (k = 0; k < nc; k++) PetscCall(ISColoringValueCast(k + nc * ((3 * j + i) % 5), colors + ii++)); in DMCreateColoring_DA_2d_5pt_MPIAIJ()
485 ncolors = 5 * nc; in DMCreateColoring_DA_2d_5pt_MPIAIJ()
486 …PetscCall(ISColoringCreate(comm, ncolors, nc * nx * ny, colors, PETSC_OWN_POINTER, &dd->localcolor… in DMCreateColoring_DA_2d_5pt_MPIAIJ()
491 PetscCall(PetscMalloc1(nc * gnx * gny, &colors)); in DMCreateColoring_DA_2d_5pt_MPIAIJ()
495 …for (k = 0; k < nc; k++) PetscCall(ISColoringValueCast(k + nc * ((3 * SetInRange(j, n) + SetInRang… in DMCreateColoring_DA_2d_5pt_MPIAIJ()
498 ncolors = 5 * nc; in DMCreateColoring_DA_2d_5pt_MPIAIJ()
499 …PetscCall(ISColoringCreate(comm, ncolors, nc * gnx * gny, colors, PETSC_OWN_POINTER, &dd->ghostedc… in DMCreateColoring_DA_2d_5pt_MPIAIJ()
824 …ys, nx, ny, i, j, slot, gxs, gys, gnx, gny, m, n, dim, s, *cols = NULL, k, nc, *rows = NULL, col, … in DMCreateMatrix_DA_2d_MPISELL() local
837 PetscCall(DMDAGetInfo(da, &dim, &m, &n, NULL, NULL, NULL, NULL, &nc, &s, &bx, &by, NULL, &st)); in DMCreateMatrix_DA_2d_MPISELL()
843 PetscCall(PetscMalloc2(nc, &rows, col * col * nc * nc, &cols)); in DMCreateMatrix_DA_2d_MPISELL()
846 PetscCall(MatSetBlockSize(J, nc)); in DMCreateMatrix_DA_2d_MPISELL()
848 MatPreallocateBegin(comm, nc * nx * ny, nc * nx * ny, dnz, onz); in DMCreateMatrix_DA_2d_MPISELL()
860 for (k = 0; k < nc; k++) { in DMCreateMatrix_DA_2d_MPISELL()
864 cols[cnt++] = k + nc * (slot + gnx * l + p); in DMCreateMatrix_DA_2d_MPISELL()
868 rows[k] = k + nc * (slot); in DMCreateMatrix_DA_2d_MPISELL()
870 PetscCall(MatPreallocateSetLocal(ltog, nc, rows, ltog, cnt, cols, dnz, onz)); in DMCreateMatrix_DA_2d_MPISELL()
873 PetscCall(MatSetBlockSize(J, nc)); in DMCreateMatrix_DA_2d_MPISELL()
886 PetscCall(PetscCalloc1(col * col * nc * nc, &values)); in DMCreateMatrix_DA_2d_MPISELL()
898 for (k = 0; k < nc; k++) { in DMCreateMatrix_DA_2d_MPISELL()
902 cols[cnt++] = k + nc * (slot + gnx * l + p); in DMCreateMatrix_DA_2d_MPISELL()
906 rows[k] = k + nc * (slot); 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
939 PetscCall(DMDAGetInfo(da, &dim, &m, &n, &p, &M, &N, &P, &nc, &s, &bx, &by, &bz, &st)); in DMCreateMatrix_DA_3d_MPISELL()
945 PetscCall(PetscMalloc2(nc, &rows, col * col * col * nc * nc, &cols)); in DMCreateMatrix_DA_3d_MPISELL()
948 PetscCall(MatSetBlockSize(J, nc)); in DMCreateMatrix_DA_3d_MPISELL()
950 MatPreallocateBegin(comm, nc * nx * ny * nz, nc * nx * ny * nz, dnz, onz); in DMCreateMatrix_DA_3d_MPISELL()
964 for (l = 0; l < nc; l++) { in DMCreateMatrix_DA_3d_MPISELL()
969 cols[cnt++] = l + nc * (slot + ii + gnx * jj + gnx * gny * kk); in DMCreateMatrix_DA_3d_MPISELL()
974 rows[l] = l + nc * (slot); in DMCreateMatrix_DA_3d_MPISELL()
976 PetscCall(MatPreallocateSetLocal(ltog, nc, rows, ltog, cnt, cols, dnz, onz)); in DMCreateMatrix_DA_3d_MPISELL()
980 PetscCall(MatSetBlockSize(J, nc)); in DMCreateMatrix_DA_3d_MPISELL()
992 PetscCall(PetscCalloc1(col * col * col * nc * nc * nc, &values)); in DMCreateMatrix_DA_3d_MPISELL()
1006 for (l = 0; l < nc; l++) { in DMCreateMatrix_DA_3d_MPISELL()
1011 cols[cnt++] = l + nc * (slot + ii + gnx * jj + gnx * gny * kk); in DMCreateMatrix_DA_3d_MPISELL()
1016 rows[l] = l + nc * (slot); in DMCreateMatrix_DA_3d_MPISELL()
1018 PetscCall(MatSetValuesLocal(J, nc, rows, cnt, cols, values, INSERT_VALUES)); in DMCreateMatrix_DA_3d_MPISELL()
1036 …ys, nx, ny, i, j, slot, gxs, gys, gnx, gny, m, n, dim, s, *cols = NULL, k, nc, *rows = NULL, col, … in DMCreateMatrix_DA_2d_MPIAIJ() local
1049 PetscCall(DMDAGetInfo(da, &dim, &m, &n, NULL, &M, &N, NULL, &nc, &s, &bx, &by, NULL, &st)); in DMCreateMatrix_DA_2d_MPIAIJ()
1062 PetscCall(PetscMalloc2(nc, &rows, col * col * nc * nc, &cols)); in DMCreateMatrix_DA_2d_MPIAIJ()
1065 PetscCall(MatSetBlockSize(J, nc)); in DMCreateMatrix_DA_2d_MPIAIJ()
1067 MatPreallocateBegin(comm, nc * nx * ny, nc * nx * ny, dnz, onz); in DMCreateMatrix_DA_2d_MPIAIJ()
1079 for (k = 0; k < nc; k++) { in DMCreateMatrix_DA_2d_MPIAIJ()
1083 cols[cnt++] = k + nc * (slot + gnx * l + p); in DMCreateMatrix_DA_2d_MPIAIJ()
1087 rows[k] = k + nc * (slot); 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()
1093 PetscCall(MatSetBlockSize(J, nc)); in DMCreateMatrix_DA_2d_MPIAIJ()
1120 cols[cnt++] = nc * (slot + gnx * l + p); in DMCreateMatrix_DA_2d_MPIAIJ()
1121 for (k = 1; k < nc; k++) { in DMCreateMatrix_DA_2d_MPIAIJ()
1128 for (k = 0; k < nc; k++) rows[k] = k + nc * (slot); 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
1163 PetscCall(DMDAGetInfo(da, &dim, &m, &n, NULL, &M, &N, NULL, &nc, &s, &bx, &by, NULL, &st)); in DMCreateMatrix_DA_2d_MPIAIJ_Fill()
1175 PetscCall(PetscMalloc1(col * col * nc, &cols)); in DMCreateMatrix_DA_2d_MPIAIJ_Fill()
1178 PetscCall(MatSetBlockSize(J, nc)); in DMCreateMatrix_DA_2d_MPIAIJ_Fill()
1180 MatPreallocateBegin(comm, nc * nx * ny, nc * nx * ny, dnz, onz); in DMCreateMatrix_DA_2d_MPIAIJ_Fill()
1191 for (k = 0; k < nc; k++) { in DMCreateMatrix_DA_2d_MPIAIJ_Fill()
1197 …]; ifill_col < ofill[k + 1]; ifill_col++) cols[cnt++] = ofill[ifill_col] + nc * (slot + gnx * l + … in DMCreateMatrix_DA_2d_MPIAIJ_Fill()
1201 …]; ifill_col < dfill[k + 1]; ifill_col++) cols[cnt++] = dfill[ifill_col] + nc * (slot + gnx * l + … 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()
1208 row = k + nc * (slot); in DMCreateMatrix_DA_2d_MPIAIJ_Fill()
1236 for (k = 0; k < nc; k++) { in DMCreateMatrix_DA_2d_MPIAIJ_Fill()
1242 …]; ifill_col < ofill[k + 1]; ifill_col++) cols[cnt++] = ofill[ifill_col] + nc * (slot + gnx * l + … in DMCreateMatrix_DA_2d_MPIAIJ_Fill()
1246 …]; ifill_col < dfill[k + 1]; ifill_col++) cols[cnt++] = dfill[ifill_col] + nc * (slot + gnx * l + … 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()
1253 row = k + nc * (slot); 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
1285 PetscCall(DMDAGetInfo(da, &dim, &m, &n, &p, &M, &N, &P, &nc, &s, &bx, &by, &bz, &st)); in DMCreateMatrix_DA_3d_MPIAIJ()
1301 PetscCall(PetscMalloc2(nc, &rows, col * col * col * nc * nc, &cols)); in DMCreateMatrix_DA_3d_MPIAIJ()
1304 PetscCall(MatSetBlockSize(J, nc)); in DMCreateMatrix_DA_3d_MPIAIJ()
1306 MatPreallocateBegin(comm, nc * nx * ny * nz, nc * nx * ny * nz, dnz, onz); in DMCreateMatrix_DA_3d_MPIAIJ()
1320 for (l = 0; l < nc; l++) { in DMCreateMatrix_DA_3d_MPIAIJ()
1325 cols[cnt++] = l + nc * (slot + ii + gnx * jj + gnx * gny * kk); in DMCreateMatrix_DA_3d_MPIAIJ()
1330 rows[l] = l + nc * (slot); 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()
1337 PetscCall(MatSetBlockSize(J, nc)); in DMCreateMatrix_DA_3d_MPIAIJ()
1367 cols[cnt++] = nc * (slot + ii + gnx * jj + gnx * gny * kk); in DMCreateMatrix_DA_3d_MPIAIJ()
1368 for (l = 1; l < nc; l++) { in DMCreateMatrix_DA_3d_MPIAIJ()
1376 rows[0] = nc * (slot); in DMCreateMatrix_DA_3d_MPIAIJ()
1377 for (l = 1; l < nc; l++) rows[l] = 1 + rows[l - 1]; 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
1411 …PetscCall(DMDAGetInfo(da, &dim, &m, NULL, NULL, NULL, NULL, NULL, &nc, &s, &bx, NULL, NULL, NULL)); in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1416 PetscCall(MatSetBlockSize(J, nc)); in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1417 PetscCall(PetscCalloc2(nx * nc, &cols, nx * nc, &ocols)); in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1426 for (j = 0; j < nc; j++) { in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1438 for (j = 0; j < nc; j++) { in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1446 for (j = 0; j < nc; j++) { in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1472 row = xs * nc; in DMCreateMatrix_DA_1d_MPIAIJ_Fill()
1475 for (j = 0; j < nc; j++) { 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()
1500 for (j = 0; j < nc; j++) { 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()
1519 for (j = 0; j < nc; j++) { 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()
1557 PetscInt m, dim, s, *cols = NULL, nc, *rows = NULL, col, cnt, l; in DMCreateMatrix_DA_1d_MPIAIJ() local
1567 …PetscCall(DMDAGetInfo(da, &dim, &m, NULL, NULL, NULL, NULL, NULL, &nc, &s, &bx, NULL, NULL, NULL)); in DMCreateMatrix_DA_1d_MPIAIJ()
1574 PetscCall(MatSetBlockSize(J, nc)); in DMCreateMatrix_DA_1d_MPIAIJ()
1575 PetscCall(MatSeqAIJSetPreallocation(J, col * nc, NULL)); in DMCreateMatrix_DA_1d_MPIAIJ()
1576 PetscCall(MatMPIAIJSetPreallocation(J, col * nc, NULL, col * nc, NULL)); in DMCreateMatrix_DA_1d_MPIAIJ()
1588 PetscCall(PetscMalloc2(nc, &rows, col * nc * nc, &cols)); in DMCreateMatrix_DA_1d_MPIAIJ()
1596 cols[cnt++] = nc * (slot + i1); in DMCreateMatrix_DA_1d_MPIAIJ()
1597 for (l = 1; l < nc; l++) { in DMCreateMatrix_DA_1d_MPIAIJ()
1602 rows[0] = nc * (slot); in DMCreateMatrix_DA_1d_MPIAIJ()
1603 for (l = 1; l < nc; l++) rows[l] = 1 + rows[l - 1]; 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
1631 …PetscCall(DMDAGetInfo(da, &dim, &m, NULL, NULL, NULL, NULL, NULL, &nc, &s, &bx, NULL, NULL, NULL)); in DMCreateMatrix_DA_1d_SeqAIJ_NoPreallocation()
1637 PetscCall(MatSetBlockSize(J, nc)); in DMCreateMatrix_DA_1d_SeqAIJ_NoPreallocation()
1638 PetscCall(MatSeqAIJSetTotalPreallocation(J, nx * nc * col * nc)); in DMCreateMatrix_DA_1d_SeqAIJ_NoPreallocation()
1650 PetscCall(PetscMalloc2(nc, &rows, col * nc * nc, &cols)); in DMCreateMatrix_DA_1d_SeqAIJ_NoPreallocation()
1658 cols[cnt++] = nc * (slot + i1); in DMCreateMatrix_DA_1d_SeqAIJ_NoPreallocation()
1659 for (l = 1; l < nc; l++) { in DMCreateMatrix_DA_1d_SeqAIJ_NoPreallocation()
1664 rows[0] = nc * (slot); in DMCreateMatrix_DA_1d_SeqAIJ_NoPreallocation()
1665 for (l = 1; l < nc; l++) rows[l] = 1 + rows[l - 1]; 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
1697 PetscCall(DMDAGetInfo(da, &dim, &m, &n, NULL, NULL, NULL, NULL, &nc, &s, &bx, &by, NULL, &st)); in DMCreateMatrix_DA_2d_MPIBAIJ()
1704 PetscCall(PetscMalloc1(col * col * nc * nc, &cols)); in DMCreateMatrix_DA_2d_MPIBAIJ()
1730 PetscCall(MatSeqBAIJSetPreallocation(J, nc, 0, dnz)); in DMCreateMatrix_DA_2d_MPIBAIJ()
1731 PetscCall(MatMPIBAIJSetPreallocation(J, nc, 0, dnz, 0, onz)); in DMCreateMatrix_DA_2d_MPIBAIJ()
1742 PetscCall(PetscCalloc1(col * col * nc * nc, &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
1789 PetscCall(DMDAGetInfo(da, &dim, &m, &n, &p, NULL, NULL, NULL, &nc, &s, &bx, &by, &bz, &st)); in DMCreateMatrix_DA_3d_MPIBAIJ()
1829 PetscCall(MatSeqBAIJSetPreallocation(J, nc, 0, dnz)); in DMCreateMatrix_DA_3d_MPIBAIJ()
1830 PetscCall(MatMPIBAIJSetPreallocation(J, nc, 0, dnz, 0, onz)); in DMCreateMatrix_DA_3d_MPIBAIJ()
1841 PetscCall(PetscCalloc1(col * col * col * nc * nc, &values)); in DMCreateMatrix_DA_3d_MPIBAIJ()
1901 PetscInt m, n, dim, s, *cols, nc, col, cnt, *dnz, *onz; in DMCreateMatrix_DA_2d_MPISBAIJ() local
1914 PetscCall(DMDAGetInfo(da, &dim, &m, &n, NULL, NULL, NULL, NULL, &nc, &s, &bx, &by, NULL, &st)); in DMCreateMatrix_DA_2d_MPISBAIJ()
1921 PetscCall(PetscMalloc1(col * col * nc * nc, &cols)); in DMCreateMatrix_DA_2d_MPISBAIJ()
1946 PetscCall(MatSeqSBAIJSetPreallocation(J, nc, 0, dnz)); in DMCreateMatrix_DA_2d_MPISBAIJ()
1947 PetscCall(MatMPISBAIJSetPreallocation(J, nc, 0, dnz, 0, onz)); in DMCreateMatrix_DA_2d_MPISBAIJ()
1958 PetscCall(PetscCalloc1(col * col * nc * nc, &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
2006 PetscCall(DMDAGetInfo(da, &dim, &m, &n, &p, NULL, NULL, NULL, &nc, &s, &bx, &by, &bz, &st)); in DMCreateMatrix_DA_3d_MPISBAIJ()
2046 PetscCall(MatSeqSBAIJSetPreallocation(J, nc, 0, dnz)); in DMCreateMatrix_DA_3d_MPISBAIJ()
2047 PetscCall(MatMPISBAIJSetPreallocation(J, nc, 0, dnz, 0, onz)); in DMCreateMatrix_DA_3d_MPISBAIJ()
2058 PetscCall(PetscCalloc1(col * col * col * nc * nc, &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
2115 PetscCall(DMDAGetInfo(da, &dim, &m, &n, &p, &M, &N, &P, &nc, &s, &bx, &by, &bz, &st)); in DMCreateMatrix_DA_3d_MPIAIJ_Fill()
2130 PetscCall(PetscMalloc1(col * col * col * nc, &cols)); in DMCreateMatrix_DA_3d_MPIAIJ_Fill()
2134 MatPreallocateBegin(comm, nc * nx * ny * nz, nc * nx * ny * nz, dnz, onz); in DMCreateMatrix_DA_3d_MPIAIJ_Fill()
2136 PetscCall(MatSetBlockSize(J, nc)); in DMCreateMatrix_DA_3d_MPIAIJ_Fill()
2149 for (l = 0; l < nc; l++) { in DMCreateMatrix_DA_3d_MPIAIJ_Fill()
2156 …]; ifill_col < ofill[l + 1]; ifill_col++) cols[cnt++] = ofill[ifill_col] + nc * (slot + ii + gnx *… in DMCreateMatrix_DA_3d_MPIAIJ_Fill()
2160 …]; ifill_col < dfill[l + 1]; ifill_col++) cols[cnt++] = dfill[ifill_col] + nc * (slot + ii + gnx *… 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()
2168 row = l + nc * (slot); in DMCreateMatrix_DA_3d_MPIAIJ_Fill()
2200 for (l = 0; l < nc; l++) { in DMCreateMatrix_DA_3d_MPIAIJ_Fill()
2207 …]; ifill_col < ofill[l + 1]; ifill_col++) cols[cnt++] = ofill[ifill_col] + nc * (slot + ii + gnx *… in DMCreateMatrix_DA_3d_MPIAIJ_Fill()
2211 …]; ifill_col < dfill[l + 1]; ifill_col++) cols[cnt++] = dfill[ifill_col] + nc * (slot + ii + gnx *… 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()
2219 row = l + nc * (slot); in DMCreateMatrix_DA_3d_MPIAIJ_Fill()