| /petsc/src/mat/tests/ |
| H A D | ex4.c | 9 IS irow, icol; in main() local 37 PetscCall(ISCreateStride(PETSC_COMM_SELF, m, 0, 1, &irow)); in main() 39 PetscCall(MatCreateSubMatrices(mat, 1, &irow, &icol, MAT_INITIAL_MATRIX, &submatrices)); in main() 40 PetscCall(MatCreateSubMatrices(mat, 1, &irow, &icol, MAT_REUSE_MATRIX, &submatrices)); in main() 50 PetscCall(ISDestroy(&irow)); in main() 60 PetscCall(ISCreateStride(PETSC_COMM_SELF, 3, 2, 1, &irow)); in main() 62 PetscCall(MatCreateSubMatrices(mat, 1, &irow, &icol, MAT_INITIAL_MATRIX, &submatrices)); in main() 66 PetscCall(MatCreateSubMatrices(mat, 1, &irow, &icol, MAT_REUSE_MATRIX, &submatrices)); in main() 80 PetscCall(MatCreateSubMatrices(mat, 1, &irow, &icol, MAT_INITIAL_MATRIX, &submatrices)); in main() 81 PetscCall(MatCreateSubMatrices(mat, 1, &irow, &icol, MAT_REUSE_MATRIX, &submatrices)); in main() [all …]
|
| H A D | ex249.c | 9 IS *irow, *icol; in main() local 40 PetscCall(PetscMalloc2(n, &irow, n, &icol)); in main() 42 PetscCall(ISCreate(PETSC_COMM_SELF, &irow[i])); in main() 44 PetscCall(ISLoad(irow[i], rowfd)); in main() 53 PetscCall(MatCreateSubMatrices(A, n, irow, icol, MAT_INITIAL_MATRIX, &submats)); in main() 60 PetscCall(MatCreateSubMatrices(A, n, irow, icol, MAT_REUSE_MATRIX, &submats)); in main() 70 PetscCall(ISDestroy(&irow[i])); in main() 75 PetscCall(PetscFree2(irow, icol)); in main()
|
| H A D | ex87.c | 13 IS isrow, iscol, irow[n], icol[n]; in main() local 34 irow[0] = irow[1] = isrow; in main() 38 PetscCall(MatCreateSubMatrices(BAIJ, n, irow, icol, MAT_INITIAL_MATRIX, &subBAIJ)); in main() 39 PetscCall(MatCreateSubMatrices(BAIJ, n, irow, icol, MAT_REUSE_MATRIX, &subBAIJ)); in main() 43 PetscCall(MatCreateSubMatrices(SBAIJ, n, irow, icol, MAT_INITIAL_MATRIX, &subSBAIJ)); in main() 44 PetscCall(MatCreateSubMatrices(SBAIJ, n, irow, icol, MAT_REUSE_MATRIX, &subSBAIJ)); in main()
|
| H A D | ex139.c | 27 …m, n, top_bs, row_bs, col_bs, nlocblocks, *idx, nrowblocks, ncolblocks, *ridx, *cidx, *icol, *irow; in main() local 93 PetscCall(PetscMalloc3(row_bs, &irow, col_bs, &icol, row_bs * col_bs, &vals)); in main() 98 irow[k] = i * row_bs + k; in main() 104 PetscCall(MatSetValuesLocal(B, row_bs, irow, col_bs, icol, vals, ADD_VALUES)); in main() 108 PetscCall(PetscFree3(irow, icol, vals)); in main()
|
| H A D | ex22.c | 102 PetscErrorCode MatGetOrdering_myordering(Mat mat, MatOrderingType type, IS *irow, IS *icol) in MatGetOrdering_myordering() argument 116 PetscCall(ISCreateGeneral(PETSC_COMM_SELF, n, ii, PETSC_COPY_VALUES, irow)); in MatGetOrdering_myordering() 118 PetscCall(ISSetPermutation(*irow)); in MatGetOrdering_myordering()
|
| H A D | ex23.c | 19 IS irow[2], icol[2]; in main() local 549 …ll(ISCreateStride(PETSC_COMM_SELF, rrange[lrank + 1] - rrange[lrank], rrange[lrank], 1, &irow[0])); in main() 551 …ll(ISCreateStride(PETSC_COMM_SELF, rrange[rrank + 1] - rrange[rrank], rrange[rrank], 1, &irow[1])); in main() 553 PetscCall(MatCreateSubMatrices(A, 2, irow, icol, MAT_INITIAL_MATRIX, &Asub)); in main() 554 PetscCall(MatCreateSubMatrices(B, 2, irow, icol, MAT_INITIAL_MATRIX, &Bsub)); in main() 557 PetscCall(MatCreateSubMatrices(A, 2, irow, icol, MAT_REUSE_MATRIX, &Asub)); in main() 558 PetscCall(MatCreateSubMatrices(B, 2, irow, icol, MAT_REUSE_MATRIX, &Bsub)); in main() 563 PetscCall(ISDestroy(&irow[0])); in main() 564 PetscCall(ISDestroy(&irow[1])); in main()
|
| /petsc/src/snes/tutorials/ |
| H A D | ex73f90t.F90 | 247 PetscInt irow, row(1), col(5), i, j 268 do irow = low, high - 1 269 j = irow/solver%mx 270 i = mod(irow, solver%mx) 274 col(1) = irow 275 row(1) = irow 290 col(1) = irow - solver%mx 291 col(2) = irow - 1 292 col(3) = irow 293 col(4) = irow + 1 [all …]
|
| /petsc/src/mat/graphops/order/ |
| H A D | sorder.c | 11 PETSC_INTERN PetscErrorCode MatGetOrdering_Natural(Mat mat, MatOrderingType type, IS *irow, IS *ico… in MatGetOrdering_Natural() argument 30 PetscCall(ISCreateGeneral(PETSC_COMM_SELF, n, ii, PETSC_COPY_VALUES, irow)); in MatGetOrdering_Natural() 36 PetscCall(ISCreateStride(comm, end - start, start, 1, irow)); in MatGetOrdering_Natural() 39 PetscCall(ISSetIdentity(*irow)); in MatGetOrdering_Natural() 49 PETSC_INTERN PetscErrorCode MatGetOrdering_RowLength(Mat mat, MatOrderingType type, IS *irow, IS *i… in MatGetOrdering_RowLength() argument 68 PetscCall(ISCreateGeneral(PETSC_COMM_SELF, n, permr, PETSC_COPY_VALUES, irow)); in MatGetOrdering_RowLength()
|
| /petsc/src/mat/impls/aij/seq/bas/ |
| H A D | spbas.c | 382 PetscInt *irow; in spbas_matrix_to_crs() local 391 PetscCall(PetscMalloc1(nrows + 1, &irow)); in spbas_matrix_to_crs() 394 *irow_out = irow; in spbas_matrix_to_crs() 399 *irow_out = irow; in spbas_matrix_to_crs() 402 irow[0] = 0; in spbas_matrix_to_crs() 405 i0 = irow[i]; in spbas_matrix_to_crs() 406 irow[i + 1] = i0 + r_nnz; in spbas_matrix_to_crs() 441 PetscInt *irow; in spbas_transpose() local 461 irow = in_matrix.icols[i]; in spbas_transpose() 463 for (j = 0; j < r_nnz; j++) result->row_nnz[irow[j]]++; in spbas_transpose() [all …]
|
| /petsc/src/dm/impls/da/hypre/ |
| H A D | mhyp.c | 25 static PetscErrorCode MatSetValuesLocal_HYPREStruct_3d(Mat mat, PetscInt nrow, const PetscInt irow[… in MatSetValuesLocal_HYPREStruct_3d() argument 36 stencil = icol[j] - irow[i]; in MatSetValuesLocal_HYPREStruct_3d() 51 …nt_FMT " local column %" PetscInt_FMT " have bad stencil %" PetscInt_FMT, irow[i], icol[j], stenci… in MatSetValuesLocal_HYPREStruct_3d() 53 row = ex->gindices[irow[i]] - ex->rstart; in MatSetValuesLocal_HYPREStruct_3d() 64 static PetscErrorCode MatZeroRowsLocal_HYPREStruct_3d(Mat mat, PetscInt nrow, const PetscInt irow[]… in MatZeroRowsLocal_HYPREStruct_3d() argument 76 row = ex->gindices[irow[i]] - ex->rstart; in MatZeroRowsLocal_HYPREStruct_3d() 339 static PetscErrorCode MatSetValuesLocal_HYPRESStruct_3d(Mat mat, PetscInt nrow, const PetscInt irow… in MatSetValuesLocal_HYPRESStruct_3d() argument 361 grid_rank = irow[i] / nvars; in MatSetValuesLocal_HYPRESStruct_3d() 362 var_type = (irow[i] % nvars); in MatSetValuesLocal_HYPRESStruct_3d() 386 …nt_FMT " local column %" PetscInt_FMT " have bad stencil %" PetscInt_FMT, irow[i], icol[j], stenci… in MatSetValuesLocal_HYPRESStruct_3d() [all …]
|
| /petsc/src/mat/impls/localref/ |
| H A D | mlocalref.c | 35 …SetValuesBlockedLocal_LocalRef_Block(Mat A, PetscInt nrow, const PetscInt irow[], PetscInt ncol, c… in MatSetValuesBlockedLocal_LocalRef_Block() argument 43 PetscCall(ISLocalToGlobalMappingApplyBlock(A->rmap->mapping, nrow, irow, irowm)); in MatSetValuesBlockedLocal_LocalRef_Block() 50 …etValuesBlockedLocal_LocalRef_Scalar(Mat A, PetscInt nrow, const PetscInt irow[], PetscInt ncol, c… in MatSetValuesBlockedLocal_LocalRef_Scalar() argument 58 BlockIndicesExpand(nrow, irow, rbs, irowm); in MatSetValuesBlockedLocal_LocalRef_Scalar() 67 static PetscErrorCode MatSetValuesLocal_LocalRef_Scalar(Mat A, PetscInt nrow, const PetscInt irow[]… in MatSetValuesLocal_LocalRef_Scalar() argument 77 PetscCall(ISLocalToGlobalMappingApply(A->rmap->mapping, nrow, irow, irowm)); in MatSetValuesLocal_LocalRef_Scalar() 79 PetscCall(ISLocalToGlobalMappingApplyBlock(A->rmap->mapping, nrow, irow, irowm)); in MatSetValuesLocal_LocalRef_Scalar()
|
| /petsc/src/mat/impls/dense/mpi/ |
| H A D | mmdense.c | 57 const PetscInt **irow, **icol, *irow_i; in MatCreateSubMatrices_MPIDense_Local() local 87 …PetscCall(PetscMalloc5(ismax, (PetscInt ***)&irow, ismax, (PetscInt ***)&icol, ismax, &nrow, ismax… in MatCreateSubMatrices_MPIDense_Local() 89 PetscCall(ISGetIndices(isrow[i], &irow[i])); in MatCreateSubMatrices_MPIDense_Local() 109 irow_i = irow[i]; in MatCreateSubMatrices_MPIDense_Local() 186 irow_i = irow[i]; in MatCreateSubMatrices_MPIDense_Local() 300 irow_i = irow[i]; in MatCreateSubMatrices_MPIDense_Local() 325 irow_i = irow[i]; in MatCreateSubMatrices_MPIDense_Local() 373 PetscCall(ISRestoreIndices(isrow[i], irow + i)); in MatCreateSubMatrices_MPIDense_Local() 377 PetscCall(PetscFree5(*(PetscInt ***)&irow, *(PetscInt ***)&icol, nrow, ncol, rtable)); in MatCreateSubMatrices_MPIDense_Local()
|
| /petsc/src/mat/impls/adj/mpi/ |
| H A D | mpiadj.c | 133 static PetscErrorCode MatCreateSubMatrices_MPIAdj_Private(Mat mat, PetscInt n, const IS irow[], con… in MatCreateSubMatrices_MPIAdj_Private() argument 147 PetscCall(ISGetLocalSize(irow[i], &irow_n)); in MatCreateSubMatrices_MPIAdj_Private() 157 PetscCall(PetscObjectGetComm((PetscObject)irow[i], &scomm_row)); in MatCreateSubMatrices_MPIAdj_Private() 170 PetscCall(MatCreateSubMatrix_MPIAdj_data(mat, irow[i], icol[i], &sxadj, &sadjncy, &svalues)); in MatCreateSubMatrices_MPIAdj_Private() 171 PetscCall(ISGetLocalSize(irow[i], &irow_n)); in MatCreateSubMatrices_MPIAdj_Private() 173 PetscCall(ISGetIndices(irow[i], &irow_indices)); in MatCreateSubMatrices_MPIAdj_Private() 175 PetscCall(ISRestoreIndices(irow[i], &irow_indices)); in MatCreateSubMatrices_MPIAdj_Private() 209 static PetscErrorCode MatCreateSubMatricesMPI_MPIAdj(Mat mat, PetscInt n, const IS irow[], const IS… in MatCreateSubMatricesMPI_MPIAdj() argument 213 PetscCall(MatCreateSubMatrices_MPIAdj_Private(mat, n, irow, icol, PETSC_TRUE, scall, submat)); in MatCreateSubMatricesMPI_MPIAdj() 217 static PetscErrorCode MatCreateSubMatrices_MPIAdj(Mat mat, PetscInt n, const IS irow[], const IS ic… in MatCreateSubMatrices_MPIAdj() argument [all …]
|
| /petsc/src/mat/impls/baij/mpi/ |
| H A D | baijov.c | 618 const PetscInt **icol, **irow; local 655 …PetscCall(PetscMalloc5(ismax, (PetscInt ***)&irow, ismax, (PetscInt ***)&icol, ismax, &nrow, ismax… 679 irow[i] = NULL; 682 PetscCall(ISGetIndices(isrow[i], &irow[i])); 759 irow_i = irow[i]; 843 irow_i = irow[i]; 1012 irow_i = irow[i]; 1061 irow_i = irow[i]; 1073 irow_i = irow[i]; 1295 irow_i = irow[i]; [all …]
|
| /petsc/src/tao/matrix/ |
| H A D | submatfree.c | 222 PetscErrorCode MatCreateSubMatrices_SMF(Mat A, PetscInt n, IS *irow, IS *icol, MatReuse scall, Mat … in MatCreateSubMatrices_SMF() argument 229 for (i = 0; i < n; i++) PetscCall(MatCreateSubMatrix_SMF(A, irow[i], icol[i], scall, &(*B)[i])); in MatCreateSubMatrices_SMF()
|
| H A D | adamat.c | 233 static PetscErrorCode MatCreateSubMatrices_ADA(Mat A, PetscInt n, IS *irow, IS *icol, MatReuse scal… in MatCreateSubMatrices_ADA() argument 239 for (i = 0; i < n; i++) PetscCall(MatCreateSubMatrix_ADA(A, irow[i], icol[i], scall, &(*B)[i])); in MatCreateSubMatrices_ADA()
|
| /petsc/src/mat/impls/aij/mpi/ |
| H A D | mpiov.c | 1220 const PetscInt *icol, *irow; in MatCreateSubMatrices_MPIAIJ_SingleIS_Local() local 1258 PetscCall(ISGetIndices(isrow[0], &irow)); in MatCreateSubMatrices_MPIAIJ_SingleIS_Local() 1285 row = irow[j]; in MatCreateSubMatrices_MPIAIJ_SingleIS_Local() 1348 *ptr[row2proc[j]] = irow[j]; in MatCreateSubMatrices_MPIAIJ_SingleIS_Local() 1500 row = irow[j]; in MatCreateSubMatrices_MPIAIJ_SingleIS_Local() 1540 row = irow[j]; in MatCreateSubMatrices_MPIAIJ_SingleIS_Local() 1544 PetscCall(PetscHMapISet(rmap, irow[j] + 1, j + 1)); in MatCreateSubMatrices_MPIAIJ_SingleIS_Local() 1549 for (PetscInt j = 0; j < nrow; j++) rmap[irow[j]] = j; in MatCreateSubMatrices_MPIAIJ_SingleIS_Local() 1736 row = irow[j]; in MatCreateSubMatrices_MPIAIJ_SingleIS_Local() 1896 PetscCall(ISRestoreIndices(isrow[0], &irow)); in MatCreateSubMatrices_MPIAIJ_SingleIS_Local() [all …]
|
| /petsc/src/mat/impls/normal/ |
| H A D | normmh.c | 9 static PetscErrorCode MatCreateSubMatrices_NormalHermitian(Mat mat, PetscInt n, const IS irow[], co… in MatCreateSubMatrices_NormalHermitian() argument 18 PetscCheck(irow == icol, PetscObjectComm((PetscObject)mat), PETSC_ERR_SUP, "Not implemented"); in MatCreateSubMatrices_NormalHermitian()
|
| H A D | normm.c | 26 static PetscErrorCode MatCreateSubMatrices_Normal(Mat mat, PetscInt n, const IS irow[], const IS ic… in MatCreateSubMatrices_Normal() argument 35 PetscCheck(irow == icol, PetscObjectComm((PetscObject)mat), PETSC_ERR_SUP, "Not implemented"); in MatCreateSubMatrices_Normal()
|
| /petsc/src/mat/impls/aij/mpi/mumps/ |
| H A D | mumps.c | 1069 PetscCount rstart, nz, i, j, k, m, jj, irow, countA, countB; in MatConvertToTriples_mpisbaij_mpisbaij() local 1110 irow = rstart; in MatConvertToTriples_mpisbaij_mpisbaij() 1124 if (rstart + ajj[j] * bs > irow || k >= m) { in MatConvertToTriples_mpisbaij_mpisbaij() 1126 PetscCall(PetscMUMPSIntCast(irow + m + shift, &row[jj])); in MatConvertToTriples_mpisbaij_mpisbaij() 1140 PetscCall(PetscMUMPSIntCast(irow + m + shift, &row[jj])); in MatConvertToTriples_mpisbaij_mpisbaij() 1151 PetscCall(PetscMUMPSIntCast(irow + shift, &row[jj])); in MatConvertToTriples_mpisbaij_mpisbaij() 1160 PetscCall(PetscMUMPSIntCast(irow + shift, &row[jj])); in MatConvertToTriples_mpisbaij_mpisbaij() 1166 irow += bs; in MatConvertToTriples_mpisbaij_mpisbaij() 1175 PetscCount rstart, cstart, nz, i, j, jj, irow, countA, countB; in MatConvertToTriples_mpiaij_mpiaij() local 1211 irow = rstart; in MatConvertToTriples_mpiaij_mpiaij() [all …]
|
| /petsc/src/mat/impls/cdiagonal/ |
| H A D | cdiagonal.c | 88 static PetscErrorCode MatCreateSubMatrices_ConstantDiagonal(Mat A, PetscInt n, const IS irow[], con… in MatCreateSubMatrices_ConstantDiagonal() argument 94 PetscCall(MatCreateSubMatrices(B, n, irow, icol, scall, submat)); in MatCreateSubMatrices_ConstantDiagonal()
|
| /petsc/src/mat/interface/ |
| H A D | matrix.c | 2214 PetscErrorCode MatGetValuesLocal(Mat mat, PetscInt nrow, const PetscInt irow[], PetscInt ncol, cons… in MatGetValuesLocal() argument 2221 PetscAssertPointer(irow, 3); in MatGetValuesLocal() 2229 if (mat->ops->getvalueslocal) PetscUseTypeMethod(mat, getvalueslocal, nrow, irow, ncol, icol, y); in MatGetValuesLocal() 2242 PetscCall(ISLocalToGlobalMappingApply(mat->rmap->mapping, nrow, irow, irowm)); in MatGetValuesLocal() 2455 PetscErrorCode MatSetValuesLocal(Mat mat, PetscInt nrow, const PetscInt irow[], PetscInt ncol, cons… in MatSetValuesLocal() argument 2462 PetscAssertPointer(irow, 3); in MatSetValuesLocal() 2476 …if (mat->ops->setvalueslocal) PetscUseTypeMethod(mat, setvalueslocal, nrow, irow, ncol, icol, y, a… in MatSetValuesLocal() 2491 …if (mat->rmap->mapping) PetscCall(ISLocalToGlobalMappingApply(mat->rmap->mapping, nrow, irow, bufr… in MatSetValuesLocal() 2492 else irowm = irow; in MatSetValuesLocal() 2494 …if (mat->cmap->mapping != mat->rmap->mapping || ncol != nrow || icol != irow) PetscCall(ISLocalToG… in MatSetValuesLocal() [all …]
|
| /petsc/src/mat/impls/htool/ |
| H A D | htool.cxx | 158 static PetscErrorCode MatCreateSubMatrices_Htool(Mat A, PetscInt n, const IS irow[], const IS icol[… in MatCreateSubMatrices_Htool() argument 173 PetscCall(ISGetLocalSize(irow[i], &nrow)); in MatCreateSubMatrices_Htool() 175 PetscCall(ISGetIndices(irow[i], &idxr)); in MatCreateSubMatrices_Htool() 179 if (irow[i] == icol[i]) { /* same row and column IS? */ in MatCreateSubMatrices_Htool() 182 PetscCall(ISSorted(irow[i], &flg)); in MatCreateSubMatrices_Htool() 251 PetscCall(ISRestoreIndices(irow[i], &idxr)); in MatCreateSubMatrices_Htool()
|
| /petsc/src/mat/impls/sbaij/seq/ |
| H A D | sbaij2.c | 111 const PetscInt *irow, *icol; in MatCreateSubMatrix_SeqSBAIJ_Private() local 119 PetscCall(ISGetIndices(isrow, &irow)); in MatCreateSubMatrix_SeqSBAIJ_Private() 130 kstart = ai[irow[i]]; in MatCreateSubMatrix_SeqSBAIJ_Private() 131 kend = kstart + a->ilen[irow[i]]; in MatCreateSubMatrix_SeqSBAIJ_Private() 169 row = irow[i]; in MatCreateSubMatrix_SeqSBAIJ_Private() 222 PetscCall(ISRestoreIndices(isrow, &irow)); in MatCreateSubMatrix_SeqSBAIJ_Private() 275 PetscErrorCode MatCreateSubMatrices_SeqSBAIJ(Mat A, PetscInt n, const IS irow[], const IS icol[], M… in MatCreateSubMatrices_SeqSBAIJ() argument 282 …for (i = 0; i < n; i++) PetscCall(MatCreateSubMatrix_SeqSBAIJ(A, irow[i], icol[i], scall, &(*B)[i]… in MatCreateSubMatrices_SeqSBAIJ()
|
| /petsc/src/binding/petsc4py/src/petsc4py/PETSc/ |
| H A D | Mat.pyx | 2557 cdef PetscInt irow=0, ncols=0 2559 for irow from 0 <= irow < nrows: 2560 CHKERR(MatGetRow(self.mat, irow+rstart, &ncols, NULL, NULL)) 2561 AI[irow+1] = AI[irow] + ncols 2562 CHKERR(MatRestoreRow(self.mat, irow+rstart, &ncols, NULL, NULL)) 2570 for irow from 0 <= irow < nrows: 2571 CHKERR(MatGetRow(self.mat, irow+rstart, &ncols, &cols, &vals)) 2572 CHKERR(PetscMemcpy(AJ+AI[irow], cols, <size_t>ncols*sizeof(PetscInt))) 2573 CHKERR(PetscMemcpy(AV+AI[irow], vals, <size_t>ncols*sizeof(PetscScalar))) 2574 CHKERR(MatRestoreRow(self.mat, irow+rstart, &ncols, &cols, &vals)) [all …]
|