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

Lisandro Dalcin dalcinl at gmail.com
Wed Apr 15 11:38:11 CDT 2015


On 15 April 2015 at 18:15, Hong <hzhang at mcs.anl.gov> wrote:
> 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.
>

opts = PETSc.Options() # dict-like
opts["mat_mumps_icntl_13"] = 1
opts["mat_mumps_icntl_24"] = 1
opts["mat_mumps_cntl_3"] = 1e-12

Or also:

opts = PETSc.Options()
opts.prefixPush("mat_mumps_")
opts["icntl_13"] = 1
opts["icntl_24"] = 1
opts["cntl_3"] = 1e-12
opts.prefixPop()

Or also:

opts = PETSc.Options("mat_mumps_")
opts["icntl_13"] = 1
opts["icntl_24"] = 1
opts["cntl_3"] = 1e-12


-- 
Lisandro Dalcin
============
Research Scientist
Computer, Electrical and Mathematical Sciences & Engineering (CEMSE)
Numerical Porous Media Center (NumPor)
King Abdullah University of Science and Technology (KAUST)
http://numpor.kaust.edu.sa/

4700 King Abdullah University of Science and Technology
al-Khawarizmi Bldg (Bldg 1), Office # 4332
Thuwal 23955-6900, Kingdom of Saudi Arabia
http://www.kaust.edu.sa

Office Phone: +966 12 808-0459


More information about the petsc-users mailing list