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:
705 bytes
|
Rev | Line | |
---|
[19895] | 1 | import pairoptions
|
---|
| 2 |
|
---|
| 3 | def matlaboptions(**kwargs):
|
---|
| 4 | #MATLABOPTIONS - return Matlab petsc options
|
---|
| 5 | #
|
---|
| 6 | # Usage:
|
---|
| 7 | # options=matlaboptions;
|
---|
| 8 |
|
---|
| 9 | #retrieve options provided in varargin
|
---|
| 10 | arguments=pairoptions.pairoptions(**kwargs)
|
---|
| 11 |
|
---|
| 12 | options=[['toolkit','petsc'],['ksp_type','matlab']];
|
---|
| 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.