Skip to content

Commit

Permalink
Fixing the fix ...
Browse files Browse the repository at this point in the history
Signed-off-by: Umberto Zerbinati <[email protected]>
  • Loading branch information
Umberto Zerbinati committed Jun 2, 2024
1 parent 36059fe commit 27e368b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_pc.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from mpi4py.MPI import COMM_WORLD
import pytest

from ngsPETSc.pc import *
from ngsPETSc.pc import PETScPreconditioner

def test_pc():
'''
Expand Down Expand Up @@ -88,11 +88,11 @@ def test_pc_hiptmaier_xu_sor():
aH1 = BilinearForm(fesH1)
aH1 += grad(u)*grad(v)*dx
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()
Expand Down Expand Up @@ -134,11 +134,11 @@ def test_pc_hiptmaier_xu_bjacobi():
aH1 = BilinearForm(fesH1)
aH1 += grad(u)*grad(v)*dx
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()
Expand Down

0 comments on commit 27e368b

Please sign in to comment.