petsc4py.PETSc.DMPlex#

class petsc4py.PETSc.DMPlex#

Bases: DM

Encapsulate an unstructured mesh.

DMPlex encapsulates both topology and geometry. It is capable of parallel refinement and coarsening (using Pragmatic or ParMmg) and parallel redistribution for load balancing. It is designed to interface with the FE and FV trial discretization objects.

Enumerations

ReorderDefaultFlag

Methods Summary

computeCellGeometryFVM(cell)

Compute the volume for a given cell.

computeGradientClementInterpolant(locX, locC)

Return the L2 projection of the cellwise gradient of a function onto P1.

constructGhostCells([labelName])

Construct ghost cells which connect to every boundary face.

coordinatesLoad(viewer, sfxc)

Load coordinates into this DMPlex object.

coordinatesView(viewer)

Save DMPlex coordinates into a file.

create([comm])

Create a DMPlex object, which encapsulates an unstructured mesh.

createBoxMesh(faces[, lower, upper, ...])

Create a mesh on the tensor product of intervals.

createBoxSurfaceMesh(faces[, lower, upper, ...])

Create a mesh on the surface of a box mesh using tensor cells.

createCGNS(cgid[, interpolate, comm])

Create a DMPlex mesh from a CGNS file.

createCGNSFromFile(filename[, interpolate, comm])

"Create a DMPlex mesh from a CGNS file.

createClosureIndex(sec)

Calculate an index for sec for the closure operation.

createCoarsePointIS()

Create an IS covering the coarse DMPlex chart with the fine points as data.

createCohesiveSubmesh(hasLagrange, value)

Extract the hypersurface defined by one face of the cohesive cells.

createExodus(exoid[, interpolate, comm])

Create a DMPlex mesh from an ExodusII file ID.

createExodusFromFile(filename[, ...])

Create a DMPlex mesh from an ExodusII file.

createFromCellList(dim, cells, coords[, ...])

Create a DMPlex from a list of vertices for each cell on process 0.

createFromFile(filename[, plexname, ...])

Create DMPlex from a file.

createGmsh(viewer[, interpolate, comm])

Create a DMPlex mesh from a Gmsh file viewer.

createPointNumbering()

Create a global numbering for all points.

createSection(numComp, numDof[, bcField, ...])

Create a Section based upon the DOF layout specification provided.

distribute([overlap])

Distribute the mesh and any associated sections.

distributeField(sf, sec, vec[, newsec, newvec])

Distribute field data with a with a given SF.

distributeGetDefault()

Return a flag indicating whether the DM should be distributed by default.

distributeOverlap([overlap])

Add partition overlap to a distributed non-overlapping DMPlex.

distributeSetDefault(flag)

Set flag indicating whether the DMPlex should be distributed by default.

distributionGetName()

Retrieve the name of the specific parallel distribution.

distributionSetName(name)

Set the name of the specific parallel distribution.

generate(boundary[, name, interpolate])

Generate a mesh.

getAdjacency(p)

Return all points adjacent to the given point.

getAdjacencyUseAnchors()

Query whether adjacency in the mesh uses the point-to-point constraints.

getCellNumbering()

Return a global cell numbering for all cells on this process.

getCellType(p)

Return the polytope type of a given cell.

getCellTypeLabel()

Return the DMLabel recording the polytope type of each cell.

getChart()

Return the interval for all mesh points [pStart, pEnd).

getCone(p)

Return the points on the in-edges for this point in the DAG.

getConeOrientation(p)

Return the orientations on the in-edges for this point in the DAG.

getConeSize(p)

Return the number of in-edges for this point in the DAG.

getDepth()

Return the depth of the DAG representing this mesh.

getDepthStratum(svalue)

Return the bounds [start, end) for all points at a certain depth.

getFullJoin(points)

Return an array for the join of the set of points.

getHeightStratum(svalue)

Return the bounds [start, end) for all points at a certain height.

getJoin(points)

Return an array for the join of the set of points.

getMaxSizes()

Return the maximum number of in-edges and out-edges of the DAG.

getMeet(points)

Return an array for the meet of the set of points.

getMinRadius()

Return the minimum distance from any cell centroid to a face.

getOrdering(otype)

Calculate a reordering of the mesh.

getPartitioner()

Return the mesh partitioner.

getPointDepth(point)

Return the depth of a given point.

getPointGlobal(point)

Return location of point data in global Vec.

getPointGlobalField(point, field)

Return location of point field data in global Vec.

getPointHeight(point)

Return the height of a given point.

getPointLocal(point)

Return location of point data in local Vec.

getPointLocalField(point, field)

Return location of point field data in local Vec.

getRefinementLimit()

Retrieve the maximum cell volume for refinement.

getRefinementUniform()

Retrieve the flag for uniform refinement.

getSupport(p)

Return the points on the out-edges for this point in the DAG.

getSupportSize(p)

Return the number of out-edges for this point in the DAG.

getTransitiveClosure(p[, useCone])

Return the points and orientations on the transitive closure of this point.

getVecClosure(sec, vec, point)

Return an array of the values on the closure of a point.

getVertexNumbering()

Return a global vertex numbering for all vertices on this process.

globalVectorLoad(viewer, sectiondm, sf, vec)

Load on-disk vector data into a global vector.

globalVectorView(viewer, sectiondm, vec)

Save a global vector.

insertCone(p, conePos, conePoint)

DMPlexInsertCone - Insert a point into the in-edges for the point p in the DAG.

insertConeOrientation(p, conePos, ...)

Insert a point orientation for the in-edge for the point p in the DAG.

interpolate()

Convert to a mesh with all intermediate faces, edges, etc.

isDistributed()

Return the flag indicating if the mesh is distributed.

isSimplex()

Return the flag indicating if the first cell is a simplex.

labelCohesiveComplete(label, bdlabel, ...)

Add all other mesh pieces to complete the surface.

labelComplete(label)

Add the transitive closure to the surface.

labelsLoad(viewer, sfxc)

Load labels into this DMPlex object.

labelsView(viewer)

Save DMPlex labels into a file.

localVectorLoad(viewer, sectiondm, sf, vec)

Load on-disk vector data into a local vector.

localVectorView(viewer, sectiondm, vec)

Save a local vector.

markBoundaryFaces(label[, value])

Mark all faces on the boundary.

metricAverage2(metric1, metric2, metricAvg)

Compute and return the unweighted average of two metrics.

metricAverage3(metric1, metric2, metric3, ...)

Compute and return the unweighted average of three metrics.

metricCreate([field])

Create a Riemannian metric field.

metricCreateIsotropic(indicator[, field])

Construct an isotropic metric from an error indicator.

metricCreateUniform(alpha[, field])

Construct a uniform isotropic metric.

metricDeterminantCreate([field])

Create the determinant field for a Riemannian metric.

metricEnforceSPD(metric, ometric, determinant)

Enforce symmetric positive-definiteness of a metric.

metricGetGradationFactor()

Return the metric gradation factor.

metricGetHausdorffNumber()

Return the metric Hausdorff number.

metricGetMaximumAnisotropy()

Return the maximum tolerated metric anisotropy.

metricGetMaximumMagnitude()

Return the maximum tolerated metric magnitude.

metricGetMinimumMagnitude()

Return the minimum tolerated metric magnitude.

metricGetNormalizationOrder()

Return the order p for L-p normalization.

metricGetNumIterations()

Return the number of parallel adaptation iterations.

metricGetTargetComplexity()

Return the target metric complexity.

metricGetVerbosity()

Return the verbosity of the mesh adaptation package.

metricIntersection2(metric1, metric2, metricInt)

Compute and return the intersection of two metrics.

metricIntersection3(metric1, metric2, ...)

Compute the intersection of three metrics.

metricIsIsotropic()

Return the flag indicating whether the metric is isotropic or not.

metricIsUniform()

Return the flag indicating whether the metric is uniform or not.

metricNoInsertion()

Return the flag indicating whether node insertion and deletion are turned off.

metricNoMovement()

Return the flag indicating whether node movement is turned off.

metricNoSurf()

Return the flag indicating whether surface modification is turned off.

metricNoSwapping()

Return the flag indicating whether facet swapping is turned off.

metricNormalize(metric, ometric, determinant)

Apply L-p normalization to a metric.

metricRestrictAnisotropyFirst()

Return true if anisotropy is restricted before normalization.

metricSetFromOptions()

Source code at petsc4py/PETSc/DMPlex.pyx:2240

metricSetGradationFactor(beta)

Set the metric gradation factor.

metricSetHausdorffNumber(hausd)

Set the metric Hausdorff number.

metricSetIsotropic(isotropic)

Record whether the metric is isotropic or not.

metricSetMaximumAnisotropy(a_max)

Set the maximum tolerated metric anisotropy.

metricSetMaximumMagnitude(h_max)

Set the maximum tolerated metric magnitude.

metricSetMinimumMagnitude(h_min)

Set the minimum tolerated metric magnitude.

metricSetNoInsertion(noInsert)

Set the flag indicating whether node insertion should be turned off.

metricSetNoMovement(noMove)

Set the flag indicating whether node movement should be turned off.

metricSetNoSurf(noSurf)

Set the flag indicating whether surface modification should be turned off.

metricSetNoSwapping(noSwap)

Set the flag indicating whether facet swapping should be turned off.

metricSetNormalizationOrder(p)

Set the order p for L-p normalization.

metricSetNumIterations(numIter)

Set the number of parallel adaptation iterations.

metricSetRestrictAnisotropyFirst(...)

Record whether anisotropy is be restricted before normalization or after.

metricSetTargetComplexity(targetComplexity)

Set the target metric complexity.

metricSetUniform(uniform)

Record whether the metric is uniform or not.

metricSetVerbosity(verbosity)

Set the verbosity of the mesh adaptation package.

orient()

Give a consistent orientation to the input mesh.

permute(perm)

Reorder the mesh according to the input permutation.

rebalanceSharedPoints([entityDepth, ...])

Redistribute shared points in order to achieve better balancing.

reorderGetDefault()

Return flag indicating whether the DMPlex should be reordered by default.

reorderSetDefault(flag)

Set flag indicating whether the DM should be reordered by default.

sectionLoad(viewer, sectiondm, sfxc)

Load section into a DM.

sectionView(viewer, sectiondm)

Save a section associated with a DMPlex.

setAdjacencyUseAnchors([useAnchors])

Define adjacency in the mesh using the point-to-point constraints.

setCellType(p, ctype)

Set the polytope type of a given cell.

setChart(pStart, pEnd)

Set the interval for all mesh points [pStart, pEnd).

setCone(p, cone[, orientation])

Set the points on the in-edges for this point in the DAG.

setConeOrientation(p, orientation)

Set the orientations on the in-edges for this point in the DAG.

setConeSize(p, size)

Set the number of in-edges for this point in the DAG.

setMatClosure(sec, gsec, mat, point, values)

Set an array of the values on the closure of point.

setPartitioner(part)

Set the mesh partitioner.

setRefinementLimit(refinementLimit)

Set the maximum cell volume for refinement.

setRefinementUniform([refinementUniform])

Set the flag for uniform refinement.

setSupport(p, supp)

Set the points on the out-edges for this point in the DAG.

setSupportSize(p, size)

Set the number of out-edges for this point in the DAG.

setTetGenOptions(opts)

Set the options used for the Tetgen mesh generator.

setTriangleOptions(opts)

Set the options used for the Triangle mesh generator.

setVecClosure(sec, vec, point, values[, addv])

Set an array of the values on the closure of point.

stratify()

Calculate the strata of DAG.

symmetrize()

Create support (out-edge) information from cone (in-edge) information.

topologyLoad(viewer)

Load a topology into this DMPlex object.

topologyView(viewer)

Save a DMPlex topology into a file.

uninterpolate()

Convert to a mesh with only cells and vertices.

vecGetClosure(sec, vec, p)

Return an array of values on the closure of p.

Methods Documentation

computeCellGeometryFVM(cell)#

Compute the volume for a given cell.

Collective.

Parameters:

cell (int) – The cell.

Returns:

  • volume (float) – The cell volume.

  • centroid (ArrayReal) – The cell centroid.

  • normal (ArrayReal) – The cell normal, if appropriate.

Return type:

tuple[float, ArrayReal, ArrayReal]

Source code at petsc4py/PETSc/DMPlex.pyx:2177

computeGradientClementInterpolant(locX, locC)#

Return the L2 projection of the cellwise gradient of a function onto P1.

Collective.

Parameters:
  • locX (Vec) – The coefficient vector of the function.

  • locC (Vec) – The output Vec which holds the Clement interpolant of the gradient.

Return type:

Vec

Source code at petsc4py/PETSc/DMPlex.pyx:2978

constructGhostCells(labelName=None)#

Construct ghost cells which connect to every boundary face.

Collective.

Parameters:

labelName (str | None) – The name of the label specifying the boundary faces. Defaults to "Face Sets".

Returns:

numGhostCells – The number of ghost cells added to the DMPlex.

Return type:

int

Source code at petsc4py/PETSc/DMPlex.pyx:2209

coordinatesLoad(viewer, sfxc)#

Load coordinates into this DMPlex object.

Collective.

Parameters:
Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:3151

coordinatesView(viewer)#

Save DMPlex coordinates into a file.

Collective.

Parameters:

viewer (Viewer) – The Viewer for saving.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:3018

create(comm=None)#

Create a DMPlex object, which encapsulates an unstructured mesh.

Collective.

Parameters:

comm (Comm | None) – MPI communicator, defaults to Sys.getDefaultComm.

Return type:

Self

Source code at petsc4py/PETSc/DMPlex.pyx:22

createBoxMesh(faces, lower=(0, 0, 0), upper=(1, 1, 1), simplex=True, periodic=False, interpolate=True, comm=None)#

Create a mesh on the tensor product of intervals.

Collective.

Parameters:
Return type:

Self

Source code at petsc4py/PETSc/DMPlex.pyx:98

createBoxSurfaceMesh(faces, lower=(0, 0, 0), upper=(1, 1, 1), interpolate=True, comm=None)#

Create a mesh on the surface of a box mesh using tensor cells.

Collective.

Parameters:
Return type:

Self

Source code at petsc4py/PETSc/DMPlex.pyx:149

createCGNS(cgid, interpolate=True, comm=None)#

Create a DMPlex mesh from a CGNS file.

Collective.

Parameters:
  • cgid (int) – The CG id associated with a file and obtained using cg_open.

  • interpolate (bool | None) – Create faces and edges in the mesh.

  • comm (Comm | None) – MPI communicator, defaults to Sys.getDefaultComm.

Return type:

Self

Source code at petsc4py/PETSc/DMPlex.pyx:226

createCGNSFromFile(filename, interpolate=True, comm=None)#

“Create a DMPlex mesh from a CGNS file.

Collective.

Parameters:
  • filename (str) – The name of the CGNS file.

  • interpolate (bool | None) – Create faces and edges in the mesh.

  • comm (Comm | None) – MPI communicator, defaults to Sys.getDefaultComm.

Return type:

Self

Source code at petsc4py/PETSc/DMPlex.pyx:254

createClosureIndex(sec)#

Calculate an index for sec for the closure operation.

Not collective.

Parameters:

sec (Section) – The Section describing the layout in the local vector, or None to use the default section.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:1999

createCoarsePointIS()#

Create an IS covering the coarse DMPlex chart with the fine points as data.

Collective.

Returns:

fpointIS – The IS of all the fine points which exist in the original coarse mesh.

Return type:

IS

Source code at petsc4py/PETSc/DMPlex.pyx:1786

createCohesiveSubmesh(hasLagrange, value)#

Extract the hypersurface defined by one face of the cohesive cells.

Parameters:
  • hasLagrange (bool) – Flag indicating whether the mesh has Lagrange dofs in the cohesive cells.

  • value (int) – A label value.

Return type:

DMPlex

Source code at petsc4py/PETSc/DMPlex.pyx:377

createExodus(exoid, interpolate=True, comm=None)#

Create a DMPlex mesh from an ExodusII file ID.

Collective.

Parameters:
  • exoid (int) – The ExodusII id associated with a exodus file and obtained using ex_open.

  • interpolate (bool | None) – Create faces and edges in the mesh,

  • comm (Comm | None) – MPI communicator, defaults to Sys.getDefaultComm.

Return type:

Self

Source code at petsc4py/PETSc/DMPlex.pyx:312

createExodusFromFile(filename, interpolate=True, comm=None)#

Create a DMPlex mesh from an ExodusII file.

Collective.

Parameters:
  • filename (str) – The name of the ExodusII file.

  • interpolate (bool | None) – Create faces and edges in the mesh.

  • comm (Comm | None) – MPI communicator, defaults to Sys.getDefaultComm.

Return type:

Self

Source code at petsc4py/PETSc/DMPlex.pyx:283

createFromCellList(dim, cells, coords, interpolate=True, comm=None)#

Create a DMPlex from a list of vertices for each cell on process 0.

Collective.

Parameters:
  • dim (int) – The topological dimension of the mesh.

  • cells (Sequence[int]) – An array of number of cells times number of vertices on each cell.

  • coords (Sequence[float]) – An array of number of vertices times spatial dimension for coordinates.

  • interpolate (bool | None) – Flag to interpolate the mesh.

  • comm (Comm | None) – MPI communicator, defaults to Sys.getDefaultComm.

Return type:

Self

Source code at petsc4py/PETSc/DMPlex.pyx:43

createFromFile(filename, plexname='unnamed', interpolate=True, comm=None)#

Create DMPlex from a file.

Collective.

Parameters:
  • filename (str) – A file name.

  • plexname (str | None) – The name of the resulting DMPlex, also used for intra-datafile lookup by some formats.

  • interpolate (bool | None) – Flag to create intermediate mesh pieces (edges, faces).

  • comm (Comm | None) – MPI communicator, defaults to Sys.getDefaultComm.

Source code at petsc4py/PETSc/DMPlex.pyx:192

createGmsh(viewer, interpolate=True, comm=None)#

Create a DMPlex mesh from a Gmsh file viewer.

Collective.

Parameters:
Return type:

Self

Notes

-dm_plex_gmsh_hybrid forces triangular prisms to use tensor order.

-dm_plex_gmsh_periodic allows for reading Gmsh periodic section.

-dm_plex_gmsh_highorder allows for generating high-order coordinates.

-dm_plex_gmsh_project projects high-order coordinates to a different space, use the prefix -dm_plex_gmsh_project_ to define the space.

-dm_plex_gmsh_use_regions generates labels with region names.

-dm_plex_gmsh_mark_vertices adds vertices to generated labels.

-dm_plex_gmsh_multiple_tags allows multiple tags for default labels.

-dm_plex_gmsh_spacedim <d> embedding space dimension.

Source code at petsc4py/PETSc/DMPlex.pyx:339

createPointNumbering()#

Create a global numbering for all points.

Collective.

Source code at petsc4py/PETSc/DMPlex.pyx:907

Return type:

IS

createSection(numComp, numDof, bcField=None, bcComps=None, bcPoints=None, perm=None)#

Create a Section based upon the DOF layout specification provided.

Not collective.

Parameters:
  • numComp (Sequence[int]) – An array of size numFields holding the number of components per field.

  • numDof (Sequence[int]) – An array of size numFields*(dim+1) holding the number of DOFs per field on a mesh piece of dimension dim.

  • bcField (Sequence[int] | None) – An array of size numBC giving the field number for each boundary condition, where numBC is the number of boundary conditions.

  • bcComps (Sequence[IS] | None) – An array of size numBC giving an IS holding the field components to which each boundary condition applies.

  • bcPoints (Sequence[IS] | None) – An array of size numBC giving an IS holding the DMPlex points to which each boundary condition applies.

  • perm (IS | None) – Permutation of the chart.

Return type:

Section

Source code at petsc4py/PETSc/DMPlex.pyx:1806

distribute(overlap=0)#

Distribute the mesh and any associated sections.

Collective.

Parameters:

overlap (int | None) – The overlap of partitions.

Returns:

sf – The SF used for point distribution, or None if not distributed.

Return type:

SF or None

Source code at petsc4py/PETSc/DMPlex.pyx:1536

distributeField(sf, sec, vec, newsec=None, newvec=None)#

Distribute field data with a with a given SF.

Collective.

Parameters:
  • sf (SF) – The SF describing the communication pattern.

  • sec (Section) – The Section for existing data layout.

  • vec (Vec) – The existing data in a local vector.

  • newsec (Section | None) – The SF describing the new data layout.

  • newvec (Vec | None) – The new data in a local vector.

Returns:

  • newSection (Section) – The SF describing the new data layout.

  • newVec (Vec) – The new data in a local vector.

Return type:

tuple[Section, Vec]

Source code at petsc4py/PETSc/DMPlex.pyx:1727

distributeGetDefault()#

Return a flag indicating whether the DM should be distributed by default.

Not collective.

Returns:

dist – Flag indicating whether the DMPlex should be distributed by default.

Return type:

bool

Source code at petsc4py/PETSc/DMPlex.pyx:1620

distributeOverlap(overlap=0)#

Add partition overlap to a distributed non-overlapping DMPlex.

Collective.

Parameters:

overlap (int | None) – The overlap of partitions (the same on all ranks).

Returns:

sf – The SF used for point distribution.

Return type:

SF

Source code at petsc4py/PETSc/DMPlex.pyx:1564

distributeSetDefault(flag)#

Set flag indicating whether the DMPlex should be distributed by default.

Logically collective.

Parameters:

flag (bool) – Flag indicating whether the DMPlex should be distributed by default.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:1640

distributionGetName()#

Retrieve the name of the specific parallel distribution.

Returns:

name – The name of the specific parallel distribution.

Return type:

str

Source code at petsc4py/PETSc/DMPlex.pyx:1679

distributionSetName(name)#

Set the name of the specific parallel distribution.

Parameters:

name (str) – The name of the specific parallel distribution.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:1660

generate(boundary, name=None, interpolate=True)#

Generate a mesh.

Not collective.

Parameters:
  • boundary (DMPlex) – The DMPlex boundary object.

  • name (str | None) – The mesh generation package name.

  • interpolate (bool | None) – Flag to create intermediate mesh elements.

Return type:

Self

Source code at petsc4py/PETSc/DMPlex.pyx:1276

getAdjacency(p)#

Return all points adjacent to the given point.

Parameters:

p (int) – The point.

Return type:

ArrayInt

Source code at petsc4py/PETSc/DMPlex.pyx:1446

getAdjacencyUseAnchors()#

Query whether adjacency in the mesh uses the point-to-point constraints.

Source code at petsc4py/PETSc/DMPlex.pyx:1433

Return type:

bool

getCellNumbering()#

Return a global cell numbering for all cells on this process.

Source code at petsc4py/PETSc/DMPlex.pyx:881

Return type:

IS

getCellType(p)#

Return the polytope type of a given cell.

Not collective.

Parameters:

p (int) – The cell.

Return type:

PolytopeType

Source code at petsc4py/PETSc/DMPlex.pyx:683

getCellTypeLabel()#

Return the DMLabel recording the polytope type of each cell.

Not collective.

Source code at petsc4py/PETSc/DMPlex.pyx:704

Return type:

DMLabel

getChart()#

Return the interval for all mesh points [pStart, pEnd).

Not collective.

Returns:

  • pStart (int) – The first mesh point.

  • pEnd (int) – The upper bound for mesh points.

Return type:

tuple[int, int]

Source code at petsc4py/PETSc/DMPlex.pyx:398

getCone(p)#

Return the points on the in-edges for this point in the DAG.

Not collective.

Parameters:

p (int) – The point, which must lie in the chart set with DMPlex.setChart.

Return type:

ArrayInt

Source code at petsc4py/PETSc/DMPlex.pyx:489

getConeOrientation(p)#

Return the orientations on the in-edges for this point in the DAG.

Not collective.

Parameters:

p (int) – The point, which must lie in the chart set with DMPlex.setChart.

Return type:

ArrayInt

Source code at petsc4py/PETSc/DMPlex.pyx:604

getConeSize(p)#

Return the number of in-edges for this point in the DAG.

Not collective.

Parameters:

p (int) – The point, which must lie in the chart set with DMPlex.setChart.

Return type:

int

Source code at petsc4py/PETSc/DMPlex.pyx:440

getDepth()#

Return the depth of the DAG representing this mesh.

Not collective.

Source code at petsc4py/PETSc/DMPlex.pyx:921

Return type:

int

getDepthStratum(svalue)#

Return the bounds [start, end) for all points at a certain depth.

Not collective.

Parameters:

svalue (int) – The requested depth.

Returns:

  • pStart (int) – The first stratum point.

  • pEnd (int) – The upper bound for stratum points.

Return type:

tuple[int, int]

Source code at petsc4py/PETSc/DMPlex.pyx:936

getFullJoin(points)#

Return an array for the join of the set of points.

Not collective.

Parameters:

points (Sequence[int]) – The input points.

Return type:

ArrayInt

Source code at petsc4py/PETSc/DMPlex.pyx:1084

getHeightStratum(svalue)#

Return the bounds [start, end) for all points at a certain height.

Not collective.

Parameters:

svalue (int) – The requested height.

Returns:

  • pStart (int) – The first stratum point.

  • pEnd (int) – The upper bound for stratum points.

Return type:

tuple[int, int]

Source code at petsc4py/PETSc/DMPlex.pyx:963

getJoin(points)#

Return an array for the join of the set of points.

Not collective.

Parameters:

points (Sequence[int]) – The input points.

Return type:

ArrayInt

Source code at petsc4py/PETSc/DMPlex.pyx:1058

getMaxSizes()#

Return the maximum number of in-edges and out-edges of the DAG.

Not collective.

Returns:

  • maxConeSize (int) – The maximum number of in-edges.

  • maxSupportSize (int) – The maximum number of out-edges.

Return type:

tuple[int, int]

Source code at petsc4py/PETSc/DMPlex.pyx:824

getMeet(points)#

Return an array for the meet of the set of points.

Not collective.

Parameters:

points (Sequence[int]) – The input points.

Return type:

ArrayInt

Source code at petsc4py/PETSc/DMPlex.pyx:1032

getMinRadius()#

Return the minimum distance from any cell centroid to a face.

Not collective.

Source code at petsc4py/PETSc/DMPlex.pyx:1772

Return type:

float

getOrdering(otype)#

Calculate a reordering of the mesh.

Collective.

Parameters:

otype (OrderingType) – Type of reordering, see Mat.OrderingType.

Returns:

perm – The point permutation.

Return type:

IS

Source code at petsc4py/PETSc/DMPlex.pyx:2090

getPartitioner()#

Return the mesh partitioner.

Not collective.

Source code at petsc4py/PETSc/DMPlex.pyx:1487

Return type:

Partitioner

getPointDepth(point)#

Return the depth of a given point.

Not collective.

Parameters:

point (int) – The point.

Return type:

int

Source code at petsc4py/PETSc/DMPlex.pyx:990

getPointGlobal(point)#

Return location of point data in global Vec.

Not collective.

Parameters:

point (int) – The topological point.

Returns:

  • start (int) – Start of point data; returns -(globalStart+1) if point is not owned.

  • end (int) – End of point data; returns -(globalEnd+1) if point is not owned.

Return type:

tuple[int, int]

Source code at petsc4py/PETSc/DMPlex.pyx:1940

getPointGlobalField(point, field)#

Return location of point field data in global Vec.

Not collective.

Parameters:
  • point (int) – The topological point.

  • field (int) – The field number.

Returns:

  • start (int) – Start of point data; returns -(globalStart+1) if point is not owned.

  • end (int) – End of point data; returns -(globalEnd+1) if point is not owned.

Return type:

tuple[int, int]

Source code at petsc4py/PETSc/DMPlex.pyx:1968

getPointHeight(point)#

Return the height of a given point.

Not collective.

Parameters:

point (int) – The point.

Return type:

int

Source code at petsc4py/PETSc/DMPlex.pyx:1011

getPointLocal(point)#

Return location of point data in local Vec.

Not collective.

Parameters:

point (int) – The topological point.

Returns:

  • start (int) – Start of point data.

  • end (int) – End of point data.

Return type:

tuple[int, int]

Source code at petsc4py/PETSc/DMPlex.pyx:1881

getPointLocalField(point, field)#

Return location of point field data in local Vec.

Not collective.

Parameters:
  • point (int) – The topological point.

  • field (int) – The field number.

Returns:

  • start (int) – Start of point data.

  • end (int) – End of point data.

Return type:

tuple[int, int]

Source code at petsc4py/PETSc/DMPlex.pyx:1909

getRefinementLimit()#

Retrieve the maximum cell volume for refinement.

Source code at petsc4py/PETSc/DMPlex.pyx:2076

Return type:

float

getRefinementUniform()#

Retrieve the flag for uniform refinement.

Returns:

refinementUniform – The flag for uniform refinement.

Return type:

bool

Source code at petsc4py/PETSc/DMPlex.pyx:2039

getSupport(p)#

Return the points on the out-edges for this point in the DAG.

Not collective.

Parameters:

p (int) – The point, which must lie in the chart set with DMPlex.setChart.

Return type:

ArrayInt

Source code at petsc4py/PETSc/DMPlex.pyx:769

getSupportSize(p)#

Return the number of out-edges for this point in the DAG.

Not collective.

Parameters:

p (int) – The point, which must lie in the chart set with DMPlex.setChart.

Return type:

int

Source code at petsc4py/PETSc/DMPlex.pyx:720

getTransitiveClosure(p, useCone=True)#

Return the points and orientations on the transitive closure of this point.

Not collective.

Parameters:
  • p (int) – The mesh point.

  • useCone (bool | None) – True for the closure, otherwise return the star.

Returns:

  • points (ArrayInt) – The points.

  • orientations (ArrayInt) – The orientations.

Return type:

tuple[ArrayInt, ArrayInt]

Source code at petsc4py/PETSc/DMPlex.pyx:1110

getVecClosure(sec, vec, point)#

Return an array of the values on the closure of a point.

Not collective.

Parameters:
  • sec (Section) – The Section describing the layout in vec or None to use the default section.

  • vec (Vec) – The local vector.

  • point (int) – The point in the DMPlex.

Return type:

ArrayScalar

Source code at petsc4py/PETSc/DMPlex.pyx:1177

getVertexNumbering()#

Return a global vertex numbering for all vertices on this process.

Source code at petsc4py/PETSc/DMPlex.pyx:894

Return type:

IS

globalVectorLoad(viewer, sectiondm, sf, vec)#

Load on-disk vector data into a global vector.

Collective.

Parameters:
  • viewer (Viewer) – The Viewer that represents the on-disk vector data.

  • sectiondm (DM) – The DM that contains the global section on which vec is defined.

  • sf (SF) – The SF that migrates the on-disk vector data into vec.

  • vec (Vec) – The global vector to set values of.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:3228

globalVectorView(viewer, sectiondm, vec)#

Save a global vector.

Collective.

Parameters:
  • viewer (Viewer) – The Viewer to save data with.

  • sectiondm (DM) – The DM containing the global section on which vec is defined; may be the same as this DMPlex object.

  • vec (Vec) – The global vector to be saved.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:3075

insertCone(p, conePos, conePoint)#

DMPlexInsertCone - Insert a point into the in-edges for the point p in the DAG.

Not collective.

Parameters:
  • p (int) – The point, which must lie in the chart set with DMPlex.setChart.

  • conePos (int) – The local index in the cone where the point should be put.

  • conePoint (int) – The mesh point to insert.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:554

insertConeOrientation(p, conePos, coneOrientation)#

Insert a point orientation for the in-edge for the point p in the DAG.

Not collective.

Parameters:
  • p (int) – The point, which must lie in the chart set with DMPlex.setChart

  • conePos (int) – The local index in the cone where the point should be put.

  • coneOrientation (int) – The point orientation to insert.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:579

interpolate()#

Convert to a mesh with all intermediate faces, edges, etc.

Collective.

Source code at petsc4py/PETSc/DMPlex.pyx:1697

Return type:

None

isDistributed()#

Return the flag indicating if the mesh is distributed.

Collective.

Source code at petsc4py/PETSc/DMPlex.pyx:1593

Return type:

bool

isSimplex()#

Return the flag indicating if the first cell is a simplex.

Source code at petsc4py/PETSc/DMPlex.pyx:1607

Return type:

bool

labelCohesiveComplete(label, bdlabel, bdvalue, flip, subdm)#

Add all other mesh pieces to complete the surface.

Parameters:
  • label (DMLabel) – A DMLabel marking the surface.

  • bdlabel (DMLabel) – A DMLabel marking the vertices on the boundary which will not be duplicated.

  • bdvalue (int) – Value of DMLabel marking the vertices on the boundary.

  • flip (bool) – Flag to flip the submesh normal and replace points on the other side.

  • subdm (DMPlex) – The DMPlex associated with the label.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:1386

labelComplete(label)#

Add the transitive closure to the surface.

Parameters:

label (DMLabel) – A DMLabel marking the surface points.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:1371

labelsLoad(viewer, sfxc)#

Load labels into this DMPlex object.

Collective.

Parameters:
Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:3171

labelsView(viewer)#

Save DMPlex labels into a file.

Collective.

Parameters:

viewer (Viewer) – The Viewer for saving.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:3036

localVectorLoad(viewer, sectiondm, sf, vec)#

Load on-disk vector data into a local vector.

Collective.

Parameters:
  • viewer (Viewer) – The Viewer that represents the on-disk vector data.

  • sectiondm (DM) – The DM that contains the local section on which vec is defined.

  • sf (SF) – The SF that migrates the on-disk vector data into vec.

  • vec (Vec) – The local vector to set values of.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:3253

localVectorView(viewer, sectiondm, vec)#

Save a local vector.

Collective.

Parameters:
  • viewer (Viewer) – The Viewer to save data with.

  • sectiondm (DM) – The DM that contains the local section on which vec is defined; may be the same as this DMPlex object.

  • vec (Vec) – The local vector to be saved.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:3099

markBoundaryFaces(label, value=None)#

Mark all faces on the boundary.

Not collective.

Parameters:
  • value (int | None) – The marker value, or DETERMINE or None to use some value in the closure (or 1 if none are found).

  • label (str) –

Return type:

DMLabel

Source code at petsc4py/PETSc/DMPlex.pyx:1344

metricAverage2(metric1, metric2, metricAvg)#

Compute and return the unweighted average of two metrics.

Parameters:
  • metric1 (Vec) – The first metric to be averaged.

  • metric2 (Vec) – The second metric to be averaged.

  • metricAvg (Vec) – The output averaged metric.

Return type:

Vec

Source code at petsc4py/PETSc/DMPlex.pyx:2894

metricAverage3(metric1, metric2, metric3, metricAvg)#

Compute and return the unweighted average of three metrics.

Parameters:
  • metric1 (Vec) – The first metric to be averaged.

  • metric2 (Vec) – The second metric to be averaged.

  • metric3 (Vec) – The third metric to be averaged.

  • metricAvg (Vec) – The output averaged metric.

Return type:

Vec

Source code at petsc4py/PETSc/DMPlex.pyx:2914

metricCreate(field=0)#

Create a Riemannian metric field.

Parameters:

field (int | None) – The field number to use.

Return type:

Vec

Source code at petsc4py/PETSc/DMPlex.pyx:2736

metricCreateIsotropic(indicator, field=0)#

Construct an isotropic metric from an error indicator.

Parameters:
  • indicator (Vec) – The error indicator.

  • field (int | None) – The field number to use.

Return type:

Vec

Source code at petsc4py/PETSc/DMPlex.pyx:2777

metricCreateUniform(alpha, field=0)#

Construct a uniform isotropic metric.

Parameters:
  • alpha (float) – Scaling parameter for the diagonal.

  • field (int | None) – The field number to use.

Return type:

Vec

Source code at petsc4py/PETSc/DMPlex.pyx:2755

metricDeterminantCreate(field=0)#

Create the determinant field for a Riemannian metric.

Parameters:

field (int | None) – The field number to use.

Returns:

  • determinant (Vec) – The determinant field.

  • dmDet (DM) – The corresponding DM

Return type:

tuple[Vec, DM]

Source code at petsc4py/PETSc/DMPlex.pyx:2798

metricEnforceSPD(metric, ometric, determinant, restrictSizes=False, restrictAnisotropy=False)#

Enforce symmetric positive-definiteness of a metric.

Parameters:
  • metric (Vec) – The metric.

  • ometric (Vec) – The output metric.

  • determinant (Vec) – The output determinant.

  • restrictSizes (bool | None) – Flag indicating whether maximum/minimum magnitudes should be enforced.

  • restrictAnisotropy (bool | None) – Flag indicating whether maximum anisotropy should be enforced.

Returns:

  • ometric (Vec) – The output metric.

  • determinant (Vec) – The output determinant.

Return type:

tuple[Vec, Vec]

Source code at petsc4py/PETSc/DMPlex.pyx:2825

metricGetGradationFactor()#

Return the metric gradation factor.

Source code at petsc4py/PETSc/DMPlex.pyx:2693

Return type:

float

metricGetHausdorffNumber()#

Return the metric Hausdorff number.

Source code at petsc4py/PETSc/DMPlex.pyx:2723

Return type:

float

metricGetMaximumAnisotropy()#

Return the maximum tolerated metric anisotropy.

Source code at petsc4py/PETSc/DMPlex.pyx:2603

Return type:

float

metricGetMaximumMagnitude()#

Return the maximum tolerated metric magnitude.

Source code at petsc4py/PETSc/DMPlex.pyx:2573

Return type:

float

metricGetMinimumMagnitude()#

Return the minimum tolerated metric magnitude.

Source code at petsc4py/PETSc/DMPlex.pyx:2543

Return type:

float

metricGetNormalizationOrder()#

Return the order p for L-p normalization.

Source code at petsc4py/PETSc/DMPlex.pyx:2663

Return type:

float

metricGetNumIterations()#

Return the number of parallel adaptation iterations.

Source code at petsc4py/PETSc/DMPlex.pyx:2513

Return type:

int

metricGetTargetComplexity()#

Return the target metric complexity.

Source code at petsc4py/PETSc/DMPlex.pyx:2633

Return type:

float

metricGetVerbosity()#

Return the verbosity of the mesh adaptation package.

Returns:

verbosity – The verbosity, where -1 is silent and 10 is maximum.

Return type:

int

Source code at petsc4py/PETSc/DMPlex.pyx:2478

metricIntersection2(metric1, metric2, metricInt)#

Compute and return the intersection of two metrics.

Parameters:
  • metric1 (Vec) – The first metric to be intersected.

  • metric2 (Vec) – The second metric to be intersected.

  • metricInt (Vec) – The output intersected metric.

Return type:

Vec

Source code at petsc4py/PETSc/DMPlex.pyx:2936

metricIntersection3(metric1, metric2, metric3, metricInt)#

Compute the intersection of three metrics.

Parameters:
  • metric1 (Vec) – The first metric to be intersected.

  • metric2 (Vec) – The second metric to be intersected.

  • metric3 (Vec) – The third metric to be intersected.

  • metricInt (Vec) – The output intersected metric.

Return type:

Vec

Source code at petsc4py/PETSc/DMPlex.pyx:2956

metricIsIsotropic()#

Return the flag indicating whether the metric is isotropic or not.

Source code at petsc4py/PETSc/DMPlex.pyx:2290

Return type:

bool

metricIsUniform()#

Return the flag indicating whether the metric is uniform or not.

Source code at petsc4py/PETSc/DMPlex.pyx:2260

Return type:

bool

metricNoInsertion()#

Return the flag indicating whether node insertion and deletion are turned off.

Source code at petsc4py/PETSc/DMPlex.pyx:2351

Return type:

bool

metricNoMovement()#

Return the flag indicating whether node movement is turned off.

Source code at petsc4py/PETSc/DMPlex.pyx:2415

Return type:

bool

metricNoSurf()#

Return the flag indicating whether surface modification is turned off.

Source code at petsc4py/PETSc/DMPlex.pyx:2447

Return type:

bool

metricNoSwapping()#

Return the flag indicating whether facet swapping is turned off.

Source code at petsc4py/PETSc/DMPlex.pyx:2383

Return type:

bool

metricNormalize(metric, ometric, determinant, restrictSizes=True, restrictAnisotropy=True)#

Apply L-p normalization to a metric.

Parameters:
  • metric (Vec) – The metric.

  • ometric (Vec) – The output metric.

  • determinant (Vec) – The output determinant.

  • restrictSizes (bool | None) – Flag indicating whether maximum/minimum magnitudes should be enforced.

  • restrictAnisotropy (bool | None) – Flag indicating whether maximum anisotropy should be enforced.

Returns:

  • ometric (Vec) – The output normalized metric.

  • determinant (Vec) – The output determinant.

Return type:

tuple[Vec, Vec]

Source code at petsc4py/PETSc/DMPlex.pyx:2860

metricRestrictAnisotropyFirst()#

Return true if anisotropy is restricted before normalization.

Source code at petsc4py/PETSc/DMPlex.pyx:2320

Return type:

bool

metricSetFromOptions()#

Source code at petsc4py/PETSc/DMPlex.pyx:2240

Return type:

None

metricSetGradationFactor(beta)#

Set the metric gradation factor.

Parameters:

beta (float) – The metric gradation factor.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:2676

metricSetHausdorffNumber(hausd)#

Set the metric Hausdorff number.

Parameters:

hausd (float) – The metric Hausdorff number.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:2706

metricSetIsotropic(isotropic)#

Record whether the metric is isotropic or not.

Parameters:

isotropic (bool) – Flag indicating whether the metric is isotropic or not.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:2273

metricSetMaximumAnisotropy(a_max)#

Set the maximum tolerated metric anisotropy.

Parameters:

a_max (float) – The maximum tolerated metric anisotropy.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:2586

metricSetMaximumMagnitude(h_max)#

Set the maximum tolerated metric magnitude.

Parameters:

h_max (float) – The maximum tolerated metric magnitude.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:2556

metricSetMinimumMagnitude(h_min)#

Set the minimum tolerated metric magnitude.

Parameters:

h_min (float) – The minimum tolerated metric magnitude.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:2526

metricSetNoInsertion(noInsert)#

Set the flag indicating whether node insertion should be turned off.

Parameters:

noInsert (bool) – Flag indicating whether node insertion and deletion should be turned off.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:2333

metricSetNoMovement(noMove)#

Set the flag indicating whether node movement should be turned off.

Parameters:

noMove (bool) – Flag indicating whether node movement should be turned off.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:2397

metricSetNoSurf(noSurf)#

Set the flag indicating whether surface modification should be turned off.

Parameters:

noSurf (bool) – Flag indicating whether surface modification should be turned off.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:2429

metricSetNoSwapping(noSwap)#

Set the flag indicating whether facet swapping should be turned off.

Parameters:

noSwap (bool) – Flag indicating whether facet swapping should be turned off.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:2365

metricSetNormalizationOrder(p)#

Set the order p for L-p normalization.

Parameters:

p (float) – The normalization order.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:2646

metricSetNumIterations(numIter)#

Set the number of parallel adaptation iterations.

Parameters:

numIter (int) – The number of parallel adaptation iterations.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:2496

metricSetRestrictAnisotropyFirst(restrictAnisotropyFirst)#

Record whether anisotropy is be restricted before normalization or after.

Parameters:

restrictAnisotropyFirst (bool) – Flag indicating if anisotropy is restricted before normalization or after.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:2303

metricSetTargetComplexity(targetComplexity)#

Set the target metric complexity.

Parameters:

targetComplexity (float) – The target metric complexity.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:2616

metricSetUniform(uniform)#

Record whether the metric is uniform or not.

Parameters:

uniform (bool) – Flag indicating whether the metric is uniform or not.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:2243

metricSetVerbosity(verbosity)#

Set the verbosity of the mesh adaptation package.

Parameters:

verbosity (int) – The verbosity, where -1 is silent and 10 is maximum.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:2461

orient()#

Give a consistent orientation to the input mesh.

Source code at petsc4py/PETSc/DMPlex.pyx:871

Return type:

None

permute(perm)#

Reorder the mesh according to the input permutation.

Collective.

Parameters:

perm (IS) – The point permutation, perm[old point number] = new point number.

Returns:

pdm – The permuted DMPlex.

Return type:

DMPlex

Source code at petsc4py/PETSc/DMPlex.pyx:2118

rebalanceSharedPoints(entityDepth=0, useInitialGuess=True, parallel=True)#

Redistribute shared points in order to achieve better balancing.

Parameters:
  • entityDepth (int | None) – Depth of the entity to balance (e.g., 0 -> balance vertices).

  • useInitialGuess (bool | None) – Whether to use the current distribution as initial guess.

  • parallel (bool | None) – Whether to use ParMETIS and do the partition in parallel or gather the graph onto a single process.

Returns:

success – Whether the graph partitioning was successful or not. Unsuccessful simply means no change to the partitioning.

Return type:

bool

Source code at petsc4py/PETSc/DMPlex.pyx:1504

reorderGetDefault()#

Return flag indicating whether the DMPlex should be reordered by default.

Not collective.

Source code at petsc4py/PETSc/DMPlex.pyx:2142

Return type:

ReorderDefaultFlag

reorderSetDefault(flag)#

Set flag indicating whether the DM should be reordered by default.

Logically collective.

Parameters:

Source code at petsc4py/PETSc/DMPlex.pyx:2156

sectionLoad(viewer, sectiondm, sfxc)#

Load section into a DM.

Collective.

Parameters:
  • viewer (Viewer) – The Viewer that represents the on-disk section (sectionA).

  • sectiondm (DM) – The DM into which the on-disk section (sectionA) is migrated.

  • sfxc (SF) – The SF returned by topologyLoad.

Returns:

  • gsf (SF) – The SF that migrates any on-disk Vec data associated with sectionA into a global Vec associated with the sectiondm’s global section (None if not needed).

  • lsf (SF) – The SF that migrates any on-disk Vec data associated with sectionA into a local Vec associated with the sectiondm’s local section (None if not needed).

Return type:

tuple[SF, SF]

Source code at petsc4py/PETSc/DMPlex.pyx:3191

sectionView(viewer, sectiondm)#

Save a section associated with a DMPlex.

Collective.

Parameters:
  • viewer (Viewer) – The Viewer for saving.

  • sectiondm (DM) – The DM that contains the section to be saved.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:3054

setAdjacencyUseAnchors(useAnchors=True)#

Define adjacency in the mesh using the point-to-point constraints.

Parameters:

useAnchors (bool) – Flag to use the constraints. If True, then constrained points are omitted from DMPlex.getAdjacency, and their anchor points appear in their place.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:1414

setCellType(p, ctype)#

Set the polytope type of a given cell.

Not collective.

Parameters:
  • p (int) – The cell.

  • ctype (PolytopeType) – The polytope type of the cell.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:661

setChart(pStart, pEnd)#

Set the interval for all mesh points [pStart, pEnd).

Not collective.

Parameters:
  • pStart (int) – The first mesh point.

  • pEnd (int) – The upper bound for mesh points.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:419

setCone(p, cone, orientation=None)#

Set the points on the in-edges for this point in the DAG.

Not collective.

Parameters:
  • p (int) – The point, which must lie in the chart set with DMPlex.setChart.

  • cone (Sequence[int]) – An array of points which are on the in-edges for point p.

  • orientation (Sequence[int] | None) – An array of orientations, defaults to None.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:515

setConeOrientation(p, orientation)#

Set the orientations on the in-edges for this point in the DAG.

Not collective.

Parameters:
Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:630

setConeSize(p, size)#

Set the number of in-edges for this point in the DAG.

Not collective.

Parameters:
  • p (int) – The point, which must lie in the chart set with DMPlex.setChart.

  • size (int) – The cone size for point p.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:464

setMatClosure(sec, gsec, mat, point, values, addv=None)#

Set an array of the values on the closure of point.

Not collective.

Parameters:
  • sec (Section) – The section describing the layout in mat, or None to use the default section.

  • gsec (Section) – The section describing the layout in mat, or None to use the default global section.

  • mat (Mat) – The matrix.

  • point (int) – The point in the DMPlex.

  • values (Sequence[Scalar]) – The array of values.

  • mode – The insertion mode.

  • addv (InsertModeSpec | None) –

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:1239

setPartitioner(part)#

Set the mesh partitioner.

Logically collective.

Parameters:

part (Partitioner) – The partitioner.

Source code at petsc4py/PETSc/DMPlex.pyx:1469

setRefinementLimit(refinementLimit)#

Set the maximum cell volume for refinement.

Parameters:

refinementLimit (float) – The maximum cell volume in the refined mesh.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:2058

setRefinementUniform(refinementUniform=True)#

Set the flag for uniform refinement.

Parameters:

refinementUniform (bool | None) – The flag for uniform refinement.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:2021

setSupport(p, supp)#

Set the points on the out-edges for this point in the DAG.

Not collective.

Parameters:
  • p (int) – The point, which must lie in the chart set with DMPlex.setChart.

  • supp (Sequence[int]) – An array of points which are on the out-edges for point p.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:795

setSupportSize(p, size)#

Set the number of out-edges for this point in the DAG.

Not collective.

Parameters:
  • p (int) – The point, which must lie in the chart set with DMPlex.setChart.

  • size (int) – The support size for point p.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:744

setTetGenOptions(opts)#

Set the options used for the Tetgen mesh generator.

Not collective.

Parameters:

opts (str) – The command line options.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:1324

setTriangleOptions(opts)#

Set the options used for the Triangle mesh generator.

Not collective.

Parameters:

opts (str) – The command line options.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:1304

setVecClosure(sec, vec, point, values, addv=None)#

Set an array of the values on the closure of point.

Not collective.

Parameters:
  • sec (Section) – The section describing the layout in vec, or None to use the default section.

  • vec (Vec) – The local vector.

  • point (int) – The point in the DMPlex.

  • values (Sequence[Scalar]) – The array of values.

  • mode – The insertion mode.

  • addv (InsertModeSpec | None) –

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:1207

stratify()#

Calculate the strata of DAG.

Collective.

Source code at petsc4py/PETSc/DMPlex.pyx:859

Return type:

None

symmetrize()#

Create support (out-edge) information from cone (in-edge) information.

Not collective.

Source code at petsc4py/PETSc/DMPlex.pyx:846

Return type:

None

topologyLoad(viewer)#

Load a topology into this DMPlex object.

Collective.

Parameters:

viewer (Viewer) – The Viewer for the saved topology

Returns:

sfxc – The SF that pushes points in [0, N) to the associated points in the loaded DMPlex, where N is the global number of points.

Return type:

SF

Source code at petsc4py/PETSc/DMPlex.pyx:3125

topologyView(viewer)#

Save a DMPlex topology into a file.

Collective.

Parameters:

viewer (Viewer) – The Viewer for saving.

Return type:

None

Source code at petsc4py/PETSc/DMPlex.pyx:3000

uninterpolate()#

Convert to a mesh with only cells and vertices.

Collective.

Source code at petsc4py/PETSc/DMPlex.pyx:1712

Return type:

None

vecGetClosure(sec, vec, p)#

Return an array of values on the closure of p.

Not collective.

Parameters:
  • sec (Section) – The section describing the layout in vec.

  • vec (Vec) – The local vector.

  • p (int) – The point in the DMPlex.

Return type:

ArrayScalar

Source code at petsc4py/PETSc/DMPlex.pyx:1149