From 3c4a7c26a33432b04221c1e6a7c1a46efbc33496 Mon Sep 17 00:00:00 2001 From: SNMS95 Date: Tue, 19 Sep 2023 16:17:44 +0200 Subject: [PATCH] Direct solver works now --- jax_am/fem/solver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jax_am/fem/solver.py b/jax_am/fem/solver.py index 03e23c1..f27eae6 100644 --- a/jax_am/fem/solver.py +++ b/jax_am/fem/solver.py @@ -20,7 +20,8 @@ def petsc_solve(A, b, ksp_type, pc_type, direct_solve=True): ksp = PETSc.KSP().create() ksp.setFromOptions() if direct_solve: - ksp.setOperators((A + A.transpose())/2.0) + # A = (A + A.transpose())/2.0 # Causes errors A= A.t but A != (A + A.T)/2.0 + ksp.setOperators(A) ksp.setType('preonly') ksp.pc.setType('lu') else: