Lines Matching defs:mesh
20 "title = {Efficient mesh management in {Firedrake} using {PETSc-DMPlex}},\n"
34 DMPlexIsSimplex - Is the first cell in this mesh a simplex?
45 This just gives the first range of cells found. If the mesh has several cell types, it will only give the first.
46 If the mesh has no cells, this returns `PETSC_FALSE`.
1011 DM_Plex *mesh = (DM_Plex *)dm->data;
1047 PetscCall(PetscSectionGetDof(mesh->supportSection, p, &dof));
1048 PetscCall(PetscSectionGetOffset(mesh->supportSection, p, &off));
1049 for (s = off; s < off + dof; ++s) PetscCall(PetscViewerASCIISynchronizedPrintf(viewer, "[%d]: %" PetscInt_FMT " ----> %" PetscInt_FMT "\n", rank, p, mesh->supports[s]));
1057 PetscCall(PetscSectionGetDof(mesh->coneSection, p, &dof));
1058 PetscCall(PetscSectionGetOffset(mesh->coneSection, p, &off));
1059 for (c = off; c < off + dof; ++c) PetscCall(PetscViewerASCIISynchronizedPrintf(viewer, "[%d]: %" PetscInt_FMT " <---- %" PetscInt_FMT " (%" PetscInt_FMT ")\n", rank, p, mesh->cones[c], mesh->coneOrientations[c]));
1134 if (mesh->periodic.face_sfs)
1135 for (PetscInt i = 0; i < mesh->periodic.num_face_sfs; i++) PetscCall(PetscSFView(mesh->periodic.face_sfs[i], viewer));
1710 PetscCall(PetscViewerASCIIPrintf(viewer, "Periodic mesh"));
2820 DM_Plex *mesh = (DM_Plex *)dm->data;
2844 if (--mesh->refct > 0) PetscFunctionReturn(PETSC_SUCCESS);
2845 PetscCall(PetscSectionDestroy(&mesh->coneSection));
2846 PetscCall(PetscFree(mesh->cones));
2847 PetscCall(PetscFree(mesh->coneOrientations));
2848 PetscCall(PetscSectionDestroy(&mesh->supportSection));
2849 PetscCall(PetscSectionDestroy(&mesh->subdomainSection));
2850 PetscCall(PetscFree(mesh->supports));
2851 PetscCall(PetscFree(mesh->cellTypes));
2852 PetscCall(DMPlexTransformDestroy(&mesh->tr));
2853 PetscCall(PetscFree(mesh->tetgenOpts));
2854 PetscCall(PetscFree(mesh->triangleOpts));
2855 PetscCall(PetscFree(mesh->transformType));
2856 PetscCall(PetscFree(mesh->distributionName));
2857 PetscCall(PetscPartitionerDestroy(&mesh->partitioner));
2858 PetscCall(DMLabelDestroy(&mesh->subpointMap));
2859 PetscCall(ISDestroy(&mesh->subpointIS));
2860 PetscCall(ISDestroy(&mesh->globalVertexNumbers));
2861 PetscCall(ISDestroy(&mesh->globalCellNumbers));
2862 if (mesh->periodic.face_sfs) {
2863 for (PetscInt i = 0; i < mesh->periodic.num_face_sfs; i++) PetscCall(PetscSFDestroy(&mesh->periodic.face_sfs[i]));
2864 PetscCall(PetscFree(mesh->periodic.face_sfs));
2866 PetscCall(PetscSFDestroy(&mesh->periodic.composed_sf));
2867 if (mesh->periodic.periodic_points) {
2868 for (PetscInt i = 0; i < mesh->periodic.num_face_sfs; i++) PetscCall(ISDestroy(&mesh->periodic.periodic_points[i]));
2869 PetscCall(PetscFree(mesh->periodic.periodic_points));
2871 if (mesh->periodic.transform) PetscCall(PetscFree(mesh->periodic.transform));
2872 PetscCall(PetscSectionDestroy(&mesh->anchorSection));
2873 PetscCall(ISDestroy(&mesh->anchorIS));
2874 PetscCall(PetscSectionDestroy(&mesh->parentSection));
2875 PetscCall(PetscFree(mesh->parents));
2876 PetscCall(PetscFree(mesh->childIDs));
2877 PetscCall(PetscSectionDestroy(&mesh->childSection));
2878 PetscCall(PetscFree(mesh->children));
2879 PetscCall(DMDestroy(&mesh->referenceTree));
2880 PetscCall(PetscGridHashDestroy(&mesh->lbox));
2881 PetscCall(PetscFree(mesh->neighbors));
2882 if (mesh->metricCtx) PetscCall(PetscFree(mesh->metricCtx));
2883 if (mesh->nonempty_comm != MPI_COMM_NULL && mesh->nonempty_comm != MPI_COMM_SELF) PetscCallMPI(MPI_Comm_free(&mesh->nonempty_comm));
2884 PetscCall(DMPlexTransformDestroy(&mesh->transform));
2886 PetscCall(PetscFree(mesh));
3052 DM_Plex *mesh = (DM_Plex *)dm->data;
3056 if (!mesh->subdomainSection) {
3062 PetscCall(PetscSectionCreateGlobalSection(section, sf, PETSC_TRUE, PETSC_FALSE, PETSC_TRUE, &mesh->subdomainSection));
3065 *subsection = mesh->subdomainSection;
3070 DMPlexGetChart - Return the interval for all mesh points [`pStart`, `pEnd`)
3078 + pStart - The first mesh point
3079 - pEnd - The upper bound for mesh points
3087 DM_Plex *mesh = (DM_Plex *)dm->data;
3091 if (mesh->tr) PetscCall(DMPlexTransformGetChart(mesh->tr, pStart, pEnd));
3092 else PetscCall(PetscSectionGetChart(mesh->coneSection, pStart, pEnd));
3097 DMPlexSetChart - Set the interval for all mesh points [`pStart`, `pEnd`)
3103 . pStart - The first mesh point
3104 - pEnd - The upper bound for mesh points
3112 DM_Plex *mesh = (DM_Plex *)dm->data;
3116 PetscCall(PetscSectionSetChart(mesh->coneSection, pStart, pEnd));
3117 PetscCall(PetscSectionSetChart(mesh->supportSection, pStart, pEnd));
3118 PetscCall(PetscFree(mesh->cellTypes));
3140 DM_Plex *mesh = (DM_Plex *)dm->data;
3145 if (mesh->tr) PetscCall(DMPlexTransformGetConeSize(mesh->tr, p, size));
3146 else PetscCall(PetscSectionGetDof(mesh->coneSection, p, size));
3169 DM_Plex *mesh = (DM_Plex *)dm->data;
3173 PetscCheck(!mesh->tr, PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_WRONG, "Cannot call DMPlexSetConeSize() on a mesh with a transform defined.");
3174 PetscCall(PetscSectionSetDof(mesh->coneSection, p, size));
3205 DM_Plex *mesh = (DM_Plex *)dm->data;
3211 PetscCall(PetscSectionGetOffset(mesh->coneSection, p, &off));
3212 *cone = PetscSafePointerPlusOffset(mesh->cones, off);
3444 DM_Plex *mesh = (DM_Plex *)dm->data;
3449 PetscCall(PetscSectionGetDof(mesh->coneSection, p, &dof));
3451 PetscCall(PetscSectionGetOffset(mesh->coneSection, p, &off));
3454 PetscCall(PetscSectionGetChart(mesh->coneSection, &pStart, &pEnd));
3458 mesh->cones[off + c] = cone[c];
3461 for (c = 0; c < dof; ++c) mesh->cones[off + c] = cone[c];
3496 DM_Plex *mesh = (DM_Plex *)dm->data;
3503 PetscCall(PetscSectionGetDof(mesh->coneSection, p, &dof));
3506 PetscCall(PetscSectionGetOffset(mesh->coneSection, p, &off));
3508 *coneOrientation = &mesh->coneOrientations[off];
3533 DM_Plex *mesh = (DM_Plex *)dm->data;
3539 PetscCall(PetscSectionGetDof(mesh->coneSection, p, &dof));
3541 PetscCall(PetscSectionGetOffset(mesh->coneSection, p, &off));
3543 PetscCall(PetscSectionGetChart(mesh->coneSection, &pStart, &pEnd));
3548 PetscCall(PetscSectionGetDof(mesh->coneSection, mesh->cones[off + c], &cdof));
3550 mesh->coneOrientations[off + c] = o;
3553 for (c = 0; c < dof; ++c) mesh->coneOrientations[off + c] = coneOrientation[c];
3567 - conePoint - The mesh point to insert
3575 DM_Plex *mesh = (DM_Plex *)dm->data;
3582 PetscCall(PetscSectionGetChart(mesh->coneSection, &pStart, &pEnd));
3585 PetscCall(PetscSectionGetDof(mesh->coneSection, p, &dof));
3588 PetscCall(PetscSectionGetOffset(mesh->coneSection, p, &off));
3589 mesh->cones[off + conePos] = conePoint;
3613 DM_Plex *mesh = (DM_Plex *)dm->data;
3620 PetscCall(PetscSectionGetChart(mesh->coneSection, &pStart, &pEnd));
3622 PetscCall(PetscSectionGetDof(mesh->coneSection, p, &dof));
3625 PetscCall(PetscSectionGetOffset(mesh->coneSection, p, &off));
3626 mesh->coneOrientations[off + conePos] = coneOrientation;
3665 DM_Plex *mesh = (DM_Plex *)dm->data;
3669 if (mesh->tr) {
3670 PetscCall(DMPlexTransformGetCone(mesh->tr, p, cone, ornt));
3675 PetscCall(PetscSectionGetDof(mesh->coneSection, p, &dof));
3681 PetscCall(PetscSectionGetOffset(mesh->coneSection, p, &off));
3682 if (cone) *cone = PetscSafePointerPlusOffset(mesh->cones, off);
3683 if (ornt) *ornt = PetscSafePointerPlusOffset(mesh->coneOrientations, off);
3706 DM_Plex *mesh = (DM_Plex *)dm->data;
3710 if (mesh->tr) PetscCall(DMPlexTransformRestoreCone(mesh->tr, p, cone, ornt));
3732 DM_Plex *mesh = (DM_Plex *)dm->data;
3737 PetscCall(PetscSectionGetDof(mesh->supportSection, p, size));
3760 DM_Plex *mesh = (DM_Plex *)dm->data;
3764 PetscCall(PetscSectionSetDof(mesh->supportSection, p, size));
3795 DM_Plex *mesh = (DM_Plex *)dm->data;
3801 PetscCall(PetscSectionGetOffset(mesh->supportSection, p, &off));
3802 *support = PetscSafePointerPlusOffset(mesh->supports, off);
3825 DM_Plex *mesh = (DM_Plex *)dm->data;
3831 PetscCall(PetscSectionGetChart(mesh->supportSection, &pStart, &pEnd));
3832 PetscCall(PetscSectionGetDof(mesh->supportSection, p, &dof));
3834 PetscCall(PetscSectionGetOffset(mesh->supportSection, p, &off));
3838 mesh->supports[off + c] = support[c];
3852 - supportPoint - The mesh point to insert
3860 DM_Plex *mesh = (DM_Plex *)dm->data;
3866 PetscCall(PetscSectionGetChart(mesh->supportSection, &pStart, &pEnd));
3867 PetscCall(PetscSectionGetDof(mesh->supportSection, p, &dof));
3868 PetscCall(PetscSectionGetOffset(mesh->supportSection, p, &off));
3872 mesh->supports[off + supportPos] = supportPoint;
3925 /* Takes in a mesh whose orientations are in the previous scheme and converts them all to the current numbering */
3970 DM_Plex *mesh = (DM_Plex *)dm->data;
3973 if (PetscDefined(USE_DEBUG) || mesh->tr) {
3983 const PetscSection s = mesh->coneSection;
3988 *arr = mesh->cones + off;
3989 *ornt = mesh->coneOrientations + off;
3991 const PetscSection s = mesh->supportSection;
3996 *arr = mesh->supports + off;
4004 DM_Plex *mesh = (DM_Plex *)dm->data;
4007 if (PetscDefined(USE_DEBUG) || mesh->tr) {
4212 . p - The mesh point
4261 . p - The mesh point
4300 DM_Plex *mesh = (DM_Plex *)dm->data;
4304 if (maxConeSize) PetscCall(PetscSectionGetMaxDof(mesh->coneSection, maxConeSize));
4305 if (maxSupportSize) PetscCall(PetscSectionGetMaxDof(mesh->supportSection, maxSupportSize));
4311 DM_Plex *mesh = (DM_Plex *)dm->data;
4316 PetscCall(PetscSectionSetUp(mesh->coneSection));
4317 PetscCall(PetscSectionGetStorageSize(mesh->coneSection, &size));
4318 PetscCall(PetscMalloc1(size, &mesh->cones));
4319 PetscCall(PetscCalloc1(size, &mesh->coneOrientations));
4320 PetscCall(PetscSectionGetMaxDof(mesh->supportSection, &maxSupportSize));
4322 PetscCall(PetscSectionSetUp(mesh->supportSection));
4323 PetscCall(PetscSectionGetStorageSize(mesh->supportSection, &size));
4324 PetscCall(PetscMalloc1(size, &mesh->supports));
4386 DM_Plex *mesh = (DM_Plex *)dm->data;
4393 PetscCheck(!mesh->supports, PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_WRONGSTATE, "Supports were already setup in this DMPlex");
4400 PetscCall(PetscSectionGetDof(mesh->coneSection, p, &dof));
4401 PetscCall(PetscSectionGetOffset(mesh->coneSection, p, &off));
4402 for (c = off; c < off + dof; ++c) PetscCall(PetscSectionAddDof(mesh->supportSection, mesh->cones[c], 1));
4404 PetscCall(PetscSectionSetUp(mesh->supportSection));
4406 PetscCall(PetscSectionGetStorageSize(mesh->supportSection, &supportSize));
4407 PetscCall(PetscMalloc1(supportSize, &mesh->supports));
4412 PetscCall(PetscSectionGetDof(mesh->coneSection, p, &dof));
4413 PetscCall(PetscSectionGetOffset(mesh->coneSection, p, &off));
4415 const PetscInt q = mesh->cones[c];
4418 PetscCall(PetscSectionGetOffset(mesh->supportSection, q, &offS));
4420 mesh->supports[offS + offsets[q]] = p;
4588 until cells have depth equal to the dimension of the mesh. The depth label can be accessed through `DMPlexGetDepthLabel()` or `DMPlexGetDepthStratum()`, or
4593 if run on a partially interpolated mesh, meaning one that had some edges and faces, but not others. For example, suppose that
4594 we had a mesh consisting of one triangle (c0) and three vertices (v0, v1, v2), and only one edge is on the boundary so we choose
4600 If `DMPlexStratify()` is run on this mesh, it will give depths
4613 DM_Plex *mesh = (DM_Plex *)dm->data;
4637 PetscCall(PetscObjectStateGet((PetscObject)label, &mesh->depthState));
4789 DM_Plex *mesh;
4795 mesh = (DM_Plex *)dm->data;
4799 PetscCall(PetscFree(mesh->cellTypes));
4800 PetscCall(PetscMalloc1(pEnd - pStart, &mesh->cellTypes));
4809 mesh->cellTypes[p - pStart].value_as_uint8 = (uint8_t)ct;
4811 PetscCall(PetscObjectStateGet((PetscObject)ctLabel, &mesh->celltypeState));
4845 DM_Plex *mesh = (DM_Plex *)dm->data;
4856 PetscCall(PetscSectionGetMaxDof(mesh->supportSection, &maxSupportSize));
4860 PetscCall(PetscSectionGetDof(mesh->supportSection, points[0], &dof));
4861 PetscCall(PetscSectionGetOffset(mesh->supportSection, points[0], &off));
4862 for (joinSize = 0; joinSize < dof; ++joinSize) join[i][joinSize] = mesh->supports[off + joinSize];
4867 PetscCall(PetscSectionGetDof(mesh->supportSection, points[p], &dof));
4868 PetscCall(PetscSectionGetOffset(mesh->supportSection, points[p], &off));
4870 const PetscInt point = mesh->supports[off + c];
5054 DM_Plex *mesh = (DM_Plex *)dm->data;
5065 PetscCall(PetscSectionGetMaxDof(mesh->coneSection, &maxConeSize));
5069 PetscCall(PetscSectionGetDof(mesh->coneSection, points[0], &dof));
5070 PetscCall(PetscSectionGetOffset(mesh->coneSection, points[0], &off));
5071 for (meetSize = 0; meetSize < dof; ++meetSize) meet[i][meetSize] = mesh->cones[off + meetSize];
5076 PetscCall(PetscSectionGetDof(mesh->coneSection, points[p], &dof));
5077 PetscCall(PetscSectionGetOffset(mesh->coneSection, points[p], &off));
5079 const PetscInt point = mesh->cones[off + c];
5403 DMPlexGetDepth - Get the depth of the DAG representing this mesh
5420 An empty mesh gives -1.
5426 DM_Plex *mesh = (DM_Plex *)dm->data;
5433 if (mesh->tr) {
5434 PetscCall(DMPlexTransformGetDepth(mesh->tr, depth));
5461 often "vertices". If the mesh is "interpolated" (see `DMPlexInterpolate()`), then depth stratum 1 contains the next
5468 DM_Plex *mesh = (DM_Plex *)dm->data;
5489 if (mesh->tr) {
5490 PetscCall(DMPlexTransformGetDepthStratum(mesh->tr, depth, start, end));
5516 points, often called "cells" or "elements". If the mesh is "interpolated" (see `DMPlexInterpolate()`), then height
5652 DM_Plex *mesh = (DM_Plex *)dm->data;
5659 if (mesh->tr) {
5660 PetscCall(DMPlexTransformGetCellType(mesh->tr, cell, celltype));
5664 PetscCall(PetscSectionGetChart(mesh->coneSection, &pStart, NULL));
5665 if (!mesh->cellTypes) { /* XXX remove? optimize? */
5666 PetscCall(PetscSectionGetChart(mesh->coneSection, NULL, &pEnd));
5671 PetscCall(PetscMalloc1(pEnd - pStart, &mesh->cellTypes));
5675 mesh->cellTypes[p - pStart].value_as_uint8 = (uint8_t)ct;
5678 *celltype = (DMPolytopeType)mesh->cellTypes[cell - pStart].value_as_uint8;
5711 DM_Plex *mesh = (DM_Plex *)dm->data;
5717 PetscCall(PetscSectionGetChart(mesh->coneSection, &pStart, &pEnd));
5720 if (!mesh->cellTypes) PetscCall(PetscMalloc1(pEnd - pStart, &mesh->cellTypes));
5721 mesh->cellTypes[cell - pStart].value_as_uint8 = (uint8_t)celltype;
5806 DM_Plex *mesh = (DM_Plex *)dm->data;
5810 if (section) *section = mesh->coneSection;
5831 DM_Plex *mesh = (DM_Plex *)dm->data;
5835 if (section) *section = mesh->supportSection;
5856 DM_Plex *mesh = (DM_Plex *)dm->data;
5860 if (cones) *cones = mesh->cones;
5887 DM_Plex *mesh = (DM_Plex *)dm->data;
5891 if (coneOrientations) *coneOrientations = mesh->coneOrientations;
5936 /* Assume the full interpolated mesh is in the chart; lines in particular */
5988 A typical interpolated single-quad mesh might order points as
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()`.
6736 . depth - The depth of mesh points that should be returned
6747 This is used for getting the values in a `Vec` associated with specific mesh points.
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()`.
8415 DM_Plex *mesh = (DM_Plex *)dm->data;
8431 if (mesh->printSetValues) PetscCall(DMPlexPrintMatSetValues(PETSC_VIEWER_STDOUT_SELF, A, point, numIndices, indices, 0, NULL, values));
8444 if (mesh->printFEM > 1) {
8506 DM_Plex *mesh = (DM_Plex *)dmRow->data;
8533 if (mesh->printSetValues) PetscCall(DMPlexPrintMatSetValues(PETSC_VIEWER_STDOUT_SELF, A, point, numIndicesRow, indicesRow, numIndicesCol, indicesCol, valuesV2));
8557 DM_Plex *mesh = (DM_Plex *)dmf->data;
8701 if (mesh->printSetValues) PetscCall(DMPlexPrintMatSetValues(PETSC_VIEWER_STDOUT_SELF, A, point, numFIndices, findices, numCIndices, cindices, values));
8879 DM_Plex *mesh = (DM_Plex *)dm->data;
8884 *cellHeight = mesh->vtkCellHeight;
8901 DM_Plex *mesh = (DM_Plex *)dm->data;
8905 mesh->vtkCellHeight = cellHeight;
8926 DM_Plex *mesh = (DM_Plex *)dm->data;
8942 if (mesh->tr) {
8943 PetscCall(DMPlexTransformGetCellTypeStratum(mesh->tr, ct, start, end));
9055 DM_Plex *mesh = (DM_Plex *)dm->data;
9059 if (!mesh->globalCellNumbers) PetscCall(DMPlexCreateCellNumbering(dm, PETSC_FALSE, &mesh->globalCellNumbers));
9060 *globalCellNumbers = mesh->globalCellNumbers;
9090 DM_Plex *mesh = (DM_Plex *)dm->data;
9094 if (!mesh->globalVertexNumbers) PetscCall(DMPlexCreateVertexNumbering_Internal(dm, PETSC_FALSE, &mesh->globalVertexNumbers));
9095 *globalVertexNumbers = mesh->globalVertexNumbers;
9116 consider a parallel mesh in which the first two elements and first two vertices are owned by rank 0.
9118 The partitioned mesh is
9338 DMPlexCheckSymmetry - Check that the adjacency information in the mesh is symmetric.
9554 It will error out if a partially interpolated mesh is given on some rank.
9555 It will do nothing for locally uninterpolated mesh (as there is nothing to check).
9634 DMPlexCheckGeometry - Check the geometry of mesh cells
9808 DMPlexCheckOrphanVertices - Check that no vertices are disconnected from the mesh, unless the mesh only consists of disconnected vertices.
9838 PetscCheck(suppSize, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Vertex %" PetscInt_FMT " is disconnected from the mesh", v);
10029 DMPlexComputeOrthogonalQuality - Compute cell-wise orthogonal quality mesh statistic. Optionally tags all cells with
10522 DMPlexGetRegularRefinement - Get the flag indicating that this mesh was obtained by regular refinement from its coarse mesh
10544 DMPlexSetRegularRefinement - Set the flag indicating that this mesh was obtained by regular refinement from its coarse mesh