| 1 | function outoptions=process_solve_options(options)
|
|---|
| 2 | %DEFAULT_SOLVE_OPTIONS - set up default options for solve phase
|
|---|
| 3 | %
|
|---|
| 4 | % Usage:
|
|---|
| 5 | % options=process_solve_options(options)
|
|---|
| 6 | %
|
|---|
| 7 | % See also: SOLVE
|
|---|
| 8 |
|
|---|
| 9 | %analysis_type: check on this option, error out otherwise
|
|---|
| 10 | analysis_type=getfieldvalue(options,'analysis_type');
|
|---|
| 11 |
|
|---|
| 12 | %sub_analysis_type: check on it, not mandatory
|
|---|
| 13 | sub_analysis_type=getfieldvalue(options,'sub_analysis_type',NoneAnalysisEnum);
|
|---|
| 14 |
|
|---|
| 15 | %batch mode for launching jobs.
|
|---|
| 16 | outoptions.batch=getfieldvalue(options,'batch','no');
|
|---|
| 17 |
|
|---|
| 18 | %directory
|
|---|
| 19 | outoptions.directory=getfieldvalue(options,'directory','');
|
|---|
| 20 |
|
|---|
| 21 | %convert to Enum if a string was provided
|
|---|
| 22 | if ischar(analysis_type), error(['only Enums are supported as ''analysis_type''. For example: md=solve(md,''analysis_type'',DiagnosticSolutionEnum); ']); end
|
|---|
| 23 | if ischar(sub_analysis_type), error(['only Enums are supported as ''sub_analysis_type''. For example: md=solve(md,''analysis_type'',DiagnosticSolutionEnum); ']); end
|
|---|
| 24 |
|
|---|
| 25 | %check solution type is supported
|
|---|
| 26 | if ~ismember(analysis_type,[DiagnosticSolutionEnum,PrognosticSolutionEnum,ThermalSolutionEnum,...
|
|---|
| 27 | SteadystateSolutionEnum,ParametersSolutionEnum,Transient2DSolutionEnum,Transient3DSolutionEnum...
|
|---|
| 28 | BalancedthicknessSolutionEnum,BalancedvelocitiesSolutionEnum,BedSlopeSolutionEnum,SurfaceSlopeSolutionEnum,GroundingLineMigration2DSolutionEnum]),
|
|---|
| 29 | error(['process_solve_options error message: analysis_type ' EnumToString(analysis_type) ' not supported yet!']);
|
|---|
| 30 | end
|
|---|
| 31 | if ~ismember(sub_analysis_type,[SteadyAnalysisEnum,NoneAnalysisEnum,GradientAnalysisEnum,InverseAnalysisEnum,TransientAnalysisEnum]),
|
|---|
| 32 | error(['process_solve_options error message: sub_analysis_type ' sub_analysis_type ' not supported yet!']);
|
|---|
| 33 | end
|
|---|
| 34 | outoptions.analysis_type=analysis_type;
|
|---|
| 35 | outoptions.sub_analysis_type=sub_analysis_type;
|
|---|
| 36 | outoptions.upload=getfieldvalue(options,'upload','off');
|
|---|
| 37 |
|
|---|
| 38 | % process qmu arguments
|
|---|
| 39 | outoptions.qmudir=getfieldvalue(options,'qmudir',['qmu' num2str(GetPId)]); % qmudir =['qmu_' datestr(now,'yyyymmdd_HHMMSS')];
|
|---|
| 40 | outoptions.qmufile=getfieldvalue(options,'qmufile','qmu');% qmufile cannot be changed unless ????script.sh is also changed
|
|---|
| 41 | outoptions.overwrite=getfieldvalue(options,'overwrite','n');
|
|---|
| 42 | outoptions.keep=getfieldvalue(options,'keep','n');
|
|---|
| 43 | outoptions.ivar=getfieldvalue(options,'ivar',1);
|
|---|
| 44 | outoptions.iresp=getfieldvalue(options,'iresp',1);
|
|---|
| 45 | outoptions.imethod=getfieldvalue(options,'imethod',1);
|
|---|
| 46 | outoptions.iparams=getfieldvalue(options,'iparams',1);
|
|---|
| 47 | outoptions.runmpi=getfieldvalue(options,'runmpi',false);
|
|---|