Skip to main content
`Ctrl`+`K`

# 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

    See also

    `setRefine`, `DMShellSetCoarsen`

    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:

      - decomp (Callable[[DM], tuple[list[str] | None, list[IS] | None, list[IS] | None, list[DM] | None]] | None) – The routine to create the decomposition.

      - args (tuple[Any, ...] | None) – Additional positional arguments for `decomp`.

      - kargs (dict[str, Any] | None) – Additional keyword arguments for `decomp`.

    Return type:

      None

    See also

    `DMShellSetCreateDomainDecomposition`

    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:

      - scatter (Callable[[DM, list[DM]], tuple[list[Scatter], list[Scatter], list[Scatter]]] | None) – The routine to create the scatters.

      - args (tuple[Any, ...] | None) – Additional positional arguments for `scatter`.

      - kargs (dict[str, Any] | None) – Additional keyword arguments for `scatter`.

    Return type:

      None

    See also

    `DMShellSetCreateDomainDecompositionScatters`

    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:

      - decomp (Callable[[DM], tuple[list[str] | None, list[IS] | None, list[DM] | None]] | None) – The routine to create the decomposition.

      - args (tuple[Any, ...] | None) – Additional positional arguments for `decomp`.

      - kargs (dict[str, Any] | None) – Additional keyword arguments for `decomp`.

    Return type:

      None

    See also

    `DMShellSetCreateFieldDecomposition`

    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

    See also

    `setCreateLocalVector`, `DMShellSetCreateGlobalVector`

    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

    See also

    `DMShellSetCreateInjection`

    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

    See also

    `DMShellSetCreateInterpolation`

    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

    See also

    `setCreateGlobalVector`, `DMShellSetCreateLocalVector`

    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

    See also

    `DMShellSetCreateMatrix`

    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

    See also

    `DMShellSetCreateRestriction`

    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:

      - subdm – The routine to create the decomposition.

      - args (tuple[Any, ...] | None) – Additional positional arguments for `subdm`.

      - kargs (dict[str, Any] | None) – Additional keyword arguments for `subdm`.

      - create_subdm (Callable[[DM, Sequence[int]], tuple[IS, DM]] | None)

    Return type:

      None

    See also

    `DMShellSetCreateSubDM`

    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:

      - dm – The `DMShell`.

      - begin (Callable[[DM, Vec, InsertMode, Vec], None] | None) – The routine which begins the global to local scatter.

      - end (Callable[[DM, Vec, InsertMode, Vec], None] | None) – The routine which ends the global to local scatter.

      - begin_args (tuple[Any, ...] | None) – Additional positional arguments for `begin`.

      - begin_kargs (dict[str, Any] | None) – Additional keyword arguments for `begin`.

      - end_args (tuple[Any, ...] | None) – Additional positional arguments for `end`.

      - end_kargs (dict[str, Any] | None) – Additional keyword arguments for `end`.

    Return type:

      None

    See also

    `DMShellSetGlobalToLocal`

    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

    See also

    `DMShellSetGlobalToLocalVecScatter`

    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

    See also

    `setLocalVector`, `DMShellSetGlobalVector`

    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:

      - begin (Callable[[DM, Vec, InsertMode, Vec], None] | None) – The routine which begins the local to global scatter.

      - end (Callable[[DM, Vec, InsertMode, Vec], None] | None) – The routine which ends the local to global scatter.

      - begin_args (tuple[Any, ...] | None) – Additional positional arguments for `begin`.

      - begin_kargs (dict[str, Any] | None) – Additional keyword arguments for `begin`.

      - end_args (tuple[Any, ...] | None) – Additional positional arguments for `end`.

      - end_kargs (dict[str, Any] | None) – Additional keyword arguments for `end`.

    Return type:

      None

    See also

    `DMShellSetLocalToGlobal`

    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

    See also

    `DMShellSetLocalToGlobalVecScatter`

    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:

      - begin (Callable[[DM, Vec, InsertMode, Vec], None] | None) – The routine which begins the local to local scatter.

      - end (Callable[[DM, Vec, InsertMode, Vec], None] | None) – The routine which ends the local to local scatter.

      - begin_args (tuple[Any, ...] | None) – Additional positional arguments for `begin`.

      - begin_kargs (dict[str, Any] | None) – Additional keyword arguments for `begin`.

      - end_args (tuple[Any, ...] | None) – Additional positional arguments for `end`.

      - end_kargs (dict[str, Any] | None) – Additional keyword arguments for `end`.

    Return type:

      None

    See also

    `DMShellSetLocalToLocal`

    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

    See also

    `DMShellSetLocalToLocalVecScatter`

    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

    See also

    `setGlobalVector`, `DMShellSetLocalVector`

    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

    See also

    `setCoarsen`, `DMShellSetRefine`

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