MCPcopy Create free account
hub / github.com/NGSolve/ngsolve / __init__

Method __init__

python/krylovspace.py:64–88  ·  view source on GitHub ↗
(self, mat : BaseMatrix,
                 pre : Optional[Preconditioner] = None,
                 freedofs : Optional[BitArray] = None,
                 tol : float = None,
                 maxiter : int = 100,
                 atol : float = None,
                 callback : Optional[Callable[[int, float], None]] = None,
                 callback_sol : Optional[Callable[[BaseVector], None]] = None,
                 printrates : bool = False,
                 plotrates : bool = False)

Source from the content-addressed store, hash-verified

62""" + linear_solver_param_doc
63 name = "LinearSolver"
64 def __init__(self, mat : BaseMatrix,
65 pre : Optional[Preconditioner] = None,
66 freedofs : Optional[BitArray] = None,
67 tol : float = None,
68 maxiter : int = 100,
69 atol : float = None,
70 callback : Optional[Callable[[int, float], None]] = None,
71 callback_sol : Optional[Callable[[BaseVector], None]] = None,
72 printrates : bool = False,
73 plotrates : bool = False):
74 super().__init__()
75 if atol is None and tol is None:
76 tol = 1e-12
77 self.mat = mat
78 assert (freedofs is None) != (pre is None) # either pre or freedofs must be given
79 self.pre = pre if pre else Projector(freedofs, True)
80 self.tol = tol
81 self.atol = atol
82 self.maxiter = maxiter
83 self.callback = callback
84 self.callback_sol = callback_sol
85 self.printrates = printrates
86 self.plotrates = plotrates
87 self.residuals = []
88 self.iterations = 0
89
90 @TimeFunction
91 def Solve(self, rhs : BaseVector, sol : Optional[BaseVector] = None,

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected