Lines Matching defs:point
109 // Check that a point has the right height
938 PetscInt point = closure[cl], depth, dof, off, d, p;
940 if ((point < pStart) || (point >= pEnd)) continue;
941 PetscCall(PetscSectionGetDof(coordSection, point, &dof));
943 PetscCall(DMLabelGetValue(depthLabel, point, &depth));
944 PetscCall(PetscSectionGetOffset(coordSection, point, &off));
945 PetscCall(PetscViewerASCIIPrintf(viewer, "%s %" PetscInt_FMT " coords:", name[depth], point));
1281 /* Rotate coordinates since PGF makes z point out of the page instead of up */
1330 /* Rotate coordinates since PGF makes z point out of the page instead of up */
1399 const PetscInt point = closure[p];
1401 if ((point >= vStart) && (point < vEnd)) closure[Nv++] = point;
1445 /* Rotate coordinates since PGF makes z point out of the page instead of up */
2610 This function is a wrapper around `PetscSectionLoad()`; it loads, in addition to the raw section, a list of global point numbers that associates each on-disk section point with a global point number in [0, NX), where NX is the number of topology points in `dm`. Noting that globalToLocalPointSF associates each topology point in dm with a global number in [0, NX), one can readily establish an association of the on-disk section points with the topology points.
2629 sectionA's global point numbers: 0 2 | 3 <- loaded in DMPlexSectionLoad()
2631 sectionB's global point numbers: 0 1 3 | 3 2 <- associated with [0, NX) by globalToLocalPointSF
2637 where "|" represents a partition of loaded data, and global point 3 is assumed to be owned by rank 0.
2941 for (PetscInt point = pStart; point < pEnd; ++point) {
2942 const PetscInt p = perm ? perm[point] : point;
2945 case DM_BLOCKING_TOPOLOGICAL_POINT: { // One block per topological point
3078 + pStart - The first mesh point
3103 . pStart - The first mesh point
3123 DMPlexGetConeSize - Return the number of in-edges for this point in the DAG
3129 - p - The point, which must lie in the chart set with `DMPlexSetChart()`
3132 . size - The cone size for point `p`
3151 DMPlexSetConeSize - Set the number of in-edges for this point in the DAG
3157 . p - The point, which must lie in the chart set with `DMPlexSetChart()`
3158 - size - The cone size for point `p`
3179 DMPlexGetCone - Return the points on the in-edges for this point in the DAG
3185 - p - The point, which must lie in the chart set with `DMPlexSetChart()`
3188 . cone - An array of points which are on the in-edges for point `p`, the length of `cone` is the result of `DMPlexGetConeSize()`
3227 - pCones - An `IS` containing the points which are on the in-edges for the point set `p`
3253 DMPlexGetConeRecursiveVertices - Expand each given point into its cone points and do that recursively until we end up just with vertices.
3291 DMPlexGetConeRecursive - Expand each given point into its cone points and do that recursively until we end up just with vertices
3426 DMPlexSetCone - Set the points on the in-edges for this point in the DAG; that is these are the points that cover the specific point
3432 . p - The point, which must lie in the chart set with `DMPlexSetChart()`
3433 - cone - An array of points which are on the in-edges for point `p`, its length must have been previously provided with `DMPlexSetConeSize()`
3455 PetscCheck(!(p < pStart) && !(p >= pEnd), PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_OUTOFRANGE, "Mesh point %" PetscInt_FMT " is not in the valid range [%" PetscInt_FMT ", %" PetscInt_FMT ")", p, pStart, pEnd);
3457 PetscCheck(!(cone[c] < pStart) && !(cone[c] >= pEnd), PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_OUTOFRANGE, "Cone point %" PetscInt_FMT " is not in the valid range [%" PetscInt_FMT ", %" PetscInt_FMT ")", cone[c], pStart, pEnd);
3467 DMPlexGetConeOrientation - Return the orientations on the in-edges for this point in the DAG
3473 - p - The point, which must lie in the chart set with `DMPlexSetChart()`
3476 . coneOrientation - An array of orientations which are on the in-edges for point `p`. An orientation is an
3513 DMPlexSetConeOrientation - Set the orientations on the in-edges for this point in the DAG
3519 . p - The point, which must lie in the chart set with `DMPlexSetChart()`
3544 PetscCheck(!(p < pStart) && !(p >= pEnd), PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_OUTOFRANGE, "Mesh point %" PetscInt_FMT " is not in the valid range [%" PetscInt_FMT ", %" PetscInt_FMT ")", p, pStart, pEnd);
3559 DMPlexInsertCone - Insert a point into the in-edges for the point p in the DAG
3565 . p - The point, which must lie in the chart set with `DMPlexSetChart()`
3566 . conePos - The local index in the cone where the point should be put
3567 - conePoint - The mesh point to insert
3583 PetscCheck(!(p < pStart) && !(p >= pEnd), PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_OUTOFRANGE, "Mesh point %" PetscInt_FMT " is not in the valid range [%" PetscInt_FMT ", %" PetscInt_FMT ")", p, pStart, pEnd);
3584 PetscCheck(!(conePoint < pStart) && !(conePoint >= pEnd), PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_OUTOFRANGE, "Cone point %" PetscInt_FMT " is not in the valid range [%" PetscInt_FMT ", %" PetscInt_FMT ")", conePoint, pStart, pEnd);
3586 PetscCheck(!(conePos < 0) && !(conePos >= dof), PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_OUTOFRANGE, "Cone position %" PetscInt_FMT " of point %" PetscInt_FMT " is not in the valid range [0, %" PetscInt_FMT ")", conePos, p, dof);
3594 DMPlexInsertConeOrientation - Insert a point orientation for the in-edge for the point p in the DAG
3600 . p - The point, which must lie in the chart set with `DMPlexSetChart()`
3601 . conePos - The local index in the cone where the point should be put
3602 - coneOrientation - The point orientation to insert
3621 PetscCheck(!(p < pStart) && !(p >= pEnd), PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_OUTOFRANGE, "Mesh point %" PetscInt_FMT " is not in the valid range [%" PetscInt_FMT ", %" PetscInt_FMT ")", p, pStart, pEnd);
3623 PetscCheck(!(conePos < 0) && !(conePos >= dof), PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_OUTOFRANGE, "Cone position %" PetscInt_FMT " of point %" PetscInt_FMT " is not in the valid range [0, %" PetscInt_FMT ")", conePos, p, dof);
3631 DMPlexGetOrientedCone - Return the points and orientations on the in-edges for this point in the DAG
3637 - p - The point, which must lie in the chart set with DMPlexSetChart()
3640 + cone - An array of points which are on the in-edges for point `p`
3641 - ornt - An array of orientations which are on the in-edges for point `p`. An orientation is an
3689 DMPlexRestoreOrientedCone - Restore the points and orientations on the in-edges for this point in the DAG obtained with `DMPlexGetOrientedCone()`
3695 . p - The point, which must lie in the chart set with `DMPlexSetChart()`
3696 . cone - An array of points which are on the in-edges for point p
3697 - ornt - An array of orientations which are on the in-edges for point `p`. An orientation is an
3715 DMPlexGetSupportSize - Return the number of out-edges for this point in the DAG
3721 - p - The point, which must lie in the chart set with `DMPlexSetChart()`
3724 . size - The support size for point `p`
3742 DMPlexSetSupportSize - Set the number of out-edges for this point in the DAG
3748 . p - The point, which must lie in the chart set with `DMPlexSetChart()`
3749 - size - The support size for point `p`
3769 DMPlexGetSupport - Return the points on the out-edges for this point in the DAG
3775 - p - The point, which must lie in the chart set with `DMPlexSetChart()`
3778 . support - An array of points which are on the out-edges for point `p`, its length is that obtained from `DMPlexGetSupportSize()`
3807 DMPlexSetSupport - Set the points on the out-edges for this point in the DAG, that is the list of points that this point covers
3813 . p - The point, which must lie in the chart set with `DMPlexSetChart()`
3814 - support - An array of points which are on the out-edges for point `p`, its length is that obtained from `DMPlexGetSupportSize()`
3835 PetscCheck(!(p < pStart) && !(p >= pEnd), PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_OUTOFRANGE, "Mesh point %" PetscInt_FMT " is not in the valid range [%" PetscInt_FMT ", %" PetscInt_FMT ")", p, pStart, pEnd);
3837 PetscCheck(!(support[c] < pStart) && !(support[c] >= pEnd), PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_OUTOFRANGE, "Support point %" PetscInt_FMT " is not in the valid range [%" PetscInt_FMT ", %" PetscInt_FMT ")", support[c], pStart, pEnd);
3844 DMPlexInsertSupport - Insert a point into the out-edges for the point p in the DAG
3850 . p - The point, which must lie in the chart set with `DMPlexSetChart()`
3851 . supportPos - The local index in the cone where the point should be put
3852 - supportPoint - The mesh point to insert
3869 PetscCheck(!(p < pStart) && !(p >= pEnd), PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_OUTOFRANGE, "Mesh point %" PetscInt_FMT " is not in the valid range [%" PetscInt_FMT ", %" PetscInt_FMT ")", p, pStart, pEnd);
3870 PetscCheck(!(supportPoint < pStart) && !(supportPoint >= pEnd), PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_OUTOFRANGE, "Support point %" PetscInt_FMT " is not in the valid range [%" PetscInt_FMT ", %" PetscInt_FMT ")", supportPoint, pStart, pEnd);
3871 PetscCheck(supportPos < dof, PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_OUTOFRANGE, "Support position %" PetscInt_FMT " of point %" PetscInt_FMT " is not in the valid range [0, %" PetscInt_FMT ")", supportPos, p, dof);
4061 static PetscErrorCode DMPlexTransitiveClosure_Tensor_Internal(DM dm, PetscInt point, DMPolytopeType ct, PetscInt o, PetscBool useCone, PetscInt *numPoints, PetscInt **points)
4072 PetscCall(DMPlexGetTransitiveClosure_Hot_Private(dm, point, PETSC_TRUE, &coneSize, &cone, &ornt));
4081 pts[c++] = point;
4100 PetscCall(DMPlexRestoreTransitiveClosure_Hot_Private(dm, point, PETSC_TRUE, &coneSize, &cone, &ornt));
4206 DMPlexGetTransitiveClosure - Return the points on the transitive closure of the in-edges or out-edges for this point in the DAG
4212 . p - The mesh point
4216 . points - The points and point orientations, interleaved as pairs [p0, o0, p1, o1, ...];
4255 DMPlexRestoreTransitiveClosure - Restore the array of points on the transitive closure of the in-edges or out-edges for this point in the DAG
4261 . p - The mesh point
4264 - points - The points and point orientations, interleaved as pairs [p0, o0, p1, o1, ...]
4283 DMPlexGetMaxSizes - Return the maximum number of in-edges (cone) and out-edges (support) for any point in the DAG
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
4592 The depth of a point is calculated by executing a breadth-first search (BFS) on the DAG. This could produce surprising results
4859 /* Copy in support of first point */
4870 const PetscInt point = mesh->supports[off + c];
4873 if (point == join[i][m]) {
4874 join[1 - i][newJoinSize++] = point;
4993 /* Copy in support of first point */
5002 const PetscInt point = closures[p][(offsets[p * (depth + 2) + d] + c) * 2];
5005 if (point == join[i][m]) {
5006 join[1 - i][newJoinSize++] = point;
5068 /* Copy in cone of first point */
5079 const PetscInt point = mesh->cones[off + c];
5082 if (point == meet[i][m]) {
5083 meet[1 - i][newMeetSize++] = point;
5195 /* Copy in cone of first point */
5204 const PetscInt point = closures[p][(offsets[p * (height + 2) + h] + c) * 2];
5207 if (point == meet[i][m]) {
5208 meet[1 - i][newMeetSize++] = point;
5379 DMPlexGetDepthLabel - Get the `DMLabel` recording the depth of each point
5387 . depthLabel - The `DMLabel` recording point depth
5416 This returns maximum of point depths over all points, i.e. maximum value of the label returned by `DMPlexGetDepthLabel()`.
5418 The point depth is described more in detail in `DMPlexGetDepthStratum()`.
5454 + start - The first point at this `depth`
5455 - end - One beyond the last point at this `depth`
5509 + start - The first point at this `height`
5510 - end - One beyond the last point at this `height`
5552 DMPlexGetPointDepth - Get the `depth` of a given point
5558 - point - The point
5561 . depth - The depth of the `point`
5567 PetscErrorCode DMPlexGetPointDepth(DM dm, PetscInt point, PetscInt *depth)
5572 PetscCall(DMLabelGetValue(dm->depthLabel, point, depth));
5577 DMPlexGetPointHeight - Get the `height` of a given point
5583 - point - The point
5586 . height - The height of the `point`
5592 PetscErrorCode DMPlexGetPointHeight(DM dm, PetscInt point, PetscInt *height)
5600 PetscCall(DMLabelGetValue(dm->depthLabel, point, &pDepth));
5848 . cones - The cone for each point
5920 Returns number of components and tensor degree for the field. For interpolated meshes, line should be a point
5978 DMPlexSetClosurePermutationTensor - Create a permutation from the default (BFS) point ordering in the closure, to a
5984 . point - Either a cell (highest dim point) or an edge (dim 1 point), or `PETSC_DETERMINE`
6029 The point is used to determine the number of dofs/field on an edge. For SEM, this is related to the polynomial
6036 PetscErrorCode DMPlexSetClosurePermutationTensor(DM dm, PetscInt point, PetscSection section)
6045 if (point < 0) {
6049 point = sEnd - sStart ? sStart : point;
6052 if (point >= 0) PetscCall(DMLabelGetValue(label, point, &depth));
6055 eStart = point;
6059 PetscCall(DMPlexGetCone(dm, point, &cone));
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);
6312 PetscErrorCode DMPlexGetPointDualSpaceFEM(DM dm, PetscInt point, PetscInt field, PetscDualSpace *dspace)
6331 PetscCall(DMLabelGetValue(label, point, &h));
6343 static inline PetscErrorCode DMPlexVecGetClosure_Depth1_Static(DM dm, PetscSection section, Vec v, PetscInt point, PetscInt *csize, PetscScalar *values[])
6352 PetscCall(DMPlexGetConeSize(dm, point, &numPoints));
6353 PetscCall(DMPlexGetCone(dm, point, &cone));
6354 PetscCall(DMPlexGetConeOrientation(dm, point, &coneO));
6356 if ((point >= pStart) && (point < pEnd)) {
6359 PetscCall(PetscSectionGetDof(section, point, &dof));
6380 if ((point >= pStart) && (point < pEnd)) {
6384 PetscCall(PetscSectionGetDof(section, point, &dof));
6385 PetscCall(PetscSectionGetOffset(section, point, &off));
6438 PetscErrorCode DMPlexGetCompressedClosure(DM dm, PetscSection section, PetscInt point, PetscInt ornt, PetscInt *numPoints, PetscInt **points, PetscSection *clSec, IS *clPoints, const PetscInt **clp)
6448 PetscCall(PetscSectionGetDof(*clSec, point, &dof));
6449 PetscCall(PetscSectionGetOffset(*clSec, point, &off));
6454 PetscCall(DMPlexGetTransitiveClosure_Internal(dm, point, ornt, PETSC_TRUE, &np, &pts));
6463 PetscErrorCode DMPlexRestoreCompressedClosure(DM dm, PetscSection section, PetscInt point, PetscInt *numPoints, PetscInt **points, PetscSection *clSec, IS *clPoints, const PetscInt **clp)
6467 PetscCall(DMPlexRestoreTransitiveClosure(dm, point, PETSC_TRUE, numPoints, points));
6489 const PetscInt point = points[2 * p];
6495 PetscCall(PetscSectionGetDof(section, point, &dof));
6496 PetscCall(PetscSectionGetOffset(section, point, &off));
6537 const PetscInt point = points[2 * p];
6543 PetscCall(PetscSectionGetFieldDof(section, point, f, &fdof));
6544 PetscCall(PetscSectionGetFieldOffset(section, point, f, &foff));
6574 DMPlexVecGetOrientedClosure - Get an array of the values on the closure of 'point' with a given orientation, optionally applying the closure permutation.
6583 . point - The point in the `DM`
6610 PetscErrorCode DMPlexVecGetOrientedClosure(DM dm, PetscSection section, PetscBool useClPerm, Vec v, PetscInt point, PetscInt ornt, PetscInt *csize, PetscScalar *values[])
6626 PetscCall(DMPlexVecGetClosure_Depth1_Static(dm, section, v, point, csize, values));
6630 PetscCall(DMPlexGetCompressedClosure(dm, section, point, ornt, &numPoints, &points, &clSection, &clPoints, &clp));
6656 PetscCall(DMPlexRestoreCompressedClosure(dm, section, point, &numPoints, &points, &clSection, &clPoints, &clp));
6661 DMPlexVecGetClosure - Get an array of the values on the closure of 'point'
6669 - point - The point in the `DM`
6679 This is used for getting the all values in a `Vec` in the closure of a mesh point.
6680 To get only the values in the closure of a mesh point at a specific depth (for example, at mesh vertices), use `DMPlexVecGetClosureAtDepth()`.
6720 PetscErrorCode DMPlexVecGetClosure(DM dm, PetscSection section, Vec v, PetscInt point, PetscInt *csize, PetscScalar *values[])
6723 PetscCall(DMPlexVecGetOrientedClosure(dm, section, PETSC_TRUE, v, point, 0, csize, values));
6728 DMPlexVecGetClosureAtDepth - Get an array of the values on the closure of 'point' that are at a specific depth
6737 - point - The point in the `DM`
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()`.
6788 PetscErrorCode DMPlexVecGetClosureAtDepth(DM dm, PetscSection section, Vec v, PetscInt point, PetscInt depth, PetscInt *csize, PetscScalar *values[])
6808 PetscCall(DMPlexVecGetClosure_Depth1_Static(dm, section, v, point, csize, values));
6812 PetscCall(DMPlexGetCompressedClosure(dm, section, point, 0, &numPoints, &points, &clSection, &clPoints, &clp));
6838 PetscCall(DMPlexRestoreCompressedClosure(dm, section, point, &numPoints, &points, &clSection, &clPoints, &clp));
6851 PetscCall(DMPlexRestoreCompressedClosure(dm, section, point, &numPoints, &points, &clSection, &clPoints, &clp));
6865 DMPlexVecRestoreClosure - Restore the array of the values on the closure of 'point' obtained with `DMPlexVecGetClosure()`
6873 . point - The point in the `DM`
6888 PetscErrorCode DMPlexVecRestoreClosure(DM dm, PetscSection section, Vec v, PetscInt point, PetscInt *csize, PetscScalar *values[])
6908 static inline PetscErrorCode updatePoint_private(PetscSection section, PetscInt point, PetscInt dof, void (*fuse)(PetscScalar *, PetscScalar), PetscBool setBC, const PetscInt perm[], const PetscScalar flip[], const PetscInt clperm[], const PetscScalar values[], PetscInt offset, PetscScalar array[])
6910 PetscInt cdof; /* The number of constraints on this point */
6911 const PetscInt *cdofs; /* The indices of the constrained dofs on this point */
6916 PetscCall(PetscSectionGetConstraintDof(section, point, &cdof));
6917 PetscCall(PetscSectionGetOffset(section, point, &off));
6934 PetscCall(PetscSectionGetConstraintIndices(section, point, &cdofs));
6976 static inline PetscErrorCode updatePointBC_private(PetscSection section, PetscInt point, PetscInt dof, void (*fuse)(PetscScalar *, PetscScalar), const PetscInt perm[], const PetscScalar flip[], const PetscInt clperm[], const PetscScalar values[], PetscInt offset, PetscScalar array[])
6978 PetscInt cdof; /* The number of constraints on this point */
6979 const PetscInt *cdofs; /* The indices of the constrained dofs on this point */
6984 PetscCall(PetscSectionGetConstraintDof(section, point, &cdof));
6985 PetscCall(PetscSectionGetOffset(section, point, &off));
6988 PetscCall(PetscSectionGetConstraintIndices(section, point, &cdofs));
7026 static inline PetscErrorCode updatePointFields_private(PetscSection section, PetscInt point, const PetscInt *perm, const PetscScalar *flip, PetscInt f, void (*fuse)(PetscScalar *, PetscScalar), PetscBool setBC, const PetscInt clperm[], const PetscScalar values[], PetscInt *offset, PetscScalar array[])
7030 const PetscInt *fcdofs; /* The indices of the constrained dofs for field f on this point */
7034 PetscCall(PetscSectionGetFieldDof(section, point, f, &fdof));
7035 PetscCall(PetscSectionGetFieldConstraintDof(section, point, f, &fcdof));
7036 PetscCall(PetscSectionGetFieldOffset(section, point, f, &foff));
7053 PetscCall(PetscSectionGetFieldConstraintIndices(section, point, f, &fcdofs));
7096 static inline PetscErrorCode updatePointFieldsBC_private(PetscSection section, PetscInt point, const PetscInt perm[], const PetscScalar flip[], PetscInt f, PetscInt Ncc, const PetscInt comps[], void (*fuse)(PetscScalar *, PetscScalar), const PetscInt clperm[], const PetscScalar values[], PetscInt *offset, PetscScalar array[])
7100 const PetscInt *fcdofs; /* The indices of the constrained dofs for field f on this point */
7106 PetscCall(PetscSectionGetFieldDof(section, point, f, &fdof));
7107 PetscCall(PetscSectionGetFieldConstraintDof(section, point, f, &fcdof));
7108 PetscCall(PetscSectionGetFieldOffset(section, point, f, &foff));
7112 PetscCall(PetscSectionGetFieldConstraintIndices(section, point, f, &fcdofs));
7211 static inline PetscErrorCode DMPlexVecSetClosure_Depth1_Static(DM dm, PetscSection section, Vec v, PetscInt point, const PetscScalar values[], InsertMode mode)
7219 PetscCall(DMPlexGetConeSize(dm, point, &numPoints));
7220 PetscCall(DMPlexGetCone(dm, point, &cone));
7221 PetscCall(DMPlexGetConeOrientation(dm, point, &coneO));
7224 const PetscInt cp = !p ? point : cone[p - 1];
7234 const PetscInt *cdofs; /* The indices of the constrained dofs on this point */
7274 DMPlexVecSetClosure - Set an array of the values on the closure of `point`
7282 . point - The point in the `DM`
7294 PetscErrorCode DMPlexVecSetClosure(DM dm, PetscSection section, Vec v, PetscInt point, const PetscScalar values[], InsertMode mode)
7311 PetscCall(DMPlexVecSetClosure_Depth1_Static(dm, section, v, point, values, mode));
7315 PetscCall(DMPlexGetCompressedClosure(dm, section, point, 0, &numPoints, &points, &clSection, &clPoints, &clp));
7335 const PetscInt point = points[2 * p];
7338 PetscCall(updatePointFields_private(section, point, perm, flip, f, insert, PETSC_FALSE, clperm, values, &offset, array));
7343 const PetscInt point = points[2 * p];
7346 PetscCall(updatePointFields_private(section, point, perm, flip, f, insert, PETSC_TRUE, clperm, values, &offset, array));
7351 const PetscInt point = points[2 * p];
7354 PetscCall(updatePointFieldsBC_private(section, point, perm, flip, f, -1, NULL, insert, clperm, values, &offset, array));
7359 const PetscInt point = points[2 * p];
7362 PetscCall(updatePointFields_private(section, point, perm, flip, f, add, PETSC_FALSE, clperm, values, &offset, array));
7367 const PetscInt point = points[2 * p];
7370 PetscCall(updatePointFields_private(section, point, perm, flip, f, add, PETSC_TRUE, clperm, values, &offset, array));
7375 const PetscInt point = points[2 * p];
7378 PetscCall(updatePointFieldsBC_private(section, point, perm, flip, f, -1, NULL, add, clperm, values, &offset, array));
7395 const PetscInt point = points[2 * p];
7398 PetscCall(PetscSectionGetDof(section, point, &dof));
7399 PetscCall(updatePoint_private(section, point, dof, insert, PETSC_FALSE, perm, flip, clperm, values, off, array));
7404 const PetscInt point = points[2 * p];
7407 PetscCall(PetscSectionGetDof(section, point, &dof));
7408 PetscCall(updatePoint_private(section, point, dof, insert, PETSC_TRUE, perm, flip, clperm, values, off, array));
7413 const PetscInt point = points[2 * p];
7416 PetscCall(PetscSectionGetDof(section, point, &dof));
7417 PetscCall(updatePointBC_private(section, point, dof, insert, perm, flip, clperm, values, off, array));
7422 const PetscInt point = points[2 * p];
7425 PetscCall(PetscSectionGetDof(section, point, &dof));
7426 PetscCall(updatePoint_private(section, point, dof, add, PETSC_FALSE, perm, flip, clperm, values, off, array));
7431 const PetscInt point = points[2 * p];
7434 PetscCall(PetscSectionGetDof(section, point, &dof));
7435 PetscCall(updatePoint_private(section, point, dof, add, PETSC_TRUE, perm, flip, clperm, values, off, array));
7440 const PetscInt point = points[2 * p];
7443 PetscCall(PetscSectionGetDof(section, point, &dof));
7444 PetscCall(updatePointBC_private(section, point, dof, add, perm, flip, clperm, values, off, array));
7453 PetscCall(DMPlexRestoreCompressedClosure(dm, section, point, &numPoints, &points, &clSection, &clPoints, &clp));
7459 /* Check whether the given point is in the label. If not, update the offset to skip this point */
7460 static inline PetscErrorCode CheckPoint_Private(DMLabel label, PetscInt labelId, PetscSection section, PetscInt point, PetscInt f, PetscInt *offset, PetscBool *contains)
7467 PetscCall(DMLabelStratumHasPoint(label, labelId, point, contains));
7469 PetscCall(PetscSectionGetFieldDof(section, point, f, &fdof));
7478 PetscErrorCode DMPlexVecSetFieldClosure_Internal(DM dm, PetscSection section, Vec v, PetscBool fieldActive[], PetscInt point, PetscInt Ncc, const PetscInt comps[], DMLabel label, PetscInt labelId, const PetscScalar values[], InsertMode mode)
7495 PetscCall(DMPlexGetCompressedClosure(dm, section, point, 0, &numPoints, &points, &clSection, &clPoints, &clp));
7516 const PetscInt point = points[2 * p];
7519 PetscCall(CheckPoint_Private(label, labelId, section, point, f, &offset, &contains));
7521 PetscCall(updatePointFields_private(section, point, perm, flip, f, insert, PETSC_FALSE, NULL, values, &offset, array));
7526 const PetscInt point = points[2 * p];
7529 PetscCall(CheckPoint_Private(label, labelId, section, point, f, &offset, &contains));
7531 PetscCall(updatePointFields_private(section, point, perm, flip, f, insert, PETSC_TRUE, NULL, values, &offset, array));
7536 const PetscInt point = points[2 * p];
7539 PetscCall(CheckPoint_Private(label, labelId, section, point, f, &offset, &contains));
7541 PetscCall(updatePointFieldsBC_private(section, point, perm, flip, f, Ncc, comps, insert, NULL, values, &offset, array));
7546 const PetscInt point = points[2 * p];
7549 PetscCall(CheckPoint_Private(label, labelId, section, point, f, &offset, &contains));
7551 PetscCall(updatePointFields_private(section, point, perm, flip, f, add, PETSC_FALSE, NULL, values, &offset, array));
7556 const PetscInt point = points[2 * p];
7559 PetscCall(CheckPoint_Private(label, labelId, section, point, f, &offset, &contains));
7561 PetscCall(updatePointFields_private(section, point, perm, flip, f, add, PETSC_TRUE, NULL, values, &offset, array));
7570 PetscCall(DMPlexRestoreCompressedClosure(dm, section, point, &numPoints, &points, &clSection, &clPoints, &clp));
7576 static PetscErrorCode DMPlexPrintMatSetValues(PetscViewer viewer, Mat A, PetscInt point, PetscInt numRIndices, const PetscInt rindices[], PetscInt numCIndices, const PetscInt cindices[], const PetscScalar values[])
7583 PetscCall(PetscViewerASCIIPrintf(viewer, "[%d]mat for point %" PetscInt_FMT "\n", rank, point));
7603 DMPlexGetIndicesPoint_Internal - Add the indices for dofs on a point to an index array
7608 . point - The point contributing dofs with these indices
7609 . off - The global offset of this point
7612 . perm - A permutation of the dofs on this point, or NULL
7616 . indices - Indices for dofs on this point
7622 PetscErrorCode DMPlexGetIndicesPoint_Internal(PetscSection section, PetscBool islocal, PetscInt point, PetscInt off, PetscInt *loff, PetscBool setBC, const PetscInt perm[], const PetscInt indperm[], PetscInt indices[])
7624 PetscInt dof; /* The number of unknowns on this point */
7625 PetscInt cdof; /* The number of constraints on this point */
7626 const PetscInt *cdofs; /* The indices of the constrained dofs on this point */
7631 PetscCall(PetscSectionGetDof(section, point, &dof));
7632 PetscCall(PetscSectionGetConstraintDof(section, point, &cdof));
7641 PetscCall(PetscSectionGetConstraintIndices(section, point, &cdofs));
7660 DMPlexGetIndicesPointFields_Internal - gets section indices for a point in its canonical ordering.
7665 . point - point within section
7666 . off - The offset of this point in the (local or global) indexed space - should match islocal and (usually) the section
7667 . foffs - array of length numFields containing the offset in canonical point ordering (the location in indices) of each field
7675 . indices - array to hold indices (as defined by section) of each dof associated with point
7686 The section is only used for field layout, so islocal is technically a statement about the offset (off). At some point
7691 Suppose a point contains one field with three components, and for which the unconstrained indices are {10, 11, 12}.
7698 PetscErrorCode DMPlexGetIndicesPointFields_Internal(PetscSection section, PetscBool islocal, PetscInt point, PetscInt off, PetscInt foffs[], PetscBool setBC, const PetscInt ***perms, PetscInt permsoff, const PetscInt indperm[], PetscInt indices[])
7707 const PetscInt *fcdofs; /* The indices of the constrained dofs for field f on this point */
7711 PetscCall(PetscSectionGetFieldDof(section, point, f, &fdof));
7712 PetscCall(PetscSectionGetFieldConstraintDof(section, point, f, &cfdof));
7721 PetscCall(PetscSectionGetFieldConstraintIndices(section, point, f, &fcdofs));
7741 This version believes the globalSection offsets for each field, rather than just the point offset
7749 static PetscErrorCode DMPlexGetIndicesPointFieldsSplit_Internal(PetscSection section, PetscSection globalSection, PetscInt point, PetscInt foffs[], const PetscInt ***perms, PetscInt permsoff, const PetscInt indperm[], PetscInt indices[])
7757 const PetscInt *fcdofs; /* The indices of the constrained dofs for field f on this point */
7761 PetscCall(PetscSectionGetFieldDof(section, point, f, &fdof));
7762 PetscCall(PetscSectionGetFieldConstraintDof(section, point, f, &cfdof));
7763 PetscCall(PetscSectionGetFieldOffset(globalSection, point, f, &foff));
7772 PetscCall(PetscSectionGetFieldConstraintIndices(section, point, f, &fcdofs));
7863 /* if there are point-to-point constraints */
7888 /* this point is constrained */
7911 /* this point is not constrained */
8127 static PetscErrorCode DMPlexGetClosureIndicesSize_Internal(DM dm, PetscSection section, PetscInt point, PetscInt *closureSize)
8137 PetscCall(DMPlexGetCompressedClosure(dm, section, point, 0, &Ncl, &points, &clSection, &clPoints, &clp));
8144 PetscCall(DMPlexRestoreCompressedClosure(dm, section, point, &Ncl, &points, &clSection, &clPoints, &clp));
8149 static PetscErrorCode DMPlexGetClosureIndices_Internal(DM dm, PetscSection section, PetscSection idxSection, PetscInt point, PetscBool useClPerm, PetscInt *numRows, PetscInt *numCols, PetscInt *indices[], PetscInt outOffsets[], PetscScalar *values[], PetscBool multiplyRight, PetscBool multiplyLeft)
8185 PetscCall(DMPlexGetCompressedClosure(dm, section, point, 0, &Ncl, &points, &clSection, &clPoints, &clp));
8188 PetscCall(DMPlexGetPointDepth(dm, point, &depth));
8266 PetscCall(DMPlexRestoreCompressedClosure(dm, section, point, &Ncl, &points, &clSection, &clPoints, &clp));
8323 PetscCall(DMPlexRestoreCompressedClosure(dm, section, point, &Ncl, &points, &clSection, &clPoints, &clp));
8331 DMPlexGetClosureIndices - Gets the global dof indices associated with the closure of the given point within the provided sections.
8339 . point - The point defining the closure
8340 - useClPerm - Use the closure point permutation if available
8343 + numIndices - The number of dof indices in the closure of point with the input sections
8346 - values - The input values, which may be modified if sign flips are induced by the point symmetries, or `NULL`
8362 PetscErrorCode DMPlexGetClosureIndices(DM dm, PetscSection section, PetscSection idxSection, PetscInt point, PetscBool useClPerm, PetscInt *numIndices, PetscInt *indices[], PeOp PetscInt outOffsets[], PeOp PetscScalar *values[])
8367 PetscCall(DMPlexGetClosureIndices_Internal(dm, section, idxSection, point, useClPerm, &numRows, &numCols, indices, outOffsets, values, PETSC_TRUE, PETSC_TRUE));
8374 DMPlexRestoreClosureIndices - Restores the global dof indices associated with the closure of the given point within the provided sections.
8382 . point - The point defining the closure
8383 - useClPerm - Use the closure point permutation if available
8386 + numIndices - The number of dof indices in the closure of point with the input sections
8389 - values - The input values, which may be modified if sign flips are induced by the point symmetries, or `NULL`
8404 PetscErrorCode DMPlexRestoreClosureIndices(DM dm, PetscSection section, PetscSection idxSection, PetscInt point, PetscBool useClPerm, PetscInt *numIndices, PetscInt *indices[], PeOp PetscInt outOffsets[], PeOp PetscScalar *values[])
8413 PetscErrorCode DMPlexMatSetClosure_Internal(DM dm, PetscSection section, PetscSection globalSection, PetscBool useClPerm, Mat A, PetscInt point, const PetscScalar values[], InsertMode mode)
8429 PetscCall(DMPlexGetClosureIndices(dm, section, globalSection, point, useClPerm, &numIndices, &indices, NULL, (PetscScalar **)&values));
8431 if (mesh->printSetValues) PetscCall(DMPlexPrintMatSetValues(PETSC_VIEWER_STDOUT_SELF, A, point, numIndices, indices, 0, NULL, values));
8439 PetscCall(DMPlexPrintMatSetValues(PETSC_VIEWER_STDERR_SELF, A, point, numIndices, indices, 0, NULL, values));
8440 PetscCall(DMPlexRestoreClosureIndices(dm, section, globalSection, point, PETSC_TRUE, &numIndices, &indices, NULL, (PetscScalar **)&values));
8451 PetscCall(DMPlexRestoreClosureIndices(dm, section, globalSection, point, PETSC_TRUE, &numIndices, &indices, NULL, (PetscScalar **)&values));
8457 DMPlexMatSetClosure - Set an array of the values on the closure of 'point'
8466 . point - The point in the `DM`
8474 PetscErrorCode DMPlexMatSetClosure(DM dm, PetscSection section, PetscSection globalSection, Mat A, PetscInt point, const PetscScalar values[], InsertMode mode)
8477 PetscCall(DMPlexMatSetClosure_Internal(dm, section, globalSection, PETSC_TRUE, A, point, values, mode));
8482 DMPlexMatSetClosureGeneral - Set an array of the values on the closure of 'point' using a different row and column section
8496 . point - The point in the `DM`
8504 PetscErrorCode DMPlexMatSetClosureGeneral(DM dmRow, PetscSection sectionRow, PetscSection globalSectionRow, PetscBool useRowPerm, DM dmCol, PetscSection sectionCol, PetscSection globalSectionCol, PetscBool useColPerm, Mat A, PetscInt point, const PetscScalar values[], InsertMode mode)
8526 PetscCall(DMPlexGetClosureIndicesSize_Internal(dmRow, sectionRow, point, &numIndicesRow));
8527 PetscCall(DMPlexGetClosureIndicesSize_Internal(dmCol, sectionCol, point, &numIndicesCol));
8529 PetscCall(DMPlexGetClosureIndices_Internal(dmRow, sectionRow, globalSectionRow, point, useRowPerm, &numIndicesRow, &numIndicesCol, &indicesRow, NULL, (PetscScalar **)&valuesV1, PETSC_FALSE, PETSC_TRUE));
8531 PetscCall(DMPlexGetClosureIndices_Internal(dmCol, sectionCol, globalSectionCol, point, useColPerm, &numIndicesRow, &numIndicesCol, &indicesCol, NULL, (PetscScalar **)&valuesV2, PETSC_TRUE, PETSC_FALSE));
8533 if (mesh->printSetValues) PetscCall(DMPlexPrintMatSetValues(PETSC_VIEWER_STDOUT_SELF, A, point, numIndicesRow, indicesRow, numIndicesCol, indicesCol, valuesV2));
8541 PetscCall(DMPlexPrintMatSetValues(PETSC_VIEWER_STDERR_SELF, A, point, numIndicesRow, indicesRow, numIndicesCol, indicesCol, values));
8542 PetscCall(DMPlexRestoreClosureIndices(dmCol, sectionCol, globalSectionCol, point, PETSC_TRUE, &numIndicesCol, &indicesRow, NULL, (PetscScalar **)&valuesV2));
8543 PetscCall(DMPlexRestoreClosureIndices(dmRow, sectionRow, globalSectionRow, point, PETSC_TRUE, &numIndicesRow, &indicesRow, NULL, (PetscScalar **)&valuesV1));
8548 PetscCall(DMPlexRestoreClosureIndices(dmCol, sectionCol, globalSectionCol, point, useColPerm, &numIndicesCol, &indicesCol, NULL, (PetscScalar **)&valuesV2));
8549 PetscCall(DMPlexRestoreClosureIndices(dmRow, sectionRow, globalSectionRow, point, useRowPerm, &numIndicesRow, &indicesRow, NULL, (PetscScalar **)&valuesV1));
8555 PetscErrorCode DMPlexMatSetClosureRefined(DM dmf, PetscSection fsection, PetscSection globalFSection, DM dmc, PetscSection csection, PetscSection globalCSection, Mat A, PetscInt point, const PetscScalar values[], InsertMode mode)
8584 PetscCall(DMPlexGetTransitiveClosure(dmc, point, PETSC_TRUE, &numCPoints, &cpoints));
8610 PetscCall(DMPlexGetCellType(dmc, point, &ct));
8618 PetscCall(DMPlexTransformCellTransform(tr, ct, point, NULL, &Nt, &rct, &rsize, &rcone, &rornt));
8625 PetscCall(DMPlexGetTransitiveClosure(dmf, point * numSubcells + r, PETSC_TRUE, &numFPoints, &fpoints));
8640 PetscCall(DMPlexRestoreTransitiveClosure(dmf, point, PETSC_TRUE, &numFPoints, &fpoints));
8701 if (mesh->printSetValues) PetscCall(DMPlexPrintMatSetValues(PETSC_VIEWER_STDOUT_SELF, A, point, numFIndices, findices, numCIndices, cindices, values));
8710 PetscCall(DMPlexPrintMatSetValues(PETSC_VIEWER_STDERR_SELF, A, point, numFIndices, findices, numCIndices, cindices, values));
8715 PetscCall(DMPlexRestoreTransitiveClosure(dmc, point, PETSC_TRUE, &numCPoints, &cpoints));
8721 PetscErrorCode DMPlexMatGetClosureIndicesRefined(DM dmf, PetscSection fsection, PetscSection globalFSection, DM dmc, PetscSection csection, PetscSection globalCSection, PetscInt point, PetscInt cindices[], PetscInt findices[])
8744 PetscCall(DMPlexGetTransitiveClosure(dmc, point, PETSC_TRUE, &numCPoints, &cpoints));
8770 PetscCall(DMPlexGetCellType(dmc, point, &ct));
8778 PetscCall(DMPlexTransformCellTransform(tr, ct, point, NULL, &Nt, &rct, &rsize, &rcone, &rornt));
8785 PetscCall(DMPlexGetTransitiveClosure(dmf, point * numSubcells + r, PETSC_TRUE, &numFPoints, &fpoints));
8800 PetscCall(DMPlexRestoreTransitiveClosure(dmf, point, PETSC_TRUE, &numFPoints, &fpoints));
8860 PetscCall(DMPlexRestoreTransitiveClosure(dmc, point, PETSC_TRUE, &numCPoints, &cpoints));
8957 - depth - The depth for the given point stratum
9113 The point numbering `IS` is parallel, with local portion indexed by local points (see `DMGetLocalSection()`). The global
9197 The point numbering `IS` is parallel, with local portion indexed by local points (see `DMGetLocalSection()`). In the IS, owned edges will have their non-negative value while edges owned by different ranks will be involuted -(idx+1).
9269 DMPlexCreateLabelField - Create a field whose value is the label value for that point
9365 /* Check that point p is found in the support of its cone points, and vice versa */
9391 PetscCheck(!dup, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %" PetscInt_FMT " not repeatedly found in support of repeated cone point %" PetscInt_FMT, p, cone[c]);
9392 SETERRQ(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %" PetscInt_FMT " not found in support of cone point %" PetscInt_FMT, p, cone[c]);
9420 SETERRQ(PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point %" PetscInt_FMT " not found in cone of support point %" PetscInt_FMT, p, support[s]);
9705 DMPlexCheckPointSF - Check that several necessary conditions are met for the point `PetscSF` of this plex.
9773 const PetscInt point = locals ? locals[l] : l;
9775 PetscCheck(point < cStart || point >= cEnd, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point SF contains %" PetscInt_FMT " which is a cell", point);
9779 /* If some point is in interface, then all its cone points must be also in interface (either as leaves or roots) */
9786 const PetscInt point = locals ? locals[l] : l;
9790 PetscCall(DMPlexGetConeSize(dm, point, &coneSize));
9791 PetscCall(DMPlexGetCone(dm, point, &cone));
9799 PetscCheck(idx >= 0, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Point SF contains %" PetscInt_FMT " but not %" PetscInt_FMT " from its cone", point, cone[c]);
10178 /* PetscAbs because I don't know if normals are guaranteed to point out */
10563 DMPlexGetAnchors - Get the layout of the anchor (point-to-point) constraints. Typically, the user will not have to
10592 DMPlexSetAnchors - Set the layout of the local anchor (point-to-point) constraints.
10605 Unlike boundary conditions, when a point's degrees of freedom in a section are constrained to
10606 an outside value, the anchor constraints set a point's degrees of freedom to be a linear
10919 const PetscInt point = spmap[p];
10921 PetscCall(PetscSectionGetOffset(sectionGlobal, point, &goff));