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
- clearStratum(stratum)#
Remove a stratum.
Not collective.
See also
- clearValue(point, value)#
Clear the value a label assigns to a point.
Not collective.
See also
- computeIndex()#
Create an index structure for membership determination.
Not collective.
Automatically determines the bounds.
See also
Source code at petsc4py/PETSc/DMLabel.pyx:422
- Return type:
- create(name, comm=None)#
Create a
DMLabel
object, which is a multimap.Collective.
- Parameters:
- Return type:
See also
- createIndex(pStart, pEnd)#
Create an index structure for membership determination.
Not collective.
- Parameters:
- Return type:
See also
- destroy()#
Destroy the label.
Collective.
See also
Source code at petsc4py/PETSc/DMLabel.pyx:8
- Return type:
- destroyIndex()#
Destroy the index structure.
Not collective.
See also
Source code at petsc4py/PETSc/DMLabel.pyx:456
- Return type:
- duplicate()#
Duplicate the
DMLabel
.Collective.
See also
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
- gather(sf)#
Gather all label values from leaves into roots.
Collective.
This is the inverse operation to
distribute
.See also
- 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
- 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
Source code at petsc4py/PETSc/DMLabel.pyx:161
- Return type:
- getNonEmptyStratumValuesIS()#
Return an
IS
of all values that theDMLabel
takes.Not collective.
See also
Source code at petsc4py/PETSc/DMLabel.pyx:620
- Return type:
- getNumValues()#
Return the number of values that the
DMLabel
takes.Not collective.
See also
Source code at petsc4py/PETSc/DMLabel.pyx:273
- Return type:
- getStratumSize(stratum)#
Return the size of a stratum.
Not collective.
See also
- 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
- getValueIS()#
Return an
IS
of all values that theDMLabel
takes.Not collective.
See also
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
- hasStratum(value)#
Determine whether points exist with the given value.
Not collective.
See also
- hasValue(value)#
Determine whether a label assigns the value to any point.
Not collective.
See also
- permute(permutation)#
Create a new label with permuted points.
Not collective.
See also
- reset()#
Destroy internal data structures in the
DMLabel
.Not collective.
See also
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
- 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
- stratumHasPoint(value, point)#
Return whether the stratum contains a point.
Not collective.
See also
- view(viewer=None)#
View the label.
Collective.
See also