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