| /petsc/src/vec/is/is/utils/ |
| H A D | isblock.c | 30 PetscInt tt, gid1, *nidx; in ISCompressIndicesGeneral() local 33 PetscInt *nidx; in ISCompressIndicesGeneral() local 43 PetscCall(PetscMalloc1(Nbs, &nidx)); in ISCompressIndicesGeneral() 77 if (!PetscBTLookupSet(table, ival)) nidx[isz++] = ival; in ISCompressIndicesGeneral() 83 PetscCall(PetscMalloc1(isz, &nidx)); in ISCompressIndicesGeneral() 90 nidx[tt] = gid1 - 1; in ISCompressIndicesGeneral() 95 …PetscCall(ISCreateGeneral(PetscObjectComm((PetscObject)is_in[i]), isz, nidx, PETSC_OWN_POINTER, is… in ISCompressIndicesGeneral() 97 …PetscCall(ISCreateGeneral(PetscObjectComm((PetscObject)is_in[i]), isz, nidx, PETSC_COPY_VALUES, is… in ISCompressIndicesGeneral() 104 PetscCall(PetscFree(nidx)); in ISCompressIndicesGeneral() 128 PetscInt len, i, j, k, *nidx; in ISExpandIndicesGeneral() local [all …]
|
| /petsc/include/petsc/private/ |
| H A D | matimpl.h | 906 static inline PetscErrorCode PetscLLAdd_Private(PetscInt nidx, const PetscInt *PETSC_RESTRICT indic… in PetscLLAdd_Private() argument 910 for (PetscInt k = 0, lnkdata = idx_start; k < nidx; ++k) { in PetscLLAdd_Private() 931 static inline PetscErrorCode PetscLLAdd(PetscInt nidx, const PetscInt *PETSC_RESTRICT indices, Pets… in PetscLLAdd() argument 934 PetscCall(PetscLLAdd_Private(nidx, indices, idx_start, nlnk, lnk, bt, PETSC_FALSE)); in PetscLLAdd() 951 static inline PetscErrorCode PetscLLAddSorted(PetscInt nidx, const PetscInt *PETSC_RESTRICT indices… in PetscLLAddSorted() argument 954 PetscCall(PetscLLAdd_Private(nidx, indices, idx_start, nlnk, lnk, bt, PETSC_TRUE)); in PetscLLAddSorted() 972 static inline PetscErrorCode PetscLLAddPerm(PetscInt nidx, const PetscInt *PETSC_RESTRICT indices, … in PetscLLAddPerm() argument 976 for (PetscInt k = 0, lnkdata = idx_start; k < nidx; ++k) { in PetscLLAddPerm() 986 static inline PetscErrorCode PetscLLAddSorted_new(PetscInt nidx, PetscInt *indices, PetscInt idx_st… 992 for (PetscInt k = 0; k < nidx; ++k) { [all …]
|
| /petsc/src/mat/impls/sbaij/mpi/ |
| H A D | sbaijov.c | 13 …PetscInt i, N = C->cmap->N, bs = C->rmap->bs, M = C->rmap->N, Mbs = M / bs, *nidx, isz, iov; in MatIncreaseOverlap_MPISBAIJ() local 37 PetscCall(PetscMalloc1(Mbs + 1, &nidx)); in MatIncreaseOverlap_MPISBAIJ() 96 nidx[l] = idx[l]; in MatIncreaseOverlap_MPISBAIJ() 104 if (!PetscBTLookupSet(table, brow)) nidx[isz++] = brow; in MatIncreaseOverlap_MPISBAIJ() 111 PetscCall(ISCreateGeneral(PETSC_COMM_SELF, isz, nidx, PETSC_COPY_VALUES, is_new + i)); in MatIncreaseOverlap_MPISBAIJ() 122 PetscCall(PetscFree(nidx)); in MatIncreaseOverlap_MPISBAIJ() 465 …creaseOverlap_MPISBAIJ_Local(Mat C, PetscInt *data, PetscInt whose, PetscInt *nidx, PetscBT *table) in MatIncreaseOverlap_MPISBAIJ_Local() argument 488 nidx[0] = is_max; in MatIncreaseOverlap_MPISBAIJ_Local() 490 nidx_i = nidx + is_max + 1; /* ptr to output is[0] array */ in MatIncreaseOverlap_MPISBAIJ_Local() 498 nidx_i = nidx + 1 + is_max + Mbs * i; in MatIncreaseOverlap_MPISBAIJ_Local() [all …]
|
| /petsc/src/ksp/pc/impls/gasm/ |
| H A D | gasm.c | 56 PetscInt j, nidx; in PCGASMSubdomainView_Private() local 75 PetscCall(ISGetLocalSize(osm->iis[i], &nidx)); in PCGASMSubdomainView_Private() 76 PetscCall(PetscMalloc1(16 * (nidx + 1) + 1, &cidx)); in PCGASMSubdomainView_Private() 77 PetscCall(PetscViewerStringOpen(PETSC_COMM_SELF, cidx, 16 * (nidx + 1) + 1, &sviewer)); in PCGASMSubdomainView_Private() 79 …for (j = 0; j < nidx; ++j) PetscCall(PetscViewerStringSPrintf(sviewer, "%" PetscInt_FMT " ", idx[j… in PCGASMSubdomainView_Private() 101 PetscCall(ISGetLocalSize(osm->ois[i], &nidx)); in PCGASMSubdomainView_Private() 102 PetscCall(PetscMalloc1(16 * (nidx + 1) + 1, &cidx)); in PCGASMSubdomainView_Private() 103 PetscCall(PetscViewerStringOpen(PETSC_COMM_SELF, cidx, 16 * (nidx + 1) + 1, &sviewer)); in PCGASMSubdomainView_Private() 105 …for (j = 0; j < nidx; ++j) PetscCall(PetscViewerStringSPrintf(sviewer, "%" PetscInt_FMT " ", idx[j… in PCGASMSubdomainView_Private() 1418 PetscInt *count, nidx, *indices, *newidx, start = 0; in PCGASMCreateLocalSubdomains() local [all …]
|
| /petsc/src/binding/petsc4py/src/petsc4py/PETSc/ |
| H A D | AO.pyx | 239 cdef PetscInt nidx = 0, *idx = NULL 244 indices = oarray_i(indices, &nidx, &idx) 245 CHKERR(AOApplicationToPetsc(self.ao, nidx, idx)) 273 cdef PetscInt nidx = 0, *idx = NULL 278 indices = oarray_i(indices, &nidx, &idx) 279 CHKERR(AOPetscToApplication(self.ao, nidx, idx))
|
| H A D | IS.pyx | 163 cdef PetscInt nidx = 0, *idx = NULL 166 indices = iarray_i(indices, &nidx, &idx) 167 CHKERR(ISCreateGeneral(ccomm, nidx, idx, cm, &newiset)) 196 cdef PetscInt nidx = 0, *idx = NULL 199 indices = iarray_i(indices, &nidx, &idx) 200 CHKERR(ISCreateBlock(ccomm, bs, nidx, idx, cm, &newiset)) 833 cdef PetscInt nidx = 0, *idx = NULL 835 indices = iarray_i(indices, &nidx, &idx) 836 CHKERR(ISGeneralSetIndices(self.iset, nidx, idx, cm)) 877 cdef PetscInt nidx = 0, *idx = NULL [all …]
|
| /petsc/src/ksp/pc/impls/asm/ |
| H A D | asm.c | 86 PetscInt i, j, nidx; in PCASMPrintSubdomains() local 99 PetscCall(ISGetLocalSize(osm->is[i], &nidx)); in PCASMPrintSubdomains() 102 #define len 16 * (nidx + 1) + 512 in PCASMPrintSubdomains() 107 …for (j = 0; j < nidx; j++) PetscCall(PetscViewerStringSPrintf(sviewer, "%" PetscInt_FMT " ", idx[j… in PCASMPrintSubdomains() 118 #define len 16 * (nidx + 1) + 512 in PCASMPrintSubdomains() 123 PetscCall(ISGetLocalSize(osm->is_local[i], &nidx)); in PCASMPrintSubdomains() 125 …for (j = 0; j < nidx; j++) PetscCall(PetscViewerStringSPrintf(sviewer, "%" PetscInt_FMT " ", idx[j… in PCASMPrintSubdomains() 1465 PetscInt *count, nidx, *indices, *newidx, start = 0; in PCASMCreateSubdomains() local 1473 PetscCall(ISGetLocalSize(isnumb, &nidx)); in PCASMCreateSubdomains() 1474 PetscCall(PetscMalloc1(nidx, &indices)); in PCASMCreateSubdomains() [all …]
|
| /petsc/src/dm/impls/stag/ |
| H A D | stagstencil.c | 36 PetscInt n_stencil_unique, dim, count, nidx, nc_max; in DMStagCreateISFromStencils() local 87 nidx = n_stencil_unique; in DMStagCreateISFromStencils() 88 …for (PetscInt d = 0; d < dim; ++d) nidx *= (n[d] + 1); /* Overestimate (always assumes extraPoint)… in DMStagCreateISFromStencils() 89 PetscCall(PetscMalloc1(nidx, &idx)); in DMStagCreateISFromStencils()
|
| /petsc/src/mat/impls/aij/mpi/ |
| H A D | mpiov.c | 36 PetscInt *nidx = NULL; in ISAdjustForBlockSize() local 50 PetscCall(PetscMalloc1(n, &nidx)); in ISAdjustForBlockSize() 54 if (!PetscBTLookupSet(bt, idx[j] / bs - Nmin)) nidx[n++] = idx[j] / bs; in ISAdjustForBlockSize() 61 PetscCall(ISCreateBlock(comm, bs, n, nidx, PETSC_OWN_POINTER, is + i)); in ISAdjustForBlockSize() 88 static PetscErrorCode MatIncreaseOverlap_MPIAIJ_Once_Scalable(Mat mat, PetscInt nidx, IS is[]) in MatIncreaseOverlap_MPIAIJ_Once_Scalable() argument 109 PetscCall(PetscMalloc2(nidx, (PetscInt ***)&indices, nidx, &length)); in MatIncreaseOverlap_MPIAIJ_Once_Scalable() 111 for (PetscInt i = 0; i < nidx; i++) { in MatIncreaseOverlap_MPIAIJ_Once_Scalable() 120 for (PetscInt i = 0; i < nidx; i++) { in MatIncreaseOverlap_MPIAIJ_Once_Scalable() 148 PetscCall(MatIncreaseOverlap_MPIAIJ_Local_Scalable(mat, nidx, is)); in MatIncreaseOverlap_MPIAIJ_Once_Scalable() 198 …PetscCall(MatIncreaseOverlap_MPIAIJ_Send_Scalable(mat, nidx, nfrom, fromranks, fromsizes, fromdata… in MatIncreaseOverlap_MPIAIJ_Once_Scalable() [all …]
|
| H A D | mpiaij.c | 7680 PetscInt cnt = -1, nidx, j; in MatCollapseRow() local 7684 PetscCall(MatGetRow(Amat, row, &nidx, &idx, NULL)); in MatCollapseRow() 7685 if (nidx) { in MatCollapseRow() 7688 for (j = 1; j < nidx; j++) { in MatCollapseRow() 7692 PetscCall(MatRestoreRow(Amat, row, &nidx, &idx, NULL)); in MatCollapseRow()
|
| /petsc/src/vec/is/is/impls/general/ |
| H A D | general.c | 768 PetscInt i, nidx; in ISGeneralSetIndicesFromMask_General() local 772 for (i = 0, nidx = 0; i < rend - rstart; i++) in ISGeneralSetIndicesFromMask_General() 773 if (mask[i]) nidx++; in ISGeneralSetIndicesFromMask_General() 774 PetscCall(PetscMalloc1(nidx, &idx)); in ISGeneralSetIndicesFromMask_General() 775 for (i = 0, nidx = 0; i < rend - rstart; i++) { in ISGeneralSetIndicesFromMask_General() 777 idx[nidx] = i + rstart; in ISGeneralSetIndicesFromMask_General() 778 nidx++; in ISGeneralSetIndicesFromMask_General() 781 PetscCall(ISGeneralSetIndices_General(is, nidx, idx, PETSC_OWN_POINTER)); in ISGeneralSetIndicesFromMask_General()
|
| /petsc/src/vec/vec/utils/ |
| H A D | vinv.c | 942 PetscErrorCode VecStrideSubSetGather(Vec v, PetscInt nidx, const PetscInt idxv[], const PetscInt id… in VecStrideSubSetGather() argument 947 if (nidx == PETSC_DETERMINE) nidx = s->map->bs; in VecStrideSubSetGather() 948 PetscUseTypeMethod(v, stridesubsetgather, nidx, idxv, idxs, s, addv); in VecStrideSubSetGather() 980 PetscErrorCode VecStrideSubSetScatter(Vec s, PetscInt nidx, const PetscInt idxs[], const PetscInt i… in VecStrideSubSetScatter() argument 985 if (nidx == PETSC_DETERMINE) nidx = s->map->bs; in VecStrideSubSetScatter() 986 PetscCall((*v->ops->stridesubsetscatter)(s, nidx, idxs, idxv, v, addv)); in VecStrideSubSetScatter() 1054 PetscErrorCode VecStrideSubSetGather_Default(Vec v, PetscInt nidx, const PetscInt idxv[], const Pet… in VecStrideSubSetGather_Default() argument 1072 for (j = 0; j < nidx; j++) { in VecStrideSubSetGather_Default() 1076 …PetscCheck(idxs || bss == nidx, PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Must provide idxs when… in VecStrideSubSetGather_Default() 1118 PetscErrorCode VecStrideSubSetScatter_Default(Vec s, PetscInt nidx, const PetscInt idxs[], const Pe… in VecStrideSubSetScatter_Default() argument [all …]
|
| /petsc/src/ksp/pc/impls/telescope/ |
| H A D | telescope_dmda.c | 127 PetscInt i, j, si, sj, ni, nj, M, N, Ml, Nl, c, nidx; in PCTelescopeSetUp_dmda_repart_coors2d() local 160 nidx = (i) + (j)*M; in PCTelescopeSetUp_dmda_repart_coors2d() 161 fine_indices[c] = 2 * nidx; in PCTelescopeSetUp_dmda_repart_coors2d() 162 fine_indices[c + 1] = 2 * nidx + 1; in PCTelescopeSetUp_dmda_repart_coors2d() 218 PetscInt i, j, k, si, sj, sk, ni, nj, nk, M, N, P, Ml, Nl, Pl, c, nidx; in PCTelescopeSetUp_dmda_repart_coors3d() local 256 nidx = (i) + (j)*M + (k)*M * N; in PCTelescopeSetUp_dmda_repart_coors3d() 257 fine_indices[c] = 3 * nidx; in PCTelescopeSetUp_dmda_repart_coors3d() 258 fine_indices[c + 1] = 3 * nidx + 1; in PCTelescopeSetUp_dmda_repart_coors3d() 259 fine_indices[c + 2] = 3 * nidx + 2; in PCTelescopeSetUp_dmda_repart_coors3d()
|
| /petsc/src/dm/impls/network/ |
| H A D | network.c | 2986 …, PetscInt numkeys, PetscInt keys[], PetscInt blocksize[], PetscInt nselectedvar[], PetscInt *nidx) in DMISAddSize_private() argument 3002 *nidx += nvar; in DMISAddSize_private() 3004 *nidx += nselectedvar[j] * nvar / blocksize[j]; in DMISAddSize_private() 3069 PetscInt i, p, estart, eend, vstart, vend, nidx, *idx; in DMNetworkCreateIS() local 3085 nidx = 0; in DMNetworkCreateIS() 3086 …nd; p++) PetscCall(DMISAddSize_private(network, p, numkeys, keys, blocksize, nselectedvar, &nidx)); in DMNetworkCreateIS() 3090 PetscCall(DMISAddSize_private(network, p, numkeys, keys, blocksize, nselectedvar, &nidx)); in DMNetworkCreateIS() 3094 PetscCall(PetscMalloc1(nidx, &idx)); in DMNetworkCreateIS() 3104 PetscCall(ISCreateGeneral(comm, nidx, idx, PETSC_COPY_VALUES, is)); in DMNetworkCreateIS() 3165 PetscInt i, p, pstart, pend, nidx, *idx; in DMNetworkCreateLocalIS() local [all …]
|
| /petsc/src/mat/impls/sbaij/seq/ |
| H A D | sbaij2.c | 11 PetscInt brow, i, j, k, l, mbs, n, *nidx, isz, bcol, bcol_max, start, end, *ai, *aj, bs; in MatIncreaseOverlap_SeqSBAIJ() local 22 PetscCall(PetscMalloc1(mbs + 1, &nidx)); in MatIncreaseOverlap_SeqSBAIJ() 39 nidx[isz++] = brow; in MatIncreaseOverlap_SeqSBAIJ() 50 for (l = k; l < isz; l++) PetscCall(PetscBTSet(table_in, nidx[l])); in MatIncreaseOverlap_SeqSBAIJ() 60 nidx[isz++] = bcol; in MatIncreaseOverlap_SeqSBAIJ() 71 if (!PetscBTLookupSet(table_out, brow)) nidx[isz++] = brow; in MatIncreaseOverlap_SeqSBAIJ() 78 PetscCall(ISCreateBlock(PETSC_COMM_SELF, bs, isz, nidx, PETSC_COPY_VALUES, is + i)); in MatIncreaseOverlap_SeqSBAIJ() 81 PetscCall(PetscFree(nidx)); in MatIncreaseOverlap_SeqSBAIJ()
|
| /petsc/src/mat/impls/aij/seq/ |
| H A D | aij.c | 2737 PetscInt row, i, j, k, l, ll, m, n, *nidx, isz, val; in MatIncreaseOverlap_SeqAIJ() local 2749 PetscCall(PetscMalloc1(m + 1, &nidx)); in MatIncreaseOverlap_SeqAIJ() 2764 if (!PetscBTLookupSet(table, idx[j] / bs)) nidx[isz++] = idx[j] / bs; in MatIncreaseOverlap_SeqAIJ() 2774 row = bs * nidx[k] + ll; in MatIncreaseOverlap_SeqAIJ() 2779 if (!PetscBTLookupSet(table, val)) nidx[isz++] = val; in MatIncreaseOverlap_SeqAIJ() 2784 PetscCall(ISCreateBlock(PETSC_COMM_SELF, bs, isz, nidx, PETSC_COPY_VALUES, is + i)); in MatIncreaseOverlap_SeqAIJ() 2788 if (!PetscBTLookupSet(table, idx[j])) nidx[isz++] = idx[j]; in MatIncreaseOverlap_SeqAIJ() 2797 row = nidx[k]; in MatIncreaseOverlap_SeqAIJ() 2802 if (!PetscBTLookupSet(table, val)) nidx[isz++] = val; in MatIncreaseOverlap_SeqAIJ() 2806 PetscCall(ISCreateGeneral(PETSC_COMM_SELF, isz, nidx, PETSC_COPY_VALUES, is + i)); in MatIncreaseOverlap_SeqAIJ() [all …]
|
| /petsc/src/mat/impls/baij/seq/ |
| H A D | baij2.c | 16 PetscInt row, i, j, k, l, m, n, *nidx, isz, val, ival; in MatIncreaseOverlap_SeqBAIJ() local 30 PetscCall(PetscMalloc1(m + 1, &nidx)); in MatIncreaseOverlap_SeqBAIJ() 45 if (!PetscBTLookupSet(table, ival)) nidx[isz++] = ival; in MatIncreaseOverlap_SeqBAIJ() 54 row = nidx[k]; in MatIncreaseOverlap_SeqBAIJ() 59 if (!PetscBTLookupSet(table, val)) nidx[isz++] = val; in MatIncreaseOverlap_SeqBAIJ() 63 PetscCall(ISCreateBlock(PETSC_COMM_SELF, bs, isz, nidx, PETSC_COPY_VALUES, is + i)); in MatIncreaseOverlap_SeqBAIJ() 66 PetscCall(PetscFree(nidx)); in MatIncreaseOverlap_SeqBAIJ()
|