[petsc-users] petsc4py and mumps (or other direct sparse solver)

Hong hzhang at mcs.anl.gov
Wed Apr 15 10:15:17 CDT 2015


Benoit :

mumps options can be called from PETSc C-code as
ierr = PetscOptionsInsertString("-mat_mumps_icntl_13 1 -mat_mumps_icntl_24
1 -mat_mumps_cntl_3 1e-12");CHKERRQ(ierr);

or see petsc/src/ksp/ksp/examples/tutorials/ex52.c

I do not know how to translate these calls into python API though.

Hong

Dear petsc-users,
>
> I am a beginner in petsc and I have some question with the python
> interface. I am trying to solve problem with mumps (or other direct sparse
> solver)
>
> I have written the following piece of code
>
>     ksp = PETSc.KSP()
>     ksp.create(PETSc.COMM_WORLD)
>     ksp.setOperators(A)
>     ksp.setType('preonly')
>     pc=ksp.getPC()
>     pc.setType('lu')
>     pc.setFactorSolverPackage('mumps')
>
> It seems to works, however I have 2 questions
> 1/ how to set the Icntl parameters of mumps ? I didn't find the function
> MatMumpsSetIcntl.
> 2/ Is this piece of code right or written in good petsc style ?
>
> thanks a lot,
>
> Benoit
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150415/209a0635/attachment.html>


More information about the petsc-users mailing list