Changeset 9751


Ignore:
Timestamp:
09/09/11 17:04:04 (14 years ago)
Author:
Mathieu Morlighem
Message:

some more consistency checks

Location:
issm/trunk/src/m
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/classes/balancethickness.m

    r9739 r9751  
    4040                end % }}}
    4141                function checkconsistency(obj,md) % {{{
    42 
     42                        if ~ismember(md.balancethickness.stabilization,[0 1 3]),
     43                                checkmessage('model not consistent: balancethickness.stabilization should be a scalar (0 or 1 or 3)');
     44                        end
    4345                end % }}}
    4446        end
  • issm/trunk/src/m/classes/clusters/castor.m

    r9650 r9751  
    4646                 end
    4747                 %}}}
    48                  function IsConsistent(cluster) % {{{1
     48                 function checkconsistency(cluster,md) % {{{1
    4949
    5050                         available_queues={'shortc','longc'};
  • issm/trunk/src/m/classes/clusters/cosmos.m

    r9650 r9751  
    4646                 end
    4747                 %}}}
    48                  function IsConsistent(cluster) % {{{1
     48                 function checkconsistency(cluster,md) % {{{1
    4949
    5050                         available_queues={'debug','shortq','longq'};
  • issm/trunk/src/m/classes/clusters/gemini.m

    r9650 r9751  
    4646                 end
    4747                 %}}}
    48                  function IsConsistent(cluster) % {{{1
     48                 function checkconsistency(cluster,md) % {{{1
    4949
    5050                         available_queues={'debug','shortg','longg'};
  • issm/trunk/src/m/classes/clusters/generic.m

    r9650 r9751  
    6060                 end
    6161                 %}}}
    62                  function IsConsistent(cluster) % {{{1
     62                 function checkconsistency(cluster,md) % {{{1
    6363                         if cluster.np<1
    64                                  error(['number of processors should be at least 1']);
     64                                 checkmessage(['number of processors should be at least 1']);
    6565                         end
    6666                         if isnan(cluster.np),
    67                                  error('number of processors should not be NaN!');
     67                                 checkessage('number of processors should not be NaN!');
    6868                         end
    6969                 end
  • issm/trunk/src/m/classes/clusters/none.m

    r8587 r9751  
    3030                 end
    3131                 %}}}
    32                  function IsConsistent(cluster) % {{{1
     32                 function checkconsistency(cluster,md) % {{{1
    3333                 end
    3434                 %}}}
  • issm/trunk/src/m/classes/clusters/pfe.m

    r9650 r9751  
    6565                 end
    6666                 %}}}
    67                  function IsConsistent(cluster) % {{{1
     67                 function checkconsistency(cluster,md) % {{{1
    6868
    6969                         available_queues={'long','debug'};
     
    7777                                 if cluster.hyperthreading,
    7878                                         if ((cluster.cpuspernode>16 ) | (cluster.cpuspernode<1)),
    79                                                  error('IsConsistent error message: cpuspernode should be between 1 and 16 for ''neh'' and ''har'' processors in hyperthreading mode');
     79                                                 checkmessage('cpuspernode should be between 1 and 16 for ''neh'' and ''har'' processors in hyperthreading mode');
    8080                                         end
    8181                                 else
    8282                                         if ((cluster.cpuspernode>8 ) | (cluster.cpuspernode<1)),
    83                                                  error('IsConsistent error message: cpuspernode should be between 1 and 8 for ''neh'' and ''har'' processors');
     83                                                 checkmessage('cpuspernode should be between 1 and 8 for ''neh'' and ''har'' processors');
    8484                                         end
    8585                                 end
     
    8787                                 if cluster.hyperthreading,
    8888                                         if ((cluster.cpuspernode>24 ) | (cluster.cpuspernode<1)),
    89                                                  error('IsConsistent error message: cpuspernode should be between 1 and 24 for ''wes'' processors in hyperthreading mode');
     89                                                 checkmessage('cpuspernode should be between 1 and 24 for ''wes'' processors in hyperthreading mode');
    9090                                         end
    9191                                 else
    9292                                         if ((cluster.cpuspernode>12 ) | (cluster.cpuspernode<1)),
    93                                                  error('IsConsistent error message: cpuspernode should be between 1 and 12 for ''wes'' processors');
     93                                                 checkmessage('cpuspernode should be between 1 and 12 for ''wes'' processors');
    9494                                         end
    9595                                 end
    9696                         else
    97                                  error('IsConsistent error message: unknown processor type, should be ''neh'',''wes'' or ''har''');
     97                                 checkmessage('unknown processor type, should be ''neh'',''wes'' or ''har''');
    9898                         end
    9999
    100100                         %Miscelaneous
    101                          if isempty(cluster.login), error('IsConsistent error message: login empty'); end
    102                          if isempty(cluster.codepath), error('IsConsistent error message: codepath empty'); end
    103                          if isempty(cluster.executionpath), error('IsConsistent error message: executionpath empty'); end
     101                         if isempty(cluster.login), checkmessage('login empty'); end
     102                         if isempty(cluster.codepath), checkmessage('codepath empty'); end
     103                         if isempty(cluster.executionpath), checkmessage('executionpath empty'); end
    104104
    105105                 end
  • issm/trunk/src/m/classes/clusters/pollux.m

    r9650 r9751  
    4646                 end
    4747                 %}}}
    48                  function IsConsistent(cluster) % {{{1
     48                 function checkconsistency(cluster,md) % {{{1
    4949
    5050                         available_queues={'shortp','longp'};
  • issm/trunk/src/m/classes/groundingline.m

    r9739 r9751  
    4444                function checkconsistency(obj,md) % {{{
    4545
     46                        if ~ismember({obj.migration},{'None' 'AgressiveMigration' 'SoftMigration'}),
     47                                checkmessage(['groundingline.migration field should be ''None'' ''AgressiveMigration'' or ''SoftMigration''']);
     48                        end
     49                        if ~strcmp(obj.migration,'None'),
     50                                if (md.mesh.dimension==3 | strcmpi(md.cluster.name,'none')),
     51                                        checkmessage(['requesting grounding line migration, but grounding line module only implemented for 2d models and parallel runs!']);
     52                                end
     53                                if isnan(md.geometry.bathymetry),
     54                                        checkmessage(['requesting grounding line migration, but bathymetry is absent!']);
     55                                end
     56                                pos=find(md.mask.vertexongroundedice);
     57                                if any(md.geometry.bed(pos)-md.geometry.bathymetry(pos)),
     58                                        checkmessage(['bathymetry not equal to bed on grounded ice !']);
     59                                end
     60                                pos=find(md.mask.vertexonfloatingice);
     61                                if any(md.geometry.bathymetry(pos)-md.geometry.bed(pos)>tolerance),
     62                                        checkmessage(['bathymetry superior to bed on floating ice !']);
     63                                end
     64                        end
     65
    4666                end % }}}
    4767        end
  • issm/trunk/src/m/classes/materials.m

    r9749 r9751  
    8585                        fields={'rheology_B'};
    8686                        checksize(md,'materials',fields,[md.mesh.numberofvertices 1]);
     87
     88                        if ~ismember({md.materials.rheology_law},{'None' 'Paterson' 'Arrhenius'}),
     89                                checkmessage(['model not consistent: model ' md.miscellaneous.name ' rheology_law field should be ''none'' ''paterson'' or ''arrhenius''']);
     90                        end
    8791                end % }}}
    8892                function disp(obj) % {{{
  • issm/trunk/src/m/classes/mesh.m

    r9749 r9751  
    105105                        end
    106106
     107
     108                        if (md.mesh.dimension==2),
     109                                if md.mesh.average_vertex_connectivity<9,
     110                                        checkmessage('model not consistent: connectivity should be at least 9 for 2d models');
     111                                end
     112                        end
     113                        if md.mesh.dimension==3,
     114                                if md.mesh.average_vertex_connectivity<24,
     115                                        checkmessage('model not consistent: connectivity should be at least 24 for 3d models');
     116                                end
     117                        end
     118
    107119                        %Solution specific checks
    108120                        switch(md.private.solution),
  • issm/trunk/src/m/classes/prognostic.m

    r9739 r9751  
    4747                end % }}}
    4848                function checkconsistency(obj,md) % {{{
     49                        if ~ismember(obj.stabilization,[0 1 3]),
     50                                checkmessage('prognostic.stabilization should be a scalar (0 or 1 or 3)');
     51                        end
    4952
     53                        if ~ismember(md.prognostic.hydrostatic_adjustment,{'Absolute' 'Incremental'}),
     54                                checkmessage(['model not consistent: model ' md.miscellaneous.name ' prognostic.hydrostatic_adjustment field should be AbsoluteEnum or IncrementalEnum']);
     55                        end
    5056                end % }}}
    5157                function disp(obj) % {{{
  • issm/trunk/src/m/classes/rifts.m

    r9739 r9751  
    3636                end % }}}
    3737                function checkconsistency(obj,md) % {{{
    38 
     38                        if obj.numrifts,
     39                                if ~(md.mesh.dimension==2),
     40                                        checkmessage(['model not consistent: models with rifts are only supported in 2d for now!']);
     41                                end
     42                                if ~isstruct(obj.riftstruct),
     43                                        checkmessage(['rifts.riftstruct should be a structure!']);
     44                                end
     45                                if ~isempty(find(md.mesh.segmentmarkers>=2)),
     46                                        %We have segments with rift markers, but no rift structure!
     47                                        checkmessage(['model should be processed for rifts (run meshprocessrifts)!']);
     48                                end
     49                                %Check that rifts are filled with proper material
     50                                checkvalues(md,{'rifts.riftstruct.fill'},[WaterEnum() AirEnum() IceEnum() MelangeEnum()]);
     51                        else
     52                                if ~isnans(obj.riftstruct),
     53                                        checkmessage(['riftstruct shoud be NaN since obj.numrifts is 0!']);
     54                                end
     55                        end
    3956                end % }}}
    4057        end
  • issm/trunk/src/m/classes/thermal.m

    r9739 r9751  
    5151                end % }}}
    5252                function checkconsistency(obj,md) % {{{
     53                        if ~ismember(obj.stabilization,[0 1 2]),
     54                                checkmessage('thermal.stabilization should be a scalar (0 or 1 or 2)');
     55                        end
    5356
    5457                end % }}}
  • issm/trunk/src/m/classes/timestepping.m

    r9739 r9751  
    4747                end % }}}
    4848                function checkconsistency(obj,md) % {{{
    49 
     49                        if ~ismember(md.timestepping.time_adapt,[0 1]),
     50                                checkmessage(['model not consistent: model ' md.miscellaneous.name ' time_adapt field should be 0 or 1']);
     51                        end
    5052                end % }}}
    5153        end
  • issm/trunk/src/m/model/ismodelselfconsistent.m

    r9739 r9751  
    1212for i=1:length(fields),
    1313        field=fields{i};
    14         if ismember(field,{'cluster' 'results' 'debug' 'radaroverlay'}),
     14        if ismember(field,{'results' 'debug' 'radaroverlay'}),
    1515                continue;
    1616        end
Note: See TracChangeset for help on using the changeset viewer.