Changeset 8296


Ignore:
Timestamp:
05/16/11 13:10:11 (14 years ago)
Author:
Mathieu Morlighem
Message:

no need to provide analysis_type in solve command anymore

Location:
issm/trunk/src/m/model
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/model/process_solve_options.m

    r8290 r8296  
    88
    99%solution_type: check on this option, error out otherwise
    10 solution_type=getfieldvalue(options,'analysis_type');
    11 
    12 %batch mode for launching jobs.
    13 outoptions.batch=getfieldvalue(options,'batch','no');
    14 
    15 %directory
    16 outoptions.directory=getfieldvalue(options,'directory','');
    17 
    18 %convert to Enum if a string was provided
     10solution_type=getfieldvalue(options,'solution_type');
    1911if ischar(solution_type), error(['only Enums are supported as ''solution_type''. For example: md=solve(md,''solution_type'',DiagnosticSolutionEnum); ']); end
    20 
    21 %check solution type is supported
    2212if ~ismember(solution_type,[DiagnosticSolutionEnum,PrognosticSolutionEnum,ThermalSolutionEnum,...
    2313                SteadystateSolutionEnum,ParametersSolutionEnum,Transient2DSolutionEnum,Transient3DSolutionEnum...
     
    2616end
    2717outoptions.solution_type=solution_type;
     18
    2819outoptions.upload=getfieldvalue(options,'upload','off');
     20outoptions.batch=getfieldvalue(options,'batch','no');
     21outoptions.directory=getfieldvalue(options,'directory','');
    2922
    3023%  process qmu arguments
     
    4639outoptions.latsgn=getfieldvalue(options,'latsgn',0);
    4740outoptions.cmap=getfieldvalue(options,'cmap',[]);
    48 
  • issm/trunk/src/m/model/solve.m

    r7686 r8296  
    1 function md=solve(md,varargin)
     1function md=solve(md,solutionenum,varargin)
    22%SOLVE - apply solution sequence for this model
    33%
    44%   Usage:
    5 %      md=solve(md,varargin)
     5%      md=solve(md,solutionenum,varargin)
    66%      where varargin is a lit of paired arguments of string OR enums
    7 %      arguments can be: 'analysis_type': 'DiagnosticAnalysis','ThermalAnalysis','PrognosticAnalysis','Transient2DAnalysis'
    87%
    98%   Examples:
    10 %      md=solve(md,'analysis_type',DiagnosticSolutionEnum);
     9%      md=solve(md,DiagnosticSolutionEnum);
    1110
    1211%recover options
    13 options=pairoptions(varargin{:});
     12options=pairoptions(varargin{:},'solution_type',solutionenum);
    1413
    1514%add default options
     
    6261
    6362%Check result is consistent
    64 disp('checking result consistency');
     63%disp('checking result consistency');
    6564%if ~isresultconsistent(md,options.solution_type),
    6665%       disp('!! results not consistent correct the model !!') %it would be very cruel to put an error, it would kill the computed results (even if not consistent...)
Note: See TracChangeset for help on using the changeset viewer.