File: pcpython_protocol.py

package info (click to toggle)
petsc4py 3.23.1-1exp2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 3,448 kB
  • sloc: python: 12,503; ansic: 1,697; makefile: 343; f90: 313; sh: 14
file content (61 lines) | stat: -rw-r--r-- 1,897 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from petsc4py.PETSc import KSP
from petsc4py.PETSc import PC
from petsc4py.PETSc import Mat
from petsc4py.PETSc import Vec
from petsc4py.PETSc import Viewer


# A template class with the Python methods supported by PCPYTHON


class PCPythonProtocol:
    def apply(self, pc: PC, b: Vec, x: Vec) -> None:
        """Apply the preconditioner on vector b, return in x."""
        ...

    def applySymmetricLeft(self, pc: PC, b: Vec, x: Vec) -> None:
        """Apply the symmetric left part of the preconditioner on vector b, return in x."""
        ...

    def applySymmetricRight(self, pc: PC, b: Vec, x: Vec) -> None:
        """Apply the symmetric right part of the preconditioner on vector b, return in x."""
        ...

    def applyTranspose(self, pc: PC, b: Vec, x: Vec) -> None:
        """Apply the transposed preconditioner on vector b, return in x."""
        ...

    def applyMat(self, pc: PC, B: Mat, X: Mat) -> None:
        """Apply the preconditioner on a block of right-hand sides B, return in X."""
        ...

    def preSolve(self, pc: PC, ksp: KSP, b: Vec, x: Vec) -> None:
        """Callback called at the beginning of a Krylov method.

        This method is allowed to modify the right-hand side b and the initial guess x.

        """
        ...

    def postSolve(self, pc: PC, ksp: KSP, b: Vec, x: Vec) -> None:
        """Callback called at the end of a Krylov method.

        This method is allowed to modify the right-hand side b and the solution x.

        """

    def view(self, pc: PC, viewer: Viewer) -> None:
        """View the preconditioner."""
        ...

    def setFromOptions(self, pc: PC) -> None:
        """Process command line for customization."""
        ...

    def setUp(self, pc: PC) -> None:
        """Perform the required setup."""
        ...

    def reset(self, pc: PC) -> None:
        """Reset the preconditioner."""
        ...