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