Skip to content

Commit

Permalink
Fix PC test
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 35db34f commit c9ae9bc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/test_pc.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
from mpi4py.MPI import COMM_WORLD
import pytest

from ngsPETSc import pc
from ngsPETSc.pc import *

def test_pc():
'''
Testing the pc has registered function to register preconditioners
'''
from ngsPETSc import pc
assert hasattr(pc,"createPETScPreconditioner")

def test_pc_gamg():
Expand Down Expand Up @@ -87,7 +88,8 @@ 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 = Preconditioner(aH1, "PETScPC", pc_type="bddc", matType="is")
preH1 = PETScPreconditioner(aH1, fesH1.FreeDofs(), matType="is",
solverParameters={"pc_type":"bddc"})
aH1.Assemble()
transform = fesH1.ConvertL2Operator(fesDG)
pre = transform @ preH1.mat @ transform.T + smoother.mat
Expand Down Expand Up @@ -132,7 +134,8 @@ def test_pc_hiptmaier_xu_bjacobi():
aH1 = BilinearForm(fesH1)
aH1 += grad(u)*grad(v)*dx
smoother = Preconditioner(aDG, "PETScPC", pc_type="bjacobi")
preH1 = Preconditioner(aH1, "PETScPC", pc_type="bddc", matType="is")
preH1 = PETScPreconditioner(aH1, fesH1.FreeDofs(), matType="is",
solverParameters={"pc_type":"bddc"})
aH1.Assemble()
transform = fesH1.ConvertL2Operator(fesDG)
pre = transform @ preH1.mat @ transform.T + smoother.mat
Expand Down

0 comments on commit c9ae9bc

Please sign in to comment.