Changeset 1311


Ignore:
Timestamp:
07/14/09 14:56:10 (16 years ago)
Author:
Mathieu Morlighem
Message:

better checks

File:
1 edited

Legend:

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

    r1298 r1311  
    214214%PROGNOSTIC
    215215if strcmp(md.analysis_type,'prognostic'),
    216         %old testing
    217         %       if isempty(find(md.gridondirichlet_diag)),
    218         %               disp(['model ' md.name ' diagnostic is not well posed (singular). You need at least one grid with fixed velocity!'])
    219         %               bool=0;return;
    220         %       end
    221         %       if isempty(find(md.gridondirichlet_prog)),
    222         %               disp(['model ' md.name ' prognostic is not well posed (singular). You need at least one grid with fixed thickness!'])
    223         %               bool=0;return;
    224         %       end
    225216
    226217        %VELOCITIES
     
    231222end
    232223
    233 %THERMAL TRANSIENT
    234 if strcmp(md.analysis_type,'thermal')
    235         if strcmp(md.sub_analysis_type,'transient')
    236 
    237                 %INITIAL TEMPERATURE, MELTING AND ACCUMULATION
    238                 if isempty(md.temperature),
    239                         disp(['An  initial temperature is needed for a transient thermal computation'])
    240                         bool=0;return;
    241                 end
    242                 if isstruct(md.temperature) |  isstruct(md.melting) | isstruct(md.accumulation),
    243                         disp(['The initial temperature, melting or accumulation should be a list and not a structure'])
    244                         bool=0;return;
    245                 end
    246         end
    247 end
    248 
    249224%THERMAL STEADY AND THERMAL TRANSIENT
    250225if strcmpi(md.analysis_type,'thermal'),
     
    257232
    258233        %VELOCITIES AND PRESSURE
    259         if (isempty(md.vx) | isnan(md.vx) | isempty(md.vy)  | isnan(md.vy) | isempty(md.vz) | isnan(md.vz)),
     234        if (length(md.vx)~=md.numberofgrids | length(md.vy)~=md.numberofgrids | length(md.vz)~=md.numberofgrids),
    260235                disp(['a 3d velocity is required. Run ''diagnostic'' solution first!'])
    261236                bool=0;return;
    262237        end
    263         if (isempty(md.pressure) | isnan(md.pressure)),
     238        if (length(md.pressure)~=md.numberofgrids),
    264239                disp(['pressure is required. Run ''diagnostic'' solution first!'])
    265240                bool=0;return;
     
    267242end
    268243
    269 %THERMAL TRANSIENT AND TRANSIENT
    270 if strcmp(md.analysis_type,'thermal'),
     244%THERMAL TRANSIENT
     245if strcmpi(md.analysis_type,'thermal') & strcmp(md.sub_analysis_type,'transient'),
    271246
    272247        %DT and NDT
     
    279254        end
    280255
    281         %INITIAL TEMPERATURE
    282         if isstruct(md.temperature),
    283                 disp(['The initial temperature should be empty or a list but not a structure'])
     256        %INITIAL TEMPERATURE, MELTING AND ACCUMULATION
     257        if (length(md.temperature)~=md.numberofgrids),
     258                disp(['An  initial temperature is needed for a transient thermal computation'])
     259                bool=0;return;
     260        end
     261        if (length(md.temperature)~=md.numberofgrids | length(md.accumulation)~=md.numberofgrids | length(md.melting)~=md.numberofgrids),
     262                disp(['The initial temperature, melting or accumulation should be a list and not a structure'])
    284263                bool=0;return;
    285264        end
Note: See TracChangeset for help on using the changeset viewer.