Last change
on this file since 22758 was 22758, checked in by Mathieu Morlighem, 7 years ago |
merged trunk-jpl and trunk for revision 22757
|
File size:
801 bytes
|
Rev | Line | |
---|
[17806] | 1 | import pairoptions
|
---|
| 2 |
|
---|
[11791] | 3 | def jacobicgoptions(*args):
|
---|
| 4 | #ASMOPTIONS - return Additive Shwartz Method with Jacobi preconditioner petsc options
|
---|
| 5 | #
|
---|
| 6 | # Usage:
|
---|
| 7 | # options=jacobicgoptions;
|
---|
| 8 |
|
---|
| 9 | #retrieve options provided in varargin
|
---|
[17806] | 10 | arguments=pairoptions.pairoptions(*args)
|
---|
[11791] | 11 |
|
---|
[22758] | 12 | options=[['toolkit','petsc'],['mat_type','mpiaij'],['ksp_type','cg'],['ksp_max_it',100],['ksp_rtol',1e-15]];
|
---|
[11791] | 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.