| /petsc/src/dm/impls/plex/tutorials/ |
| H A D | dmplexgetrestoreclosureindices.F90 | 23 PetscInt, allocatable :: idxMatrix(:, :), offsets(:) 38 allocate (offsets(Nf + 1), source=zero) 42 …PetscCallA(DMPlexGetClosureIndices(cdm, gS, gS, cStart, PETSC_TRUE, nIdx, indices, offsets, PETSC_… 46 …PetscCheckA(size(offsets) == (Nf + 1) .and. offsets(1) == zero, PETSC_COMM_WORLD, PETSC_ERR_PLIB, … 47 …PetscCallA(DMPlexRestoreClosureIndices(cdm, gS, gS, cStart, PETSC_TRUE, nIdx, indices, offsets, PE… 49 …PetscCallA(DMPlexGetClosureIndices(cdm, gS, gS, cEnd - 1, PETSC_TRUE, nIdx, indices, offsets, PETS… 51 …PetscCallA(DMPlexRestoreClosureIndices(cdm, gS, gS, cEnd - 1, PETSC_TRUE, nIdx, indices, offsets, … 61 deallocate (offsets)
|
| /petsc/src/dm/partitioner/impls/simple/ |
| H A D | partsimple.c | 49 PetscInt *cellproc, *offsets, cells[3] = {1, 1, 1}, pcells[3] = {1, 1, 1}; in PetscPartitionerPartition_Simple_Grid() local 80 PetscCall(PetscCalloc1(nparts, &offsets)); in PetscPartitionerPartition_Simple_Grid() 81 for (np = 0; np < nparts; ++np) PetscCall(PetscSectionGetOffset(partSection, np, &offsets[np])); in PetscPartitionerPartition_Simple_Grid() 101 cellproc[offsets[pid]++] = cid; in PetscPartitionerPartition_Simple_Grid() 111 …offsets[np] - offsets[np - 1] == numVertices / nparts, PETSC_COMM_SELF, PETSC_ERR_ARG_INCOMP, "Off… in PetscPartitionerPartition_Simple_Grid() 112 PetscCall(PetscFree(offsets)); in PetscPartitionerPartition_Simple_Grid() 186 PetscInt nvGlobal, *offsets, myFirst, myLast; in PetscPartitionerPartition_Simple() local 188 PetscCall(PetscMalloc1(size + 1, &offsets)); in PetscPartitionerPartition_Simple() 189 offsets[0] = 0; in PetscPartitionerPartition_Simple() 190 PetscCallMPI(MPI_Allgather(&numVertices, 1, MPIU_INT, &offsets[1], 1, MPIU_INT, comm)); in PetscPartitionerPartition_Simple() [all …]
|
| /petsc/src/dm/impls/plex/tests/ |
| H A D | ex49.c | 101 PetscInt *offsets, Ncell, Ncl, Nc, n; in CheckOffsets() local 103 …(DMPlexGetLocalOffsets(dm, domain_label, label_value, height, f, &Ncell, &Ncl, &Nc, &n, &offsets)); in CheckOffsets() 104 PetscCall(ISCreateGeneral(PETSC_COMM_SELF, Ncell * Ncl, offsets, PETSC_OWN_POINTER, &offIS)); in CheckOffsets() 111 PetscInt *offsets, *offsetsNeg, *offsetsPos, Nface, Nc, n, i = 0; in CheckOffsets() local 114 PetscCall(PetscMalloc1(Nface * Nc * 2, &offsets)); in CheckOffsets() 116 for (PetscInt c = 0; c < Nc; ++c) offsets[i++] = offsetsNeg[f] + c; in CheckOffsets() 117 for (PetscInt c = 0; c < Nc; ++c) offsets[i++] = offsetsPos[f] + c; in CheckOffsets() 122 … PetscCall(ISCreateGeneral(PETSC_COMM_SELF, Nface * Nc * 2, offsets, PETSC_OWN_POINTER, &offIS)); in CheckOffsets() 138 PetscInt cdim, *offsets, Ncell, Ncl, Nc, n; in CheckOffsets() local 154 …DMPlexGetLocalOffsets(cdm, domain_label, label_value, height, 0, &Ncell, &Ncl, &Nc, &n, &offsets)); in CheckOffsets() [all …]
|
| /petsc/src/dm/impls/plex/ |
| H A D | plextree.c | 476 PetscInt *offsets, *children, pStart, pEnd; in DMPlexTreeSymmetrize() local 505 PetscCall(PetscCalloc1(parMax - parMin, &offsets)); in DMPlexTreeSymmetrize() 516 children[cOff + offsets[par - parMin]++] = p; in DMPlexTreeSymmetrize() 521 PetscCall(PetscFree(offsets)); in DMPlexTreeSymmetrize() 790 PetscInt *offsets; in DMPlexTreeExchangeSupports() local 799 PetscCall(PetscCalloc1(pEnd, &offsets)); in DMPlexTreeExchangeSupports() 845 if (j < numCones) newSupports[newOff + offsets[p]++] = q; in DMPlexTreeExchangeSupports() 865 if (j < numCones) newSupports[newOff + offsets[p]++] = r; in DMPlexTreeExchangeSupports() 877 if (j < numCones) newSupports[newqOff + offsets[q]++] = r; in DMPlexTreeExchangeSupports() 887 PetscCall(PetscFree(offsets)); in DMPlexTreeExchangeSupports() [all …]
|
| H A D | plexpartition.c | 12 …rGraph_Overlap(DM dm, PetscInt height, PetscInt *numVertices, PetscInt **offsets, PetscInt **adjac… in DMPlexCreatePartitionerGraph_Overlap() argument 30 PetscCall(DMPlexCreateNeighborCSR(dm, height, numVertices, offsets, adjacency)); in DMPlexCreatePartitionerGraph_Overlap() 35 PetscCall(PetscMalloc1(1, offsets)); in DMPlexCreatePartitionerGraph_Overlap() 36 (*offsets)[0] = 0; in DMPlexCreatePartitionerGraph_Overlap() 102 if (offsets) { in DMPlexCreatePartitionerGraph_Overlap() 103 *offsets = vOffsets; in DMPlexCreatePartitionerGraph_Overlap() 111 …erGraph_Native(DM dm, PetscInt height, PetscInt *numVertices, PetscInt **offsets, PetscInt **adjac… in DMPlexCreatePartitionerGraph_Native() argument 132 PetscCall(DMPlexCreateNeighborCSR(dm, height, numVertices, offsets, adjacency)); in DMPlexCreatePartitionerGraph_Native() 137 PetscCall(PetscMalloc1(1, offsets)); in DMPlexCreatePartitionerGraph_Native() 138 (*offsets)[0] = 0; in DMPlexCreatePartitionerGraph_Native() [all …]
|
| H A D | plexvtu.c | 54 PetscVTKInt *conn, *offsets; in DMPlexGetVTKConnectivity() local 59 PetscCall(PetscMalloc3(piece->nconn, &conn, piece->ncells, &offsets, piece->ncells, &types)); in DMPlexGetVTKConnectivity() 106 PetscCall(PetscVTKIntCast(countconn, &offsets[countcell])); in DMPlexGetVTKConnectivity() 117 *ooffsets = offsets; in DMPlexGetVTKConnectivity() 516 PetscVTKInt *connectivity = NULL, *offsets = NULL; in DMPlexVTKWriteAll_VTU() local 518 PetscCall(DMPlexGetVTKConnectivity(dm, localized, &piece, &connectivity, &offsets, &types)); in DMPlexVTKWriteAll_VTU() 520 … PetscCall(TransferWrite(comm, viewer, fp, r, 0, offsets, buffer, piece.ncells, MPI_INT, tag)); in DMPlexVTKWriteAll_VTU() 522 PetscCall(PetscFree3(connectivity, offsets, types)); in DMPlexVTKWriteAll_VTU()
|
| H A D | plex.c | 4387 PetscInt *offsets; in DMPlexSymmetrize() local 4408 PetscCall(PetscCalloc1(pEnd - pStart, &offsets)); in DMPlexSymmetrize() 4420 mesh->supports[offS + offsets[q]] = p; in DMPlexSymmetrize() 4421 ++offsets[q]; in DMPlexSymmetrize() 4424 PetscCall(PetscFree(offsets)); in DMPlexSymmetrize() 4951 PetscInt *offsets, **closures; in DMPlexGetFullJoin() local 4964 PetscCall(DMGetWorkArray(dm, numPoints * (depth + 2), MPIU_INT, &offsets)); in DMPlexGetFullJoin() 4975 offsets[p * (depth + 2) + 0] = 0; in DMPlexGetFullJoin() 4980 for (i = offsets[p * (depth + 2) + d]; i < closureSize; ++i) { in DMPlexGetFullJoin() 4982 offsets[p * (depth + 2) + d + 1] = i; in DMPlexGetFullJoin() [all …]
|
| H A D | plexceed.c | 58 …etscInt *num_cells, PetscInt *cell_size, PetscInt *num_comp, PetscInt *l_size, PetscInt *offsets[]) in DMPlexGetLocalOffsets() argument 164 *offsets = restr_indices; in DMPlexGetLocalOffsets()
|
| H A D | plexpreallocate.c | 23 PetscInt p, q, a, aSize, *offsets, aStart, aEnd, *inverse, iSize, *adj, adjSize; in DMPlexComputeAnchorAdjacencies() local 41 PetscCall(PetscCalloc1(pEnd - pStart, &offsets)); in DMPlexComputeAnchorAdjacencies() 54 inverse[iOff + offsets[a - pStart]++] = p; in DMPlexComputeAnchorAdjacencies() 58 PetscCall(PetscFree(offsets)); in DMPlexComputeAnchorAdjacencies()
|
| /petsc/src/mat/graphops/partition/impls/hierarchical/ |
| H A D | hierarchical.c | 39 PetscInt *parts_indices, i, j, mat_localsize, *offsets; in MatPartitioningApply_Hierarchical() local 95 PetscCall(PetscMalloc1(hpart->ncoarseparts + 1, &offsets)); in MatPartitioningApply_Hierarchical() 98 offsets[0] = 0; in MatPartitioningApply_Hierarchical() 99 if (part->n % hpart->nfineparts != 0) offsets[1] = part->n % hpart->nfineparts; in MatPartitioningApply_Hierarchical() 100 else offsets[1] = hpart->nfineparts; in MatPartitioningApply_Hierarchical() 102 part_weights[0] = ((PetscReal)offsets[1]) / part->n; in MatPartitioningApply_Hierarchical() 105 offsets[i] = hpart->nfineparts; in MatPartitioningApply_Hierarchical() 106 part_weights[i - 1] = ((PetscReal)offsets[i]) / part->n; in MatPartitioningApply_Hierarchical() 109 offsets[0] = 0; in MatPartitioningApply_Hierarchical() 110 for (i = 1; i <= hpart->ncoarseparts; i++) offsets[i] += offsets[i - 1]; in MatPartitioningApply_Hierarchical() [all …]
|
| /petsc/src/vec/is/is/utils/ |
| H A D | iscoloring.c | 675 PetscMPIInt size, *sizes = NULL, *offsets = NULL, nn; in ISAllGather() local 690 PetscCall(PetscMalloc2(size, &sizes, size, &offsets)); in ISAllGather() 694 offsets[0] = 0; in ISAllGather() 696 PetscInt s = offsets[i - 1] + sizes[i - 1]; in ISAllGather() 697 PetscCall(PetscMPIIntCast(s, &offsets[i])); in ISAllGather() 699 N = offsets[size - 1] + sizes[size - 1]; in ISAllGather() 703 …PetscCallMPI(MPI_Allgatherv((void *)lindices, nn, MPIU_INT, indices, sizes, offsets, MPIU_INT, com… in ISAllGather() 705 PetscCall(PetscFree2(sizes, offsets)); in ISAllGather() 738 PetscMPIInt size, *offsets = NULL, *sizes = NULL, nn; in ISAllGatherColors() local 743 PetscCall(PetscMalloc2(size, &sizes, size, &offsets)); in ISAllGatherColors() [all …]
|
| /petsc/src/dm/impls/plex/tutorials/output/ |
| H A D | ex8_1d_q1_periodic.out | 27 DM box offsets: num_elem 3, size 2, comp 1, dof 3 31 DM coords offsets: num_elem 3, size 2, comp 1, dof 3
|
| H A D | ex8_2d_q1_periodic_sparse.out | 65 DM box offsets: num_elem 6, size 4, comp 1, dof 9 72 DM coords offsets: num_elem 6, size 4, comp 2, dof 18 103 DM cell coords offsets: num_elem 6, size 4, comp 2, dof 48
|
| H A D | ex8_2d_q1_periodic.out | 65 DM box offsets: num_elem 6, size 4, comp 1, dof 9 72 DM coords offsets: num_elem 6, size 4, comp 2, dof 18
|
| H A D | ex8_3d_q1_periodic_project.out | 67 DM box offsets: num_elem 3, size 8, comp 1, dof 12 71 DM coords offsets: num_elem 3, size 8, comp 3, dof 36
|
| H A D | ex8_3d_q1_periodic.out | 106 DM box offsets: num_elem 6, size 8, comp 1, dof 18 113 DM coords offsets: num_elem 6, size 8, comp 3, dof 54
|
| /petsc/doc/manual/ |
| H A D | dmcommonality.md | 9 …the storage location (offsets) of numerical values associated with said entities in PETSc vectors … 58 on the grid, PDE, and discretization. Hence all the offsets 60 and stores the offsets and then using the `PetscSection` gives access to the needed offsets. 64 …ces) of the cell entities. Then one uses an associated `PetscSection` to determine the offsets into 77 are used to obtain the needed offsets from a given point (node or edge) and submodel at that point.… 91 …arious approaches for mapping between the entities and the related array offsets and the large amo…
|
| H A D | section.md | 85 A `PetscSection` with one field and and offsets set in `PetscSectionSetUp()` may be thought of as d… 165 This behavior of the offsets is controlled via an argument to `PetscSectionCreateGlobalSection()`. 207 …before `PetscSectionSetUp()` and will only affect the calculation of the offsets for each grid poi…
|
| /petsc/src/dm/impls/da/hypre/ |
| H A D | mhyp.c | 155 HYPRE_Int offsets[3][1] = {{-1}, {0}, {1}}; in MatSetUp_HYPREStruct() local 158 … ssize; i++) PetscCallHYPRE(HYPRE_StructStencilSetElement(ex->hstencil, (HYPRE_Int)i, offsets[i])); in MatSetUp_HYPREStruct() 160 HYPRE_Int offsets[5][2] = { in MatSetUp_HYPREStruct() local 169 … ssize; i++) PetscCallHYPRE(HYPRE_StructStencilSetElement(ex->hstencil, (HYPRE_Int)i, offsets[i])); in MatSetUp_HYPREStruct() 171 HYPRE_Int offsets[7][3] = { in MatSetUp_HYPREStruct() local 182 … ssize; i++) PetscCallHYPRE(HYPRE_StructStencilSetElement(ex->hstencil, (HYPRE_Int)i, offsets[i])); in MatSetUp_HYPREStruct() 587 HYPRE_Int offsets[3][1] = {{-1}, {0}, {1}}; in MatSetUp_HYPRESStruct() local 595 …PetscCallHYPRE(HYPRE_SStructStencilSetEntry(ex->ss_stencil, (HYPRE_Int)cnt, offsets[j], (HYPRE_Int… in MatSetUp_HYPRESStruct() 600 HYPRE_Int offsets[5][2] = { in MatSetUp_HYPRESStruct() local 614 …PetscCallHYPRE(HYPRE_SStructStencilSetEntry(ex->ss_stencil, (HYPRE_Int)cnt, offsets[j], (HYPRE_Int… in MatSetUp_HYPRESStruct() [all …]
|
| /petsc/src/vec/vec/utils/tagger/impls/ |
| H A D | cdf.c | 159 PetscInt offsets[2]; in VecTaggerComputeBox_CDF_SortedArray_Iterative() local 170 offsets[0] = 0; in VecTaggerComputeBox_CDF_SortedArray_Iterative() 171 offsets[1] = 0; in VecTaggerComputeBox_CDF_SortedArray_Iterative() 243 PetscInt totalLessThan = offsets[i] + stats[i][0].moment[0]; in VecTaggerComputeBox_CDF_SortedArray_Iterative() 249 offsets[i] = totalLessThan; in VecTaggerComputeBox_CDF_SortedArray_Iterative() 257 offsets[i] = totalLessThan; in VecTaggerComputeBox_CDF_SortedArray_Iterative() 260 …imate(&stats[i][section], ((i ? cdfBox->max : cdfBox->min) - ((PetscReal)offsets[i] / (PetscReal)M… in VecTaggerComputeBox_CDF_SortedArray_Iterative()
|
| /petsc/src/vec/is/utils/ |
| H A D | kdtree.c | 429 PetscReal *offsets, rd; in PetscKDTreeQueryPointsNearestNeighbor() local 440 PetscCall(PetscCalloc1(tree->dim, &offsets)); in PetscKDTreeQueryPointsNearestNeighbor() 446 …ee, &points[p * tree->dim], tree->root_handle, (char)tree->is_root_leaf, offsets, rd, PetscSqr(tol… in PetscKDTreeQueryPointsNearestNeighbor() 449 PetscCall(PetscFree(offsets)); in PetscKDTreeQueryPointsNearestNeighbor()
|
| /petsc/src/vec/is/is/interface/ |
| H A D | index.c | 1351 PetscMPIInt rank, size, *sizes = NULL, *offsets = NULL, nn; in ISGatherTotal_Private() local 1360 PetscCall(PetscMalloc2(size, &sizes, size, &offsets)); in ISGatherTotal_Private() 1364 offsets[0] = 0; in ISGatherTotal_Private() 1365 for (i = 1; i < size; ++i) offsets[i] = offsets[i - 1] + sizes[i - 1]; in ISGatherTotal_Private() 1366 N = offsets[size - 1] + sizes[size - 1]; in ISGatherTotal_Private() 1370 …PetscCallMPI(MPI_Allgatherv((void *)lindices, nn, MPIU_INT, is->total, sizes, offsets, MPIU_INT, c… in ISGatherTotal_Private() 1372 is->local_offset = offsets[rank]; in ISGatherTotal_Private() 1373 PetscCall(PetscFree2(sizes, offsets)); in ISGatherTotal_Private()
|
| /petsc/src/vec/vec/impls/mpi/ |
| H A D | pdvec.c | 1009 PetscInt *offsets; in VecSetPreallocationCOO_MPI() local 1014 PetscCall(PetscMalloc1(nsend, &offsets)); in VecSetPreallocationCOO_MPI() 1022 …otdata*/, PETSC_MEMTYPE_HOST, nentries /*leafdata*/, PETSC_MEMTYPE_HOST, offsets /*leafupdate*/, M… in VecSetPreallocationCOO_MPI() 1023 …PetscCall(PetscSFFetchAndOpEnd(sf1, MPIU_INT, &nroots2, nentries, offsets, MPI_SUM)); /* Would nro… in VecSetPreallocationCOO_MPI() 1036 …PetscCheck(offsets[k] >= 0, PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Number of SF roots is too … in VecSetPreallocationCOO_MPI() 1039 PetscCall(PetscIntCast(offsets[k] + q, &iremote[p].index)); in VecSetPreallocationCOO_MPI() 1053 PetscCall(PetscFree(offsets)); in VecSetPreallocationCOO_MPI()
|
| /petsc/src/dm/dt/interface/ |
| H A D | dtds.c | 2857 PetscErrorCode PetscDSGetComponentOffsets(PetscDS prob, PetscInt *offsets[]) in PetscDSGetComponentOffsets() argument 2861 PetscAssertPointer(offsets, 2); in PetscDSGetComponentOffsets() 2863 *offsets = prob->off; in PetscDSGetComponentOffsets() 2882 PetscErrorCode PetscDSGetComponentDerivativeOffsets(PetscDS prob, PetscInt *offsets[]) in PetscDSGetComponentDerivativeOffsets() argument 2886 PetscAssertPointer(offsets, 2); in PetscDSGetComponentDerivativeOffsets() 2888 *offsets = prob->offDer; in PetscDSGetComponentDerivativeOffsets() 2908 PetscErrorCode PetscDSGetComponentOffsetsCohesive(PetscDS ds, PetscInt s, PetscInt *offsets[]) in PetscDSGetComponentOffsetsCohesive() argument 2912 PetscAssertPointer(offsets, 3); in PetscDSGetComponentOffsetsCohesive() 2916 *offsets = ds->offCohesive[s]; in PetscDSGetComponentOffsetsCohesive() 2936 …ErrorCode PetscDSGetComponentDerivativeOffsetsCohesive(PetscDS ds, PetscInt s, PetscInt *offsets[]) in PetscDSGetComponentDerivativeOffsetsCohesive() argument [all …]
|
| /petsc/src/binding/petsc4py/src/petsc4py/PETSc/ |
| H A D | Section.pyx | 97 """Calculate offsets. 832 """Return the full range of offsets, [start, end), for a section. 859 This gives negative sizes and offsets to points not owned by this
|