From 054876c5060cbb141b71aa63543ad4f2367691e7 Mon Sep 17 00:00:00 2001 From: Umberto Zerbinati Date: Mon, 3 Jun 2024 00:20:08 +0100 Subject: [PATCH] Fixing the fix ... Signed-off-by: Umberto Zerbinati --- tests/test_pc.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/test_pc.py b/tests/test_pc.py index ae59026..5948b6c 100644 --- a/tests/test_pc.py +++ b/tests/test_pc.py @@ -17,7 +17,7 @@ from mpi4py.MPI import COMM_WORLD import pytest -from ngsPETSc.pc import * +from ngsPETSc.pc import PETScPreconditioner def test_pc(): ''' @@ -87,12 +87,12 @@ def test_pc_hiptmaier_xu_sor(): u,v = fesH1.TnT() aH1 = BilinearForm(fesH1) aH1 += grad(u)*grad(v)*dx + aH1.Assemble() smoother = Preconditioner(aDG, "PETScPC", pc_type="sor", pc_sor_omega=1., pc_sor_symmetric="") - preH1 = PETScPreconditioner(aH1, fesH1.FreeDofs(), matType="is", + preH1 = PETScPreconditioner(aH1.mat, fesH1.FreeDofs(), matType="is", solverParameters={"pc_type":"bddc"}) - aH1.Assemble() transform = fesH1.ConvertL2Operator(fesDG) - pre = transform @ preH1.mat @ transform.T + smoother.mat + pre = transform @ preH1 @ transform.T + smoother.mat CG(mat=aDG.mat, rhs=fDG.vec, sol=gfuDG.vec, pre=pre, printrates = True, maxsteps=200) lam = EigenValues_Preconditioner(aDG.mat, pre) assert (lam.NumPy()<3.0).all() @@ -133,12 +133,12 @@ def test_pc_hiptmaier_xu_bjacobi(): u,v = fesH1.TnT() aH1 = BilinearForm(fesH1) aH1 += grad(u)*grad(v)*dx + aH1.Assemble() smoother = Preconditioner(aDG, "PETScPC", pc_type="bjacobi") - preH1 = PETScPreconditioner(aH1, fesH1.FreeDofs(), matType="is", + preH1 = PETScPreconditioner(aH1.mat, fesH1.FreeDofs(), matType="is", solverParameters={"pc_type":"bddc"}) - aH1.Assemble() transform = fesH1.ConvertL2Operator(fesDG) - pre = transform @ preH1.mat @ transform.T + smoother.mat + pre = transform @ preH1 @ transform.T + smoother.mat CG(mat=aDG.mat, rhs=fDG.vec, sol=gfuDG.vec, pre=pre, printrates = True, maxsteps=200) lam = EigenValues_Preconditioner(aDG.mat, pre) assert (lam.NumPy()<3.0).all()