petsc4py.PETSc.DMLabel
- class petsc4py.PETSc.DMLabel
Bases:
Object
An object representing a subset of mesh entities from a
DM
.Methods Summary
addStrata
(strata)Add new stratum values in a
DMLabel
.addStrataIS
(iset)Add new stratum values in a
DMLabel
.addStratum
(value)Add a new stratum value in a
DMLabel
.clearStratum
(stratum)Remove a stratum.
clearValue
(point, value)Clear the value a label assigns to a point.
Create an index structure for membership determination.
create
(name[, comm])Create a
DMLabel
object, which is a multimap.createIndex
(pStart, pEnd)Create an index structure for membership determination.
destroy
()Destroy the label.
Destroy the index structure.
distribute
(sf)Create a new label pushed forward over the
SF
.Duplicate the
DMLabel
.filter
(start, end)Remove all points outside of [start, end).
gather
(sf)Gather all label values from leaves into roots.
Return the smallest and largest point in the label.
Return the default value returned by
getValue
.Return the number of values that the
DMLabel
takes.getStratumIS
(stratum)Return an
IS
with the stratum points.getStratumSize
(stratum)Return the size of a stratum.
getValue
(point)Return the value a label assigns to a point.
hasPoint
(point)Determine whether the label contains a point.
hasStratum
(value)Determine whether points exist with the given value.
hasValue
(value)Determine whether a label assigns the value to any point.
insertIS
(iset, value)Set all points in the
IS
to a value.permute
(permutation)Create a new label with permuted points.
reset
()Destroy internal data structures in the
DMLabel
.setDefaultValue
(value)Set the default value returned by
getValue
.setStratumIS
(stratum, iset)Set the stratum points using an
IS
.setValue
(point, value)Set the value a label assigns to a point.
stratumHasPoint
(value, point)Return whether the stratum contains a point.
view
([viewer])View the label.
Methods Documentation
- addStrata(strata)
Add new stratum values in a
DMLabel
.Not collective.
See also
addStrataIS
,addStratum
,petsc.DMLabelAddStrata
- addStrataIS(iset)
Add new stratum values in a
DMLabel
.Not collective.
See also
addStrata
,addStratum
,petsc.DMLabelAddStrataIS
- addStratum(value)
Add a new stratum value in a
DMLabel
.See also
addStrata
,addStrataIS
,petsc.DMLabelAddStratum
- clearStratum(stratum)
Remove a stratum.
Not collective.
See also
petsc.DMLabelClearStratum
- clearValue(point, value)
Clear the value a label assigns to a point.
Not collective.
See also
petsc.DMLabelClearValue
- computeIndex()
Create an index structure for membership determination.
Not collective.
Automatically determines the bounds.
See also
petsc.DMLabelComputeIndex
Source code at petsc4py/PETSc/DMLabel.pyx:422
- Return type:
- convertToSection()
Return a
Section
andIS
that encode the label.Not collective.
See also
petsc.DMLabelConvertToSection
- create(name, comm=None)
Create a
DMLabel
object, which is a multimap.Collective.
- Parameters:
- Return type:
See also
petsc.DMLabelCreate
- createIndex(pStart, pEnd)
Create an index structure for membership determination.
Not collective.
- Parameters:
- Return type:
See also
destroyIndex
,petsc.DMLabelCreateIndex
- destroy()
Destroy the label.
Collective.
See also
petsc.DMLabelDestroy
Source code at petsc4py/PETSc/DMLabel.pyx:8
- Return type:
- destroyIndex()
Destroy the index structure.
Not collective.
See also
createIndex
,petsc.DMLabelDestroyIndex
Source code at petsc4py/PETSc/DMLabel.pyx:456
- Return type:
- distribute(sf)
Create a new label pushed forward over the
SF
.Collective.
See also
gather
,petsc.DMLabelDistribute
- duplicate()
Duplicate the
DMLabel
.Collective.
See also
petsc.DMLabelDuplicate
Source code at petsc4py/PETSc/DMLabel.pyx:65
- Return type:
- filter(start, end)
Remove all points outside of [start, end).
Not collective.
- Parameters:
- Return type:
See also
petsc.DMLabelFilter
- gather(sf)
Gather all label values from leaves into roots.
Collective.
This is the inverse operation to
distribute
.See also
distribute
,petsc.DMLabelGather
- getBounds()
Return the smallest and largest point in the label.
Not collective.
The returned values are the smallest point and the largest point + 1.
See also
petsc.DMLabelGetBounds
- getDefaultValue()
Return the default value returned by
getValue
.Not collective.
The default value is returned if a point has not been explicitly given a value. When a label is created, it is initialized to
-1
.See also
setDefaultValue
,petsc.DMLabelGetDefaultValue
Source code at petsc4py/PETSc/DMLabel.pyx:161
- Return type:
- getNonEmptyStratumValuesIS()
Return an
IS
of all values that theDMLabel
takes.Not collective.
See also
petsc.DMLabelGetNonEmptyStratumValuesIS
Source code at petsc4py/PETSc/DMLabel.pyx:620
- Return type:
- getNumValues()
Return the number of values that the
DMLabel
takes.Not collective.
See also
petsc.DMLabelGetNumValues
Source code at petsc4py/PETSc/DMLabel.pyx:273
- Return type:
- getStratumIS(stratum)
Return an
IS
with the stratum points.Not collective.
See also
setStratumIS
,petsc.DMLabelGetStratumIS
- getStratumSize(stratum)
Return the size of a stratum.
Not collective.
See also
petsc.DMLabelGetStratumSize
- getValue(point)
Return the value a label assigns to a point.
Not collective.
If no value was assigned, a default value will be returned The default value, initially
-1
, can be changed withsetDefaultValue
.See also
setValue
,setDefaultValue
,petsc.DMLabelGetValue
- getValueIS()
Return an
IS
of all values that theDMLabel
takes.Not collective.
See also
petsc.DMLabelGetValueIS
Source code at petsc4py/PETSc/DMLabel.pyx:287
- Return type:
- hasPoint(point)
Determine whether the label contains a point.
Not collective.
The user must call
createIndex
before this function.See also
hasValue
,petsc.DMLabelHasPoint
- hasStratum(value)
Determine whether points exist with the given value.
Not collective.
See also
petsc.DMLabelHasStratum
- hasValue(value)
Determine whether a label assigns the value to any point.
Not collective.
See also
hasPoint
,petsc.DMLabelHasValue
- insertIS(iset, value)
Set all points in the
IS
to a value.Not collective.
See also
petsc.DMLabelInsertIS
- permute(permutation)
Create a new label with permuted points.
Not collective.
See also
petsc.DMLabelPermute
- reset()
Destroy internal data structures in the
DMLabel
.Not collective.
See also
petsc.DMLabelReset
Source code at petsc4py/PETSc/DMLabel.pyx:79
- Return type:
- setDefaultValue(value)
Set the default value returned by
getValue
.Not collective.
The value is used if a point has not been explicitly given a value. When a label is created, the default value is initialized to
-1
.See also
getDefaultValue
,petsc.DMLabelSetDefaultValue
- setStratumIS(stratum, iset)
Set the stratum points using an
IS
.Not collective.
See also
getStratumIS
,petsc.DMLabelSetStratumIS
- setValue(point, value)
Set the value a label assigns to a point.
Not collective.
If the value is the same as the label’s default value (which is initially
-1
, and can be changed withsetDefaultValue
), this function will do nothing.See also
getValue
,setDefaultValue
,petsc.DMLabelSetValue
- stratumHasPoint(value, point)
Return whether the stratum contains a point.
Not collective.
See also
petsc.DMLabelStratumHasPoint