Lines Matching defs:depth
127 PetscInt cdim, pStart, pEnd, vStart, vEnd, cStart, cEnd, c, depth, cellHeight, t;
146 PetscCall(DMPlexGetDepth(dm, &depth));
157 if (dep != depth - cellHeight) continue;
938 PetscInt point = closure[cl], depth, dof, off, d, p;
943 PetscCall(DMLabelGetValue(depthLabel, point, &depth));
945 PetscCall(PetscViewerASCIIPrintf(viewer, "%s %" PetscInt_FMT " coords:", name[depth], point));
1123 PetscCall(PetscStrcmp(name, "depth", &isdepth));
1147 PetscInt numLabels, l, numColors, numLColors, dim, d, depth, cStart, cEnd, c, vStart, vEnd, v, eStart = 0, eEnd = 0, fStart = 0, fEnd = 0, e, p, n;
1161 PetscCall(DMPlexGetDepth(dm, &depth));
1191 plotEdges = (PetscBool)(depth > 1 && drawNumbers[1] && dim < 3);
1193 PetscCheck(!flg || !plotEdges || depth >= dim, PetscObjectComm((PetscObject)dm), PETSC_ERR_SUP, "Mesh must be interpolated");
1194 if (depth < dim) plotEdges = PETSC_FALSE;
1459 if (drawHasse) color = colors[depth % numColors];
1479 color = colors[depth % numColors];
1486 if (depth > 2) {
1631 PetscInt locDepth, depth, cellHeight, dim, d;
1648 PetscCallMPI(MPIU_Allreduce(&locDepth, &depth, 1, MPIU_INT, MPI_MAX, comm));
1653 for (d = 0; d <= depth; d++) {
1671 if (d == depth) PetscCallMPI(MPI_Gather(&gcNum, 1, MPIU_INT, ghostsizes, 1, MPIU_INT, 0, comm));
1672 PetscCall(PetscViewerASCIIPrintf(viewer, " Number of %" PetscInt_FMT "-cells per rank:", (depth == 1) && d ? dim : d));
1689 if (d == depth) {
1694 PetscCall(PetscViewerASCIIPrintf(viewer, " Min/Max of %" PetscInt_FMT "-cells per rank:", (depth == 1) && d ? dim : d));
3267 Like `DMPlexGetConeRecursive()` but returns only the 0-depth `IS` (i.e. vertices only) and no sections.
3277 PetscInt depth;
3283 PetscCall(DMPlexGetConeRecursive(dm, points, &depth, &expandedPointsAll, NULL));
3286 PetscCall(DMPlexRestoreConeRecursive(dm, points, &depth, &expandedPointsAll, NULL));
3292 (DAG points of depth 0, i.e., without cones).
3301 + depth - (optional) Size of the output arrays, equal to `DMPLEX` depth, returned by `DMPlexGetDepth()`
3310 Array `expandedPoints` has size equal to `depth`. Each `expandedPoints`[d] contains DAG points with maximum depth d, recursively cone-wise expanded from the input points.
3313 Array section has size equal to `depth`. Each `PetscSection` `sections`[d] realizes mapping from `expandedPoints`[d+1] (section points) to `expandedPoints`[d] (section dofs) as follows\:
3314 (1) DAG points in `expandedPoints`[d+1] with `depth` d+1 to their cone points in `expandedPoints`[d];
3315 (2) DAG points in `expandedPoints`[d+1] with `depth` in [0,d] to the same points in `expandedPoints`[d].
3320 PetscErrorCode DMPlexGetConeRecursive(DM dm, IS points, PeOp PetscInt *depth, PeOp IS *expandedPoints[], PeOp PetscSection *sections[])
3331 if (depth) PetscAssertPointer(depth, 3);
3370 *depth = depth_;
3394 + depth - (optional) Size of the output arrays, equal to `DMPLEX` depth, returned by `DMPlexGetDepth()`
3406 PetscErrorCode DMPlexRestoreConeRecursive(DM dm, IS points, PeOp PetscInt *depth, PeOp IS *expandedPoints[], PeOp PetscSection *sections[])
3412 PetscCheck(!depth || *depth == depth_, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "depth changed since last call to DMPlexGetConeRecursive");
3413 if (depth) *depth = 0;
4136 PetscInt depth, maxSize;
4139 PetscCall(DMPlexGetDepth(dm, &depth));
4140 if (depth == 1) {
4151 coneSeries = (maxConeSize > 1) ? ((PetscPowInt(maxConeSize, depth + 1) - 1) / (maxConeSize - 1)) : depth + 1;
4152 supportSeries = (maxSupportSize > 1) ? ((PetscPowInt(maxSupportSize, depth + 1) - 1) / (maxSupportSize - 1)) : depth + 1;
4163 /* Should kick out early when depth is reached, rather than checking all vertices for empty cones */
4429 static PetscErrorCode DMPlexCreateDepthStratum(DM dm, DMLabel label, PetscInt depth, PetscInt pStart, PetscInt pEnd)
4446 PetscCheck(!overlap, PETSC_COMM_SELF, PETSC_ERR_PLIB, "New depth %" PetscInt_FMT " range [%" PetscInt_FMT ",%" PetscInt_FMT ") overlaps with depth %" PetscInt_FMT " range [%" PetscInt_FMT ",%" PetscInt_FMT ")", depth, pStart, pEnd, level, qStart, qEnd);
4449 PetscCall(DMLabelSetStratumIS(label, depth, stratumIS));
4582 grade can be seen as the height (or depth) of the point in the DAG.
4586 Concretely, `DMPlexStratify()` creates a new label named "depth" containing the depth in the DAG of each point. For cell-vertex
4587 meshes, vertices are depth 0 and cells are depth 1. For fully interpolated meshes, depth 0 for vertices, 1 for edges, and so on
4588 until cells have depth equal to the dimension of the mesh. The depth label can be accessed through `DMPlexGetDepthLabel()` or `DMPlexGetDepthStratum()`, or
4589 manually via `DMGetLabel()`. The height is defined implicitly by height = maxDimension - depth, and can be accessed
4592 The depth of a point is calculated by executing a breadth-first search (BFS) on the DAG. This could produce surprising results
4602 depth 0 = {v0, v1, v2}
4603 depth 1 = {e0, c0}
4605 where the triangle has been given depth 1, instead of 2, because it is reachable from vertex v2.
4621 // Create depth label
4622 PetscCall(DMRemoveLabel(dm, "depth", NULL));
4623 PetscCall(DMCreateLabel(dm, "depth"));
4645 PetscInt dim, depth, pheight, coneSize;
4650 PetscCall(DMPlexGetDepth(dm, &depth));
4653 pheight = depth - pdepth;
4654 if (depth <= 1) {
4953 PetscInt depth = 0, maxSize, joinSize = 0, i = 0;
4962 PetscCall(DMPlexGetDepth(dm, &depth));
4964 PetscCall(DMGetWorkArray(dm, numPoints * (depth + 2), MPIU_INT, &offsets));
4966 maxSize = (ms > 1) ? ((PetscPowInt(ms, depth + 1) - 1) / (ms - 1)) : depth + 1;
4975 offsets[p * (depth + 2) + 0] = 0;
4976 for (d = 0; d < depth + 1; ++d) {
4980 for (i = offsets[p * (depth + 2) + d]; i < closureSize; ++i) {
4982 offsets[p * (depth + 2) + d + 1] = i;
4986 if (i == closureSize) offsets[p * (depth + 2) + d + 1] = i;
4988 PetscCheck(offsets[p * (depth + 2) + depth + 1] == closureSize, PetscObjectComm((PetscObject)dm), PETSC_ERR_PLIB, "Total size of closure %" PetscInt_FMT " should be %" PetscInt_FMT, offsets[p * (depth + 2) + depth + 1], closureSize);
4990 for (d = 0; d < depth + 1; ++d) {
5000 dof = offsets[p * (depth + 2) + d + 1] - offsets[p * (depth + 2) + d];
5002 const PetscInt point = closures[p][(offsets[p * (depth + 2) + d] + c) * 2];
5020 PetscCall(DMRestoreWorkArray(dm, numPoints * (depth + 2), MPIU_INT, &offsets));
5248 PetscInt depth, depthB, pStart, pEnd, pStartB, pEndB, p;
5256 PetscCall(DMPlexGetDepth(dmA, &depth));
5258 if (depth != depthB) PetscFunctionReturn(PETSC_SUCCESS);
5379 DMPlexGetDepthLabel - Get the `DMLabel` recording the depth of each point
5387 . depthLabel - The `DMLabel` recording point depth
5403 DMPlexGetDepth - Get the depth of the DAG representing this mesh
5411 . depth - The number of strata (breadth first levels) in the DAG
5418 The point depth is described more in detail in `DMPlexGetDepthStratum()`.
5424 PetscErrorCode DMPlexGetDepth(DM dm, PetscInt *depth)
5432 PetscAssertPointer(depth, 2);
5434 PetscCall(DMPlexTransformGetDepth(mesh->tr, depth));
5439 *depth = d;
5445 DMPlexGetDepthStratum - Get the bounds [`start`, `end`) for all points at a certain depth.
5451 - depth - The requested depth
5454 + start - The first point at this `depth`
5455 - end - One beyond the last point at this `depth`
5461 often "vertices". If the mesh is "interpolated" (see `DMPlexInterpolate()`), then depth stratum 1 contains the next
5466 PetscErrorCode DMPlexGetDepthStratum(DM dm, PetscInt depth, PeOp PetscInt *start, PeOp PetscInt *end)
5484 if (depth < 0) {
5490 PetscCall(DMPlexTransformGetDepthStratum(mesh->tr, depth, start, end));
5493 PetscCheck(label, PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_WRONG, "No label named depth was found");
5494 PetscCall(DMLabelGetStratumBounds(label, depth, start, end));
5524 PetscInt depth, pStart, pEnd;
5544 if (label) PetscCall(DMLabelGetNumValues(label, &depth));
5545 else PetscCall(DMGetDimension(dm, &depth));
5546 PetscCheck(depth >= 0, PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_WRONG, "Depth not yet computed");
5547 PetscCall(DMPlexGetDepthStratum(dm, depth - 1 - height, start, end));
5552 DMPlexGetPointDepth - Get the `depth` of a given point
5561 . depth - The depth of the `point`
5567 PetscErrorCode DMPlexGetPointDepth(DM dm, PetscInt point, PetscInt *depth)
5571 PetscAssertPointer(depth, 3);
5572 PetscCall(DMLabelGetValue(dm->depthLabel, point, depth));
5601 *height = n - 1 - pDepth; /* DAG depth is n-1 */
5899 PetscInt depth;
5902 PetscCall(DMPlexGetDepth(plex, &depth));
5903 PetscCall(DMGetStratumIS(plex, "dim", depth, cellIS));
5904 if (!*cellIS) PetscCall(DMGetStratumIS(plex, "depth", depth, cellIS));
5910 PetscInt depth;
5913 PetscCall(DMPlexGetDepth(plex, &depth));
5914 PetscCall(DMGetStratumIS(plex, "dim", depth - 1, faceIS));
5915 if (!*faceIS) PetscCall(DMGetStratumIS(plex, "depth", depth - 1, faceIS));
6039 PetscInt dim, depth = -1, eStart = -1, Nf;
6052 if (point >= 0) PetscCall(DMLabelGetValue(label, point, &depth));
6054 if (depth == 1) {
6056 } else if (depth == dim) {
6065 } else SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Point %" PetscInt_FMT " of depth %" PetscInt_FMT " cannot be used to bootstrap spectral ordering for dim %" PetscInt_FMT, point, depth, dim);
6066 } else PetscCheck(depth < 0, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Point %" PetscInt_FMT " of depth %" PetscInt_FMT " cannot be used to bootstrap spectral ordering for dim %" PetscInt_FMT, point, depth, dim);
6315 PetscInt depth, Nf, h;
6330 PetscCall(DMLabelGetNumValues(label, &depth));
6332 h = depth - 1 - h;
6616 PetscInt depth, numFields, numPoints, asize;
6623 PetscCall(DMPlexGetDepth(dm, &depth));
6625 if (depth == 1 && numFields < 2) {
6645 if (useClPerm) PetscCall(PetscSectionGetClosureInversePermutation_Internal(section, (PetscObject)dm, depth, asize, &perm));
6680 To get only the values in the closure of a mesh point at a specific depth (for example, at mesh vertices), use `DMPlexVecGetClosureAtDepth()`.
6728 DMPlexVecGetClosureAtDepth - Get an array of the values on the closure of 'point' that are at a specific depth
6736 . depth - The depth of mesh points that should be returned
6748 For example, to get only the values at mesh vertices, pass `depth=0`. To get all the values in the closure of a mesh point, use `DMPlexVecGetClosure()`.
6757 PetscCall(DMPlexVecGetClosureAtDepth(dm, NULL, v, p, depth, &clSize, &values));
6768 PetscCall(DMPlexVecGetClosureAtDepth(dm, NULL, v, p, depth, &clSize, &values));
6788 PetscErrorCode DMPlexVecGetClosureAtDepth(DM dm, PetscSection section, Vec v, PetscInt point, PetscInt depth, PetscInt *csize, PetscScalar *values[])
6818 PetscCall(PetscSectionGetClosureInversePermutation_Internal(section, (PetscObject)dm, depth, clsize, &perm));
6824 if (dep != depth) continue;
7301 PetscInt depth, numFields, numPoints, p, clsize;
7308 PetscCall(DMPlexGetDepth(dm, &depth));
7310 if (depth == 1 && numFields < 2 && mode == ADD_VALUES) {
7321 PetscCall(PetscSectionGetClosureInversePermutation_Internal(section, (PetscObject)dm, depth, clsize, &clperm));
8187 PetscInt depth, clsize;
8188 PetscCall(DMPlexGetPointDepth(dm, point, &depth));
8194 PetscCall(PetscSectionGetClosureInversePermutation_Internal(section, (PetscObject)dm, depth, clsize, &clperm));
8953 DMPlexGetDepthStratumGlobalSize - Get the global size for a given depth stratum
8957 - depth - The depth for the given point stratum
8966 PetscErrorCode DMPlexGetDepthStratumGlobalSize(DM dm, PetscInt depth, PetscInt *gsize)
8975 PetscCall(DMPlexGetDepthStratum(dm, depth, &start, &end));
9146 PetscInt depth, d, shift = 0;
9151 PetscCall(DMPlexGetDepth(dm, &depth));
9152 // For unstratified meshes use dim instead of depth
9153 if (depth < 0) PetscCall(DMGetDimension(dm, &depth));
9155 for (d = 0; d <= depth; ++d) {
9158 depths[d] = depth - d;
9163 for (d = 0; d <= depth; ++d) {
9167 else PetscCall(PetscSortIntWithArray(depth + 1, starts, depths));
9168 PetscCallMPI(MPIU_Allreduce(depths, gdepths, depth + 1, MPIU_INT, MPI_MAX, PetscObjectComm((PetscObject)dm)));
9169 for (d = 0; d <= depth; ++d) PetscCheck(starts[d] < 0 || depths[d] == gdepths[d], PETSC_COMM_SELF, PETSC_ERR_PLIB, "Expected depth %" PetscInt_FMT ", found %" PetscInt_FMT, depths[d], gdepths[d]);
9170 // Note here that 'shift' is collective, so that the numbering is stratified by depth
9171 for (d = 0; d <= depth; ++d) {
9178 PetscCall(ISConcatenate(PETSC_COMM_SELF, depth + 1, nums, globalPointNumbers));
9179 for (d = 0; d <= depth; ++d) PetscCall(ISDestroy(&nums[d]));
9563 PetscInt dim, depth, vStart, vEnd, cStart, cEnd, c, h;
9576 PetscCall(DMPlexGetDepth(dm, &depth));
9578 for (h = cellHeight; h < PetscMin(depth, dim); ++h) {
9653 PetscInt dim, depth, dE, d, cStart, cEnd, c;
9659 PetscCall(DMPlexGetDepth(dm, &depth));
9695 if (depth > 1) {
10381 PetscInt depth;
10392 PetscCall(DMPlexGetDepth(dm, &depth));
10393 PetscCall(DMGetStratumIS(dm, "depth", depth, &cellIS));
10429 PetscInt depth;
10439 PetscCall(DMPlexGetDepth(dmc, &depth));
10440 PetscCall(DMGetStratumIS(dmc, "depth", depth, &cellIS));
10495 PetscInt depth, Nf;
10505 PetscCall(DMPlexGetDepth(ndmr, &depth));
10506 PetscCall(DMGetStratumIS(ndmr, "depth", depth, &cellIS));