Changeset 15568
- Timestamp:
- 07/23/13 14:32:29 (12 years ago)
- Location:
- issm/trunk-jpl/src/m/solvers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/solvers/stokesoptions.m
r15564 r15568 1 function FS=FSoptions(varargin)1 function stokes=stokesoptions(varargin) 2 2 %STOKESOPTIONS - return STOKES multi-physics solver petsc options 3 3 % 4 4 % Usage: 5 % options= FSoptions;5 % options=stokesoptions; 6 6 7 7 %retrieve options provided in varargin 8 8 options=pairoptions(varargin{:}); 9 FS=struct();9 stokes=struct(); 10 10 11 %default FSoptions11 %default stokes options 12 12 PETSC_VERSION=petscversion(); 13 13 if PETSC_VERSION==2, 14 error(' FSoptions error message: multi-physics options not supported in Petsc 2');14 error('stokesoptions error message: multi-physics options not supported in Petsc 2'); 15 15 end 16 16 if PETSC_VERSION==3, 17 FS.toolkit='petsc';18 FS.mat_type=getfieldvalue(options,'mat_type','mpiaij');19 FS.ksp_max_it=getfieldvalue(options,'ksp_max_it',1000);20 FS.ksp_type=getfieldvalue(options,'ksp_type','gmres');21 FS.pc_type=getfieldvalue(options,'pc_type','fieldsplit');22 FS.pc_field_split_type=getfieldvalue(options,'pc_field_split_type','schur');23 FS.fieldsplit_0_pc_type=getfieldvalue(options,'fieldsplit_0_pc_type','hypre');24 FS.fieldsplit_0_ksp_type=getfieldvalue(options,'fieldsplit_0_ksp_type','gmres');25 FS.fieldsplit_0_pc_hypre_type=getfieldvalue(options,'fieldsplit_0_pc_hypre_type','boomerang');26 FS.fieldsplit_1_pc_type=getfieldvalue(options,'fieldsplit_1_pc_type','jacobi');27 FS.fieldsplit_1_ksp_type=getfieldvalue(options,'fieldsplit_1_ksp_type','preonly');28 FS.issm_option_solver=getfieldvalue(options,'issm_option_solver','FS');17 stokes.toolkit='petsc'; 18 stokes.mat_type=getfieldvalue(options,'mat_type','mpiaij'); 19 stokes.ksp_max_it=getfieldvalue(options,'ksp_max_it',1000); 20 stokes.ksp_type=getfieldvalue(options,'ksp_type','gmres'); 21 stokes.pc_type=getfieldvalue(options,'pc_type','fieldsplit'); 22 stokes.pc_field_split_type=getfieldvalue(options,'pc_field_split_type','schur'); 23 stokes.fieldsplit_0_pc_type=getfieldvalue(options,'fieldsplit_0_pc_type','hypre'); 24 stokes.fieldsplit_0_ksp_type=getfieldvalue(options,'fieldsplit_0_ksp_type','gmres'); 25 stokes.fieldsplit_0_pc_hypre_type=getfieldvalue(options,'fieldsplit_0_pc_hypre_type','boomerang'); 26 stokes.fieldsplit_1_pc_type=getfieldvalue(options,'fieldsplit_1_pc_type','jacobi'); 27 stokes.fieldsplit_1_ksp_type=getfieldvalue(options,'fieldsplit_1_ksp_type','preonly'); 28 stokes.issm_option_solver=getfieldvalue(options,'issm_option_solver','stokes'); 29 29 end -
issm/trunk-jpl/src/m/solvers/stokesoptions.py
r15564 r15568 3 3 from petscversion import * 4 4 #}}} 5 def FSoptions(*args):5 def stokesoptions(*args): 6 6 #STOKESOPTIONS - return STOKES multi-physics solver petsc options 7 7 # 8 8 # Usage: 9 # options= FSoptions;9 # options=stokesoptions; 10 10 11 11 #retrieve options provided in varargin … … 13 13 14 14 15 #default FSoptions15 #default stokes options 16 16 PETSC_VERSION=petscversion() 17 17 18 18 if PETSC_VERSION==2: 19 raise RuntimeError(' FSoptions error message: multi-physics options not supported in Petsc 2')19 raise RuntimeError('stokesoptions error message: multi-physics options not supported in Petsc 2') 20 20 if PETSC_VERSION==3: 21 21 options=[['toolkit','petsc'],['mat_type','mpiaij'],['ksp_max_it',1000],['ksp_type','gmres'],['pc_type','fieldsplit'],['pc_field_split_type','schur'],\ 22 22 ['fieldsplit_0_pc_type','hypre'],['fieldsplit_0_ksp_type','gmres'],['fieldsplit_0_pc_hypre_type','boomerang'],\ 23 ['fieldsplit_1_pc_type','jacobi'],['fieldsplit_1_ksp_type','preonly'],['issm_option_solver',' FS']]23 ['fieldsplit_1_pc_type','jacobi'],['fieldsplit_1_ksp_type','preonly'],['issm_option_solver','stokes']] 24 24 25 25 #now, go through our arguments, and write over default options.
Note:
See TracChangeset
for help on using the changeset viewer.