petsc4py.PETSc.DMLabel¶
- class petsc4py.PETSc.DMLabel¶
Bases:
ObjectAn 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
DMLabelobject, 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
DMLabeltakes.getStratumIS(stratum)Return an
ISwith 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
ISto 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.DMLabelComputeIndexSource code at petsc4py/PETSc/DMLabel.pyx:422
- Return type:
- convertToSection()¶
Return a
SectionandISthat encode the label.Not collective.
See also
petsc.DMLabelConvertToSection
- create(name, comm=None)¶
Create a
DMLabelobject, 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.DMLabelDestroySource code at petsc4py/PETSc/DMLabel.pyx:8
- Return type:
- destroyIndex()¶
Destroy the index structure.
Not collective.
See also
createIndex,petsc.DMLabelDestroyIndexSource 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.DMLabelDuplicateSource 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.DMLabelGetDefaultValueSource code at petsc4py/PETSc/DMLabel.pyx:161
- Return type:
- getNonEmptyStratumValuesIS()¶
Return an
ISof all values that theDMLabeltakes.Not collective.
See also
petsc.DMLabelGetNonEmptyStratumValuesISSource code at petsc4py/PETSc/DMLabel.pyx:620
- Return type:
- getNumValues()¶
Return the number of values that the
DMLabeltakes.Not collective.
See also
petsc.DMLabelGetNumValuesSource code at petsc4py/PETSc/DMLabel.pyx:273
- Return type:
- getStratumIS(stratum)¶
Return an
ISwith 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
ISof all values that theDMLabeltakes.Not collective.
See also
petsc.DMLabelGetValueISSource code at petsc4py/PETSc/DMLabel.pyx:287
- Return type:
- hasPoint(point)¶
Determine whether the label contains a point.
Not collective.
The user must call
createIndexbefore 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
ISto 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.DMLabelResetSource 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