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 054876c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 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 @@ -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()
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 054876c

Please sign in to comment.