Last change
on this file since 16137 was 16137, checked in by Mathieu Morlighem, 12 years ago |
merged trunk-jpl and trunk for revision 16135
|
File size:
791 bytes
|
Rev | Line | |
---|
[11791] | 1 | from pairoptions import *
|
---|
| 2 | def jacobicgoptions(*args):
|
---|
| 3 | #ASMOPTIONS - return Additive Shwartz Method with Jacobi preconditioner petsc options
|
---|
| 4 | #
|
---|
| 5 | # Usage:
|
---|
| 6 | # options=jacobicgoptions;
|
---|
| 7 |
|
---|
| 8 | #retrieve options provided in varargin
|
---|
| 9 | arguments=pairoptions(*args)
|
---|
| 10 |
|
---|
[15396] | 11 | options=[['toolkit','petsc'],['mat_type','aij'],['ksp_type','cg'],['ksp_max_it',100],['ksp_rtol',1e-15]];
|
---|
[11791] | 12 |
|
---|
| 13 | #now, go through our arguments, and write over default options.
|
---|
| 14 | for i in range(len(arguments.list)):
|
---|
| 15 | arg1=arguments.list[i][0]
|
---|
| 16 | arg2=arguments.list[i][1]
|
---|
| 17 | found=0;
|
---|
| 18 | for j in range(len(options)):
|
---|
| 19 | joption=options[j][0]
|
---|
| 20 | if joption==arg1:
|
---|
| 21 | joption[1]=arg2;
|
---|
| 22 | options[j]=joption;
|
---|
| 23 | found=1;
|
---|
| 24 | break
|
---|
| 25 | if not found:
|
---|
| 26 | #this option did not exist, add it:
|
---|
| 27 | options.append([arg1,arg2])
|
---|
| 28 | return options
|
---|
Note:
See
TracBrowser
for help on using the repository browser.