From c09cafecef01100857180f544cfe62e0a4d0eb16 Mon Sep 17 00:00:00 2001 From: Logan Bishop-Van Horn Date: Tue, 5 Mar 2024 12:27:00 -0800 Subject: [PATCH 1/2] Convert to scipy.sparse.csc_matrix for PyPardiso https://github.com/loganbvh/py-tdgl/issues/74 --- tdgl/finite_volume/operators.py | 3 +++ tdgl/version.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tdgl/finite_volume/operators.py b/tdgl/finite_volume/operators.py index a2fb5bd..efdd4a4 100644 --- a/tdgl/finite_volume/operators.py +++ b/tdgl/finite_volume/operators.py @@ -295,9 +295,12 @@ def build_operators(self) -> None: self.edge_directions = cupy.array(self.edge_directions) if self.sparse_solver is SparseSolver.CUPY: assert cupy is not None + # https://github.com/loganbvh/py-tdgl/issues/74 + # https://github.com/haasad/PyPardiso/issues/68 self.mu_laplacian = csc_matrix(self.mu_laplacian) self.mu_laplacian_lu = factorized(self.mu_laplacian) elif self.sparse_solver is SparseSolver.PARDISO: + self.mu_laplacian = sp.csc_matrix(self.mu_laplacian) self.mu_laplacian_lu = None else: use_umfpack = self.sparse_solver is SparseSolver.UMFPACK diff --git a/tdgl/version.py b/tdgl/version.py index f5f4a9b..25223ef 100644 --- a/tdgl/version.py +++ b/tdgl/version.py @@ -1,4 +1,4 @@ -__version_info__ = (0, 8, 1) +__version_info__ = (0, 8, 2) __version__ = ".".join(map(str, __version_info__)) From 776365d72a0c5e03725705a461edefd25d6c0f7c Mon Sep 17 00:00:00 2001 From: Logan Bishop-Van Horn Date: Tue, 5 Mar 2024 13:07:21 -0800 Subject: [PATCH 2/2] Move comments --- tdgl/finite_volume/operators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tdgl/finite_volume/operators.py b/tdgl/finite_volume/operators.py index efdd4a4..c95a847 100644 --- a/tdgl/finite_volume/operators.py +++ b/tdgl/finite_volume/operators.py @@ -295,11 +295,11 @@ def build_operators(self) -> None: self.edge_directions = cupy.array(self.edge_directions) if self.sparse_solver is SparseSolver.CUPY: assert cupy is not None - # https://github.com/loganbvh/py-tdgl/issues/74 - # https://github.com/haasad/PyPardiso/issues/68 self.mu_laplacian = csc_matrix(self.mu_laplacian) self.mu_laplacian_lu = factorized(self.mu_laplacian) elif self.sparse_solver is SparseSolver.PARDISO: + # https://github.com/loganbvh/py-tdgl/issues/74 + # https://github.com/haasad/PyPardiso/issues/68 self.mu_laplacian = sp.csc_matrix(self.mu_laplacian) self.mu_laplacian_lu = None else: