[petsc-users] Questions about ASM in petsc4py

Chih-Hao Chen chih-hao.chen2 at mail.mcgill.ca
Thu Mar 10 15:23:52 CST 2016


Hello PETSc members,


Sorry for asking for help about the ASM in petsc4py.
Currently I am using your ASM as my preconditioned in my solver.
I know how to setup the PCASM based on the ex8.c in the following link.
http://www.mcs.anl.gov/petsc/petsc-3.4/src/ksp/ksp/examples/tutorials/ex8.c

But when using the function “getASMSubKSP” in petsc4py,
I have tried several methods, but still cannot get the subksp from each mpi.
Here is the snippet of the code of the function.

def getASMSubKSP(self):
        cdef PetscInt i = 0, n = 0
        cdef PetscKSP *p = NULL
        CHKERR( PCASMGetSubKSP(self.pc, &n, NULL, &p) )
        return [ref_KSP(p[i]) for i from 0 <= i <n]

In ex8.c, we could use a “FOR” loop to access the indiivdual subksp.
But in python, could I use “FOR” loop to get all the subksps with:

subksp[i] = pc.getASMSubKSP[i]

Another question is in ex8.c, it seems I don’t need to do any setup to decompose the RHS vector.
But do I need to decompose the RHS vector with any settings if I don’t use PETSc solvers but with your preconditioners?
Thanks very much.



Best,
Chih-Hao


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160310/90aa9cc0/attachment-0001.html>


More information about the petsc-users mailing list