Changeset 11871 for issm/trunk-jpl/src/m/model/solvers/jacobiasmoptions.m
- Timestamp:
- 04/03/12 10:11:50 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/model/solvers/jacobiasmoptions.m
r6098 r11871 1 function options=jacobiasmoptions(varargin)1 function jacobiasm=jacobiasmoptions(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 jacobiasm=struct(); 9 10 10 11 %default jacobiasm options 11 options={{'mat_type','aij'},{'ksp_type','gmres'},{'pc_type','asm'},{'sub_pc_type','jacobi'},{'pc_asm_overlap',3},{'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 jacobiasm.mat_type=getfieldvalue(options,'mat_type','aij'); 13 jacobiasm.ksp_type=getfieldvalue(options,'ksp_type','gmres'); 14 jacobiasm.pc_type=getfieldvalue(options,'pc_type','asm'); 15 jacobiasm.sub_pc_type=getfieldvalue(options,'sub_pc_type','jacobi'); 16 jacobiasm.pc_asm_overlap=getfieldvalue(options,'pc_asm_overlap',3); 17 jacobiasm.ksp_max_it=getfieldvalue(options,'ksp_max_it',100); 18 jacobiasm.ksp_rtol=getfieldvalue(options,'ksp_rtol',1e-15);
Note:
See TracChangeset
for help on using the changeset viewer.