source: issm/trunk-jpl/src/py3/solvers/jacobiasmoptions.py@ 19895

Last change on this file since 19895 was 19895, checked in by bdef, 9 years ago

NEW:Adding directory to hold the python 3 implementation of the interface

File size: 872 bytes
RevLine 
[19895]1import pairoptions
2
3def jacobiasmoptions(**kwargs):
4 #ASMOPTIONS - return Additive Shwartz Method with Jacobi preconditioner petsc options
5 #
6 # Usage:
7 # options=jacobiasmoptions;
8
9 #retrieve options provided in varargin
10 arguments=pairoptions.pairoptions(**kwargs)
11
12 options=[['toolkit','petsc'],['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]];
13
14 #now, go through our arguments, and write over default options.
15 for i in range(len(arguments.list)):
16 arg1=arguments.list[i][0]
17 arg2=arguments.list[i][1]
18 found=0;
19 for j in range(len(options)):
20 joption=options[j][0]
21 if joption==arg1:
22 joption[1]=arg2;
23 options[j]=joption;
24 found=1;
25 break
26 if not found:
27 #this option did not exist, add it:
28 options.append([arg1,arg2])
29 return options
Note: See TracBrowser for help on using the repository browser.