Home
last modified time | relevance | path

Searched refs:idxs (Results 1 – 25 of 30) sorted by relevance

12

/petsc/src/vec/vec/tests/
H A Dex38.c10 PetscInt i, rstart, rend, idxs[3]; in main() local
41 idxs[0] = (size - rank - 1) * 10 + 5; in main()
42 idxs[1] = (size - rank - 1) * 10 + 2; in main()
43 idxs[2] = (size - rank - 1) * 10 + 3; in main()
47 PetscCall(ISCreateGeneral(comm, 3, idxs, PETSC_USE_POINTER, &is2)); in main()
/petsc/src/mat/utils/
H A Disltog.c6 const PetscInt *idxs; in MatCreateFromISLocalToGlobalMapping() local
19 PetscCall(ISLocalToGlobalMappingGetIndices(lgmap, &idxs)); in MatCreateFromISLocalToGlobalMapping()
23 if (idxs[i] >= 0) pidxs[c++] = idxs[i]; in MatCreateFromISLocalToGlobalMapping()
24 PetscCall(ISLocalToGlobalMappingRestoreIndices(lgmap, &idxs)); in MatCreateFromISLocalToGlobalMapping()
/petsc/src/ksp/pc/impls/bddc/
H A Dbddcnullspace.c109 const PetscInt *idxs; in PCBDDCNullSpaceAssembleCorrection() local
113 PetscCall(ISGetIndices(zerorows, &idxs)); in PCBDDCNullSpaceAssembleCorrection()
114 …for (i = 0; i < nz; i++) PetscCall(MatSetValue(shell_ctx->inv_smat, idxs[i], idxs[i], 1.0, INSERT_… in PCBDDCNullSpaceAssembleCorrection()
115 PetscCall(ISRestoreIndices(zerorows, &idxs)); in PCBDDCNullSpaceAssembleCorrection()
122 const PetscInt *idxs; in PCBDDCNullSpaceAssembleCorrection() local
126 PetscCall(ISGetIndices(zerorows, &idxs)); in PCBDDCNullSpaceAssembleCorrection()
127 …for (i = 0; i < nz; i++) PetscCall(MatSetValue(shell_ctx->inv_smat, idxs[i], idxs[i], 0.0, INSERT_… in PCBDDCNullSpaceAssembleCorrection()
128 PetscCall(ISRestoreIndices(zerorows, &idxs)); in PCBDDCNullSpaceAssembleCorrection()
H A Dbddcprivate.c166 const PetscInt *idxs, *ii, *jj, *iit, *jjt; in PCBDDCNedelecSupport() local
257 PetscCall(ISGetIndices(nedfieldlocal, &idxs)); in PCBDDCNedelecSupport()
259 if (PetscRealPart(vals[idxs[i]]) > 2.) eidxs[cum++] = idxs[i]; in PCBDDCNedelecSupport()
261 PetscCall(ISRestoreIndices(nedfieldlocal, &idxs)); in PCBDDCNedelecSupport()
309 PetscCall(ISGetIndices(nedfieldlocal, &idxs)); in PCBDDCNedelecSupport()
310 for (i = 0; i < ne; i++) matis->sf_leafdata[idxs[i]] = 1; in PCBDDCNedelecSupport()
311 PetscCall(ISRestoreIndices(nedfieldlocal, &idxs)); in PCBDDCNedelecSupport()
341 PetscCall(ISGetIndices(nedfieldlocal, &idxs)); in PCBDDCNedelecSupport()
343 if (matis->sf_leafdata[idxs[i]] == 1) tbz[cum++] = i; in PCBDDCNedelecSupport()
344 PetscCall(ISRestoreIndices(nedfieldlocal, &idxs)); in PCBDDCNedelecSupport()
[all …]
H A Dbddcschurs.c586 const PetscInt *idxs; in PCBDDCSubSchursSetUp() local
587 PetscCall(ISGetIndices(is_I_layer, &idxs)); in PCBDDCSubSchursSetUp()
588 PetscCall(PetscArraycpy(all_local_idx_N, idxs, extra)); in PCBDDCSubSchursSetUp()
590 for (PetscInt j = 0; j < extra; j++) all_local_subid_N[j] = local_subs[idxs[j]]; in PCBDDCSubSchursSetUp()
591 PetscCall(ISRestoreIndices(is_I_layer, &idxs)); in PCBDDCSubSchursSetUp()
600 const PetscInt *idxs; in PCBDDCSubSchursSetUp() local
603 PetscCall(ISGetIndices(sub_schurs->is_subs[i], &idxs)); in PCBDDCSubSchursSetUp()
605 auxnum1[i] = idxs[0]; in PCBDDCSubSchursSetUp()
608 PetscCall(PetscArraycpy(all_local_idx_N + local_size + extra, idxs, subset_size)); in PCBDDCSubSchursSetUp()
610 …scInt j = 0; j < subset_size; j++) all_local_subid_N[j + local_size + extra] = local_subs[idxs[j]]; in PCBDDCSubSchursSetUp()
[all …]
H A Dbddcscalingbasic.c417 const PetscInt *idxs; in PCBDDCScalingSetUp_Deluxe() local
419 PetscCall(ISGetIndices(sub_schurs->is_vertices, &idxs)); in PCBDDCScalingSetUp_Deluxe()
420 …PetscCall(ISGlobalToLocalMappingApply(pcis->BtoNmap, IS_GTOLM_DROP, n_com, idxs, &nmap, deluxe_ctx… in PCBDDCScalingSetUp_Deluxe()
422 PetscCall(ISRestoreIndices(sub_schurs->is_vertices, &idxs)); in PCBDDCScalingSetUp_Deluxe()
426 const PetscInt *idxs; in PCBDDCScalingSetUp_Deluxe() local
428 PetscCall(ISGetIndices(sub_schurs->is_dir, &idxs)); in PCBDDCScalingSetUp_Deluxe()
429 …PetscCall(ISGlobalToLocalMappingApply(pcis->BtoNmap, IS_GTOLM_DROP, n_dir, idxs, &nmap, deluxe_ctx… in PCBDDCScalingSetUp_Deluxe()
431 PetscCall(ISRestoreIndices(sub_schurs->is_dir, &idxs)); in PCBDDCScalingSetUp_Deluxe()
451 const PetscInt *idxs; in PCBDDCScalingSetUp_Deluxe_Private() local
478 PetscCall(ISGetIndices(sub_schurs->is_Ej_all, &idxs)); in PCBDDCScalingSetUp_Deluxe_Private()
[all …]
H A Dbddcgraph.c793 const PetscInt *idxs, *indegree; in PCBDDCGraphSetUp() local
801 PetscCall(ISLocalToGlobalMappingGetIndices(graph->l2gmap, &idxs)); in PCBDDCGraphSetUp()
802 PetscCall(ISCreateGeneral(PETSC_COMM_SELF, nvtxs, idxs, PETSC_USE_POINTER, &is)); in PCBDDCGraphSetUp()
806 PetscCall(ISLocalToGlobalMappingRestoreIndices(graph->l2gmap, &idxs)); in PCBDDCGraphSetUp()
807 PetscCall(ISGetIndices(lis, &idxs)); in PCBDDCGraphSetUp()
811 PetscCall(PetscSFSetGraphLayout(sf, layout, nvtxs, NULL, PETSC_OWN_POINTER, idxs)); in PCBDDCGraphSetUp()
823 PetscInt gid = idxs[i]; in PCBDDCGraphSetUp()
829 …PetscCheck(c == indegree[idxs[i]], PETSC_COMM_SELF, PETSC_ERR_PLIB, "%" PetscInt_FMT " != %" Petsc… in PCBDDCGraphSetUp()
836 PetscCall(ISRestoreIndices(lis, &idxs)); in PCBDDCGraphSetUp()
1039 const PetscInt *idxs; in PCBDDCGraphSetUp() local
[all …]
H A Dbddcfetidp.c496 const PetscInt *idxs = NULL; in PCBDDCSetupFETIDPMatContext() local
504 PetscCall(ISGetIndices(sub_schurs->is_Ej_all, &idxs)); in PCBDDCSetupFETIDPMatContext()
509 for (j = 0; j < subset_size; j++) nnz[idxs[j + cum]] = subset_size; in PCBDDCSetupFETIDPMatContext()
551 PetscCheck(idxs, PETSC_COMM_SELF, PETSC_ERR_PLIB, "IDXS not present"); in PCBDDCSetupFETIDPMatContext()
552 … PetscCall(MatSetValues(T, subset_size, idxs + cum, subset_size, idxs + cum, W, INSERT_VALUES)); in PCBDDCSetupFETIDPMatContext()
561 if (sub_schurs->is_Ej_all) PetscCall(ISRestoreIndices(sub_schurs->is_Ej_all, &idxs)); in PCBDDCSetupFETIDPMatContext()
644 const PetscInt *idxs, *pranges, *aranges, *lranges; in PCBDDCSetupFETIDPMatContext() local
659 PetscCall(ISLocalToGlobalMappingGetIndices(l2gmap_p, &idxs)); in PCBDDCSetupFETIDPMatContext()
664 PetscCall(PetscLayoutFindOwner(play, idxs[i], &owner)); in PCBDDCSetupFETIDPMatContext()
665 l2g_indices_p[i] = idxs[i] - pranges[owner] + aranges[owner]; in PCBDDCSetupFETIDPMatContext()
[all …]
/petsc/src/ksp/ksp/tutorials/
H A Dex71.c313 PetscInt j, idxs[8]; in main() local
318 for (j = 0; j < nen; j++) idxs[j] = i * nen + ord[j]; in main()
320 for (j = 0; j < nen; j++) idxs[j] = e_loc[i * nen + ord[j]]; in main()
322 PetscCall(MatSetValuesBlockedLocal(A, nen, idxs, nen, idxs, user.elemMat, ADD_VALUES)); in main()
324 for (j = 0; j < nen; j++) idxs[j] = e_glo[i * nen + ord[j]]; in main()
325 PetscCall(MatSetValuesBlocked(A, nen, idxs, nen, idxs, user.elemMat, ADD_VALUES)); in main()
425 const PetscInt *idxs; in main() local
439 PetscCall(ISGetIndices(is, &idxs)); in main()
441 PetscCall(VecSetValuesBlockedLocal(lc, n / bs, idxs, a, INSERT_VALUES)); in main()
445 PetscCall(ISRestoreIndices(is, &idxs)); in main()
/petsc/src/mat/tests/
H A Dex221.c186 PetscInt *idxs = NULL, nr = 0; in main() local
190 PetscCall(PetscMalloc1(nr, &idxs)); in main()
192 idxs[0] = (2 * M - 1 - test / 2) % M; in main()
194 idxs[0] = (test / 2) % M; in main()
196 idxs[0] = PetscMax(idxs[0], 0); in main()
198 PetscCall(ISCreateGeneral(PETSC_COMM_WORLD, nr, idxs, PETSC_OWN_POINTER, &zr)); in main()
225 idxs = NULL; in main()
228 PetscCall(PetscMalloc1(nr, &idxs)); in main()
230 idxs[0] = (3 * M - 2 - test / 2) % M; in main()
232 idxs[0] = (test / 2 + 1) % M; in main()
[all …]
H A Dex40.c11 const PetscInt *idxs; in ISAllGatherDisjoint() local
23 PetscCall(ISGetIndices(is, &idxs)); in ISAllGatherDisjoint()
25 PetscCall(ISCreateGeneral(PETSC_COMM_SELF, sizes[i], idxs + ls, PETSC_COPY_VALUES, &is2[i])); in ISAllGatherDisjoint()
28 PetscCall(ISRestoreIndices(is, &idxs)); in ISAllGatherDisjoint()
H A Dex23.c739 const PetscInt *sts, *idxs; in main() local
771 PetscCall(ISGetIndices(is, &idxs)); in main()
776 idxs2[i] = rank % 2 ? idxs[i] : idxs[nl - i - 1]; in main()
779 idxs2[i] = rank % 2 ? idxs[nl - i - 1] : idxs[i]; in main()
782 idxs2[i] = idxs[i]; in main()
786 PetscCall(ISRestoreIndices(is, &idxs)); in main()
1004 const PetscInt *idxs; in TestMatZeroRows() local
1040 PetscCall(ISGetIndices(gis, &idxs)); in TestMatZeroRows()
1043 PetscCall(ISGetIndices(is, &idxs)); in TestMatZeroRows()
1047 if (0 <= idxs[i] && idxs[i] < N) { in TestMatZeroRows()
[all …]
/petsc/src/ksp/ksp/impls/fetidp/
H A Dfetidp.c395 const PetscInt *idxs; in KSPFETIDPCheckOperators() local
399 PetscCall(ISGetIndices(dirdofs, &idxs)); in KSPFETIDPCheckOperators()
400 for (i = 0; i < ndir; i++) array[idxs[i]] = 0.0; in KSPFETIDPCheckOperators()
401 PetscCall(ISRestoreIndices(dirdofs, &idxs)); in KSPFETIDPCheckOperators()
443 const PetscInt *idxs; in KSPFETIDPCheckOperators() local
447 PetscCall(ISGetIndices(dirdofs, &idxs)); in KSPFETIDPCheckOperators()
448 for (i = 0; i < ndir; i++) array[idxs[i]] = 0.0; in KSPFETIDPCheckOperators()
449 PetscCall(ISRestoreIndices(dirdofs, &idxs)); in KSPFETIDPCheckOperators()
590 const PetscInt *idxs; in KSPFETIDPSetUpOperators() local
619 PetscCall(ISGetIndices(II, &idxs)); in KSPFETIDPSetUpOperators()
[all …]
/petsc/src/vec/vec/utils/
H A Dvinv.c942 …eSubSetGather(Vec v, PetscInt nidx, const PetscInt idxv[], const PetscInt idxs[], Vec s, InsertMod… in VecStrideSubSetGather() argument
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
986 PetscCall((*v->ops->stridesubsetscatter)(s, nidx, idxs, idxv, v, addv)); in VecStrideSubSetScatter()
1054 …ather_Default(Vec v, PetscInt nidx, const PetscInt idxv[], const PetscInt idxs[], Vec s, InsertMod… in VecStrideSubSetGather_Default() argument
1076 …PetscCheck(idxs || bss == nidx, PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Must provide idxs when… in VecStrideSubSetGather_Default()
1080 if (!idxs) { in VecStrideSubSetGather_Default()
1086 for (j = 0; j < bss; j++) y[bss * i + idxs[j]] = x[bs * i + idxv[j]]; in VecStrideSubSetGather_Default()
1090 if (!idxs) { in VecStrideSubSetGather_Default()
1096 for (j = 0; j < bss; j++) y[bss * i + idxs[j]] += x[bs * i + idxv[j]]; in VecStrideSubSetGather_Default()
[all …]
/petsc/src/mat/impls/is/
H A Dmatis.c146 const PetscInt *idxs; in MatGetNonzeroColumnsLocal_Private() local
152 PetscCall(ISGetIndices(zd, &idxs)); in MatGetNonzeroColumnsLocal_Private()
154 for (i = 0; i < ctd; i++) aux[i] = (idxs[bs * i] + stc) / bs; in MatGetNonzeroColumnsLocal_Private()
155 PetscCall(ISRestoreIndices(zd, &idxs)); in MatGetNonzeroColumnsLocal_Private()
161 const PetscInt *idxs; in MatGetNonzeroColumnsLocal_Private() local
167 PetscCall(ISGetIndices(zo, &idxs)); in MatGetNonzeroColumnsLocal_Private()
169 for (i = 0; i < cto; i++) aux[i + ctd] = garray[idxs[bs * i] / bs]; in MatGetNonzeroColumnsLocal_Private()
170 PetscCall(ISRestoreIndices(zo, &idxs)); in MatGetNonzeroColumnsLocal_Private()
508 const PetscInt *idxs; in MatMPIXAIJComputeLocalToGlobalMapping_Private() local
512 PetscCall(ISGetIndices(workis[j], &idxs)); in MatMPIXAIJComputeLocalToGlobalMapping_Private()
[all …]
/petsc/src/ksp/ksp/tests/
H A Dex13.c7 static PetscErrorCode Get2DStencil(PetscInt i, PetscInt j, PetscInt n, PetscInt idxs[]) in Get2DStencil() argument
12 for (k = 0; k < 9; k++) idxs[k] = -1; in Get2DStencil()
16 … if (i + k1 >= 0 && i + k1 < n && j + k2 >= 0 && j + k2 < n) idxs[k++] = n * (i + k1) + (j + k2); in Get2DStencil()
/petsc/src/dm/impls/plex/
H A Dplexpartition.c322 PetscInt *idxs, *idxs2; in DMPlexCreatePartitionerGraph_ViaMat() local
358 PetscCall(PetscMalloc1(m, &idxs)); in DMPlexCreatePartitionerGraph_ViaMat()
363 idxs[i] = -(p + 1); in DMPlexCreatePartitionerGraph_ViaMat()
365 idxs[i] = p; in DMPlexCreatePartitionerGraph_ViaMat()
371 PetscCall(ISCreateGeneral(PETSC_COMM_SELF, m, idxs, PETSC_OWN_POINTER, &fis)); in DMPlexCreatePartitionerGraph_ViaMat()
375 PetscCall(PetscMalloc1(m, &idxs)); in DMPlexCreatePartitionerGraph_ViaMat()
381 idxs[i] = -(p + 1); in DMPlexCreatePartitionerGraph_ViaMat()
383 idxs[i] = p; in DMPlexCreatePartitionerGraph_ViaMat()
389 PetscCall(ISCreateGeneral(PetscObjectComm((PetscObject)dm), m, idxs, PETSC_OWN_POINTER, &cis)); in DMPlexCreatePartitionerGraph_ViaMat()
449 PetscCall(PetscCalloc1(m + 1, &idxs)); in DMPlexCreatePartitionerGraph_ViaMat()
[all …]
H A Dplexdd.c316 const PetscInt *idxs; in DMCreateNeumannOverlap_Plex() local
365 PetscCall(ISLocalToGlobalMappingGetIndices(l2g, &idxs)); in DMCreateNeumannOverlap_Plex()
366 PetscCall(ISCreateGeneral(PetscObjectComm((PetscObject)odm), n, idxs, PETSC_COPY_VALUES, ovl)); in DMCreateNeumannOverlap_Plex()
367 PetscCall(ISLocalToGlobalMappingRestoreIndices(l2g, &idxs)); in DMCreateNeumannOverlap_Plex()
H A Dplexglvis.c49 PetscInt *nlocal, *bs, *idxs, *dims; in DMSetUpGLVisViewer_Plex() local
92 …nlocal, maxfields, &bs, maxfields, &dims, maxfields, &fec_type, totdofs, &idxs, maxfields, &Ufield… in DMSetUpGLVisViewer_Plex()
150 for (j = 0; j < Nc; j++) idxs[cum++] = off + j; in DMSetUpGLVisViewer_Plex()
152 …PetscCall(ISCreateGeneral(PetscObjectComm((PetscObject)xlocal), Nv * Nc, idxs, PETSC_USE_POINTER, … in DMSetUpGLVisViewer_Plex()
162 for (j = 0; j < Nc; j++) idxs[cum++] = off + j; in DMSetUpGLVisViewer_Plex()
164 …PetscCall(ISCreateGeneral(PetscObjectComm((PetscObject)xlocal), totc * Nc, idxs, PETSC_USE_POINTER… in DMSetUpGLVisViewer_Plex()
189 idxs[cum++] = off + c; in DMSetUpGLVisViewer_Plex()
191 …PetscCall(ISCreateGeneral(PetscObjectComm((PetscObject)xlocal), totc, idxs, PETSC_USE_POINTER, &is… in DMSetUpGLVisViewer_Plex()
220 PetscCall(PetscFree7(fieldname, nlocal, bs, dims, fec_type, idxs, Ufield)); in DMSetUpGLVisViewer_Plex()
/petsc/src/vec/is/is/interface/
H A Dindex.c38 const PetscInt *idxs, *idxs_mult = NULL; in ISRenumber() local
58 PetscCall(ISGetIndices(subset, &idxs)); in ISRenumber()
65 if (idxs[i] < 0) { in ISRenumber()
69 if (idxs[i] < lbounds[0]) lbounds[0] = idxs[i]; in ISRenumber()
70 if (idxs[i] > lbounds[1]) lbounds[1] = idxs[i]; in ISRenumber()
99 PetscCall(ISRestoreIndices(subset, &idxs)); in ISRenumber()
115 for (i = 0; i < npos; i++) gidxs[i] = (ilocal ? idxs[ilocal[i]] : idxs[i]) - gbounds[0]; in ISRenumber()
116 PetscCall(ISRestoreIndices(subset, &idxs)); in ISRenumber()
/petsc/src/vec/is/sf/utils/
H A Dsfutils.c564 PetscErrorCode PetscLayoutMapLocal(PetscLayout map, PetscInt N, const PetscInt idxs[], PetscInt *on… in PetscLayoutMapLocal() argument
583 const PetscInt idx = idxs[r]; in PetscLayoutMapLocal()
591 ridxs[nleaves].index = idxs[r] - owners[p]; in PetscLayoutMapLocal()
597 PetscCall(PetscSFReduceBegin(sf, MPIU_INT, (PetscInt *)idxs, lidxs, MPI_LOR)); in PetscLayoutMapLocal()
598 PetscCall(PetscSFReduceEnd(sf, MPIU_INT, (PetscInt *)idxs, lidxs, MPI_LOR)); in PetscLayoutMapLocal()
605 if (idxs[r] >= 0) cum++; in PetscLayoutMapLocal()
610 if (idxs[r] >= 0) work2[r] = start + cum++; in PetscLayoutMapLocal()
/petsc/src/vec/vec/impls/nest/
H A Dvecnest.c365 const PetscInt *idxs; in VecMin_Nest() local
370 PetscCall(ISGetIndices(bx->is[lw], &idxs)); in VecMin_Nest()
371 *p = idxs[lp - st]; in VecMin_Nest()
372 PetscCall(ISRestoreIndices(bx->is[lw], &idxs)); in VecMin_Nest()
398 const PetscInt *idxs; in VecMax_Nest() local
403 PetscCall(ISGetIndices(bx->is[lw], &idxs)); in VecMax_Nest()
404 *p = idxs[lp - st]; in VecMax_Nest()
405 PetscCall(ISRestoreIndices(bx->is[lw], &idxs)); in VecMax_Nest()
/petsc/src/dm/partitioner/impls/multistage/
H A Dmspart.c590 const PetscInt *idxs; in PetscPartitionerPartition_Multistage() local
719 PetscCall(ISGetIndices(lpartition, &idxs)); in PetscPartitionerPartition_Multistage()
721 PetscCall(ISCreateGeneral(comm, nid, idxs, PETSC_COPY_VALUES, partition)); in PetscPartitionerPartition_Multistage()
722 PetscCall(ISRestoreIndices(lpartition, &idxs)); in PetscPartitionerPartition_Multistage()
/petsc/src/mat/impls/aij/seq/mkl_pardiso/
H A Dmkl_pardiso.c291 const PetscInt *idxs; in MatFactorSetSchurIS_MKL_PARDISO() local
316 PetscCall(ISGetIndices(is, &idxs)); in MatFactorSetSchurIS_MKL_PARDISO()
317 PetscCall(PetscArraycpy(mpardiso->schur_idxs, idxs, size)); in MatFactorSetSchurIS_MKL_PARDISO()
318 for (i = 0; i < size; i++) mpardiso->perm[idxs[i]] = 1; in MatFactorSetSchurIS_MKL_PARDISO()
319 PetscCall(ISRestoreIndices(is, &idxs)); in MatFactorSetSchurIS_MKL_PARDISO()
/petsc/src/vec/is/utils/
H A Disltog.c377 const PetscInt *idxs; in ISLocalToGlobalMappingView() local
383 PetscCall(ISLocalToGlobalMappingGetIndices(mapping, &idxs)); in ISLocalToGlobalMappingView()
384 …teGeneral(PetscObjectComm((PetscObject)viewer), mapping->n * mapping->bs, idxs, PETSC_USE_POINTER,… in ISLocalToGlobalMappingView()
387 PetscCall(ISLocalToGlobalMappingRestoreIndices(mapping, &idxs)); in ISLocalToGlobalMappingView()

12