petsc4py.PETSc.DMComposite#
- class petsc4py.PETSc.DMComposite#
Bases:
DM
A DM object that is used to manage data for a collection of DMs.
Methods Summary
addDM
(dm, *args)Add a DM vector to the composite.
create
([comm])Create a composite object.
gather
(gvec, imode, lvecs)Gather split local vectors into a coupled global vector.
getAccess
(gvec[, locs])Get access to the individual vectors from the global vector.
Return sub-DMs contained in the composite.
Return the index sets for each composed object in the composite.
Return a local-to-global mapping for each DM in the composite.
Return index sets for each component of a composite local vector.
Get number of sub-DMs contained in the composite.
scatter
(gvec, lvecs)Scatter coupled global vector into split local vectors.
Methods Documentation
- addDM(dm, *args)#
Add a DM vector to the composite.
Collective.
See also
- create(comm=None)#
Create a composite object.
Collective.
- Parameters:
comm (Comm | None) – MPI communicator, defaults to
Sys.getDefaultComm
.- Return type:
See also
- gather(gvec, imode, lvecs)#
Gather split local vectors into a coupled global vector.
Collective.
- Parameters:
gvec (Vec) – The global vector.
imode (InsertModeSpec) – The insertion mode.
- Return type:
See also
- getAccess(gvec, locs=None)#
Get access to the individual vectors from the global vector.
Not collective.
Use via
The with statement
context manager (PEP 343).- Parameters:
- Return type:
- getEntries()#
Return sub-DMs contained in the composite.
Not collective.
See also
- getGlobalISs()#
Return the index sets for each composed object in the composite.
Collective.
These could be used to extract a subset of vector entries for a “multi-physics” preconditioner.
Use
getLocalISs
for index sets in the packed local numbering, andgetLGMaps
for to map local sub-DM (including ghost) indices to packed global indices.See also
- getLGMaps()#
Return a local-to-global mapping for each DM in the composite.
Collective.
Note that this includes all the ghost points that individual ghosted DMDA may have.
- getLocalISs()#
Return index sets for each component of a composite local vector.
Not collective.
To get the composite global indices at all local points (including ghosts), use
getLGMaps
.To get index sets for pieces of the composite global vector, use
getGlobalISs
.See also
- getNumber()#
Get number of sub-DMs contained in the composite.
Not collective.
See also
Source code at petsc4py/PETSc/DMComposite.pyx:50
- Return type:
- scatter(gvec, lvecs)#
Scatter coupled global vector into split local vectors.
Collective.
- Parameters:
- Return type:
See also