DMShell and Other DM Types
This page documents DMShell (user-defined DM), DMProduct (Cartesian product of DMs), DMRedundant (redundantly-stored DM), and DMComposite (deprecated composite DM).
DMShell
DMShell allows users to define custom DM implementations by providing callback functions for operations like creating vectors, matrices, and managing topology.
Basic DMShell Usage
using PETSc, MPI
# Initialize MPI and PETSc
MPI.Init()
petsclib = PETSc.getlib()
PETSc.initialize(petsclib)
# Create a DMShell (returns a PetscDM) and set callbacks
shell = LibPETSc.DMShellCreate(petsclib, MPI.COMM_WORLD)
# Set callbacks on the returned DM, for example:
# LibPETSc.DMShellSetCreateGlobalVector(petsclib, shell, ...)
# LibPETSc.DMShellSetCreateLocalVector(petsclib, shell, ...)
# LibPETSc.DMShellSetCreateMatrix(petsclib, shell, ...)
# Set up
LibPETSc.DMSetUp(petsclib, shell)
# Cleanup
LibPETSc.DMDestroy(petsclib, shell)
# Finalize PETSc and MPI
PETSc.finalize(petsclib)
MPI.Finalize()DMProduct
DMProduct represents a Cartesian product of multiple DMs, useful for coupled multi-physics problems.
Basic DMProduct Usage
using PETSc, MPI
# Initialize MPI and PETSc
MPI.Init()
petsclib = PETSc.getlib()
PETSc.initialize(petsclib)
# Create two simple component DMs (here using small box DMPlex meshes)
dm1 = LibPETSc.DMPlexCreateBoxMesh(
petsclib, MPI.COMM_WORLD, 2, LibPETSc.PETSC_FALSE,
[1,1], [0.0,0.0], [1.0,1.0], [LibPETSc.DM_BOUNDARY_NONE, LibPETSc.DM_BOUNDARY_NONE], LibPETSc.PETSC_TRUE, 0, LibPETSc.PETSC_FALSE
)
dm2 = LibPETSc.DMPlexCreateBoxMesh(
petsclib, MPI.COMM_WORLD, 2, LibPETSc.PETSC_FALSE,
[1,1], [0.0,0.0], [1.0,1.0], [LibPETSc.DM_BOUNDARY_NONE, LibPETSc.DM_BOUNDARY_NONE], LibPETSc.PETSC_TRUE, 0, LibPETSc.PETSC_FALSE
)
# Create a DMProduct and attach component DMs
product = LibPETSc.DMCreate(petsclib, MPI.COMM_WORLD)
LibPETSc.DMSetType(petsclib, product, "product")
# Set the product 'topological' dimension to the number of component DMs
LibPETSc.DMSetDimension(petsclib, product, 2)
# Map product slots to sub-DM dimensions (index mapping); then attach sub-DMs
LibPETSc.DMProductSetDimensionIndex(petsclib, product, 0, 0)
LibPETSc.DMProductSetDimensionIndex(petsclib, product, 1, 0)
LibPETSc.DMProductSetDM(petsclib, product, 0, dm1)
LibPETSc.DMProductSetDM(petsclib, product, 1, dm2)
# Set up
LibPETSc.DMSetUp(petsclib, product)
# Cleanup
LibPETSc.DMDestroy(petsclib, product)
LibPETSc.DMDestroy(petsclib, dm1)
LibPETSc.DMDestroy(petsclib, dm2)
# Finalize PETSc and MPI
PETSc.finalize(petsclib)
MPI.Finalize()DMRedundant
DMRedundant stores data redundantly across all processes, useful for small shared data.
DMComposite
DMComposite (deprecated, use DMProduct instead) manages multiple DMs as separate fields.
Functions
DMShell Functions
PETSc.LibPETSc.DMShellCreate — Method
dm::PetscDM = DMShellCreate(petsclib::PetscLibType, comm::MPI_Comm)Creates a DMSHELL object, used to manage user-defined problem data
Collective
Input Parameter:
comm- the processors that will share the global vector
Output Parameter:
dm- theDMSHELL
Level: advanced
See also: DMDestroy(), DMCreateGlobalVector(), DMCreateLocalVector(), DMShellSetContext(), DMShellGetContext()
External Links
- PETSc Manual:
DM/DMShellCreate
PETSc.LibPETSc.DMShellGetCoarsen — Method
DMShellGetCoarsen(petsclib::PetscLibType, dm::AbstractPetscDM, noname::Ptr{Cvoid})Get the routine used to coarsen the DMSHELL
Logically Collective
Input Parameter:
dm- theDMSHELL
Output Parameter:
coarsen- the routine that coarsens theDM
Calling sequence of coarsen:
fine- theDMto coarsencomm- theMPI_Commto share the coarserDMcoarse- the resulting coarseDM
Level: advanced
See also: DM, DMSHELL, DMShellSetCoarsen(), DMCoarsen(), DMShellSetRefine(), DMRefine()
External Links
- PETSc Manual:
DM/DMShellGetCoarsen
PETSc.LibPETSc.DMShellGetContext — Method
ctx::Ptr{Cvoid} = DMShellGetContext(petsclib::PetscLibType, dm::AbstractPetscDM)Returns the user-provided context associated to the DMSHELL
Collective
Input Parameter:
dm-DMSHELL
Output Parameter:
ctx- the context
Level: advanced
See also: DM, DMSHELL, DMCreateMatrix(), DMShellSetContext()
External Links
- PETSc Manual:
DM/DMShellGetContext
PETSc.LibPETSc.DMShellGetCreateInjection — Method
DMShellGetCreateInjection(petsclib::PetscLibType, dm::AbstractPetscDM, noname::Ptr{Cvoid})Get the routine used to create the injection operator
Logically Collective
Input Parameter:
dm- theDMSHELL
Output Parameter:
inject- the routine to create the injection
Calling sequence of inject:
fine- the fineDMcoarse- theDMto inject toinject- the output injectionMat
Level: advanced
See also: DM, DMSHELL, DMShellGetCreateInterpolation(), DMCreateInjection(), DMShellSetContext(), DMShellGetContext()
External Links
- PETSc Manual:
DM/DMShellGetCreateInjection
PETSc.LibPETSc.DMShellGetCreateInterpolation — Method
DMShellGetCreateInterpolation(petsclib::PetscLibType, dm::AbstractPetscDM, noname::Ptr{Cvoid})Get the routine used to create the interpolation operator
Logically Collective
Input Parameter:
dm- theDMSHELL
Output Parameter:
interp- the routine to create the interpolation
Calling sequence of interp:
coarse- theDMto refine tofine- the fineDMinterp- the output interpolationMatrscale- an output scalingVec, seeDMCreateInterpolationScale()
Level: advanced
See also: DM, DMSHELL, DMShellGetCreateInjection(), DMCreateInterpolation(), DMShellGetCreateRestriction(), DMShellSetContext(), DMShellGetContext()
External Links
- PETSc Manual:
DM/DMShellGetCreateInterpolation
PETSc.LibPETSc.DMShellGetCreateRestriction — Method
DMShellGetCreateRestriction(petsclib::PetscLibType, dm::AbstractPetscDM, noname::Ptr{Cvoid})Get the routine used to create the restriction operator
Logically Collective
Input Parameter:
dm- theDMSHELL
Output Parameter:
restriction- the routine to create the restriction
Calling sequence of restriction:
fine- the fineDMcoarse- theDMto restrict torestrct- the output restrictionMat
Level: advanced
See also: DM, DMSHELL, DMShellSetCreateInjection(), DMCreateInterpolation(), DMShellSetContext(), DMShellGetContext()
External Links
- PETSc Manual:
DM/DMShellGetCreateRestriction
PETSc.LibPETSc.DMShellGetCreateSubDM — Method
DMShellGetCreateSubDM(petsclib::PetscLibType, dm::AbstractPetscDM, noname::Ptr{Cvoid})Get the routine used to create a sub DM from the DMSHELL
Logically Collective
Input Parameter:
dm- theDMSHELL
Output Parameter:
subdm- the routine to create the decomposition
Calling sequence of subdm:
dm- the originalDMnumFields- the number of fields to createfields- the fields to create foris- output, theISdefining the subDMsubdm- the subDM
Level: advanced
See also: DM, DMSHELL, DMCreateSubDM(), DMShellSetCreateSubDM(), DMShellSetContext(), DMShellGetContext()
External Links
- PETSc Manual:
DM/DMShellGetCreateSubDM
PETSc.LibPETSc.DMShellGetGlobalVector — Method
DMShellGetGlobalVector(petsclib::PetscLibType, dm::AbstractPetscDM, X::AbstractPetscVec)Returns the template global vector associated with the DMSHELL, or NULL if it was not set
Not Collective
Input Parameters:
dm-DMSHELLX- template vector
Level: advanced
See also: DM, DMSHELL, DMShellSetGlobalVector(), DMShellSetCreateGlobalVector(), DMCreateGlobalVector()
External Links
- PETSc Manual:
DM/DMShellGetGlobalVector
PETSc.LibPETSc.DMShellGetRefine — Method
DMShellGetRefine(petsclib::PetscLibType, dm::AbstractPetscDM, noname::Ptr{Cvoid})Get the routine used to refine the DMSHELL
Logically Collective
Input Parameter:
dm- theDMSHELL
Output Parameter:
refine- the routine that refines theDM
Calling sequence of refine:
coarse- theDMto refinecomm- theMPI_Commto share the finerDMfine- the resulting fineDM
Level: advanced
See also: DM, DMSHELL, DMShellSetCoarsen(), DMCoarsen(), DMShellSetRefine(), DMRefine()
External Links
- PETSc Manual:
DM/DMShellGetRefine
PETSc.LibPETSc.DMShellSetCoarsen — Method
DMShellSetCoarsen(petsclib::PetscLibType, dm::AbstractPetscDM, coarsen::external)Set the routine used to coarsen the DMSHELL
Logically Collective
Input Parameters:
dm- theDMSHELLcoarsen- the routine that coarsens theDM
Calling sequence of coarsen:
fine- theDMto coarsencomm- theMPI_Commto share the coarserDMcoarse- the resulting coarseDM
Level: advanced
See also: DM, DMSHELL, DMShellSetRefine(), DMCoarsen(), DMShellGetCoarsen(), DMShellSetContext(), DMShellGetContext()
External Links
- PETSc Manual:
DM/DMShellSetCoarsen
PETSc.LibPETSc.DMShellSetContext — Method
DMShellSetContext(petsclib::PetscLibType, dm::AbstractPetscDM, ctx::Ptr{Cvoid})set some data to be usable by this DMSHELL
Collective
Input Parameters:
dm-DMSHELLctx- the context
Level: advanced
See also: DM, DMSHELL, DMCreateMatrix(), DMShellGetContext()
External Links
- PETSc Manual:
DM/DMShellSetContext
PETSc.LibPETSc.DMShellSetCreateDomainDecomposition — Method
DMShellSetCreateDomainDecomposition(petsclib::PetscLibType, dm::AbstractPetscDM, decomp::external)Set the routine used to create a domain decomposition for the DMSHELL
Logically Collective
Input Parameters:
dm- theDMSHELLdecomp- the routine to create the decomposition
Calling sequence of decomp:
dm- theDMto decompose into domainslen- output, the number of domains (orNULLif not requested)namelist- output, the name for each domain (orNULLif not requested)innerlist- output, the global indices for each domain's inner region (orNULLif not requested)outerlist- output, the global indices for each domain's outer region (orNULLif not requested)dmlist- output, theDMs for each field subproblem (orNULL, if not requested; ifNULLis returned, noDMs are defined)
Level: advanced
See also: DM, DMSHELL, DMCreateDomainDecomposition(), DMShellSetContext(), DMShellGetContext()
External Links
- PETSc Manual:
DM/DMShellSetCreateDomainDecomposition
PETSc.LibPETSc.DMShellSetCreateDomainDecompositionScatters — Method
DMShellSetCreateDomainDecompositionScatters(petsclib::PetscLibType, dm::AbstractPetscDM, scatter::external)Set the routine used to create the scatter contexts for domain decomposition with a DMSHELL
Logically Collective
Input Parameters:
dm- theDMSHELLscatter- the routine to create the scatters
Calling sequence of scatter:
dm- theDMto decompose into domainsn- number of subdomainssubdms- the subDMiscat- output, the inner scatters for the subdomainsoscat- output, outer scatters for the subdomainsgscat- output, the global scatters for the subdomains
Level: advanced
See also: DM, DMSHELL, DMCreateDomainDecompositionScatters(), DMShellSetContext(), DMShellGetContext()
External Links
- PETSc Manual:
DM/DMShellSetCreateDomainDecompositionScatters
PETSc.LibPETSc.DMShellSetCreateFieldDecomposition — Method
DMShellSetCreateFieldDecomposition(petsclib::PetscLibType, dm::AbstractPetscDM, decomp::external)Set the routine used to create a decomposition of fields for the DMSHELL
Logically Collective
Input Parameters:
dm- theDMSHELLdecomp- the routine to create the decomposition
Calling sequence of decomp:
dm- theDMto decompose into fieldslen- output, the number of fields (orNULLif not requested)namelist- output, the name for each field (orNULLif not requested)islist- output, the global indices for each field (orNULLif not requested)dmlist- output, theDMs for each field subproblem (orNULL, if not requested; ifNULLis returned, noDMs are defined)
Level: advanced
See also: DM, DMSHELL, DMCreateFieldDecomposition(), DMShellSetContext(), DMShellGetContext()
External Links
- PETSc Manual:
DM/DMShellSetCreateFieldDecomposition
PETSc.LibPETSc.DMShellSetCreateGlobalVector — Method
DMShellSetCreateGlobalVector(petsclib::PetscLibType, dm::AbstractPetscDM, func::external)sets the routine to create a global vector associated with the DMSHELL
Logically Collective
Input Parameters:
dm- theDMSHELLfunc- the creation routine
Calling sequence of func:
dm- theDMg- the globalVecto be created
Level: advanced
See also: DM, DMSHELL, DMShellSetGlobalVector(), DMShellSetCreateMatrix(), DMShellSetContext(), DMShellGetContext()
External Links
- PETSc Manual:
DM/DMShellSetCreateGlobalVector
PETSc.LibPETSc.DMShellSetCreateInjection — Method
DMShellSetCreateInjection(petsclib::PetscLibType, dm::AbstractPetscDM, inject::external)Set the routine used to create the injection operator
Logically Collective
Input Parameters:
dm- theDMSHELLinject- the routine to create the injection
Calling sequence of inject:
fine- the fineDMcoarse- theDMto inject toinject- the output injectionMat
Level: advanced
See also: DM, DMSHELL, DMShellSetCreateInterpolation(), DMCreateInjection(), DMShellGetCreateInjection(), DMShellSetContext(), DMShellGetContext()
External Links
- PETSc Manual:
DM/DMShellSetCreateInjection
PETSc.LibPETSc.DMShellSetCreateInterpolation — Method
DMShellSetCreateInterpolation(petsclib::PetscLibType, dm::AbstractPetscDM, interp::external)Set the routine used to create the interpolation operator
Logically Collective
Input Parameters:
dm- theDMSHELLinterp- the routine to create the interpolation
Calling sequence of interp:
coarse- theDMto refine tofine- the fineDMinterp- the output interpolationMatrscale- an output scalingVec, seeDMCreateInterpolationScale()
Level: advanced
See also: DM, DMSHELL, DMShellSetCreateInjection(), DMCreateInterpolation(), DMShellGetCreateInterpolation(), DMShellSetCreateRestriction(), DMShellSetContext(), DMShellGetContext()
External Links
- PETSc Manual:
DM/DMShellSetCreateInterpolation
PETSc.LibPETSc.DMShellSetCreateLocalVector — Method
DMShellSetCreateLocalVector(petsclib::PetscLibType, dm::AbstractPetscDM, func::external)sets the routine to create a local vector associated with the DMSHELL
Logically Collective
Input Parameters:
dm- theDMSHELLfunc- the creation routine
Calling sequence of func:
dm- theDMl- the localVecto be created
Level: advanced
See also: DM, DMSHELL, DMShellSetLocalVector(), DMShellSetCreateMatrix(), DMShellSetContext(), DMShellGetContext()
External Links
- PETSc Manual:
DM/DMShellSetCreateLocalVector
PETSc.LibPETSc.DMShellSetCreateMatrix — Method
DMShellSetCreateMatrix(petsclib::PetscLibType, dm::AbstractPetscDM, func::external)sets the routine to create a matrix associated with the DMSHELL
Logically Collective
Input Parameters:
dm- theDMSHELLfunc- the function to create a matrix
Calling sequence of func:
dm- theDMmat- theMatto be created
Level: advanced
See also: DM, DMSHELL, DMCreateMatrix(), DMShellSetMatrix(), DMShellSetContext(), DMShellGetContext()
External Links
- PETSc Manual:
DM/DMShellSetCreateMatrix
PETSc.LibPETSc.DMShellSetCreateRestriction — Method
DMShellSetCreateRestriction(petsclib::PetscLibType, dm::AbstractPetscDM, restriction::external)Set the routine used to create the restriction operator
Logically Collective
Input Parameters:
dm- theDMSHELLrestriction- the routine to create the restriction
Calling sequence of restriction:
fine- the fineDMcoarse- theDMto restrict torestrct- the output restrictionMat
Level: advanced
See also: DM, DMSHELL, DMShellSetCreateInjection(), DMCreateInterpolation(), DMShellGetCreateRestriction(), DMShellSetContext(), DMShellGetContext()
External Links
- PETSc Manual:
DM/DMShellSetCreateRestriction
PETSc.LibPETSc.DMShellSetCreateSubDM — Method
DMShellSetCreateSubDM(petsclib::PetscLibType, dm::AbstractPetscDM, subdm::external)Set the routine used to create a sub DM from the DMSHELL
Logically Collective
Input Parameters:
dm- theDMSHELLsubdm- the routine to create the decomposition
Calling sequence of subdm:
dm- the originalDMnumFields- the number of fields to createfields- the fields to create foris- output, theISdefining the subDMsubdm- the subDM
Level: advanced
See also: DM, DMSHELL, DMCreateSubDM(), DMShellGetCreateSubDM(), DMShellSetContext(), DMShellGetContext()
External Links
- PETSc Manual:
DM/DMShellSetCreateSubDM
PETSc.LibPETSc.DMShellSetDestroyContext — Method
DMShellSetDestroyContext(petsclib::PetscLibType, dm::AbstractPetscDM, destroyctx::Ptr{Cvoid})set a function that destroys the context provided with DMShellSetContext()
Collective
Input Parameters:
dm- theDMto attach thedestroyctx()function todestroyctx- the function that destroys the context
Level: advanced
See also: DM, DMSHELL, DMShellSetContext(), DMShellGetContext()
External Links
- PETSc Manual:
DM/DMShellSetDestroyContext
PETSc.LibPETSc.DMShellSetGlobalToLocal — Method
DMShellSetGlobalToLocal(petsclib::PetscLibType, dm::AbstractPetscDM, begin_::external, end_::external)Sets the routines used to perform a global to local scatter
Logically Collective
Input Parameters:
dm- theDMSHELLbegin- the routine that begins the global to local scatterend- the routine that ends the global to local scatter
Calling sequence of begin:
dm- theDMglobal- the globalVecto be communicatedmode- insert mode of the resulting vectorlocal- the localVecto receive the result
Calling sequence of end:
dm- theDMglobal- the globalVecto be communicatedmode- insert mode of the resulting vectorlocal- the localVecto receive the result
Level: advanced
See also: DM, DMSHELL, DMShellSetLocalToGlobal(), DMGlobalToLocalBeginDefaultShell(), DMGlobalToLocalEndDefaultShell()
External Links
- PETSc Manual:
DM/DMShellSetGlobalToLocal
PETSc.LibPETSc.DMShellSetGlobalToLocalVecScatter — Method
DMShellSetGlobalToLocalVecScatter(petsclib::PetscLibType, dm::AbstractPetscDM, gtol::VecScatter)Sets a VecScatter context for global to local communication
Logically Collective
Input Parameters:
dm- theDMSHELLgtol- the global to localVecScattercontext
Level: advanced
See also: DM, DMSHELL, DMShellSetGlobalToLocal(), DMGlobalToLocalBeginDefaultShell(), DMGlobalToLocalEndDefaultShell()
External Links
- PETSc Manual:
DM/DMShellSetGlobalToLocalVecScatter
PETSc.LibPETSc.DMShellSetGlobalVector — Method
DMShellSetGlobalVector(petsclib::PetscLibType, dm::AbstractPetscDM, X::AbstractPetscVec)sets a template global vector associated with the DMSHELL
Logically Collective
Input Parameters:
dm-DMSHELLX- template vector
Level: advanced
See also: DM, DMSHELL, DMCreateGlobalVector(), DMShellSetMatrix(), DMShellSetCreateGlobalVector()
External Links
- PETSc Manual:
DM/DMShellSetGlobalVector
PETSc.LibPETSc.DMShellSetLocalToGlobal — Method
DMShellSetLocalToGlobal(petsclib::PetscLibType, dm::AbstractPetscDM, begin_::external, end_::external)Sets the routines used to perform a local to global scatter
Logically Collective
Input Parameters:
dm- theDMSHELLbegin- the routine that begins the local to global scatterend- the routine that ends the local to global scatter
Calling sequence of begin:
dm- theDMlocal- the localVecto be communicatedmode- insert mode of the resulting vectorglobal- the globalVecto receive the result
Calling sequence of end:
dm- theDMlocal- the localVecto be communicatedmode- insert mode of the resulting vectorglobal- the globalVecto receive the result
Level: advanced
See also: DM, DMSHELL, DMShellSetGlobalToLocal(), InsertMode, VecScatter, DMLocalToGlobal(), DMGlobalToLocal()
External Links
- PETSc Manual:
DM/DMShellSetLocalToGlobal
PETSc.LibPETSc.DMShellSetLocalToGlobalVecScatter — Method
DMShellSetLocalToGlobalVecScatter(petsclib::PetscLibType, dm::AbstractPetscDM, ltog::VecScatter)Sets aVecScatter context for local to global communication
Logically Collective
Input Parameters:
dm- theDMSHELLltog- the local to globalVecScattercontext
Level: advanced
See also: DM, DMSHELL, DMShellSetLocalToGlobal(), DMLocalToGlobalBeginDefaultShell(), DMLocalToGlobalEndDefaultShell()
External Links
- PETSc Manual:
DM/DMShellSetLocalToGlobalVecScatter
PETSc.LibPETSc.DMShellSetLocalToLocal — Method
DMShellSetLocalToLocal(petsclib::PetscLibType, dm::AbstractPetscDM, begin_::external, end_::external)Sets the routines used to perform a local to local scatter
Logically Collective
Input Parameters:
dm- theDMSHELLbegin- the routine that begins the local to local scatterend- the routine that ends the local to local scatter
Calling sequence of begin:
dm- theDMlocal- the localVecto be communicatedmode- insert mode of the resulting vectornlocal- the localVecto receive the result
Calling sequence of end:
dm- theDMlocal- the localVecto be communicatedmode- insert mode of the resulting vectornlocal- the localVecto receive the result
Level: advanced
See also: DM, DMSHELL, DMShellSetGlobalToLocal(), DMLocalToLocalBeginDefaultShell(), DMLocalToLocalEndDefaultShell(), DMLocalToLocalBegin(), DMLocalToLocalEnd()
External Links
- PETSc Manual:
DM/DMShellSetLocalToLocal
PETSc.LibPETSc.DMShellSetLocalToLocalVecScatter — Method
DMShellSetLocalToLocalVecScatter(petsclib::PetscLibType, dm::AbstractPetscDM, ltol::VecScatter)Sets a VecScatter context for local to local communication
Logically Collective
Input Parameters:
dm- theDMSHELLltol- the local to localVecScattercontext
Level: advanced
See also: DM, DMSHELL, DMShellSetLocalToLocal(), DMLocalToLocalBeginDefaultShell(), DMLocalToLocalEndDefaultShell()
External Links
- PETSc Manual:
DM/DMShellSetLocalToLocalVecScatter
PETSc.LibPETSc.DMShellSetLocalVector — Method
DMShellSetLocalVector(petsclib::PetscLibType, dm::AbstractPetscDM, X::AbstractPetscVec)sets a template local vector associated with the DMSHELL
Logically Collective
Input Parameters:
dm-DMSHELLX- template vector
Level: advanced
See also: DM, DMSHELL, DMCreateLocalVector(), DMShellSetMatrix(), DMShellSetCreateLocalVector()
External Links
- PETSc Manual:
DM/DMShellSetLocalVector
PETSc.LibPETSc.DMShellSetMatrix — Method
DMShellSetMatrix(petsclib::PetscLibType, dm::AbstractPetscDM, J::AbstractPetscMat)sets a template matrix associated with the DMSHELL
Collective
Input Parameters:
dm-DMSHELLJ- template matrix
Level: advanced
See also: DM, DMSHELL, DMCreateMatrix(), DMShellSetCreateMatrix(), DMShellSetContext(), DMShellGetContext()
External Links
- PETSc Manual:
DM/DMShellSetMatrix
PETSc.LibPETSc.DMShellSetRefine — Method
DMShellSetRefine(petsclib::PetscLibType, dm::AbstractPetscDM, refine::external)Set the routine used to refine the DMSHELL
Logically Collective
Input Parameters:
dm- theDMSHELLrefine- the routine that refines theDM
Calling sequence of refine:
coarse- theDMto refinecomm- theMPI_Commto share the finerDMfine- the resulting fineDM
Level: advanced
See also: DM, DMSHELL, DMShellSetCoarsen(), DMRefine(), DMShellGetRefine(), DMShellSetContext(), DMShellGetContext()
External Links
- PETSc Manual:
DM/DMShellSetRefine
DMProduct Functions
PETSc.LibPETSc.DMProductGetDM — Method
subdm::PetscDM = DMProductGetDM(petsclib::PetscLibType, dm::AbstractPetscDM, slot::PetscInt)Get sub-DM whose coordinates will be associated with a particular dimension of the DMPRODUCT
Not Collective
Input Parameters:
dm- theDMPRODUCTslot- which dimension withinDMPRODUCTwhose coordinates is being provided, in the range 0 to dim-1
Output Parameter:
subdm- the sub-DM
Level: advanced
See also: DMPRODUCT, DMProductSetDM(), DMProductGetDimensionIndex(), DMProductSetDimensionIndex()
External Links
- PETSc Manual:
DMPRODUCT/DMProductGetDM
PETSc.LibPETSc.DMProductGetDimensionIndex — Method
idx::PetscInt = DMProductGetDimensionIndex(petsclib::PetscLibType, dm::AbstractPetscDM, slot::PetscInt)Get which dimension idx of the sub-DM coordinates will be used associated with the DMPRODUCT dimension slot
Not Collective
Input Parameters:
dm- theDMPRODUCTslot- which dimension, in the range 0 to dim-1 ofdm
Output Parameter:
idx- the dimension of the sub-DM
Level: advanced
See also: DMPRODUCT, DMProductGetDM(), DMProductSetDimensionIndex()
External Links
- PETSc Manual:
DMPRODUCT/DMProductGetDimensionIndex
PETSc.LibPETSc.DMProductSetDM — Method
DMProductSetDM(petsclib::PetscLibType, dm::AbstractPetscDM, slot::PetscInt, subdm::AbstractPetscDM)Set sub-DM whose coordinates will be associated with a particular dimension of the DMPRODUCT
Not Collective
Input Parameters:
dm- theDMPRODUCTslot- which dimension withinDMPRODUCTwhose coordinates is being provided, in the range 0 to dim-1subdm- the sub-DM
Level: advanced
See also: DMPRODUCT, DMProductGetDM(), DMProductSetDimensionIndex(), DMProductGetDimensionIndex()
External Links
- PETSc Manual:
DMPRODUCT/DMProductSetDM
PETSc.LibPETSc.DMProductSetDimensionIndex — Method
DMProductSetDimensionIndex(petsclib::PetscLibType, dm::AbstractPetscDM, slot::PetscInt, idx::PetscInt)Set which dimension idx of the sub-DM coordinates will be used associated with the DMPRODUCT dimension slot
Not Collective
Input Parameters:
dm- theDMPRODUCTslot- which dimension, in the range 0 to dim-1 you are providing to thedmidx- the dimension of the sub-DMto use
Level: advanced
See also: DMPRODUCT, DMProductGetDM(), DMProductGetDimensionIndex()
External Links
- PETSc Manual:
DMPRODUCT/DMProductSetDimensionIndex
DMRedundant Functions
PETSc.LibPETSc.DMRedundantCreate — Method
dm::PetscDM = DMRedundantCreate(petsclib::PetscLibType, comm::MPI_Comm, rank::PetscMPIInt, N::PetscInt)Creates a DM object, used to manage data for dense globally coupled variables
Collective
Input Parameters:
comm- the processors that will share the global vectorrank- the MPI rank to own the redundant valuesN- total number of degrees of freedom
Output Parameter:
dm- theDMobject of typeDMREDUNDANT
Level: advanced
See also: DM, DMREDUNDANT, DMDestroy(), DMCreateGlobalVector(), DMCreateMatrix(), DMCompositeAddDM(), DMSetType(), DMRedundantSetSize(), DMRedundantGetSize()
External Links
- PETSc Manual:
DM/DMRedundantCreate
PETSc.LibPETSc.DMRedundantGetSize — Method
rank::PetscMPIInt,N::PetscInt = DMRedundantGetSize(petsclib::PetscLibType, dm::AbstractPetscDM)Gets the size of a densely coupled redundant object
Not Collective
Input Parameter:
dm-DMobject of typeDMREDUNDANT
Output Parameters:
rank- rank of process to own the redundant degrees of freedom (orNULL)N- total number of redundant degrees of freedom (orNULL)
Level: advanced
See also: DM, DMREDUNDANT, DMDestroy(), DMCreateGlobalVector(), DMRedundantCreate(), DMRedundantSetSize()
External Links
- PETSc Manual:
DM/DMRedundantGetSize
PETSc.LibPETSc.DMRedundantSetSize — Method
DMRedundantSetSize(petsclib::PetscLibType, dm::AbstractPetscDM, rank::PetscMPIInt, N::PetscInt)Sets the size of a densely coupled redundant object
Collective
Input Parameters:
dm-DMobject of typeDMREDUNDANTrank- rank of process to own the redundant degrees of freedomN- total number of redundant degrees of freedom
Level: advanced
See also: DM, DMREDUNDANT, DMDestroy(), DMCreateGlobalVector(), DMRedundantCreate(), DMRedundantGetSize()
External Links
- PETSc Manual:
DM/DMRedundantSetSize
DMComposite Functions
PETSc.LibPETSc.DMCompositeAddDM — Method
DMCompositeAddDM(petsclib::PetscLibType, dmc::AbstractPetscDM, dm::AbstractPetscDM)adds a DM vector to a DMCOMPOSITE
Collective
Input Parameters:
dmc- theDMCOMPOSITEobjectdm- theDMobject
Level: advanced
See also: DMCOMPOSITE, DM, DMDestroy(), DMCompositeGather(), DMCreateGlobalVector(), DMCompositeScatter(), DMCompositeCreate(), DMCompositeGetISLocalToGlobalMappings(), DMCompositeGetAccess(), DMCompositeGetLocalVectors(), DMCompositeRestoreLocalVectors(), DMCompositeGetEntries()
External Links
- PETSc Manual:
DMComposite/DMCompositeAddDM
PETSc.LibPETSc.DMCompositeCreate — Method
packer::PetscDM = DMCompositeCreate(petsclib::PetscLibType, comm::MPI_Comm)Creates a DMCOMPOSITE, used to generate "composite" vectors made up of several subvectors.
Collective
Input Parameter:
comm- the processors that will share the global vector
Output Parameter:
packer- theDMCOMPOSITEobject
Level: advanced
See also: DMCOMPOSITE, DM, DMDestroy(), DMCompositeAddDM(), DMCompositeScatter(), DMCreate(), DMCompositeGather(), DMCreateGlobalVector(), DMCompositeGetISLocalToGlobalMappings(), DMCompositeGetAccess(), DMCompositeGetLocalVectors(), DMCompositeRestoreLocalVectors(), DMCompositeGetEntries()
External Links
- PETSc Manual:
DMComposite/DMCompositeCreate
PETSc.LibPETSc.DMCompositeGatherArray — Method
DMCompositeGatherArray(petsclib::PetscLibType, dm::AbstractPetscDM, imode::InsertMode, gvec::AbstractPetscVec, lvecs::AbstractPetscVec)Gathers into a global packed vector from its individual local vectors
Collective
Input Parameters:
dm- theDMCOMPOSITEobjectgvec- the global vectorimode-INSERT_VALUESorADD_VALUESlvecs- the individual sequential vectors, NULL for any that are not needed
Level: advanced
See also: DMCOMPOSITE, DM, DMDestroy(), DMCompositeAddDM(), DMCreateGlobalVector(), DMCompositeScatter(), DMCompositeCreate(), DMCompositeGetISLocalToGlobalMappings(), DMCompositeGetAccess(), DMCompositeGetLocalVectors(), DMCompositeRestoreLocalVectors(), DMCompositeGetEntries()
External Links
- PETSc Manual:
DMComposite/DMCompositeGatherArray
PETSc.LibPETSc.DMCompositeGetAccessArray — Method
DMCompositeGetAccessArray(petsclib::PetscLibType, dm::AbstractPetscDM, pvec::AbstractPetscVec, nwanted::PetscInt, wanted::Vector{PetscInt}, vecs::Vector{<:AbstractPetscVec})Allows one to access the individual packed vectors in their global representation.
Collective
Input Parameters:
dm- theDMCOMPOSITEpvec- packed vectornwanted- number of vectors wantedwanted- sorted array of integers indicating thde vectors wanted, orNULLto get all vectors, lengthnwanted
Output Parameter:
vecs- array of requested global vectors (must be previously allocated and of lengthnwanted)
Level: advanced
See also: DMCOMPOSITE, DM, DMCompositeGetAccess(), DMCompositeGetEntries(), DMCompositeScatter(), DMCompositeGather()
External Links
- PETSc Manual:
DMComposite/DMCompositeGetAccessArray
PETSc.LibPETSc.DMCompositeGetEntriesArray — Method
DMCompositeGetEntriesArray(petsclib::PetscLibType, dm::AbstractPetscDM, dms::Vector{<:AbstractPetscDM})Gets the DM for each entry in a DMCOMPOSITE
Not Collective
Input Parameter:
dm- theDMCOMPOSITEobject
Output Parameter:
dms- array of sufficient length (seeDMCompositeGetNumberDM()) to hold the individualDM
Level: advanced
See also: DMCOMPOSITE, DM, DMDestroy(), DMCompositeAddDM(), DMCreateGlobalVector(), DMCompositeGetEntries(), DMCompositeGather(), DMCompositeCreate(), DMCompositeGetISLocalToGlobalMappings(), DMCompositeGetAccess(), DMCompositeRestoreLocalVectors(), DMCompositeGetLocalVectors(), DMCompositeScatter()
External Links
- PETSc Manual:
DMComposite/DMCompositeGetEntriesArray
PETSc.LibPETSc.DMCompositeGetGlobalISs — Method
is::Ptr{CIS} = DMCompositeGetGlobalISs(petsclib::PetscLibType, dm::AbstractPetscDM)Gets the index sets for each composed object in a DMCOMPOSITE
Collective
Input Parameter:
dm- theDMCOMPOSITEobject
Output Parameter:
is- the array of index sets
Level: advanced
See also: DMCOMPOSITE, DM, DMDestroy(), DMCompositeAddDM(), DMCreateGlobalVector(), DMCompositeGather(), DMCompositeCreate(), DMCompositeGetAccess(), DMCompositeScatter(), DMCompositeGetLocalVectors(), DMCompositeRestoreLocalVectors(), DMCompositeGetEntries()
External Links
- PETSc Manual:
DMComposite/DMCompositeGetGlobalISs
PETSc.LibPETSc.DMCompositeGetISLocalToGlobalMappings — Method
ltogs::Ptr{ISLocalToGlobalMapping} = DMCompositeGetISLocalToGlobalMappings(petsclib::PetscLibType, dm::AbstractPetscDM)gets an ISLocalToGlobalMapping for each DM in the DMCOMPOSITE, maps to the composite global space
Collective; No Fortran Support
Input Parameter:
dm- theDMCOMPOSITEobject
Output Parameter:
ltogs- the individual mappings for each packed vector. Note that this includes
all the ghost points that individual ghosted DMDA may have.
Level: advanced
See also: DMCOMPOSITE, DM, DMDestroy(), DMCompositeAddDM(), DMCreateGlobalVector(), DMCompositeGather(), DMCompositeCreate(), DMCompositeGetAccess(), DMCompositeScatter(), DMCompositeGetLocalVectors(), DMCompositeRestoreLocalVectors(), DMCompositeGetEntries()
External Links
- PETSc Manual:
DMComposite/DMCompositeGetISLocalToGlobalMappings
PETSc.LibPETSc.DMCompositeGetLocalAccessArray — Method
DMCompositeGetLocalAccessArray(petsclib::PetscLibType, dm::AbstractPetscDM, pvec::AbstractPetscVec, nwanted::PetscInt, wanted::Vector{PetscInt}, vecs::Vector{<:AbstractPetscVec})Allows one to access the individual packed vectors in their local representation.
Collective
Input Parameters:
dm- theDMCOMPOSITEpvec- packed vectornwanted- number of vectors wantedwanted- sorted array of vectors wanted, orNULLto get all vectors, lengthnwanted
Output Parameter:
vecs- array of requested local vectors (must be allocated and of lengthnwanted)
Level: advanced
See also: DMCOMPOSITE, DM, DMCompositeRestoreLocalAccessArray(), DMCompositeGetAccess(), DMCompositeGetEntries(), DMCompositeScatter(), DMCompositeGather()
External Links
- PETSc Manual:
DMComposite/DMCompositeGetLocalAccessArray
PETSc.LibPETSc.DMCompositeGetLocalISs — Method
is::Ptr{CIS} = DMCompositeGetLocalISs(petsclib::PetscLibType, dm::AbstractPetscDM)Gets index sets for each component of a composite local vector
Not Collective; No Fortran Support
Input Parameter:
dm- theDMCOMPOSITE
Output Parameter:
is- array of serial index sets for each component of theDMCOMPOSITE
Level: intermediate
See also: DMCOMPOSITE, DM, DMCompositeGetGlobalISs(), DMCompositeGetISLocalToGlobalMappings(), MatGetLocalSubMatrix(), MatCreateLocalRef(), DMCompositeGetNumberDM()
External Links
- PETSc Manual:
DMComposite/DMCompositeGetLocalISs
PETSc.LibPETSc.DMCompositeGetNumberDM — Method
nDM::PetscInt = DMCompositeGetNumberDM(petsclib::PetscLibType, dm::AbstractPetscDM)Gets the number of DM objects in the DMCOMPOSITE representation.
Not Collective
Input Parameter:
dm- theDMCOMPOSITEobject
Output Parameter:
nDM- the number ofDM
Level: beginner
See also: DMCOMPOSITE, DM
External Links
- PETSc Manual:
DMComposite/DMCompositeGetNumberDM
PETSc.LibPETSc.DMCompositeRestoreAccessArray — Method
DMCompositeRestoreAccessArray(petsclib::PetscLibType, dm::AbstractPetscDM, pvec::AbstractPetscVec, nwanted::PetscInt, wanted::Vector{PetscInt}, vecs::Vector{<:AbstractPetscVec})Returns the vectors obtained with DMCompositeGetAccessArray()
Collective
Input Parameters:
dm- theDMCOMPOSITEobjectpvec- packed vectornwanted- number of vectors wantedwanted- sorted array of vectors wanted, orNULLto restore all vectorsvecs- array of global vectors
Level: advanced
See also: DMCOMPOSITE, DM, DMCompositeRestoreAccess(), DMCompositeRestoreEntries(), DMCompositeScatter(), DMCompositeGather()
External Links
- PETSc Manual:
DMComposite/DMCompositeRestoreAccessArray
PETSc.LibPETSc.DMCompositeRestoreLocalAccessArray — Method
DMCompositeRestoreLocalAccessArray(petsclib::PetscLibType, dm::AbstractPetscDM, pvec::AbstractPetscVec, nwanted::PetscInt, wanted::Vector{PetscInt}, vecs::AbstractPetscVec)Returns the vectors obtained with DMCompositeGetLocalAccessArray().
Collective
Input Parameters:
dm- theDMCOMPOSITEobjectpvec- packed vectornwanted- number of vectors wantedwanted- sorted array of vectors wanted, orNULLto restore all vectorsvecs- array of local vectors
Level: advanced
See also: DMCOMPOSITE, DM, DMCompositeGetLocalAccessArray(), DMCompositeRestoreAccessArray(), DMCompositeRestoreAccess(), DMCompositeRestoreEntries(), DMCompositeScatter(), DMCompositeGather()
External Links
- PETSc Manual:
DMComposite/DMCompositeRestoreLocalAccessArray
PETSc.LibPETSc.DMCompositeScatterArray — Method
DMCompositeScatterArray(petsclib::PetscLibType, dm::AbstractPetscDM, gvec::AbstractPetscVec, lvecs::AbstractPetscVec)Scatters from a global packed vector into its individual local vectors
Collective
Input Parameters:
dm- theDMCOMPOSITEobjectgvec- the global vectorlvecs- array of local vectors, NULL for any that are not needed
Level: advanced
See also: DMCOMPOSITE, DM, DMDestroy(), DMCompositeAddDM(), DMCreateGlobalVector(), DMCompositeGather(), DMCompositeCreate(), DMCompositeGetISLocalToGlobalMappings(), DMCompositeGetAccess(), DMCompositeGetLocalVectors(), DMCompositeRestoreLocalVectors(), DMCompositeGetEntries()
External Links
- PETSc Manual:
DMComposite/DMCompositeScatterArray
PETSc.LibPETSc.DMCompositeSetCoupling — Method
DMCompositeSetCoupling(petsclib::PetscLibType, dm::AbstractPetscDM, FormCoupleLocations::external)Sets user provided routines that compute the coupling between the separate components DM in a DMCOMPOSITE to build the correct matrix nonzero structure.
Logically Collective; No Fortran Support
Input Parameters:
dm- the composite objectFormCoupleLocations- routine to set the nonzero locations in the matrix
Level: advanced
See also: DMCOMPOSITE, DM
External Links
- PETSc Manual:
DMComposite/DMCompositeSetCoupling