Last change
on this file since 23670 was 23670, checked in by bdef, 6 years ago |
CHG: python scripts after 2to3 and indentation fix
|
File size:
869 bytes
|
Line | |
---|
1 | import pairoptions
|
---|
2 |
|
---|
3 | def jacobiasmoptions(*args):
|
---|
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(*args)
|
---|
11 |
|
---|
12 | options=[['toolkit','petsc'],['mat_type','mpiaij'],['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.