| 
            Last change
 on this file since 13395 was             13395, checked in by Mathieu Morlighem, 13 years ago           | 
        
        
          | 
             
merged trunk-jpl and trunk for revision 13393 
 
           | 
        
        
          | 
            File size:
            1.2 KB
           | 
        
      
      
| Line |   | 
|---|
| 1 | from collections import OrderedDict
 | 
|---|
| 2 | from pairoptions import *
 | 
|---|
| 3 | from petscversion import *
 | 
|---|
| 4 | 
 | 
|---|
| 5 | def mumpsoptions(*args):
 | 
|---|
| 6 |         """
 | 
|---|
| 7 |         MUMPSOPTIONS - return MUMPS direct solver  petsc options
 | 
|---|
| 8 | 
 | 
|---|
| 9 |            Usage:
 | 
|---|
| 10 |               options=mumpsoptions;
 | 
|---|
| 11 |         """
 | 
|---|
| 12 | 
 | 
|---|
| 13 |         #retrieve options provided in varargin
 | 
|---|
| 14 |         options=pairoptions(*args)
 | 
|---|
| 15 |         mumps=OrderedDict()
 | 
|---|
| 16 | 
 | 
|---|
| 17 |         #default mumps options
 | 
|---|
| 18 |         PETSC_VERSION=petscversion()
 | 
|---|
| 19 |         if PETSC_VERSION==2:
 | 
|---|
| 20 |                 mumps['mat_type']=options.getfieldvalue('mat_type','aijmumps')
 | 
|---|
| 21 |                 mumps['ksp_type']=options.getfieldvalue('ksp_type','preonly')
 | 
|---|
| 22 |                 mumps['pc_type']=options.getfieldvalue('pc_type','lu')
 | 
|---|
| 23 |                 mumps['mat_mumps_icntl_14']=options.getfieldvalue('mat_mumps_icntl_14',120)
 | 
|---|
| 24 |                 mumps['pc_factor_shift_positive_definite']=options.getfieldvalue('pc_factor_shift_positive_definite','true')
 | 
|---|
| 25 |         if PETSC_VERSION==3:
 | 
|---|
| 26 |                 mumps['mat_type']=options.getfieldvalue('mat_type','mpiaij')
 | 
|---|
| 27 |                 mumps['ksp_type']=options.getfieldvalue('ksp_type','preonly')
 | 
|---|
| 28 |                 mumps['pc_type']=options.getfieldvalue('pc_type','lu')
 | 
|---|
| 29 |                 mumps['pc_factor_mat_solver_package']=options.getfieldvalue('pc_factor_mat_solver_package','mumps')
 | 
|---|
| 30 |                 mumps['mat_mumps_icntl_14']=options.getfieldvalue('mat_mumps_icntl_14',120)
 | 
|---|
| 31 |                 mumps['pc_factor_shift_positive_definite']=options.getfieldvalue('pc_factor_shift_positive_definite','true')
 | 
|---|
| 32 | 
 | 
|---|
| 33 |         return mumps
 | 
|---|
| 34 | 
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.