| /petsc/src/mat/tests/ |
| H A D | ex219f.F90 | 7 PetscInt :: n, m, idxm(1), idxn(1), nl1, nl2, zero, one, i 23 idxm(1) = i 25 PetscCallA(MatSetValues(A, one, idxn, one, idxm, v, INSERT_VALUES, ierr)) 34 idxm(1) = n - 1 37 PetscCallA(MatSetValues(A, one, idxn, one, idxm, v, INSERT_VALUES, ierr)) 43 PetscCallA(MatGetValues(A, one, idxn, one, idxm, v, ierr))
|
| H A D | ex209f.F90 | 13 PetscInt idxm(1), i, j 26 idxm(1) = 0 34 …PetscCallA(MatSetValuesBlocked(A, one, idxm, one, idxm, reshape(km, [three*three]), ADD_VALUES, ie…
|
| H A D | ex262f.F90 | 10 PetscInt idxm(1), idxmj(1), i, j 25 idxm(1) = 0 30 idxm(1) = i - 1 + 3*rank 32 … PetscCallA(MatSetValues(B, one, idxm, one, idxmj, reshape(km, [three*three]), ADD_VALUES, ierr))
|
| /petsc/src/mat/impls/localref/ |
| H A D | mlocalref.c | 27 static void BlockIndicesExpand(PetscInt n, const PetscInt idx[], PetscInt bs, PetscInt idxm[]) in BlockIndicesExpand() argument 31 for (j = 0; j < bs; j++) idxm[i * bs + j] = idx[i] * bs + j; in BlockIndicesExpand() 96 PetscInt m, *idxm; in ISL2GCompose() local 114 PetscCall(PetscMalloc1(m, &idxm)); in ISL2GCompose() 115 PetscCall(ISLocalToGlobalMappingApplyBlock(ltog, m, idx, idxm)); in ISL2GCompose() 116 …PetscCall(ISLocalToGlobalMappingCreate(PetscObjectComm((PetscObject)is), bs, m, idxm, PETSC_OWN_PO… in ISL2GCompose() 124 PetscCall(PetscMalloc1(m, &idxm)); in ISL2GCompose() 126 PetscCall(ISLocalToGlobalMappingApply(ltog, m, idx, idxm)); in ISL2GCompose() 128 PetscCall(PetscArraycpy(idxm, idx, m)); in ISL2GCompose() 130 …PetscCall(ISLocalToGlobalMappingCreate(PetscObjectComm((PetscObject)is), bs, m, idxm, PETSC_OWN_PO… in ISL2GCompose() [all …]
|
| /petsc/src/vec/vec/impls/nest/ |
| H A D | vecnest.c | 823 static PetscErrorCode VecNestGetSubVecs_Private(Vec x, PetscInt m, const PetscInt idxm[], Vec vec[]) in VecNestGetSubVecs_Private() argument 832 row = idxm[i]; in VecNestGetSubVecs_Private() 839 static PetscErrorCode VecNestGetSubVec_Nest(Vec X, PetscInt idxm, Vec *sx) in VecNestGetSubVec_Nest() argument 843 PetscCall(VecNestGetSubVecs_Private(X, 1, &idxm, sx)); in VecNestGetSubVec_Nest() 863 PetscErrorCode VecNestGetSubVec(Vec X, PetscInt idxm, Vec *sx) in VecNestGetSubVec() argument 866 PetscUseMethod(X, "VecNestGetSubVec_C", (Vec, PetscInt, Vec *), (X, idxm, sx)); in VecNestGetSubVec() 910 static PetscErrorCode VecNestSetSubVec_Private(Vec X, PetscInt idxm, Vec x) in VecNestSetSubVec_Private() argument 920 …eck(idxm < bx->nb, PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Out of range index value %" PetscIn… in VecNestSetSubVec_Private() 923 PetscCall(VecDestroy(&bx->v[idxm])); in VecNestSetSubVec_Private() 924 bx->v[idxm] = x; in VecNestSetSubVec_Private() [all …]
|
| /petsc/src/ksp/ksp/tests/ |
| H A D | ex54.c | 46 PetscInt idxm[4] = {0, 1, 2, 3}; in fill() local 49 PetscCall(MatSetValues(m, 4, idxm, 3, idxn, values, INSERT_VALUES)); in fill() 55 PetscInt idxm[4] = {4, 5, 6, 7}; in fill() local 58 PetscCall(MatSetValues(m, 4, idxm, 3, idxn, values, INSERT_VALUES)); in fill()
|
| /petsc/src/mat/impls/nest/ |
| H A D | matnest.c | 1060 static PetscErrorCode MatNestGetSubMat_Nest(Mat A, PetscInt idxm, PetscInt jdxm, Mat *mat) in MatNestGetSubMat_Nest() argument 1065 …scCheck(idxm < bA->nr, PetscObjectComm((PetscObject)A), PETSC_ERR_ARG_OUTOFRANGE, "Row too large: … in MatNestGetSubMat_Nest() 1067 *mat = bA->m[idxm][jdxm]; in MatNestGetSubMat_Nest() 1089 PetscErrorCode MatNestGetSubMat(Mat A, PetscInt idxm, PetscInt jdxm, Mat *sub) in MatNestGetSubMat() argument 1093 PetscValidLogicalCollectiveInt(A, idxm, 2); in MatNestGetSubMat() 1096 PetscUseMethod(A, "MatNestGetSubMat_C", (Mat, PetscInt, PetscInt, Mat *), (A, idxm, jdxm, sub)); in MatNestGetSubMat() 1100 static PetscErrorCode MatNestSetSubMat_Nest(Mat A, PetscInt idxm, PetscInt jdxm, Mat mat) in MatNestSetSubMat_Nest() argument 1106 …scCheck(idxm < bA->nr, PetscObjectComm((PetscObject)A), PETSC_ERR_ARG_OUTOFRANGE, "Row too large: … in MatNestSetSubMat_Nest() 1111 PetscCall(ISGetLocalSize(bA->isglobal.row[idxm], &mi)); in MatNestSetSubMat_Nest() 1112 PetscCall(ISGetSize(bA->isglobal.row[idxm], &Mi)); in MatNestSetSubMat_Nest() [all …]
|
| /petsc/src/ksp/ksp/tutorials/ |
| H A D | ex74.c | 141 PetscInt idxm[1] = {0}, idxn[1] = {0}; in main() local 145 PetscCall(MatSetValuesBlocked(A_baij, 1, idxm, 1, idxn, A, INSERT_VALUES)); in main()
|
| /petsc/src/mat/impls/dense/mpi/ |
| H A D | mpidense.c | 133 static PetscErrorCode MatSetValues_MPIDense(Mat mat, PetscInt m, const PetscInt idxm[], PetscInt n,… in MatSetValues_MPIDense() argument 141 if (idxm[i] < 0) continue; in MatSetValues_MPIDense() 142 PetscCheck(idxm[i] < mat->rmap->N, PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Row too large"); in MatSetValues_MPIDense() 143 if (idxm[i] >= rstart && idxm[i] < rend) { in MatSetValues_MPIDense() 144 row = idxm[i] - rstart; in MatSetValues_MPIDense() 157 …PetscCall(MatStashValuesRow_Private(&mat->stash, idxm[i], n, idxn, PetscSafePointerPlusOffset(v, i… in MatSetValues_MPIDense() 159 …PetscCall(MatStashValuesCol_Private(&mat->stash, idxm[i], n, idxn, PetscSafePointerPlusOffset(v, i… in MatSetValues_MPIDense() 166 static PetscErrorCode MatGetValues_MPIDense(Mat mat, PetscInt m, const PetscInt idxm[], PetscInt n,… in MatGetValues_MPIDense() argument 173 if (idxm[i] < 0) continue; /* negative row */ in MatGetValues_MPIDense() 174 PetscCheck(idxm[i] < mat->rmap->N, PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Row too large"); in MatGetValues_MPIDense() [all …]
|
| /petsc/src/mat/impls/sell/mpi/ |
| H A D | mpisell.c | 248 static PetscErrorCode MatGetValues_MPISELL(Mat mat, PetscInt m, const PetscInt idxm[], PetscInt n, … in MatGetValues_MPISELL() argument 256 if (idxm[i] < 0) continue; /* negative row */ in MatGetValues_MPISELL() 257 …PetscCheck(idxm[i] < mat->rmap->N, PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Row too large: row … in MatGetValues_MPISELL() 258 …PetscCheck(idxm[i] >= rstart && idxm[i] < rend, PETSC_COMM_SELF, PETSC_ERR_SUP, "Only local values… in MatGetValues_MPISELL() 259 row = idxm[i] - rstart; in MatGetValues_MPISELL()
|
| /petsc/src/mat/interface/ |
| H A D | matrix.c | 1532 PetscErrorCode MatSetValues(Mat mat, PetscInt m, const PetscInt idxm[], PetscInt n, const PetscInt … in MatSetValues() argument 1538 PetscAssertPointer(idxm, 3); in MatSetValues() 1554 …, (double)PetscRealPart(v[i * n + j]), (double)PetscImaginaryPart(v[i * n + j]), idxm[i], idxn[j]); in MatSetValues() 1556 …%g at matrix entry (%" PetscInt_FMT ",%" PetscInt_FMT ")", (double)v[i * n + j], idxm[i], idxn[j]); in MatSetValues() 1561 …tscCheck(idxm[i] < mat->rmap->N, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Cannot insert in row %" Pe… in MatSetValues() 1570 PetscUseTypeMethod(mat, setvalues, m, idxm, n, idxn, v, addv); in MatSetValues() 1788 PetscErrorCode MatSetValuesStencil(Mat mat, PetscInt m, const MatStencil idxm[], PetscInt n, const … in MatSetValuesStencil() argument 1792 …PetscInt *starts = mat->stencil.starts, *dxm = (PetscInt *)idxm, *dxn = (PetscInt *)idxn, sdim = d… in MatSetValuesStencil() 1798 PetscAssertPointer(idxm, 3); in MatSetValuesStencil() 1903 PetscErrorCode MatSetValuesBlockedStencil(Mat mat, PetscInt m, const MatStencil idxm[], PetscInt n,… in MatSetValuesBlockedStencil() argument [all …]
|
| /petsc/src/ts/impls/implicit/irk/ |
| H A D | irk.c | 132 PetscInt idxm[1] = {0}, idxn[1] = {0}; in TSIRKCreate_Gauss() local 137 PetscCall(MatSetValuesBlocked(A_baij, 1, idxm, 1, idxn, gauss_A, INSERT_VALUES)); in TSIRKCreate_Gauss()
|
| /petsc/src/mat/impls/sbaij/mpi/ |
| H A D | mpisbaij.c | 650 static PetscErrorCode MatGetValues_MPISBAIJ(Mat mat, PetscInt m, const PetscInt idxm[], PetscInt n,… in MatGetValues_MPISBAIJ() argument 658 if (idxm[i] < 0) continue; /* negative row */ in MatGetValues_MPISBAIJ() 659 …PetscCheck(idxm[i] < mat->rmap->N, PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Row too large: row … in MatGetValues_MPISBAIJ() 660 …PetscCheck(idxm[i] >= bsrstart && idxm[i] < bsrend, PETSC_COMM_SELF, PETSC_ERR_SUP, "Only local va… in MatGetValues_MPISBAIJ() 661 row = idxm[i] - bsrstart; in MatGetValues_MPISBAIJ()
|
| /petsc/src/binding/petsc4py/src/petsc4py/PETSc/ |
| H A D | Vec.pyx | 3490 idxm: Sequence[int] | None = None) -> None: 3499 idxm 3507 if idxm is None: idxm = range(len(sx)) 3508 else: assert len(idxm) == len(sx) 3511 idxm = iarray_i(idxm, &N, &cidxm)
|
| H A D | Mat.pyx | 5878 cdef PetscInt idxm = asInt(i) 5880 CHKERR(MatNestGetSubMat(self.mat, idxm, jdxm, &submat.mat))
|
| /petsc/src/mat/impls/baij/mpi/ |
| H A D | mpibaij.c | 652 static PetscErrorCode MatGetValues_MPIBAIJ(Mat mat, PetscInt m, const PetscInt idxm[], PetscInt n, … in MatGetValues_MPIBAIJ() argument 660 if (idxm[i] < 0) continue; /* negative row */ in MatGetValues_MPIBAIJ() 661 …PetscCheck(idxm[i] < mat->rmap->N, PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Row too large: row … in MatGetValues_MPIBAIJ() 662 …PetscCheck(idxm[i] >= bsrstart && idxm[i] < bsrend, PETSC_COMM_SELF, PETSC_ERR_SUP, "Only local va… in MatGetValues_MPIBAIJ() 663 row = idxm[i] - bsrstart; in MatGetValues_MPIBAIJ()
|
| /petsc/src/dm/impls/da/ |
| H A D | da.c | 884 PetscErrorCode DMDAMapMatStencilToGlobal(DM da, PetscInt m, const MatStencil idxm[], PetscInt gidxm… in DMDAMapMatStencilToGlobal() argument 887 const PetscInt *dxm = (const PetscInt *)idxm; in DMDAMapMatStencilToGlobal()
|
| /petsc/doc/manual/ |
| H A D | mat.md | 77 MatSetValues(Mat A,PetscInt m,const PetscInt idxm[],PetscInt n,const PetscInt idxn[],const PetscSca… 83 MatSetValues(Mat A,PetscInt m,const PetscInt idxm[],PetscInt n,const PetscInt idxn[],const PetscSca… 87 `m*n` into the matrix. The integer indices `idxm` and `idxn`, 94 meaning that the value to be put in row `idxm[i]` and column
|
| /petsc/src/mat/impls/hypre/ |
| H A D | mhypre.c | 2104 static PetscErrorCode MatGetValues_HYPRE(Mat A, PetscInt m, const PetscInt idxm[], PetscInt n, cons… argument 2115 if (idxm[i] >= 0) { 2117 …PetscCallHYPRE(HYPRE_IJMatrixGetValues(hA->ij, 1, &hn, (HYPRE_BigInt *)&idxm[i], (HYPRE_BigInt *)i…
|
| /petsc/src/mat/impls/aij/mpi/ |
| H A D | mpiaij.c | 725 static PetscErrorCode MatGetValues_MPIAIJ(Mat mat, PetscInt m, const PetscInt idxm[], PetscInt n, c… in MatGetValues_MPIAIJ() argument 733 if (idxm[i] < 0) continue; /* negative row */ in MatGetValues_MPIAIJ() 734 …PetscCheck(idxm[i] < mat->rmap->N, PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Row too large: row … in MatGetValues_MPIAIJ() 735 …idxm[i] >= rstart && idxm[i] < rend, PETSC_COMM_SELF, PETSC_ERR_SUP, "Only local values currently … in MatGetValues_MPIAIJ() 736 row = idxm[i] - rstart; in MatGetValues_MPIAIJ()
|
| /petsc/src/ksp/pc/impls/patch/ |
| H A D | pcpatch.c | 2176 static PetscErrorCode MatSetValues_PCPatch_Private(Mat mat, PetscInt m, const PetscInt idxm[], Pets… in MatSetValues_PCPatch_Private() argument 2187 cell = idxm[0] / bs; /* use the fact that this is called once per cell */ in MatSetValues_PCPatch_Private() 2189 …PetscCheck(idxm[i] == idxn[i], PetscObjectComm((PetscObject)mat), PETSC_ERR_ARG_WRONG, "Row and co… in MatSetValues_PCPatch_Private()
|
| /petsc/src/mat/impls/is/ |
| H A D | matis.c | 34 static void BlockIndicesExpand(PetscInt n, const PetscInt idx[], PetscInt bs, PetscInt idxm[]) in BlockIndicesExpand() argument 37 for (PetscInt j = 0; j < bs; j++) idxm[i * bs + j] = idx[i] * bs + j; in BlockIndicesExpand()
|