| /petsc/src/binding/petsc4py/src/petsc4py/lib/_pytypes/viewer/ |
| H A D | petscpyvista.py | 8 def _convertCell(ctype, cells, nc, off): argument 11 tmp = cells[off + 1] 12 cells[off + 1] = cells[off + 2] 13 cells[off + 2] = tmp 15 tmp = cells[off + 1] 16 cells[off + 1] = cells[off + 3] 17 cells[off + 3] = tmp 19 tmp = cells[off + 4] 20 cells[off + 4] = cells[off + 5] 21 cells[off + 5] = tmp [all …]
|
| /petsc/src/sys/tests/ |
| H A D | ex41.c | 11 PetscInt n, off, array[4], na, nb, i, *marray, size; in main() local 65 off = 0; in main() 66 PetscCall(PetscHSetIGetElems(ht, &off, array)); in main() 67 PetscCall(PetscSortInt(off, array)); in main() 68 PetscTestCheck(off == 2); in main() 71 PetscCall(PetscHSetIGetElems(ht, &off, array)); in main() 73 PetscTestCheck(off == 4); in main() 79 off = 0; in main() 81 PetscCall(PetscHSetIGetElems(hd, &off, array)); in main() 82 PetscCall(PetscSortInt(off, array)); in main() [all …]
|
| H A D | ex40.c | 25 PetscInt n, v, koff, keys[4], voff, vals[4], na, nb, i, size, *karray, off; in PETSC_HASH_MAP() local 153 off = 0; in PETSC_HASH_MAP() 154 PetscCall(PetscHMapIVGetPairs(htv, &off, karray, varray)); in PETSC_HASH_MAP() 155 PetscTestCheck(off == (2 * n)); in PETSC_HASH_MAP() 156 PetscCall(PetscSortIntWithDataArray(off, karray, varray, sizeof(PetscScalar), vwork)); in PETSC_HASH_MAP()
|
| /petsc/src/dm/impls/plex/tests/ |
| H A D | ex34.c | 112 PetscInt dim, pStart, pEnd, p, cStart, cEnd, c, Nhyb = 0, off[2]; in OrderHybridMesh() local 127 off[0] = 0; in OrderHybridMesh() 128 off[1] = cEnd - Nhyb; in OrderHybridMesh() 133 if (coneSize == 6) ind[c] = off[1]++; in OrderHybridMesh() 134 else ind[c] = off[0]++; in OrderHybridMesh() 136 …PetscCheck(off[0] == cEnd - Nhyb, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Number of normal cells %" Pets… in OrderHybridMesh() 137 …PetscCheck(off[1] == cEnd, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Number of hybrid cells %" PetscInt_FM… in OrderHybridMesh()
|
| H A D | ex3.c | 250 PetscInt dof, off; in TransformCoordinates() local 254 PetscCall(PetscSectionGetOffset(coordSection, v, &off)); in TransformCoordinates() 257 …r = PetscSqr(PetscRealPart(coords[off + 0])) + PetscSqr(PetscRealPart(coords[off + 1… in TransformCoordinates() 258 coords[off + 0] = r == 0.0 ? 0.0 : PetscPowReal(r, (1 - p) / (2 * p)) * coords[off + 0]; in TransformCoordinates() 259 coords[off + 1] = r == 0.0 ? 0.0 : PetscPowReal(r, (1 - p) / (2 * p)) * coords[off + 1]; in TransformCoordinates() 262 …r = PetscSqr(PetscRealPart(coords[off + 0])) + PetscSqr(PetscRealPart(coords[off + 1… in TransformCoordinates() 263 coords[off + 0] = r == 0.0 ? 0.0 : PetscPowReal(r, (1 - p) / (2 * p)) * coords[off + 0]; in TransformCoordinates() 264 coords[off + 1] = r == 0.0 ? 0.0 : PetscPowReal(r, (1 - p) / (2 * p)) * coords[off + 1]; in TransformCoordinates() 265 coords[off + 2] = coords[off + 2]; in TransformCoordinates() 278 PetscInt dof, off; in TransformCoordinates() local [all …]
|
| /petsc/src/dm/impls/plex/exodusii/ |
| H A D | plexexodusii2.c | 937 PetscInt *connect, off = 0; in DMView_PlexExodusII() local 992 connect[i + off] = closure[(i + edgesInClosure + facesInClosure + 1) * 2] + 1; in DMView_PlexExodusII() 993 connect[i + off] -= cellsNotInConnectivity; in DMView_PlexExodusII() 995 connect[i + off] = closure[(i - verticesInClosure + facesInClosure + 1) * 2] + 1; in DMView_PlexExodusII() 996 if (nodes[cs][2] == 0) connect[i + off] -= numFaces; in DMView_PlexExodusII() 997 connect[i + off] -= cellsNotInConnectivity; in DMView_PlexExodusII() 999 connect[i + off] = closure[0] + 1; in DMView_PlexExodusII() 1000 connect[i + off] -= skipCells; in DMView_PlexExodusII() 1002 connect[i + off] = closure[(i - edgesInClosure - verticesInClosure) * 2] + 1; in DMView_PlexExodusII() 1003 connect[i + off] -= cellsNotInConnectivity; in DMView_PlexExodusII() [all …]
|
| /petsc/src/dm/impls/network/tests/ |
| H A D | ex2.c | 48 PetscInt vStart, vEnd, v, vglobal, compkey = 0, off, NVert; in StarGraphSetCoordinates() local 70 PetscCall(DMNetworkGetLocalVecOffset(cdm, v, 0, &off)); in StarGraphSetCoordinates() 72 coord[off] = 0.0; in StarGraphSetCoordinates() 73 coord[off + 1] = 0.0; in StarGraphSetCoordinates() 76 coord[off] = PetscCosReal(theta * (vglobal - 1)); in StarGraphSetCoordinates() 77 coord[off + 1] = PetscSinReal(theta * (vglobal - 1)); in StarGraphSetCoordinates() 143 PetscInt cdim, v, off, vglobal, vStart, vEnd; in CoordinatePrint() local 163 PetscCall(DMNetworkGetLocalVecOffset(dmclone, v, 0, &off)); in CoordinatePrint() 167 … = %f y = %f \n", vglobal, (double)PetscRealPart(carray[off]), (double)PetscRealPart(carray[off +… in CoordinatePrint()
|
| /petsc/src/mat/tests/output/ |
| H A D | ex134_1.out | 9 [0] off-diagonal part: nz 16 12 [1] off-diagonal part: nz 16 49 [0] off-diagonal part: nz 16 52 [1] off-diagonal part: nz 0 84 [0] off-diagonal part: nz 4 87 [1] off-diagonal part: nz 4 120 [0] off-diagonal part: nz 4 123 [1] off-diagonal part: nz 0
|
| H A D | ex135_1.out | 8 [0] off-diagonal part: nz 250 11 [1] off-diagonal part: nz 250 14 [2] off-diagonal part: nz 250 17 [3] off-diagonal part: nz 0
|
| H A D | ex231_1.out | 2 Max off-diagonal non-zeros: = 12 4 Max off-diagonal non-zeros: = 720
|
| /petsc/src/dm/impls/plex/ |
| H A D | plexvtu.c | 461 PetscInt off, dof; in DMPlexVTKWriteAll_VTU() local 471 PetscCall(PetscSectionGetOffset(coordSection, closure[v], &off)); in DMPlexVTKWriteAll_VTU() 473 y[cnt * 3 + 0] = (PetscVTUReal)PetscRealPart(x[off + 0]); in DMPlexVTKWriteAll_VTU() 474 … y[cnt * 3 + 1] = (PetscVTUReal)((dimEmbed > 1) ? PetscRealPart(x[off + 1]) : 0.0); in DMPlexVTKWriteAll_VTU() 477 y[cnt * 3 + 0] = (PetscVTUReal)PetscRealPart(x[off + 0]); in DMPlexVTKWriteAll_VTU() 478 y[cnt * 3 + 1] = (PetscVTUReal)PetscRealPart(x[off + 1]); in DMPlexVTKWriteAll_VTU() 479 y[cnt * 3 + 2] = (PetscVTUReal)PetscRealPart(x[off + 2]); in DMPlexVTKWriteAll_VTU() 486 PetscCall(PetscSectionGetOffset(cellCoordSection, c, &off)); in DMPlexVTKWriteAll_VTU() 489 y[cnt * 3 + 0] = (PetscVTUReal)PetscRealPart(cx[off + i * dimEmbed + 0]); in DMPlexVTKWriteAll_VTU() 490 … y[cnt * 3 + 1] = (PetscVTUReal)((dimEmbed > 1) ? PetscRealPart(cx[off + i * dimEmbed + 1]) : 0.0); in DMPlexVTKWriteAll_VTU() [all …]
|
| H A D | plexpreallocate.c | 44 PetscInt dof, off; in DMPlexComputeAnchorAdjacencies() local 47 PetscCall(PetscSectionGetOffset(aSec, p, &off)); in DMPlexComputeAnchorAdjacencies() 52 a = anchors[off + q]; in DMPlexComputeAnchorAdjacencies() 355 PetscInt dof, off, d, q, anDof; in DMPlexCreateAdjacencySection_Static() local 360 PetscCall(PetscSectionGetOffset(section, p, &off)); in DMPlexCreateAdjacencySection_Static() 369 … for (d = off; d < off + dof; ++d) PetscCall(PetscSectionAddDof(leafSectionAdj, d, ndof - ncdof)); in DMPlexCreateAdjacencySection_Static() 373 for (d = off; d < off + dof; ++d) PetscCall(PetscSectionAddDof(leafSectionAdj, d, anDof)); in DMPlexCreateAdjacencySection_Static() 393 PetscInt numAdj = PETSC_DETERMINE, adof, dof, off, d, q, anDof; in DMPlexCreateAdjacencySection_Static() local 396 PetscCall(PetscSectionGetOffset(section, p, &off)); in DMPlexCreateAdjacencySection_Static() 398 PetscCall(PetscSectionGetDof(rootSectionAdj, off, &adof)); in DMPlexCreateAdjacencySection_Static() [all …]
|
| H A D | plexorient.c | 350 …PetscInt numLeaves, numRoots, dim, h, cStart, cEnd, c, cell, fStart, fEnd, face, off, to… in DMPlexOrient() local 531 for (comp = 0, off = 0; comp < numComponents; ++comp) { in DMPlexOrient() 534 for (n = 0; n < numNeighbors[comp]; ++n, ++off) { in DMPlexOrient() 538 if (o < 0) match[off] = PETSC_TRUE; in DMPlexOrient() 539 else if (o > 0) match[off] = PETSC_FALSE; in DMPlexOrient() 541 nrankComp[off].rank = rpoints[neighbors[comp][n]].rank; in DMPlexOrient() 542 …nrankComp[off].index = lorntComp[lpoints ? lpoints[neighbors[comp][n]] : neighbors[comp][n]].index; in DMPlexOrient() 579 for (p = 0, off = 0; p < size; ++p) { in DMPlexOrient() 582 …+off) PetscCall(PetscPrintf(PETSC_COMM_SELF, " edge (%" PetscInt_FMT ", %" PetscInt_FMT ") (%s):\… in DMPlexOrient() 590 for (p = 0, off = 0; p < size; ++p) { in DMPlexOrient() [all …]
|
| H A D | plexceed.c | 386 for (PetscInt p = 0, off = 0; p < Nf; ++p) { in DMPlexCeedComputeGeometryFVM() local 399 PetscCall(DMPlexComputeCellGeometryFVM(dm, face, &area, fcentroid, &qdata[off])); in DMPlexCeedComputeGeometryFVM() 400 for (PetscInt d = 0; d < cdim; ++d) qdata[off + d] *= area; in DMPlexCeedComputeGeometryFVM() 401 off += cdim; in DMPlexCeedComputeGeometryFVM() 405 PetscCall(DMPlexComputeCellGeometryFVM(dm, supp[s], &qdata[off + s], centroids[s], NULL)); in DMPlexCeedComputeGeometryFVM() 411 qdata[off + s] = qdata[off + (1 - s)]; in DMPlexCeedComputeGeometryFVM() 416 CeedScalar *normal = &qdata[off - cdim]; in DMPlexCeedComputeGeometryFVM() 431 off += suppSize; in DMPlexCeedComputeGeometryFVM()
|
| H A D | plexpartition.c | 83 PetscInt adjSize = PETSC_DETERMINE, a, off = vOffsets[v]; in DMPlexCreatePartitionerGraph_Overlap() local 90 …if (point != c && cStart <= point && point < cEnd) vAdj[off++] = DMPlex_GlobalID(cellNum[point - c… in DMPlexCreatePartitionerGraph_Overlap() 92 …PetscCheck(off == vOffsets[v + 1], PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Offsets %" PetscInt_FMT … in DMPlexCreatePartitionerGraph_Overlap() 94 PetscCall(PetscSortInt(off - vOffsets[v], &vAdj[vOffsets[v]])); in DMPlexCreatePartitionerGraph_Overlap() 549 PetscInt *off, *adj; in DMPlexCreateNeighborCSR() local 570 PetscCall(PetscCalloc1(numCells + 1, &off)); in DMPlexCreateNeighborCSR() 583 ++off[support[0] - cStart + 1]; in DMPlexCreateNeighborCSR() 584 ++off[support[1] - cStart + 1]; in DMPlexCreateNeighborCSR() 589 for (c = 1; c <= numCells; ++c) off[c] += off[c - 1]; in DMPlexCreateNeighborCSR() 593 PetscCall(PetscMalloc1(off[numCells], &adj)); in DMPlexCreateNeighborCSR() [all …]
|
| H A D | plex.c | 938 PetscInt point = closure[cl], depth, dof, off, d, p; in DMPlexView_Ascii_Geometry() local 944 PetscCall(PetscSectionGetOffset(coordSection, point, &off)); in DMPlexView_Ascii_Geometry() 950 … PetscCall(PetscViewerASCIIPrintf(viewer, "%g", (double)PetscRealPart(a[off + p * dim + d]))); in DMPlexView_Ascii_Geometry() 1045 PetscInt dof, off, s; in DMPlexView_Ascii() local 1048 PetscCall(PetscSectionGetOffset(mesh->supportSection, p, &off)); in DMPlexView_Ascii() 1049 …for (s = off; s < off + dof; ++s) PetscCall(PetscViewerASCIISynchronizedPrintf(viewer, "[%d]: %" P… in DMPlexView_Ascii() 1055 PetscInt dof, off, c; in DMPlexView_Ascii() local 1058 PetscCall(PetscSectionGetOffset(mesh->coneSection, p, &off)); in DMPlexView_Ascii() 1059 …for (c = off; c < off + dof; ++c) PetscCall(PetscViewerASCIISynchronizedPrintf(viewer, "[%d]: %" P… in DMPlexView_Ascii() 1089 PetscInt dof, off; in DMPlexView_Ascii() local [all …]
|
| /petsc/src/binding/petsc4py/demo/legacy/dmplex/ |
| H A D | anisotropic_adaptation.py | 57 off = csec.getOffset(v) variable 58 x = pcoords[off] 59 y = pcoords[off+1] 60 pf[off//dim] = sensor(x, y)
|
| /petsc/src/ksp/pc/impls/tfs/ |
| H A D | xyt.c | 226 PetscInt off, len; in xyt_generate() local 359 off = *iptr++; in xyt_generate() 362 PetscCallBLAS("BLASdot", uu[k] = BLASdot_(&dlen, u + off, &i1, y_ptr, &i1)); in xyt_generate() 374 off = *iptr++; in xyt_generate() 377 PetscCallBLAS("BLASaxpy", BLASaxpy_(&dlen, &uu[k], x_ptr, &i1, z + off, &i1)); in xyt_generate() 409 off = len = 0; in xyt_generate() 414 off = k; in xyt_generate() 420 len -= (off - 1); in xyt_generate() 433 PetscCall(PCTFS_rvec_copy(x_ptr, v + off, len)); in xyt_generate() 435 xcol_indices[2 * i] = off; in xyt_generate() [all …]
|
| H A D | xxt.c | 173 PetscInt off, len; in xxt_generate() local 290 off = *iptr++; in xxt_generate() 293 PetscCallBLAS("BLASdot", uu[k] = BLASdot_(&dlen, u + off, &i1, x_ptr, &i1)); in xxt_generate() 305 off = *iptr++; in xxt_generate() 308 PetscCallBLAS("BLASaxpy", BLASaxpy_(&dlen, &uu[k], x_ptr, &i1, z + off, &i1)); in xxt_generate() 339 off = len = 0; in xxt_generate() 344 off = k; in xxt_generate() 350 len -= (off - 1); in xxt_generate() 363 PetscCall(PCTFS_rvec_copy(x_ptr, v + off, len)); in xxt_generate() 365 col_indices[2 * i] = off; in xxt_generate() [all …]
|
| /petsc/include/petsc/private/ |
| H A D | hashmap.h | 303 …static inline PETSC_UNUSED PetscErrorCode Petsc##HashT##GetKeys(Petsc##HashT ht, PetscInt *off, Ke… 309 PetscAssertPointer(off, 2); \ 310 pos = *off; \ 312 *off = pos; \ 316 …static inline PETSC_UNUSED PetscErrorCode Petsc##HashT##GetVals(Petsc##HashT ht, PetscInt *off, Va… 322 PetscAssertPointer(off, 2); \ 323 pos = *off; \ 325 *off = pos; \ 329 …static inline PETSC_UNUSED PetscErrorCode Petsc##HashT##GetPairs(Petsc##HashT ht, PetscInt *off, K… 336 PetscAssertPointer(off, 2); \ [all …]
|
| H A D | hashset.h | 194 …static inline PETSC_UNUSED PetscErrorCode Petsc##HashT##GetElems(Petsc##HashT ht, PetscInt *off, K… 200 …aticAnalyzerForExpressionUnderstandingThatThisIsDangerousAndBugprone(PetscAssertPointer(off, 2)); \ 201 pos = *off; \ 203 *off = pos; \
|
| /petsc/src/vec/is/is/impls/general/ |
| H A D | general.c | 200 static PetscErrorCode ISFindRun_Private(const PetscInt indices[], PetscInt len, PetscInt off, Petsc… in ISFindRun_Private() argument 202 PetscInt o = off, s, l; in ISFindRun_Private() 207 if (len - off < PetscMax(minRunLen, 2)) PetscFunctionReturn(PETSC_SUCCESS); in ISFindRun_Private() 217 if (val) *val = indices[off]; in ISFindRun_Private() 226 PetscInt n, off = 0; in ISGeneralCheckCompress() local 234 while (off < n) { in ISGeneralCheckCompress() 237 PetscCall(ISFindRun_Private(idx, n, off, minRun, &len, NULL, NULL)); in ISGeneralCheckCompress() 242 off += len; in ISGeneralCheckCompress() 255 PetscInt off = 0; in ISGeneralCompress() local 266 while (off < n) { in ISGeneralCompress() [all …]
|
| /petsc/src/sys/fileio/ |
| H A D | sysio.c | 564 PetscErrorCode PetscBinarySeek(int fd, off_t off, PetscBinarySeekType whence, off_t *offset) in PetscBinarySeek() argument 574 *offset = lseek(fd, off, iwhence); in PetscBinarySeek() 576 *offset = _lseek(fd, (long)off, iwhence); in PetscBinarySeek() 722 PetscErrorCode PetscBinarySynchronizedSeek(MPI_Comm comm, int fd, off_t off, PetscBinarySeekType wh… in PetscBinarySynchronizedSeek() argument 728 if (rank == 0) PetscCall(PetscBinarySeek(fd, off, whence, offset)); in PetscBinarySynchronizedSeek() 811 PetscErrorCode MPIU_File_write_at(MPI_File fd, MPI_Offset off, void *data, PetscMPIInt cnt, MPI_Dat… in MPIU_File_write_at() argument 818 PetscCallMPI(MPI_File_write_at(fd, off, data, cnt, dtype, status)); in MPIU_File_write_at() 823 PetscErrorCode MPIU_File_read_at(MPI_File fd, MPI_Offset off, void *data, PetscMPIInt cnt, MPI_Data… in MPIU_File_read_at() argument 829 PetscCallMPI(MPI_File_read_at(fd, off, data, cnt, dtype, status)); in MPIU_File_read_at() 834 PetscErrorCode MPIU_File_write_at_all(MPI_File fd, MPI_Offset off, void *data, PetscMPIInt cnt, MPI… in MPIU_File_write_at_all() argument [all …]
|
| /petsc/src/tao/unconstrained/tutorials/ |
| H A D | convergencestudy.m | 7 hold off 34 hold off 72 hold off
|
| /petsc/src/dm/impls/plex/transform/interface/ |
| H A D | plextransform.c | 17 PetscInt d, c, off = 0; in DMPlexCreateCellTypeOrder_Internal() local 27 off = 4 - dim; in DMPlexCreateCellTypeOrder_Internal() 28 dimOrder[off++] = 0; in DMPlexCreateCellTypeOrder_Internal() 29 for (d = dim - 1; d > 0; --d) dimOrder[off++] = d; in DMPlexCreateCellTypeOrder_Internal() 32 off = 0; in DMPlexCreateCellTypeOrder_Internal() 36 if (DMPolytopeTypeGetDim((DMPolytopeType)c) == dimOrder[d]) ctO[off++] = c; in DMPlexCreateCellTypeOrder_Internal() 40 if (c == DM_POLYTOPE_UNKNOWN_CELL || c == DM_POLYTOPE_UNKNOWN_FACE) ctO[off++] = c; in DMPlexCreateCellTypeOrder_Internal() 42 ctO[off++] = DM_NUM_POLYTOPES; in DMPlexCreateCellTypeOrder_Internal() 43 …PetscCheck(off == DM_NUM_POLYTOPES + 1, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Invalid offset %" PetscI… in DMPlexCreateCellTypeOrder_Internal() 446 PetscInt c, cN, *off; in DMPlexTransformCreateOffset_Internal() local [all …]
|