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

Method Analyze

python/solvers/cudss.py:10–36  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

8
9 @TimeFunction
10 def Analyze(self):
11 try:
12 import nvmath.sparse.advanced as nvs
13 except ImportError:
14 raise ImportError("CUDSS solver requires nvmath-python module.")
15 try:
16 import scipy.sparse as sp
17 except ImportError:
18 raise ImportError("CUDSS solver requires scipy.")
19 if hasattr(self, "solver") and self.solver is not None:
20 self.solver.free()
21 del self.solver
22
23 csr = sp.csr_matrix(self.GetInnerMatrix().CSR())
24
25 options = make_directsolver_options()
26 self.extract_symmetric = self.is_symmetric.is_true or (csr != csr.T).nnz == 0
27 if self.extract_symmetric:
28 if not self.is_symmetric_storage:
29 csr = sp.tril(csr, format="csr")
30 options.sparse_system_type = nvs.DirectSolverMatrixType.SYMMETRIC
31 options.sparse_system_view = nvs.DirectSolverMatrixViewType.LOWER
32
33 tmp = np.empty(csr.shape[1], dtype=csr.dtype)
34 self.solver = nvs.DirectSolver(csr, tmp, options=options)
35 self.solver.plan()
36 self._is_first_factor_call = True
37
38 @TimeFunction
39 def Factor(self):

Callers

nothing calls this directly

Calls 3

freeMethod · 0.80
GetInnerMatrixMethod · 0.45

Tested by

no test coverage detected