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

Method Factor

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

Source from the content-addressed store, hash-verified

37
38 @TimeFunction
39 def Factor(self):
40 if not self._is_first_factor_call:
41 from nvmath.internal.tensor_ifc_numpy import NumpyTensor
42 from nvmath.internal import utils
43 import scipy.sparse as sp
44 mat = self.GetInnerMatrix()
45 if self.extract_symmetric and not self.is_symmetric_storage:
46 values = sp.tril(sp.csr_matrix(mat.CSR()), format="csr").data
47 else:
48 values = mat.AsVector().FV().NumPy()
49 stream_holder = utils.get_or_create_stream(self.solver.device_id, None, self.solver.rhs_package)
50 values_tensor = NumpyTensor(values)
51 self.solver.a.values.copy_(values_tensor, stream_holder)
52 self.solver.factorize()
53 self._is_first_factor_call = False
54
55 @TimeFunction
56 def Solve(self, b, sol):

Callers

nothing calls this directly

Calls 3

GetInnerMatrixMethod · 0.45
FVMethod · 0.45
AsVectorMethod · 0.45

Tested by

no test coverage detected