Changeset 2164


Ignore:
Timestamp:
09/09/09 15:41:11 (15 years ago)
Author:
Mathieu Morlighem
Message:

removed package from solve options (only cielo)

Location:
issm/trunk/src/m/classes/public
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/classes/public/ismodelselfconsistent.m

    r2052 r2164  
    1 function bool=ismodelselfconsistent(md,package),
     1function bool=ismodelselfconsistent(md),
    22%ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
    33%
    44%   Usage:
    5 %      bool=ismodelselfconsistent(md,package),
     5%      bool=ismodelselfconsistent(md),
    66
    77%tolerance we use in litmus tests for the consistency of the model
    88tolerance=10^-12;
    9 if (nargin~=2  )
     9if (nargin~=1  )
    1010        help ismodelselfconsistent
    1111        error('ismodelselfconsistent error message: wrong usage');
     
    5858        end
    5959end
    60 
    6160if (md.ismacayealpattyn==0 && md.ishutter==0 && md.isstokes==0),
    6261        disp(['no elements type set for this model. at least one of ismacayealpattyn, ishutter and isstokes need to be =1']);
     62        bool=0;return;
     63end
     64if (md.analysis_type==DiagnosticAnalysisEnum & any(ismember(MacAyealFormulationEnum,md.elements_type(:,1)) & ismember(PattynFormulationEnum,md.elements_type(:,1))))
     65        disp(['coupling MacAyeal/Pattyn not implemented yet']);
     66        bool=0;return;
     67end
     68if (md.isstokes & md.analysis_type==TransientAnalysisEnum());
     69        disp(['Stokes transient not implemented yet']);
    6370        bool=0;return;
    6471end
     
    167174end
    168175
    169 %CLUSTER
    170 if ~strcmpi(package,'cielo') & ~strcmpi(md.cluster,'none')
    171         disp(['parallel solution not supported by package ' package '. Use cluster=''none'' ']);
    172         bool=0;return;
    173 end
    174 
    175176%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  SOLUTION CHECKS  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    176177%QMU
     
    306307%PARAMETERS
    307308if md.analysis_type==ParametersAnalysisEnum,
    308 
    309         %PACKAGE
    310         if ~strcmpi(package,'ice'),
    311                 disp('parameter solution only supported by package ice yet');
    312                 bool=0;return;
    313         end
    314309
    315310        %OUTPUT
     
    405400%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  PACKAGE CHECKS   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    406401
    407 %CIELO
    408 if strcmpi(package,'cielo'),
     402%NAN VALUES
     403fields={'sparsity'};
     404for i=1:length(fields),
     405        if ~isempty(md.(fields{i})),
     406                if any(isnan(md.(fields{i}))),
     407                        disp(['model ' md.name ' has an NaN value in field ' fields{i} '!']);
     408                        bool=0; return;
     409                end
     410        end
     411end
     412
     413%FIELD > 0
     414fields={'sparsity'};
     415for i=1:length(fields),
     416        if ~isempty(md.(fields{i})),
     417                if any(md.(fields{i})<0),
     418                        disp(['model ' md.name ' has a <0 value in field ' fields{i} '!']);
     419                        bool=0; return;
     420                end
     421        end
     422end
     423
     424%FIELD ~= 0
     425fields={'sparsity'};
     426for i=1:length(fields),
     427        if ~isempty(md.(fields{i})),
     428                if any(md.(fields{i})==0),
     429                        disp(['model ' md.name ' has a =0 value in field ' fields{i} '!']);
     430                        bool=0; return;
     431                end
     432        end
     433end
     434
     435%SPARSITY BETWEEN 0 AND 1
     436if ( (md.sparsity<=0) | (md.sparsity>1)),
     437        disp(['model ' md.name ' sparsity should be inside the [0 1] range']);
     438        bool=0; return;
     439end
     440
     441%CONNECTIVITY
     442if strcmpi(md.type,'2d'),
     443        if md.connectivity<9,
     444                disp('connectivity should be at least 9 for 2d models');
     445                bool=0;return;
     446        end
     447end
     448if strcmpi(md.type,'3d'),
     449        if md.connectivity<24,
     450                disp('connectivity should be at least 24 for 3d models');
     451                bool=0;return;
     452        end
     453end
     454
     455%LOWMEM = 0 or 1
     456if ((md.lowmem ~= 1) & (md.lowmem~=0)),
     457        disp(['model ' md.name ' lowmem field should be 0 or 1']);
     458        bool=0; return;
     459end
     460
     461%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  PARALLEL CHECKS   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     462
     463if ~strcmpi(md.cluster,'none'),
    409464
    410465        %NAN VALUES
    411         fields={'sparsity'};
     466        fields={'time','np'};
    412467        for i=1:length(fields),
    413468                if ~isempty(md.(fields{i})),
     
    420475
    421476        %FIELD > 0
    422         fields={'sparsity'};
     477        fields={'time','np'};
    423478        for i=1:length(fields),
    424479                if ~isempty(md.(fields{i})),
     
    431486
    432487        %FIELD ~= 0
    433         fields={'sparsity'};
     488        fields={'time','np'};
    434489        for i=1:length(fields),
    435490                if ~isempty(md.(fields{i})),
     
    441496        end
    442497
    443         %SPARSITY BETWEEN 0 AND 1
    444         if ( (md.sparsity<=0) | (md.sparsity>1)),
    445                 disp(['model ' md.name ' sparsity should be inside the [0 1] range']);
    446                 bool=0; return;
    447         end
    448 
    449         %CONNECTIVITY
    450         if strcmpi(md.type,'2d'),
    451                 if md.connectivity<9,
    452                         disp('connectivity should be at least 9 for 2d models');
    453                         bool=0;return;
    454                 end
    455         end
    456         if strcmpi(md.type,'3d'),
    457                 if md.connectivity<24,
    458                         disp('connectivity should be at least 24 for 3d models');
    459                         bool=0;return;
    460                 end
    461         end
    462 
    463         %LOWMEM = 0 or 1
    464         if ((md.lowmem ~= 1) & (md.lowmem~=0)),
    465                 disp(['model ' md.name ' lowmem field should be 0 or 1']);
    466                 bool=0; return;
    467         end
    468 
    469 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  PARALLEL CHECKS   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    470 
    471         if ~strcmpi(md.cluster,'none'),
    472 
    473                 %NAN VALUES
    474                 fields={'time','np'};
    475                 for i=1:length(fields),
    476                         if ~isempty(md.(fields{i})),
    477                                 if any(isnan(md.(fields{i}))),
    478                                         disp(['model ' md.name ' has an NaN value in field ' fields{i} '!']);
    479                                         bool=0; return;
    480                                 end
    481                         end
    482                 end
    483 
    484                 %FIELD > 0
    485                 fields={'time','np'};
    486                 for i=1:length(fields),
    487                         if ~isempty(md.(fields{i})),
    488                                 if any(md.(fields{i})<0),
    489                                         disp(['model ' md.name ' has a <0 value in field ' fields{i} '!']);
    490                                         bool=0; return;
    491                                 end
    492                         end
    493                 end
    494 
    495                 %FIELD ~= 0
    496                 fields={'time','np'};
    497                 for i=1:length(fields),
    498                         if ~isempty(md.(fields{i})),
    499                                 if any(md.(fields{i})==0),
    500                                         disp(['model ' md.name ' has a =0 value in field ' fields{i} '!']);
    501                                         bool=0; return;
    502                                 end
    503                         end
    504                 end
    505 
    506         end
    507 
    508 end
    509 
    510 %ICE and MACAYEAL
    511 if (strcmpi(package,'ice') | strcmpi(package,'macayeal')),
    512 
    513         if (isnan(md.eps_rel) & isnan(md.eps_abs)),
    514                 disp(['At least eps_rel must be positive since eps_res not supported by package ' package '!']);
    515                 bool=0; return;
    516         end
    517 
    518 end
     498end
  • issm/trunk/src/m/classes/public/process_solve_options.m

    r2104 r2164  
    66%
    77%   See also: SOLVE,RECOVER_SOLVE_OPTIONS
    8 
    9 %package: is there one? check to ''cielo''
    10 found=0;
    11 for i=1:size(options,1),
    12         if strcmpi(options{i,1},'package'),
    13                 package=options{i,2};
    14                 found=1;
    15                 break
    16         end
    17 end
    18 if ~found,
    19         disp('recover_solve_options info message: no ''package'' was provided, defaulting to ''cielo''');
    20         options(end+1,:)={'package' 'cielo'};
    21         package='cielo';
    22 end
    23 if ~ismemberi(package,{'cielo','ice','macayeal'}),
    24         error(['process_solve_options error message: package ' package ' not supported yet!']);
    25 end
    268
    279%analysis_type: check on this option, error out otherwise
     
    7153        analysis_type=eval([upper(analysis_type(1)) lower(analysis_type(2:end)) 'AnalysisEnum']);
    7254end
    73 if ~ismemberi(sub_analysis_type,{'none','horiz','adjoint','gradient','inverse','vert',''}),
     55if ~ismemberi(sub_analysis_type,{'steady','transient','none','horiz','adjoint','gradient','inverse','vert',''}),
    7456        error(['process_solve_options error message: sub_analysis_type ' sub_analysis_type ' not supported yet!']);
    7557else
     
    120102%setup final options structure
    121103outoptions.analysis_type=analysis_type;
    122 outoptions.package=package;
    123104outoptions.sub_analysis_type=sub_analysis_type;
    124105outoptions.qmudir=qmudir;
  • issm/trunk/src/m/classes/public/solve.m

    r2032 r2164  
    77%      arguments can be: 'analysis_type': 'diagnostic','thermal','prognostic','transient'
    88%      arguments can be: 'sub_analysis_type': 'transient','steady','' (default if empty = 'steady')
    9 %      arguments can be: 'package': 'macayeal','ice','cielo' (default if not specified = 'cielo')
    109%
    1110%   Examples:
    12 %      md=solve(md,'analysis_type','diagnostic','package','cielo');
    13 %      md=solve(md,'analysis_type','thermal','sub_analysis_type','transient','package','ice');
    14 %      md=solve(md,'analysis_type','thermal','sub_analysis_type','steady','package','cielo');
    15 %      md=solve(md,'analysis_type','thermal','package','cielo');
     11%      md=solve(md,'analysis_type','diagnostic');
     12%      md=solve(md,'analysis_type','thermal','sub_analysis_type','transient');
     13%      md=solve(md,'analysis_type','thermal','sub_analysis_type','steady');
     14%      md=solve(md,'analysis_type','thermal');
    1615
    1716%some checks on list of arguments
     
    2726md.analysis_type=options.analysis_type;
    2827md.sub_analysis_type=options.sub_analysis_type;
    29 package=options.package;
    3028
    31 %Use package to set solution namespace
    32 usenamespace(package);
    33 
    34 if ~ismodelselfconsistent(md,package),
     29if ~ismodelselfconsistent(md),
    3530        error(' '); %previous error messages should explain what is going on.
    3631end
     
    9489md.analysis_type=AnalysisTypeFromEnum(options.analysis_type);
    9590md.sub_analysis_type=AnalysisTypeFromEnum(options.sub_analysis_type);
    96 
    97 %re-add the paths
    98 addpath(genpath_ice([ISSM_DIR '/src/m/solutions/macayeal']));
    99 addpath(genpath_ice([ISSM_DIR '/src/m/solutions/ice']));
    100 addpath(genpath_ice([ISSM_DIR '/src/m/solutions/cielo']));
    101 addpath(genpath_ice([ISSM_DIR '/bin']));
Note: See TracChangeset for help on using the changeset viewer.