[petsc-dev] setting field split pc correctly

Chris Kees christopher.e.kees at usace.army.mil
Sat May 15 09:40:06 CDT 2010


Hi,

I appear to be setting the index sets properly now through the  
petsc4py wrappers (using the existing interface) that Lisandro and I  
added. I can't seem to set the options on the KSP/PC for the splits  
though. My options look like this:

-navierStokes_fieldsplit_type MULTIPLICATIVE -navierStokes_ksp_type  
bcgsl -navierStokes_ksp_rtol 0.0 -navierStokes_ksp_atol 1.0e-10 - 
navierStokes_ksp_monitor_true_residual -ksp_type bcgsl -ksp_rtol 0.0 - 
ksp_atol 1.0e-10    -navierStokes_fieldsplit_0_ksp_type preonly - 
navierStokes_fieldsplit_0_pc_type boomeramg - 
navierStokes_fieldsplit_1_ksp_type fgmres - 
navierStokes_fieldsplit_1_pc_type none - 
navierStokes_fieldsplit_1_ksp_norm_type NO - 
navierStokes_fieldsplit_1_ksp_max_it 3

In the code I call
         self.pc.setOptionsPrefix(prefix)
         self.ksp.setOptionsPrefix(prefix)
         self.ksp.setFromOptions()
         self.pc.setFromOptions()

The output of KSPView before each KSP solve is below. The split's use  
none,bjacobi. I'm guessing I'm making some kind of rookie mistake... - 
Chris

KSP Object:(navierStokes_)
   type: bcgsl
     BCGSL: Ell = 2
     BCGSL: Delta = 0
   maximum iterations=1000, initial guess is zero
   tolerances:  relative=0, absolute=1e-10, divergence=10000
   left preconditioning
   using PRECONDITIONED norm type for convergence test
PC Object:(navierStokes_)
   type: fieldsplit
     FieldSplit with MULTIPLICATIVE composition: total splits = 2,  
blocksize = -1
     Solver info for each split is in the following KSP objects:
     Split number 0 Defined by IS
     KSP Object:(fieldsplit_0_)
       type: preonly
       maximum iterations=10000, initial guess is zero
       tolerances:  relative=1e-05, absolute=1e-50, divergence=10000
       left preconditioning
       using PRECONDITIONED norm type for convergence test
     PC Object:(fieldsplit_0_)
       type: bjacobi
         block Jacobi: number of blocks = 4
         Local solve is same for all blocks, in the following KSP and  
PC objects:
       KSP Object:(fieldsplit_0_sub_)
         type: preonly
         maximum iterations=10000, initial guess is zero
         tolerances:  relative=1e-05, absolute=1e-50, divergence=10000
         left preconditioning
         using PRECONDITIONED norm type for convergence test
       PC Object:(fieldsplit_0_sub_)
         type: ilu
           ILU: out-of-place factorization
           0 levels of fill
           tolerance for zero pivot 1e-12
           using diagonal shift to prevent zero pivot
           matrix ordering: natural
           factor fill ratio given 1, needed 1
             Factored matrix follows:
               Matrix Object:
                 type=seqaij, rows=493, cols=493
                 package used to perform factorization: petsc
                 total: nonzeros=11409, allocated nonzeros=11409
                   using I-node routines: found 124 nodes, limit used  
is 5
         linear system matrix = precond matrix:
         Matrix Object:
           type=seqaij, rows=493, cols=493
           total: nonzeros=11409, allocated nonzeros=11409
             using I-node routines: found 124 nodes, limit used is 5
       linear system matrix = precond matrix:
       Matrix Object:
         type=mpiaij, rows=1973, cols=1973
         total: nonzeros=35591, allocated nonzeros=35591
           using I-node (on process 0) routines: found 124 nodes,  
limit used is 5
     Split number 1 Defined by IS
     KSP Object:(fieldsplit_1_)
       type: preonly
       maximum iterations=10000, initial guess is zero
       tolerances:  relative=1e-05, absolute=1e-50, divergence=10000
       left preconditioning
       using PRECONDITIONED norm type for convergence test
     PC Object:(fieldsplit_1_)
       type: bjacobi
         block Jacobi: number of blocks = 4
         Local solve is same for all blocks, in the following KSP and  
PC objects:
       KSP Object:(fieldsplit_1_sub_)
         type: preonly
         maximum iterations=10000, initial guess is zero
         tolerances:  relative=1e-05, absolute=1e-50, divergence=10000
         left preconditioning
         using PRECONDITIONED norm type for convergence test
       PC Object:(fieldsplit_1_sub_)
         type: ilu
           ILU: out-of-place factorization
           0 levels of fill
           tolerance for zero pivot 1e-12
           using diagonal shift to prevent zero pivot
           matrix ordering: natural
           factor fill ratio given 1, needed 1
             Factored matrix follows:
               Matrix Object:
                 type=seqaij, rows=1479, cols=1479
                 package used to perform factorization: petsc
                 total: nonzeros=61433, allocated nonzeros=61433
                   using I-node routines: found 370 nodes, limit used  
is 5
         linear system matrix = precond matrix:
         Matrix Object:
           type=seqaij, rows=1479, cols=1479
           total: nonzeros=61433, allocated nonzeros=61433
             using I-node routines: found 370 nodes, limit used is 5
       linear system matrix = precond matrix:
       Matrix Object:
         type=mpiaij, rows=5919, cols=5919
         total: nonzeros=240607, allocated nonzeros=240607
           using I-node (on process 0) routines: found 370 nodes,  
limit used is 5
   linear system matrix = precond matrix:
   Matrix Object:
     type=mpiaij, rows=7892, cols=7892
     total: nonzeros=389072, allocated nonzeros=469724
       using I-node (on process 0) routines: found 493 nodes, limit  
used is 5




More information about the petsc-dev mailing list