source:
issm/oecreview/Archive/15392-16133/ISSM-15567-15568.diff@
16134
Last change on this file since 16134 was 16134, checked in by , 12 years ago | |
---|---|
File size: 4.0 KB |
-
../trunk-jpl/src/m/solvers/stokesoptions.m
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 -
../trunk-jpl/src/m/solvers/stokesoptions.py
2 2 from pairoptions import * 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 12 12 arguments=pairoptions(*args) 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. 26 26 for i in range(len(arguments.list)):
Note:
See TracBrowser
for help on using the repository browser.