petsc4py.PETSc.DMShell#

class petsc4py.PETSc.DMShell#

Bases: DM

A shell DM object, used to manage user-defined problem data.

Methods Summary

create([comm])

Creates a shell DM object.

setCoarsen(coarsen[, args, kargs])

Set the routine used to coarsen the DMShell.

setCreateDomainDecomposition(decomp[, args, ...])

Set the routine used to create a domain decomposition.

setCreateDomainDecompositionScatters(scatter)

Set the routine used to create the scatter contexts for domain decomposition.

setCreateFieldDecomposition(decomp[, args, ...])

Set the routine used to create a field decomposition.

setCreateGlobalVector(create_gvec[, args, kargs])

Set the routine to create a global vector.

setCreateInjection(create_injection[, args, ...])

Set the routine used to create the injection operator.

setCreateInterpolation(create_interpolation)

Set the routine used to create the interpolation operator.

setCreateLocalVector(create_lvec[, args, kargs])

Set the routine to create a local vector.

setCreateMatrix(create_matrix[, args, kargs])

Set the routine to create a matrix.

setCreateRestriction(create_restriction[, ...])

Set the routine used to create the restriction operator.

setCreateSubDM(create_subdm[, args, kargs])

Set the routine used to create a sub DM from the DMShell.

setGlobalToLocal(begin, end[, begin_args, ...])

Set the routines used to perform a global to local scatter.

setGlobalToLocalVecScatter(gtol)

Set a Scatter context for global to local communication.

setGlobalVector(gv)

Set a template global vector.

setLocalToGlobal(begin, end[, begin_args, ...])

Set the routines used to perform a local to global scatter.

setLocalToGlobalVecScatter(ltog)

Set a Scatter context for local to global communication.

setLocalToLocal(begin, end[, begin_args, ...])

Set the routines used to perform a local to local scatter.

setLocalToLocalVecScatter(ltol)

Set a Scatter context for local to local communication.

setLocalVector(lv)

Set a template local vector.

setMatrix(mat)

Set a template matrix.

setRefine(refine[, args, kargs])

Set the routine used to refine the DMShell.

Methods Documentation

create(comm=None)#

Creates a shell DM object.

Collective.

Parameters:

comm (Comm | None) – MPI communicator, defaults to Sys.getDefaultComm.

Return type:

Self

See also

DMShellCreate

Source code at petsc4py/PETSc/DMShell.pyx:4

setCoarsen(coarsen, args=None, kargs=None)#

Set the routine used to coarsen the DMShell.

Logically collective.

Parameters:
  • coarsen (Callable[[DM, Comm], DM] | None) – The routine which coarsens the DM.

  • args (tuple[Any, ...] | None) – Additional positional arguments for coarsen.

  • kargs (dict[str, Any] | None) – Additional keyword arguments for coarsen.

Return type:

None

Source code at petsc4py/PETSc/DMShell.pyx:368

setCreateDomainDecomposition(decomp, args=None, kargs=None)#

Set the routine used to create a domain decomposition.

Logically collective.

Parameters:
Return type:

None

Source code at petsc4py/PETSc/DMShell.pyx:560

setCreateDomainDecompositionScatters(scatter, args=None, kargs=None)#

Set the routine used to create the scatter contexts for domain decomposition.

Logically collective.

Parameters:
Return type:

None

Source code at petsc4py/PETSc/DMShell.pyx:592

setCreateFieldDecomposition(decomp, args=None, kargs=None)#

Set the routine used to create a field decomposition.

Logically collective.

Parameters:
Return type:

None

Source code at petsc4py/PETSc/DMShell.pyx:528

setCreateGlobalVector(create_gvec, args=None, kargs=None)#

Set the routine to create a global vector.

Logically collective.

Parameters:
  • create_gvec (Callable[[DM], Vec] | None) – The creation routine.

  • args (tuple[Any, ...] | None) – Additional positional arguments for create_gvec.

  • kargs (dict[str, Any] | None) – Additional keyword arguments for create_gvec.

Return type:

None

Source code at petsc4py/PETSc/DMShell.pyx:76

setCreateInjection(create_injection, args=None, kargs=None)#

Set the routine used to create the injection operator.

Logically collective.

Parameters:
  • create_injection (Callable[[DM, DM], Mat] | None) – The routine to create the injection.

  • args (tuple[Any, ...] | None) – Additional positional arguments for create_injection.

  • kargs (dict[str, Any] | None) – Additional keyword arguments for create_injection.

Return type:

None

Source code at petsc4py/PETSc/DMShell.pyx:464

setCreateInterpolation(create_interpolation, args=None, kargs=None)#

Set the routine used to create the interpolation operator.

Logically collective.

Parameters:
  • create_interpolation (Callable[[DM, DM], tuple[Mat, Vec]] | None) – The routine to create the interpolation.

  • args (tuple[Any, ...] | None) – Additional positional arguments for create_interpolation.

  • kargs (dict[str, Any] | None) – Additional keyword arguments for create_interpolation.

Return type:

None

Source code at petsc4py/PETSc/DMShell.pyx:432

setCreateLocalVector(create_lvec, args=None, kargs=None)#

Set the routine to create a local vector.

Logically collective.

Parameters:
  • create_lvec (Callable[[DM], Vec] | None) – The creation routine.

  • args (tuple[Any, ...] | None) – Additional positional arguments for create_lvec.

  • kargs (dict[str, Any] | None) – Additional keyword arguments for create_lvec.

Return type:

None

Source code at petsc4py/PETSc/DMShell.pyx:108

setCreateMatrix(create_matrix, args=None, kargs=None)#

Set the routine to create a matrix.

Logically collective.

Parameters:
  • create_matrix (Callable[[DM], Mat] | None) – The function to create a matrix.

  • args (tuple[Any, ...] | None) – Additional positional arguments for create_matrix.

  • kargs (dict[str, Any] | None) – Additional keyword arguments for create_matrix.

Return type:

None

Source code at petsc4py/PETSc/DMShell.pyx:336

setCreateRestriction(create_restriction, args=None, kargs=None)#

Set the routine used to create the restriction operator.

Logically collective.

Parameters:
  • create_restriction (Callable[[DM, DM], Mat] | None) – The routine to create the restriction

  • args (tuple[Any, ...] | None) – Additional positional arguments for create_restriction.

  • kargs (dict[str, Any] | None) – Additional keyword arguments for create_restriction.

Return type:

None

Source code at petsc4py/PETSc/DMShell.pyx:496

setCreateSubDM(create_subdm, args=None, kargs=None)#

Set the routine used to create a sub DM from the DMShell.

Logically collective.

Parameters:
Return type:

None

Source code at petsc4py/PETSc/DMShell.pyx:624

setGlobalToLocal(begin, end, begin_args=None, begin_kargs=None, end_args=None, end_kargs=None)#

Set the routines used to perform a global to local scatter.

Logically collective.

Parameters:
Return type:

None

Source code at petsc4py/PETSc/DMShell.pyx:140

setGlobalToLocalVecScatter(gtol)#

Set a Scatter context for global to local communication.

Logically collective.

Parameters:

gtol (Scatter) – The global to local Scatter context.

Return type:

None

Source code at petsc4py/PETSc/DMShell.pyx:189

setGlobalVector(gv)#

Set a template global vector.

Logically collective.

Parameters:

gv (Vec) – Template vector.

Return type:

None

Source code at petsc4py/PETSc/DMShell.pyx:42

setLocalToGlobal(begin, end, begin_args=None, begin_kargs=None, end_args=None, end_kargs=None)#

Set the routines used to perform a local to global scatter.

Logically collective.

Parameters:
Return type:

None

Source code at petsc4py/PETSc/DMShell.pyx:206

setLocalToGlobalVecScatter(ltog)#

Set a Scatter context for local to global communication.

Logically collective.

Parameters:

ltog (Scatter) – The local to global Scatter context.

Return type:

None

Source code at petsc4py/PETSc/DMShell.pyx:253

setLocalToLocal(begin, end, begin_args=None, begin_kargs=None, end_args=None, end_kargs=None)#

Set the routines used to perform a local to local scatter.

Logically collective.

Parameters:
Return type:

None

Source code at petsc4py/PETSc/DMShell.pyx:270

setLocalToLocalVecScatter(ltol)#

Set a Scatter context for local to local communication.

Logically collective.

Parameters:

ltol (Scatter) – The local to local Scatter context.

Return type:

None

Source code at petsc4py/PETSc/DMShell.pyx:319

setLocalVector(lv)#

Set a template local vector.

Logically collective.

Parameters:

lv (Vec) – Template vector.

Return type:

None

Source code at petsc4py/PETSc/DMShell.pyx:59

setMatrix(mat)#

Set a template matrix.

Collective.

Parameters:

mat (Mat) – The template matrix.

Return type:

None

See also

DMShellSetMatrix

Source code at petsc4py/PETSc/DMShell.pyx:25

setRefine(refine, args=None, kargs=None)#

Set the routine used to refine the DMShell.

Logically collective.

Parameters:
  • refine (Callable[[DM, Comm], DM] | None) – The routine which refines the DM.

  • args (tuple[Any, ...] | None) – Additional positional arguments for refine.

  • kargs (dict[str, Any] | None) – Additional keyword arguments for refine.

Return type:

None

Source code at petsc4py/PETSc/DMShell.pyx:400