Changeset 11995 for issm/trunk/src/m/model/solvers/jacobicgoptions.m
- Timestamp:
- 04/16/12 14:57:18 (13 years ago)
- Location:
- issm/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk ¶
- Property svn:ignore
-
TabularUnified
old new 7 7 config.status 8 8 configure 9 doxygen10 9 ISSM.paf 11 10 ISSM.ppf 12 11 ISSM.ppf_cache 13 12 libtool 14 list15 13 Makefile 16 14 Makefile.in
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
TabularUnified issm/trunk/src/m/model/solvers/jacobicgoptions.m ¶
r10565 r11995 1 function options=jacobiasmoptions(varargin)1 function jacobicg=jacobiacgoptions(varargin) 2 2 %ASMOPTIONS - return Additive Shwartz Method with Jacobi preconditioner petsc options 3 3 % … … 6 6 7 7 %retrieve options provided in varargin 8 arguments=pairoptions(varargin{:}); 8 options=pairoptions(varargin{:}); 9 jacobicg=struct(); 9 10 10 11 %default jacobiasm options 11 options={{'mat_type','aij'},{'ksp_type','cg'},{'ksp_max_it',100},{'ksp_rtol',1e-15'}}; 12 13 %now, go through our arguments, and write over default options. 14 for i=1:size(arguments.list,1), 15 arg1=arguments.list{i,1}; 16 arg2=arguments.list{i,2}; 17 found=0; 18 for j=1:size(options,2), 19 joption=options{j}; 20 if strcmpi(joption{1},arg1), 21 joption{2}=arg2; 22 options{j}=joption; 23 found=1; 24 break; 25 end 26 end 27 if ~found, 28 %this option did not exist, add it: 29 options{end+1}={arg1,arg2}; 30 end 31 end 12 jacobicg.mat_type=getfieldvalue(options,'mat_type','aij'); 13 jacobicg.ksp_type=getfieldvalue(options,'ksp_type','cg'); 14 jacobicg.ksp_max_it=getfieldvalue(options,'ksp_max_it',100); 15 jacobicg.ksp_rtol=getfieldvalue(options,'ksp_rtol',1e-15);
Note:
See TracChangeset
for help on using the changeset viewer.