Ignore:
Timestamp:
01/31/19 07:34:11 (6 years ago)
Author:
bdef
Message:

CHG: python scripts after 2to3 and indentation fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/py3/solvers/mumpsoptions.py

    r19895 r23670  
    33from IssmConfig import IssmConfig
    44
    5 def mumpsoptions(**kwargs):
     5def mumpsoptions(*args):
    66        """
    77        MUMPSOPTIONS - return MUMPS direct solver  petsc options
     
    1212
    1313        #retrieve options provided in varargin
    14         options=pairoptions.pairoptions(**kwargs)
     14        options=pairoptions.pairoptions(*args)
    1515        mumps=OrderedDict()
    1616
    1717        #default mumps options
    18         PETSC_VERSION=IssmConfig('_PETSC_MAJOR_')[0]
    19         if PETSC_VERSION==2.:
     18        PETSC_MAJOR=IssmConfig('_PETSC_MAJOR_')[0]
     19        PETSC_MINOR=IssmConfig('_PETSC_MINOR_')[0]
     20        if PETSC_MAJOR==2.:
    2021                mumps['toolkit']='petsc'
    2122                mumps['mat_type']=options.getfieldvalue('mat_type','aijmumps')
     
    2324                mumps['pc_type']=options.getfieldvalue('pc_type','lu')
    2425                mumps['mat_mumps_icntl_14']=options.getfieldvalue('mat_mumps_icntl_14',120)
    25                 mumps['pc_factor_shift_positive_definite']=options.getfieldvalue('pc_factor_shift_positive_definite','true')
    26         if PETSC_VERSION==3.:
     26        if PETSC_MAJOR==3.:
    2727                mumps['toolkit']='petsc'
    2828                mumps['mat_type']=options.getfieldvalue('mat_type','mpiaij')
    2929                mumps['ksp_type']=options.getfieldvalue('ksp_type','preonly')
    3030                mumps['pc_type']=options.getfieldvalue('pc_type','lu')
    31                 mumps['pc_factor_mat_solver_package']=options.getfieldvalue('pc_factor_mat_solver_package','mumps')
     31                if PETSC_MINOR>8.:
     32                        mumps['pc_factor_mat_solver_type']=options.getfieldvalue('pc_factor_mat_solver_type','mumps')
     33                else:
     34                        mumps['pc_factor_mat_solver_package']=options.getfieldvalue('pc_factor_mat_solver_package','mumps')
    3235                mumps['mat_mumps_icntl_14']=options.getfieldvalue('mat_mumps_icntl_14',120)
    33                 mumps['pc_factor_shift_positive_definite']=options.getfieldvalue('pc_factor_shift_positive_definite','true')
    3436
    3537        return mumps
    36 
Note: See TracChangeset for help on using the changeset viewer.