Changeset 12663


Ignore:
Timestamp:
07/19/12 15:32:17 (13 years ago)
Author:
Mathieu Morlighem
Message:

ismodelselfconsistant now uses a model field instead of a persistent variable

Location:
issm/trunk-jpl/src/m/classes
Files:
39 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/classes/autodiff.m

    r11869 r12663  
    2222
    2323                end % }}}
    24                 function checkconsistency(obj,md,solution,analyses) % {{{
     24                function md = checkconsistency(obj,md,solution,analyses) % {{{
    2525
    2626                end % }}}
  • issm/trunk-jpl/src/m/classes/balancethickness.m

    r11869 r12663  
    2525
    2626                end % }}}
    27                 function checkconsistency(obj,md,solution,analyses) % {{{
     27                function md = checkconsistency(obj,md,solution,analyses) % {{{
    2828                        %Early return
    2929                        if solution~=BalancethicknessSolutionEnum, return; end
    3030
    31                         checkfield(md,'balancethickness.spcthickness','forcing',1);
    32                         checkfield(md,'balancethickness.thickening_rate','size',[md.mesh.numberofvertices 1],'NaN',1);
    33                         checkfield(md,'balancethickness.stabilization','size',[1 1],'values',[0 1 2 3]);
     31                        md = checkfield(md,'balancethickness.spcthickness','forcing',1);
     32                        md = checkfield(md,'balancethickness.thickening_rate','size',[md.mesh.numberofvertices 1],'NaN',1);
     33                        md = checkfield(md,'balancethickness.stabilization','size',[1 1],'values',[0 1 2 3]);
    3434                end % }}}
    3535                function disp(obj) % {{{
  • issm/trunk-jpl/src/m/classes/basalforcings.m

    r11869 r12663  
    2222
    2323                end % }}}
    24                 function checkconsistency(obj,md,solution,analyses) % {{{
     24                function md = checkconsistency(obj,md,solution,analyses) % {{{
    2525
    2626                        if ismember(PrognosticAnalysisEnum,analyses) & ~(solution==TransientSolutionEnum & md.transient.isprognostic==0),
    27                                 checkfield(md,'basalforcings.melting_rate','NaN',1,'forcing',1);
     27                                md = checkfield(md,'basalforcings.melting_rate','NaN',1,'forcing',1);
    2828                        end
    2929                        if ismember(BalancethicknessAnalysisEnum,analyses),
    30                                 checkfield(md,'basalforcings.melting_rate','NaN',1,'size',[md.mesh.numberofvertices 1]);
     30                                md = checkfield(md,'basalforcings.melting_rate','NaN',1,'size',[md.mesh.numberofvertices 1]);
    3131                        end
    3232                        if ismember(ThermalAnalysisEnum,analyses) & ~(solution==TransientSolutionEnum & md.transient.isthermal==0),
    33                                 checkfield(md,'basalforcings.melting_rate','NaN',1,'forcing',1);
    34                                 checkfield(md,'basalforcings.geothermalflux','NaN',1,'forcing',1,'>=',0);
     33                                md = checkfield(md,'basalforcings.melting_rate','NaN',1,'forcing',1);
     34                                md = checkfield(md,'basalforcings.geothermalflux','NaN',1,'forcing',1,'>=',0);
    3535                        end
    3636                end % }}}
  • issm/trunk-jpl/src/m/classes/clusters/acenet.m

    r12371 r12663  
    4747                 end
    4848                 %}}}
    49                  function checkconsistency(cluster,md,solution,analyses) % {{{
     49                 function md = checkconsistency(cluster,md,solution,analyses) % {{{
    5050
    5151                         available_queues={'debug','shortq','longq'};
  • issm/trunk-jpl/src/m/classes/clusters/castor.m

    r12372 r12663  
    3737                 end
    3838                 %}}}
    39                  function checkconsistency(cluster,md,solution,analyses) % {{{
     39                 function md = checkconsistency(cluster,md,solution,analyses) % {{{
    4040
    4141                         available_queues={'shortc','longc'};
  • issm/trunk-jpl/src/m/classes/clusters/cosmos.m

    r12371 r12663  
    3737                 end
    3838                 %}}}
    39                  function checkconsistency(cluster,md,solution,analyses) % {{{
     39                 function md = checkconsistency(cluster,md,solution,analyses) % {{{
    4040
    4141                         available_queues={'debug','shortq','longq'};
  • issm/trunk-jpl/src/m/classes/clusters/discover.m

    r12621 r12663  
    5656                 end
    5757                 %}}}
    58                  function checkconsistency(cluster,md,solution,analyses) % {{{
     58                 function md = checkconsistency(cluster,md,solution,analyses) % {{{
    5959
    6060                         available_queues={'general_long','general','general_small','debug'};
     
    6565
    6666                         if ( strcmpi(cluster.queue,'general') & cluster.cpuspernode*cluster.numnodes < 17)
    67                                  checkmessage('cpus must be great than 17 for general queue');
     67                                 md = checkmessage(md,'cpus must be great than 17 for general queue');
    6868                         end
    6969                         %now, check cluster.cpuspernode according to processor type
    7070                         if ( strcmpi(cluster.processor,'neha')),
    7171                                 if ((cluster.cpuspernode>8 ) | (cluster.cpuspernode<1)),
    72                                          checkmessage('cpuspernode should be between 1 and 8 for ''neha'' processors');
     72                                         md = checkmessage(md,'cpuspernode should be between 1 and 8 for ''neha'' processors');
    7373                                 end
    7474                         elseif strcmpi(cluster.processor,'west'),
    7575                                 if ((cluster.cpuspernode>12 ) | (cluster.cpuspernode<1)),
    76                                          checkmessage('cpuspernode should be between 1 and 12 for ''west'' processors');
     76                                         md = checkmessage(md,'cpuspernode should be between 1 and 12 for ''west'' processors');
    7777                                 end
    7878                         else
    79                                  checkmessage('unknown processor type, should be ''neha'' or ''west'' ');
     79                                 md = checkmessage(md,'unknown processor type, should be ''neha'' or ''west'' ');
    8080                         end
    8181
    8282                         %Miscelaneous
    83                          if isempty(cluster.login), checkmessage('login empty'); end
    84                          if isempty(cluster.codepath), checkmessage('codepath empty'); end
    85                          if isempty(cluster.executionpath), checkmessage('executionpath empty'); end
     83                         if isempty(cluster.login), md = checkmessage(md,'login empty'); end
     84                         if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
     85                         if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
    8686
    8787                 end
  • issm/trunk-jpl/src/m/classes/clusters/gemini.m

    r12371 r12663  
    3737                 end
    3838                 %}}}
    39                  function checkconsistency(cluster,md,solution,analyses) % {{{
     39                 function md = checkconsistency(cluster,md,solution,analyses) % {{{
    4040
    4141                         available_queues={'debug','shortg','longg'};
  • issm/trunk-jpl/src/m/classes/clusters/generic.m

    r12380 r12663  
    5050                 end
    5151                 %}}}
    52                  function checkconsistency(cluster,md,solution,analyses) % {{{
     52                 function md = checkconsistency(cluster,md,solution,analyses) % {{{
    5353                         if cluster.np<1
    54                                  checkmessage(['number of processors should be at least 1']);
     54                                 md = checkmessage(md,['number of processors should be at least 1']);
    5555                         end
    5656                         if isnan(cluster.np),
  • issm/trunk-jpl/src/m/classes/clusters/greenplanet.m

    r12371 r12663  
    4848                 end
    4949                 %}}}
    50                  function checkconsistency(cluster,md,solution,analyses) % {{{
     50                 function md = checkconsistency(cluster,md,solution,analyses) % {{{
    5151
    5252                         available_queues={'rignot','default'};
     
    5757
    5858                         %Miscelaneous
    59                          if isempty(cluster.login), checkmessage('login empty'); end
    60                          if isempty(cluster.codepath), checkmessage('codepath empty'); end
    61                          if isempty(cluster.executionpath), checkmessage('executionpath empty'); end
     59                         if isempty(cluster.login), md = checkmessage(md,'login empty'); end
     60                         if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
     61                         if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
    6262
    6363                 end
  • issm/trunk-jpl/src/m/classes/clusters/pfe.m

    r12373 r12663  
    5656                 end
    5757                 %}}}
    58                  function checkconsistency(cluster,md,solution,analyses) % {{{
     58                 function md = checkconsistency(cluster,md,solution,analyses) % {{{
    5959
    6060                         available_queues={'long','normal','debug'};
     
    6868                                 if cluster.hyperthreading,
    6969                                         if ((cluster.cpuspernode>16 ) | (cluster.cpuspernode<1)),
    70                                                  checkmessage('cpuspernode should be between 1 and 16 for ''neh'' and ''har'' processors in hyperthreading mode');
     70                                                 md = checkmessage(md,'cpuspernode should be between 1 and 16 for ''neh'' and ''har'' processors in hyperthreading mode');
    7171                                         end
    7272                                 else
    7373                                         if ((cluster.cpuspernode>8 ) | (cluster.cpuspernode<1)),
    74                                                  checkmessage('cpuspernode should be between 1 and 8 for ''neh'' and ''har'' processors');
     74                                                 md = checkmessage(md,'cpuspernode should be between 1 and 8 for ''neh'' and ''har'' processors');
    7575                                         end
    7676                                 end
     
    7878                                 if cluster.hyperthreading,
    7979                                         if ((cluster.cpuspernode>24 ) | (cluster.cpuspernode<1)),
    80                                                  checkmessage('cpuspernode should be between 1 and 24 for ''wes'' processors in hyperthreading mode');
     80                                                 md = checkmessage(md,'cpuspernode should be between 1 and 24 for ''wes'' processors in hyperthreading mode');
    8181                                         end
    8282                                 else
    8383                                         if ((cluster.cpuspernode>12 ) | (cluster.cpuspernode<1)),
    84                                                  checkmessage('cpuspernode should be between 1 and 12 for ''wes'' processors');
    85                                          end
    86                                  end
    87                          else
    88                                  checkmessage('unknown processor type, should be ''neh'',''wes'' or ''har''');
     84                                                 md = checkmessage(md,'cpuspernode should be between 1 and 12 for ''wes'' processors');
     85                                         end
     86                                 end
     87                         else
     88                                 md = checkmessage(md,'unknown processor type, should be ''neh'',''wes'' or ''har''');
    8989                         end
    9090
    9191                         %Miscelaneous
    92                          if isempty(cluster.login), checkmessage('login empty'); end
    93                          if isempty(cluster.codepath), checkmessage('codepath empty'); end
    94                          if isempty(cluster.executionpath), checkmessage('executionpath empty'); end
     92                         if isempty(cluster.login), md = checkmessage(md,'login empty'); end
     93                         if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
     94                         if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
    9595
    9696                 end
  • issm/trunk-jpl/src/m/classes/clusters/pollux.m

    r12371 r12663  
    3737                 end
    3838                 %}}}
    39                  function checkconsistency(cluster,md,solution,analyses) % {{{
     39                 function md = checkconsistency(cluster,md,solution,analyses) % {{{
    4040
    4141                         available_queues={'shortp','longp'};
  • issm/trunk-jpl/src/m/classes/constants.m

    r11869 r12663  
    3131
    3232                end % }}}
    33                 function flag = checkconsistency(obj,md,solution,analyses) % {{{
     33                function md = checkconsistency(obj,md,solution,analyses) % {{{
    3434
    35                         checkfield(md,'constants.g','>',0,'size',[1 1]);
    36                         checkfield(md,'constants.yts','>',0,'size',[1 1]);
    37                         checkfield(md,'constants.referencetemperature','size',[1 1]);
     35                        md = checkfield(md,'constants.g','>',0,'size',[1 1]);
     36                        md = checkfield(md,'constants.yts','>',0,'size',[1 1]);
     37                        md = checkfield(md,'constants.referencetemperature','size',[1 1]);
    3838
    3939                end % }}}
  • issm/trunk-jpl/src/m/classes/diagnostic.m

    r11994 r12663  
    6464
    6565                end % }}}
    66                 function checkconsistency(obj,md,solution,analyses) % {{{
     66                function md = checkconsistency(obj,md,solution,analyses) % {{{
    6767
    6868                        %Early return
     
    7070                        %if ~ismember(DiagnosticHorizAnalysisEnum,analyses) |  (solution==TransientSolutionEnum & md.transient.isdiagnostic==0), return; end
    7171
    72                         checkfield(md,'diagnostic.spcvx','forcing',1);
    73                         checkfield(md,'diagnostic.spcvy','forcing',1);
    74                         if md.mesh.dimension==3, checkfield(md,'diagnostic.spcvz','forcing',1); end
    75                         checkfield(md,'diagnostic.restol','size',[1 1],'>',0);
    76                         checkfield(md,'diagnostic.reltol','size',[1 1]);
    77                         checkfield(md,'diagnostic.abstol','size',[1 1]);
    78                         checkfield(md,'diagnostic.isnewton','numel',1,'values',[0 1]);
    79                         checkfield(md,'diagnostic.stokesreconditioning','size',[1 1],'NaN',1);
    80                         checkfield(md,'diagnostic.viscosity_overshoot','size',[1 1],'NaN',1);
     72                        md = checkfield(md,'diagnostic.spcvx','forcing',1);
     73                        md = checkfield(md,'diagnostic.spcvy','forcing',1);
     74                        if md.mesh.dimension==3, md = checkfield(md,'diagnostic.spcvz','forcing',1); end
     75                        md = checkfield(md,'diagnostic.restol','size',[1 1],'>',0);
     76                        md = checkfield(md,'diagnostic.reltol','size',[1 1]);
     77                        md = checkfield(md,'diagnostic.abstol','size',[1 1]);
     78                        md = checkfield(md,'diagnostic.isnewton','numel',1,'values',[0 1]);
     79                        md = checkfield(md,'diagnostic.stokesreconditioning','size',[1 1],'NaN',1);
     80                        md = checkfield(md,'diagnostic.viscosity_overshoot','size',[1 1],'NaN',1);
    8181                        if md.mesh.dimension==2,
    82                                 checkfield(md,'diagnostic.icefront','size',[NaN 4],'NaN',1);
     82                                md = checkfield(md,'diagnostic.icefront','size',[NaN 4],'NaN',1);
    8383                        else
    84                                 checkfield(md,'diagnostic.icefront','size',[NaN 6],'NaN',1);
     84                                md = checkfield(md,'diagnostic.icefront','size',[NaN 6],'NaN',1);
    8585                        end
    86                         checkfield(md,'diagnostic.icefront(:,end)','values',[0 1 2]);
    87                         checkfield(md,'diagnostic.maxiter','size',[1 1],'>=',1);
    88                         checkfield(md,'diagnostic.referential','size',[md.mesh.numberofvertices 6]);
     86                        md = checkfield(md,'diagnostic.icefront(:,end)','values',[0 1 2]);
     87                        md = checkfield(md,'diagnostic.maxiter','size',[1 1],'>=',1);
     88                        md = checkfield(md,'diagnostic.referential','size',[md.mesh.numberofvertices 6]);
    8989                        if ~isempty(md.diagnostic.requested_outputs),
    90                                 checkfield(md,'diagnostic.requested_outputs','size',[NaN 1]);
     90                                md = checkfield(md,'diagnostic.requested_outputs','size',[NaN 1]);
    9191                        end
    9292
    9393                        %singular solution
    9494                        if ~any((~isnan(md.diagnostic.spcvx)+~isnan(md.diagnostic.spcvy))==2),
    95                                 checkmessage(['model ' md.miscellaneous.name ' is not well posed (singular). You need at least one node with fixed velocity!'])
     95                                md = checkmessage(md,['model is not well posed (singular). You need at least one node with fixed velocity!']);
    9696                        end
    9797                        %CHECK THAT EACH LINES CONTAINS ONLY NAN VALUES OR NO NAN VALUES
    9898                        if any(sum(isnan(md.diagnostic.referential),2)~=0 & sum(isnan(md.diagnostic.referential),2)~=6),
    99                                 checkmessage(['model ' md.miscellaneous.name ' has problem with rotated spc. Each line of diagnostic.referential should contain either only NaN values or no NaN values']);
     99                                md = checkmessage(md,['Each line of diagnostic.referential should contain either only NaN values or no NaN values']);
    100100                        end
    101101                        %CHECK THAT THE TWO VECTORS PROVIDED ARE ORTHOGONAL
     
    103103                                pos=find(sum(isnan(md.diagnostic.referential),2)==0);
    104104                                if any(abs(dot(md.diagnostic.referential(pos,1:3)',md.diagnostic.referential(pos,4:6)'))>eps),
    105                                         checkmessage(['model ' md.miscellaneous.name ' has problem with referential. Vectors in diagnostic.referential (colums 1 to 3 and 4 to 6) must be orthogonal']);
     105                                        md = checkmessage(md,['Vectors in diagnostic.referential (colums 1 to 3 and 4 to 6) must be orthogonal']);
    106106                                end
    107107                        end
     
    110110                                pos=find(md.mask.vertexongroundedice & md.mesh.vertexonbed);
    111111                                if any(~isnan(md.diagnostic.referential(pos,:))),
    112                                         checkmessage(['no referential should be specified for basal vertices of grounded ice']);
     112                                        md = checkmessage(md,['no referential should be specified for basal vertices of grounded ice']);
    113113                                end
    114114                        end
  • issm/trunk-jpl/src/m/classes/flaim.m

    r11869 r12663  
    3232
    3333                end % }}}
    34                 function checkconsistency(obj,md,solution,analyses) % {{{
     34                function md = checkconsistency(obj,md,solution,analyses) % {{{
    3535
    3636                        %Early return
    3737                        if solution~=FlaimSolutionEnum, return; end
    3838
    39                         checkfield(md,'flaim.tracks','file',1);
     39                        md = checkfield(md,'flaim.tracks','file',1);
    4040                        if any(isnan(md.flaim.criterion)) || isempty(md.flaim.criterion)
    41                                 checkfield(md,'flaim.targets','file',1);
     41                                md = checkfield(md,'flaim.targets','file',1);
    4242                        else
    43                                 checkfield(md,'flaim.criterion','numel',[md.mesh.numberofvertices md.mesh.numberofelements]);
     43                                md = checkfield(md,'flaim.criterion','numel',[md.mesh.numberofvertices md.mesh.numberofelements]);
    4444                        end
    4545
  • issm/trunk-jpl/src/m/classes/flowequation.m

    r11869 r12663  
    2727
    2828                end % }}}
    29                 function checkconsistency(obj,md,solution,analyses) % {{{
     29                function md = checkconsistency(obj,md,solution,analyses) % {{{
    3030
    3131                        if ismember(DiagnosticHorizAnalysisEnum,analyses),
    3232
    33                                 checkfield(md,'flowequation.ismacayealpattyn','numel',1,'values',[0 1]);
    34                                 checkfield(md,'flowequation.ishutter','numel',1,'values',[0 1]);
    35                                 checkfield(md,'flowequation.isstokes','numel',1,'values',[0 1]);
    36                                 checkfield(md,'flowequation.bordermacayeal','size',[md.mesh.numberofvertices 1],'values',[0 1]);
    37                                 checkfield(md,'flowequation.borderpattyn','size',[md.mesh.numberofvertices 1],'values',[0 1]);
    38                                 checkfield(md,'flowequation.borderstokes','size',[md.mesh.numberofvertices 1],'values',[0 1]);
     33                                md = checkfield(md,'flowequation.ismacayealpattyn','numel',1,'values',[0 1]);
     34                                md = checkfield(md,'flowequation.ishutter','numel',1,'values',[0 1]);
     35                                md = checkfield(md,'flowequation.isstokes','numel',1,'values',[0 1]);
     36                                md = checkfield(md,'flowequation.bordermacayeal','size',[md.mesh.numberofvertices 1],'values',[0 1]);
     37                                md = checkfield(md,'flowequation.borderpattyn','size',[md.mesh.numberofvertices 1],'values',[0 1]);
     38                                md = checkfield(md,'flowequation.borderstokes','size',[md.mesh.numberofvertices 1],'values',[0 1]);
    3939                                if (md.mesh.dimension==2),
    40                                         checkfield(md,'flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[1:2]);
    41                                         checkfield(md,'flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[1:2]);
     40                                        md = checkfield(md,'flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[1:2]);
     41                                        md = checkfield(md,'flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[1:2]);
    4242                                else
    43                                         checkfield(md,'flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[0:7]);
    44                                         checkfield(md,'flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[0:7]);
     43                                        md = checkfield(md,'flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[0:7]);
     44                                        md = checkfield(md,'flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[0:7]);
    4545                                end
    4646                                if (md.flowequation.ismacayealpattyn==0 && md.flowequation.ishutter==0 && md.flowequation.isstokes==0),
    47                                         checkmessage(['no element types set for this model. At least one of ismacayealpattyn, ishutter or isstokes need to be =1']);
     47                                        md = checkmessage(md,['no element types set for this model. At least one of ismacayealpattyn, ishutter or isstokes need to be =1']);
    4848                                end
    4949                        end
    5050                        if ismember(DiagnosticHutterAnalysisEnum,analyses),
    51                                 if any(md.flowequation.element_equation==1 & md.mask.elementonfloatingice),
    52                                         disp(sprintf('\n !!! Warning: Hutter''s model is not consistent on ice shelves !!!\n'));
     51                                if any(md.flowequation.element_equation==1),
     52                                        if(md.flowequation.element_equation & md.mask.elementonfloatingice),
     53                                                disp(sprintf('\n !!! Warning: Hutter''s model is not consistent on ice shelves !!!\n'));
     54                                        end
    5355                                end
    5456                        end
  • issm/trunk-jpl/src/m/classes/friction.m

    r11869 r12663  
    2222
    2323                end % }}}
    24                 function checkconsistency(obj,md,solution,analyses) % {{{
     24                function md = checkconsistency(obj,md,solution,analyses) % {{{
    2525
    2626                        %Early return
    2727                        if ~ismember(DiagnosticHorizAnalysisEnum,analyses) & ~ismember(ThermalAnalysisEnum,analyses), return; end
    2828
    29                         checkfield(md,'friction.coefficient','NaN',1,'size',[md.mesh.numberofvertices 1]);
    30                         checkfield(md,'friction.q','NaN',1,'size',[md.mesh.numberofelements 1]);
    31                         checkfield(md,'friction.p','NaN',1,'size',[md.mesh.numberofelements 1]);
     29                        md = checkfield(md,'friction.coefficient','NaN',1,'size',[md.mesh.numberofvertices 1]);
     30                        md = checkfield(md,'friction.q','NaN',1,'size',[md.mesh.numberofelements 1]);
     31                        md = checkfield(md,'friction.p','NaN',1,'size',[md.mesh.numberofelements 1]);
    3232                end % }}}
    3333                function disp(obj) % {{{
  • issm/trunk-jpl/src/m/classes/geometry.m

    r11869 r12663  
    2424
    2525                end % }}}
    26                 function checkconsistency(obj,md,solution,analyses) % {{{
     26                function md = checkconsistency(obj,md,solution,analyses) % {{{
    2727
    28                         checkfield(md,'geometry.surface'  ,'NaN',1,'size',[md.mesh.numberofvertices 1]);
    29                         checkfield(md,'geometry.bed'      ,'NaN',1,'size',[md.mesh.numberofvertices 1]);
    30                         checkfield(md,'geometry.thickness','NaN',1,'size',[md.mesh.numberofvertices 1],'>',0);
     28                        md = checkfield(md,'geometry.surface'  ,'NaN',1,'size',[md.mesh.numberofvertices 1]);
     29                        md = checkfield(md,'geometry.bed'      ,'NaN',1,'size',[md.mesh.numberofvertices 1]);
     30                        md = checkfield(md,'geometry.thickness','NaN',1,'size',[md.mesh.numberofvertices 1],'>',0);
    3131                        if any((obj.thickness-obj.surface+obj.bed)>10^-9),
    32                                 checkmessage(['equality thickness=surface-bed violated']);
     32                                md = checkmessage(md,['equality thickness=surface-bed violated']);
    3333                        end
    3434                        if solution==TransientSolutionEnum & md.transient.isgroundingline,
    35                                 checkfield(md,'geometry.bathymetry','NaN',1,'size',[md.mesh.numberofvertices 1]);
     35                                md = checkfield(md,'geometry.bathymetry','NaN',1,'size',[md.mesh.numberofvertices 1]);
    3636                        end
    3737                end % }}}
  • issm/trunk-jpl/src/m/classes/groundingline.m

    r12149 r12663  
    2828
    2929                end % }}}
    30                 function checkconsistency(obj,md,solution,analyses) % {{{
     30                function md = checkconsistency(obj,md,solution,analyses) % {{{
    3131
    32                         checkfield(md,'groundingline.migration','values',{'None' 'AgressiveMigration' 'SoftMigration'});
     32                        md = checkfield(md,'groundingline.migration','values',{'None' 'AgressiveMigration' 'SoftMigration'});
    3333
    3434                        if ~strcmp(obj.migration,'None'),
    3535                                if isnan(md.geometry.bathymetry),
    36                                         checkmessage(['requesting grounding line migration, but bathymetry is absent!']);
     36                                        md = checkmessage(md,['requesting grounding line migration, but bathymetry is absent!']);
    3737                                end
    3838                                pos=find(md.mask.vertexongroundedice);
    3939                                if any(abs(md.geometry.bed(pos)-md.geometry.bathymetry(pos))>10^-10),
    40                                         checkmessage(['bathymetry not equal to bed on grounded ice !']);
     40                                        md = checkmessage(md,['bathymetry not equal to bed on grounded ice !']);
    4141                                end
    4242                                pos=find(md.mask.vertexonfloatingice);
    4343                                if any(md.geometry.bathymetry(pos)-md.geometry.bed(pos)>10^-9),
    44                                         checkmessage(['bathymetry superior to bed on floating ice !']);
     44                                        md = checkmessage(md,['bathymetry superior to bed on floating ice !']);
    4545                                end
    4646                        end
  • issm/trunk-jpl/src/m/classes/hydrology.m

    r11869 r12663  
    3535                        obj.stabilization=1;
    3636                end % }}}
    37                 function checkconsistency(obj,md,solution,analyses) % {{{
     37                function md = checkconsistency(obj,md,solution,analyses) % {{{
    3838
    3939                        %Early return
    4040                        if ~ismember(HydrologyAnalysisEnum,analyses), return; end
    4141
    42                         checkfield(md,'hydrology.spcwatercolumn','forcing',1);
    43                         checkfield(md,'hydrology.stabilization','>=',0);
     42                        md = checkfield(md,'hydrology.spcwatercolumn','forcing',1);
     43                        md = checkfield(md,'hydrology.stabilization','>=',0);
    4444                end % }}}
    4545                function disp(obj) % {{{
  • issm/trunk-jpl/src/m/classes/initialization.m

    r12402 r12663  
    2727
    2828                end % }}}
    29                 function checkconsistency(obj,md,solution,analyses) % {{{
     29                function md = checkconsistency(obj,md,solution,analyses) % {{{
    3030                        if ismember(DiagnosticHorizAnalysisEnum,analyses)
    3131                                if ~isnan(md.initialization.vx) & ~isnan(md.initialization.vy),
    32                                         checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices 1]);
    33                                         checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices 1]);
     32                                        md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices 1]);
     33                                        md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices 1]);
    3434                                end
    3535                        end
    3636                        if ismember(PrognosticAnalysisEnum,analyses),
    37                                 checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices 1]);
    38                                 checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices 1]);
     37                                md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices 1]);
     38                                md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices 1]);
    3939                        end
    4040                        if ismember(HydrologyAnalysisEnum,analyses),
    41                                 checkfield(md,'initialization.watercolumn','NaN',1,'size',[md.mesh.numberofvertices 1]);
     41                                md = checkfield(md,'initialization.watercolumn','NaN',1,'size',[md.mesh.numberofvertices 1]);
    4242                        end
    4343                        if ismember(BalancethicknessAnalysisEnum,analyses),
    44                                 checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices 1]);
    45                                 checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices 1]);
     44                                md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices 1]);
     45                                md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices 1]);
    4646                                %Triangle with zero velocity
    4747                                if any(sum(abs(md.initialization.vx(md.mesh.elements)),2)==0 & sum(abs(md.initialization.vy(md.mesh.elements)),2)==0)
    48                                         checkmessage('at least one triangle has all its vertices with a zero velocity');
     48                                        md = checkmessage(md,'at least one triangle has all its vertices with a zero velocity');
    4949                                end
    5050                        end
    5151                        if ismember(ThermalAnalysisEnum,analyses),
    52                                 checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices 1]);
    53                                 checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices 1]);
    54                                 checkfield(md,'initialization.vz','NaN',1,'size',[md.mesh.numberofvertices 1]);
    55                                 checkfield(md,'initialization.pressure','NaN',1,'size',[md.mesh.numberofvertices 1]);
     52                                md = checkfield(md,'initialization.vx','NaN',1,'size',[md.mesh.numberofvertices 1]);
     53                                md = checkfield(md,'initialization.vy','NaN',1,'size',[md.mesh.numberofvertices 1]);
     54                                md = checkfield(md,'initialization.vz','NaN',1,'size',[md.mesh.numberofvertices 1]);
     55                                md = checkfield(md,'initialization.pressure','NaN',1,'size',[md.mesh.numberofvertices 1]);
    5656                        end
    5757                        if (ismember(EnthalpyAnalysisEnum,analyses) & md.thermal.isenthalpy) | solution==EnthalpySolutionEnum,
    58                                 checkfield(md,'initialization.waterfraction','>=',0,'size',[md.mesh.numberofvertices 1]);
     58                                md = checkfield(md,'initialization.waterfraction','>=',0,'size',[md.mesh.numberofvertices 1]);
    5959                        end
    6060                end % }}}
  • issm/trunk-jpl/src/m/classes/inversion.m

    r11869 r12663  
    7575
    7676                end % }}}
    77                 function checkconsistency(obj,md,solution,analyses) % {{{
     77                function md = checkconsistency(obj,md,solution,analyses) % {{{
    7878
    7979                        %Early return
     
    8383                        num_costfunc=size(md.inversion.cost_functions,2);
    8484
    85                         checkfield(md,'inversion.iscontrol','values',[0 1]);
    86                         checkfield(md,'inversion.tao','values',[0 1]);
    87                         checkfield(md,'inversion.incomplete_adjoint','values',[0 1]);
    88                         checkfield(md,'inversion.control_parameters','cell',1,'values',{'BalancethicknessThickeningRate' 'FrictionCoefficient' 'MaterialsRheologyBbar' 'Vx' 'Vy'});
    89                         checkfield(md,'inversion.nsteps','numel',1,'>=',1);
    90                         checkfield(md,'inversion.maxiter_per_step','size',[md.inversion.nsteps 1],'>=',0);
    91                         checkfield(md,'inversion.step_threshold','size',[md.inversion.nsteps 1]);
    92                         checkfield(md,'inversion.cost_functions','size',[md.inversion.nsteps num_costfunc],'values',[101:105 201 501:503]);
    93                         checkfield(md,'inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices num_costfunc],'>=',0);
    94                         checkfield(md,'inversion.gradient_only','values',[0 1]);
    95                         checkfield(md,'inversion.gradient_scaling','size',[md.inversion.nsteps num_controls]);
    96                         checkfield(md,'inversion.min_parameters','size',[md.mesh.numberofvertices num_controls]);
    97                         checkfield(md,'inversion.max_parameters','size',[md.mesh.numberofvertices num_controls]);
     85                        md = checkfield(md,'inversion.iscontrol','values',[0 1]);
     86                        md = checkfield(md,'inversion.tao','values',[0 1]);
     87                        md = checkfield(md,'inversion.incomplete_adjoint','values',[0 1]);
     88                        md = checkfield(md,'inversion.control_parameters','cell',1,'values',{'BalancethicknessThickeningRate' 'FrictionCoefficient' 'MaterialsRheologyBbar' 'Vx' 'Vy'});
     89                        md = checkfield(md,'inversion.nsteps','numel',1,'>=',1);
     90                        md = checkfield(md,'inversion.maxiter_per_step','size',[md.inversion.nsteps 1],'>=',0);
     91                        md = checkfield(md,'inversion.step_threshold','size',[md.inversion.nsteps 1]);
     92                        md = checkfield(md,'inversion.cost_functions','size',[md.inversion.nsteps num_costfunc],'values',[101:105 201 501:503]);
     93                        md = checkfield(md,'inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices num_costfunc],'>=',0);
     94                        md = checkfield(md,'inversion.gradient_only','values',[0 1]);
     95                        md = checkfield(md,'inversion.gradient_scaling','size',[md.inversion.nsteps num_controls]);
     96                        md = checkfield(md,'inversion.min_parameters','size',[md.mesh.numberofvertices num_controls]);
     97                        md = checkfield(md,'inversion.max_parameters','size',[md.mesh.numberofvertices num_controls]);
    9898
    9999                        if solution==BalancethicknessSolutionEnum
    100                                 checkfield(md,'inversion.thickness_obs','size',[md.mesh.numberofvertices 1],'NaN',1);
     100                                md = checkfield(md,'inversion.thickness_obs','size',[md.mesh.numberofvertices 1],'NaN',1);
    101101                        else
    102                                 checkfield(md,'inversion.vx_obs','size',[md.mesh.numberofvertices 1],'NaN',1);
    103                                 checkfield(md,'inversion.vy_obs','size',[md.mesh.numberofvertices 1],'NaN',1);
     102                                md = checkfield(md,'inversion.vx_obs','size',[md.mesh.numberofvertices 1],'NaN',1);
     103                                md = checkfield(md,'inversion.vy_obs','size',[md.mesh.numberofvertices 1],'NaN',1);
    104104                        end
    105105                end % }}}
  • issm/trunk-jpl/src/m/classes/mask.m

    r11869 r12663  
    2525
    2626                end % }}}
    27                 function checkconsistency(obj,md,solution,analyses) % {{{
     27                function md = checkconsistency(obj,md,solution,analyses) % {{{
    2828
    29                         checkfield(md,'mask.elementonfloatingice','size',[md.mesh.numberofelements 1],'values',[0 1]);
    30                         checkfield(md,'mask.elementongroundedice','size',[md.mesh.numberofelements 1],'values',[0 1]);
    31                         checkfield(md,'mask.elementonwater'      ,'size',[md.mesh.numberofelements 1],'values',[0 1]);
    32                         checkfield(md,'mask.vertexonfloatingice','size',[md.mesh.numberofvertices 1],'values',[0 1]);
    33                         checkfield(md,'mask.vertexongroundedice','size',[md.mesh.numberofvertices 1],'values',[0 1]);
    34                         checkfield(md,'mask.vertexonwater'      ,'size',[md.mesh.numberofvertices 1],'values',[0 1]);
     29                        md = checkfield(md,'mask.elementonfloatingice','size',[md.mesh.numberofelements 1],'values',[0 1]);
     30                        md = checkfield(md,'mask.elementongroundedice','size',[md.mesh.numberofelements 1],'values',[0 1]);
     31                        md = checkfield(md,'mask.elementonwater'      ,'size',[md.mesh.numberofelements 1],'values',[0 1]);
     32                        md = checkfield(md,'mask.vertexonfloatingice','size',[md.mesh.numberofvertices 1],'values',[0 1]);
     33                        md = checkfield(md,'mask.vertexongroundedice','size',[md.mesh.numberofvertices 1],'values',[0 1]);
     34                        md = checkfield(md,'mask.vertexonwater'      ,'size',[md.mesh.numberofvertices 1],'values',[0 1]);
    3535                end % }}}
    3636                function disp(obj) % {{{
  • issm/trunk-jpl/src/m/classes/materials.m

    r12361 r12663  
    6969                        obj.rheology_law='Paterson';
    7070                end % }}}
    71                 function checkconsistency(obj,md,solution,analyses) % {{{
    72                         checkfield(md,'materials.rho_ice','>',0);
    73                         checkfield(md,'materials.rho_water','>',0);
    74                         checkfield(md,'materials.rho_freshwater','>',0);
    75                         checkfield(md,'materials.mu_water','>',0);
    76                         checkfield(md,'materials.rheology_B','>',0,'size',[md.mesh.numberofvertices 1]);
    77                         checkfield(md,'materials.rheology_n','>',0,'size',[md.mesh.numberofelements 1]);
    78                         checkfield(md,'materials.rheology_law','values',{'None' 'Paterson' 'Arrhenius'});
     71                function md = checkconsistency(obj,md,solution,analyses) % {{{
     72                        md = checkfield(md,'materials.rho_ice','>',0);
     73                        md = checkfield(md,'materials.rho_water','>',0);
     74                        md = checkfield(md,'materials.rho_freshwater','>',0);
     75                        md = checkfield(md,'materials.mu_water','>',0);
     76                        md = checkfield(md,'materials.rheology_B','>',0,'size',[md.mesh.numberofvertices 1]);
     77                        md = checkfield(md,'materials.rheology_n','>',0,'size',[md.mesh.numberofelements 1]);
     78                        md = checkfield(md,'materials.rheology_law','values',{'None' 'Paterson' 'Arrhenius'});
    7979                end % }}}
    8080                function disp(obj) % {{{
  • issm/trunk-jpl/src/m/classes/mesh.m

    r11869 r12663  
    6464                        obj.average_vertex_connectivity=25;
    6565                end % }}}
    66                 function checkconsistency(obj,md,solution,analyses) % {{{
     66                function md = checkconsistency(obj,md,solution,analyses) % {{{
    6767
    68                         checkfield(md,'mesh.x','NaN',1,'size',[md.mesh.numberofvertices 1]);
    69                         checkfield(md,'mesh.y','NaN',1,'size',[md.mesh.numberofvertices 1]);
    70                         checkfield(md,'mesh.z','NaN',1,'size',[md.mesh.numberofvertices 1]);
    71                         checkfield(md,'mesh.elements','NaN',1,'>',0,'values',1:md.mesh.numberofvertices);
     68                        md = checkfield(md,'mesh.x','NaN',1,'size',[md.mesh.numberofvertices 1]);
     69                        md = checkfield(md,'mesh.y','NaN',1,'size',[md.mesh.numberofvertices 1]);
     70                        md = checkfield(md,'mesh.z','NaN',1,'size',[md.mesh.numberofvertices 1]);
     71                        md = checkfield(md,'mesh.elements','NaN',1,'>',0,'values',1:md.mesh.numberofvertices);
    7272                        if(md.mesh.dimension==2),
    73                                 checkfield(md,'mesh.elements','size',[md.mesh.numberofelements 3]);
     73                                md = checkfield(md,'mesh.elements','size',[md.mesh.numberofelements 3]);
    7474                        else
    75                                 checkfield(md,'mesh.elements','size',[md.mesh.numberofelements 6]);
     75                                md = checkfield(md,'mesh.elements','size',[md.mesh.numberofelements 6]);
    7676                        end
    7777                        if any(~ismember(1:md.mesh.numberofvertices,sort(unique(md.mesh.elements(:)))));
    78                                 checkmessage('orphan nodes have been found. Check the mesh outline');
     78                                md = checkmessage(md,'orphan nodes have been found. Check the mesh outline');
    7979                        end
    80                         checkfield(md,'mesh.dimension','values',[2 3]);
    81                         checkfield(md,'mesh.numberoflayers','>=',0);
    82                         checkfield(md,'mesh.numberofelements','>',0);
    83                         checkfield(md,'mesh.numberofvertices','>',0);
     80                        md = checkfield(md,'mesh.dimension','values',[2 3]);
     81                        md = checkfield(md,'mesh.numberoflayers','>=',0);
     82                        md = checkfield(md,'mesh.numberofelements','>',0);
     83                        md = checkfield(md,'mesh.numberofvertices','>',0);
    8484                        %no checks for numberofedges lat long and hemisphere
    85                         checkfield(md,'mesh.elementonbed','size',[md.mesh.numberofelements 1],'values',[0 1]);
    86                         checkfield(md,'mesh.elementonsurface','size',[md.mesh.numberofelements 1],'values',[0 1]);
    87                         checkfield(md,'mesh.vertexonbed','size',[md.mesh.numberofvertices 1],'values',[0 1]);
    88                         checkfield(md,'mesh.vertexonsurface','size',[md.mesh.numberofvertices 1],'values',[0 1]);
     85                        md = checkfield(md,'mesh.elementonbed','size',[md.mesh.numberofelements 1],'values',[0 1]);
     86                        md = checkfield(md,'mesh.elementonsurface','size',[md.mesh.numberofelements 1],'values',[0 1]);
     87                        md = checkfield(md,'mesh.vertexonbed','size',[md.mesh.numberofvertices 1],'values',[0 1]);
     88                        md = checkfield(md,'mesh.vertexonsurface','size',[md.mesh.numberofvertices 1],'values',[0 1]);
    8989                        if (md.mesh.dimension==2),
    90                                 checkfield(md,'mesh.average_vertex_connectivity','>=',9,'message','''mesh.average_vertex_connectivity'' should be at least 9 in 2d');
     90                                md = checkfield(md,'mesh.average_vertex_connectivity','>=',9,'message','''mesh.average_vertex_connectivity'' should be at least 9 in 2d');
    9191                        else
    92                                 checkfield(md,'mesh.average_vertex_connectivity','>=',24,'message','''mesh.average_vertex_connectivity'' should be at least 24 in 3d');
     92                                md = checkfield(md,'mesh.average_vertex_connectivity','>=',24,'message','''mesh.average_vertex_connectivity'' should be at least 24 in 3d');
    9393                        end
    94                         checkfield(md,'mesh.elementconnectivity','size',[md.mesh.numberofelements 3],'NaN',1);
     94                        md = checkfield(md,'mesh.elementconnectivity','size',[md.mesh.numberofelements 3],'NaN',1);
    9595
    9696                        %Solution specific checks
     
    9898                                case PrognosticSolutionEnum,
    9999                                        if md.prognostic.stabilization==3,
    100                                                 checkfield(md,'mesh.dimension','values',2,'message','Discontinuous Galerkin only supported for 2d meshes');
    101                                                 checkfield(md,'mesh.edges','size',[NaN 4]);
    102                                                 checkfield(md,'mesh.edges(:,1:3)','>',0);
     100                                                md = checkfield(md,'mesh.dimension','values',2,'message','Discontinuous Galerkin only supported for 2d meshes');
     101                                                md = checkfield(md,'mesh.edges','size',[NaN 4]);
     102                                                md = checkfield(md,'mesh.edges(:,1:3)','>',0);
    103103                                        end
    104104                                case BalancethicknessSolutionEnum,
    105105                                        if md.balancethickness.stabilization==3,
    106                                                 checkfield(md,'mesh.dimension','values',2,'message','Discontinuous Galerkin only supported for 2d meshes');
    107                                                 checkfield(md,'mesh.edges','size',[NaN 4]);
    108                                                 checkfield(md,'mesh.edges(:,1:3)','>',0);
     106                                                md = checkfield(md,'mesh.dimension','values',2,'message','Discontinuous Galerkin only supported for 2d meshes');
     107                                                md = checkfield(md,'mesh.edges','size',[NaN 4]);
     108                                                md = checkfield(md,'mesh.edges(:,1:3)','>',0);
    109109                                        end
    110110                                case TransientSolutionEnum,
    111111                                        if md.transient.isprognostic & md.prognostic.stabilization==3,
    112                                                 checkfield(md,'mesh.dimension','values',2,'message','Discontinuous Galerkin only supported for 2d meshes');
    113                                                 checkfield(md,'mesh.edges','size',[NaN 4]);
    114                                                 checkfield(md,'mesh.edges(:,1:3)','>',0);
     112                                                md = checkfield(md,'mesh.dimension','values',2,'message','Discontinuous Galerkin only supported for 2d meshes');
     113                                                md = checkfield(md,'mesh.edges','size',[NaN 4]);
     114                                                md = checkfield(md,'mesh.edges(:,1:3)','>',0);
    115115                                        end
    116116                                case ThermalSolutionEnum,
    117                                         checkfield(md,'mesh.dimension','values',3,'message','thermal solution only supported on 3d meshes');
     117                                        md = checkfield(md,'mesh.dimension','values',3,'message','thermal solution only supported on 3d meshes');
    118118                        end
    119119                end % }}}
  • issm/trunk-jpl/src/m/classes/miscellaneous.m

    r11869 r12663  
    1919                        end
    2020                end % }}}
    21                 function checkconsistency(obj,md,solution,analyses) % {{{
     21                function md = checkconsistency(obj,md,solution,analyses) % {{{
    2222
    23                         checkfield(md,'miscellaneous.name','empty',1);
     23                        md = checkfield(md,'miscellaneous.name','empty',1);
    2424
    2525                end % }}}
  • issm/trunk-jpl/src/m/classes/model/model.m

    r12365 r12663  
    8383                                         error('model constructor error message: 0 of 1 argument only in input.');
    8484                                 end
     85                 end
     86                 %}}}
     87                 function md = checkmessage(md,string) % {{{
     88                         if(nargout~=1) error('wrong usage, model must be an output'); end
     89                         disp(['model not consistent: ' string]);
     90                         md.private.isconsistent=false;
    8591                 end
    8692                 %}}}
  • issm/trunk-jpl/src/m/classes/private.m

    r11869 r12663  
    66classdef private
    77        properties (SetAccess=public)
    8                  runtimename = '';
    9                  bamg        = struct();
    10                  solution    = '';
     8                isconsistent = true;
     9                runtimename  = '';
     10                bamg         = struct();
     11                solution     = '';
    1112        end
    1213        methods
     
    2223
    2324                end % }}}
    24                 function checkconsistency(obj,md,solution,analyses) % {{{
     25                function md = checkconsistency(obj,md,solution,analyses) % {{{
    2526
    2627                end % }}}
     
    2829                        disp(sprintf('   private parameters: do not change'));
    2930
     31                        fielddisplay(obj,'isconsistent','is model self consistent');
    3032                        fielddisplay(obj,'runtimename','name of the run launched');
    3133                        fielddisplay(obj,'bamg','structure with mesh properties construced if bamg is used to mesh the domain');
  • issm/trunk-jpl/src/m/classes/prognostic.m

    r11869 r12663  
    3636                        obj.hydrostatic_adjustment='Absolute';
    3737                end % }}}
    38                 function checkconsistency(obj,md,solution,analyses) % {{{
     38                function md = checkconsistency(obj,md,solution,analyses) % {{{
    3939
    4040                        %Early return,
    4141                        if ~ismember(PrognosticAnalysisEnum,analyses) |  (solution==TransientSolutionEnum & md.transient.isprognostic==0), return; end
    4242
    43                         checkfield(md,'prognostic.spcthickness','forcing',1);
    44                         checkfield(md,'prognostic.hydrostatic_adjustment','values',{'Absolute' 'Incremental'});
    45                         checkfield(md,'prognostic.stabilization','values',[0 1 2 3]);
    46                         checkfield(md,'prognostic.min_thickness','>',0);
     43                        md = checkfield(md,'prognostic.spcthickness','forcing',1);
     44                        md = checkfield(md,'prognostic.hydrostatic_adjustment','values',{'Absolute' 'Incremental'});
     45                        md = checkfield(md,'prognostic.stabilization','values',[0 1 2 3]);
     46                        md = checkfield(md,'prognostic.min_thickness','>',0);
    4747
    4848                end % }}}
  • issm/trunk-jpl/src/m/classes/qmu.m

    r11924 r12663  
    3535       
    3636                end % }}}
    37                 function checkconsistency(obj,md,solution,analyses) % {{{
     37                function md = checkconsistency(obj,md,solution,analyses) % {{{
    3838
    3939                        %Early return
     
    4141
    4242                        if md.qmu.params.evaluation_concurrency~=1,
    43                                 checkmessage(['concurrency should be set to 1 when running dakota in library mode']);
     43                                md = checkmessage(md,['concurrency should be set to 1 when running dakota in library mode']);
    4444                        end
    4545                        if ~isempty(md.qmu.partition),
    4646                                if numel(md.qmu.partition)~=md.mesh.numberofvertices,
    47                                         checkmessage(['user supplied partition for qmu analysis should have size md.mesh.numberofvertices x 1 ']);
     47                                        md = checkmessage(md,['user supplied partition for qmu analysis should have size md.mesh.numberofvertices x 1 ']);
    4848                                end
    4949                                if find(md.qmu.partition)>=md.mesh.numberofvertices,
    50                                         checkmessage(['user supplied partition should be indexed from 0 (c-convention)']);
     50                                        md = checkmessage(md,['user supplied partition should be indexed from 0 (c-convention)']);
    5151                                end
    5252                                if min(md.qmu.partition)~=0,
    53                                         checkmessage(['partition vector not indexed from 0 on']);
     53                                        md = checkmessage(md,['partition vector not indexed from 0 on']);
    5454                                end
    5555                                if max(md.qmu.partition)>=md.mesh.numberofvertices,
    56                                         checkmessage(['partition vector cannot have maximum index larger than number of nodes']);
     56                                        md = checkmessage(md,['partition vector cannot have maximum index larger than number of nodes']);
    5757                                end
    5858                                if ~isempty(find(md.qmu.partition<0)),
    59                                         checkmessage(['partition vector cannot have values less than 0']);
     59                                        md = checkmessage(md,['partition vector cannot have values less than 0']);
    6060                                end
    6161                                if ~isempty(find(md.qmu.partition>=md.qmu.numberofpartitions)),
    62                                         checkmessage(['partition vector cannot have values more than md.qmu.numberofpartitions-1']);
     62                                        md = checkmessage(md,['partition vector cannot have values more than md.qmu.numberofpartitions-1']);
    6363                                end
    6464                                if max(md.qmu.partition)>=md.qmu.numberofpartitions,
    65                                         checkmessage(['for qmu analysis, partitioning vector cannot go over npart, number of partition areas']);
     65                                        md = checkmessage(md,['for qmu analysis, partitioning vector cannot go over npart, number of partition areas']);
    6666                                end
    6767                        end
     
    6969                        if ~strcmpi(md.cluster.name,'none'),
    7070                                if md.settings.waitonlock==0,
    71                                         checkmessage(['waitonlock should be activated when running qmu in parallel mode!']);
     71                                        md = checkmessage(md,['waitonlock should be activated when running qmu in parallel mode!']);
    7272                                end
    7373                        end
  • issm/trunk-jpl/src/m/classes/rifts.m

    r11924 r12663  
    2121
    2222                end % }}}
    23                 function checkconsistency(obj,md,solution,analyses) % {{{
     23                function md = checkconsistency(obj,md,solution,analyses) % {{{
    2424                        if isempty(obj.riftstruct) | isnans(obj.riftstruct),
    2525                                numrifts=0;
     
    2929                        if numrifts,
    3030                                if ~(md.mesh.dimension==2),
    31                                         checkmessage(['models with rifts are only supported in 2d for now!']);
     31                                        md = checkmessage(md,['models with rifts are only supported in 2d for now!']);
    3232                                end
    3333                                if ~isstruct(obj.riftstruct),
    34                                         checkmessage(['rifts.riftstruct should be a structure!']);
     34                                        md = checkmessage(md,['rifts.riftstruct should be a structure!']);
    3535                                end
    3636                                if ~isempty(find(md.mesh.segmentmarkers>=2)),
    3737                                        %We have segments with rift markers, but no rift structure!
    38                                         checkmessage(['model should be processed for rifts (run meshprocessrifts)!']);
     38                                        md = checkmessage(md,['model should be processed for rifts (run meshprocessrifts)!']);
    3939                                end
    40                                 checkfield(md,'rifts.riftstruct.fill','values',[WaterEnum() AirEnum() IceEnum() MelangeEnum()]);
     40                                md = checkfield(md,'rifts.riftstruct.fill','values',[WaterEnum() AirEnum() IceEnum() MelangeEnum()]);
    4141                        else
    4242                                if ~isnans(obj.riftstruct),
    43                                         checkmessage(['riftstruct shoud be NaN since numrifts is 0!']);
     43                                        md = checkmessage(md,['riftstruct shoud be NaN since numrifts is 0!']);
    4444                                end
    4545                        end
  • issm/trunk-jpl/src/m/classes/settings.m

    r11869 r12663  
    4141                        obj.waitonlock=Inf;
    4242                end % }}}
    43                 function checkconsistency(obj,md,solution,analyses) % {{{
     43                function md = checkconsistency(obj,md,solution,analyses) % {{{
    4444
    45                         checkfield(md,'settings.io_gather','numel',1,'values',[0 1]);
    46                         checkfield(md,'settings.lowmem','numel',1,'values',[0 1]);
    47                         checkfield(md,'settings.results_as_patches','numel',1,'values',[0 1]);
    48                         checkfield(md,'settings.output_frequency','numel',1,'>=',1);
    49                         checkfield(md,'settings.waitonlock','numel',1);
     45                        md = checkfield(md,'settings.io_gather','numel',1,'values',[0 1]);
     46                        md = checkfield(md,'settings.lowmem','numel',1,'values',[0 1]);
     47                        md = checkfield(md,'settings.results_as_patches','numel',1,'values',[0 1]);
     48                        md = checkfield(md,'settings.output_frequency','numel',1,'>=',1);
     49                        md = checkfield(md,'settings.waitonlock','numel',1);
    5050
    5151                end % }}}
  • issm/trunk-jpl/src/m/classes/solver.m

    r12365 r12663  
    5454                         end
    5555                 end % }}}
    56                  function checkconsistency(obj,md,solution,analyses) % {{{
     56                 function md = checkconsistency(obj,md,solution,analyses) % {{{
    5757                         analyses=properties(obj);
    5858                         for i=1:numel(analyses),
    5959                                 if isempty(fieldnames(obj.(analyses{i})))
    60                                          checkmessage(['md.solver.' analyses{i} ' is empty']);
     60                                         md = checkmessage(md,['md.solver.' analyses{i} ' is empty']);
    6161                                 end
    6262                         end
  • issm/trunk-jpl/src/m/classes/steadystate.m

    r11924 r12663  
    2626                        obj.reltol=0.01;
    2727                end % }}}
    28                 function checkconsistency(obj,md,solution,analyses) % {{{
     28                function md = checkconsistency(obj,md,solution,analyses) % {{{
    2929
    3030                        %Early return
     
    3232
    3333                        if md.timestepping.time_step~=0,
    34                                 checkmessage(['for a steadystate computation, timestepping.time_step must be zero.']);
     34                                md = checkmessage(md,['for a steadystate computation, timestepping.time_step must be zero.']);
    3535                        end
    3636
    3737                        if isnan(md.diagnostic.reltol),
    38                                 checkmessage(['for a steadystate computation, diagnostic.reltol (relative convergence criterion) must be defined!']);
     38                                md = checkmessage(md,['for a steadystate computation, diagnostic.reltol (relative convergence criterion) must be defined!']);
    3939                        end
    4040                end % }}}
  • issm/trunk-jpl/src/m/classes/surfaceforcings.m

    r12326 r12663  
    2626
    2727                end % }}}
    28                 function checkconsistency(obj,md,solution,analyses) % {{{
     28                function md = checkconsistency(obj,md,solution,analyses) % {{{
    2929
    3030                        if ismember(PrognosticAnalysisEnum,analyses),
    31                                 checkfield(md,'surfaceforcings.ispdd','numel',1,'values',[0 1]);
     31                                md = checkfield(md,'surfaceforcings.ispdd','numel',1,'values',[0 1]);
    3232                                if(obj.ispdd)
    33                                         checkfield(md,'surfaceforcings.monthlytemperatures','forcing',1,'NaN',1);
     33                                        md = checkfield(md,'surfaceforcings.monthlytemperatures','forcing',1,'NaN',1);
    3434                                else
    35                                         checkfield(md,'surfaceforcings.mass_balance','forcing',1,'NaN',1);
     35                                        md = checkfield(md,'surfaceforcings.mass_balance','forcing',1,'NaN',1);
    3636                                end
    3737                        end
    3838                        if ismember(BalancethicknessAnalysisEnum,analyses),
    39                                 checkfield(md,'surfaceforcings.mass_balance','size',[md.mesh.numberofvertices 1],'NaN',1);
     39                                md = checkfield(md,'surfaceforcings.mass_balance','size',[md.mesh.numberofvertices 1],'NaN',1);
    4040                        end
    4141                end % }}}
  • issm/trunk-jpl/src/m/classes/thermal.m

    r12423 r12663  
    4040                        obj.isenthalpy=0;
    4141                end % }}}
    42                 function checkconsistency(obj,md,solution,analyses) % {{{
     42                function md = checkconsistency(obj,md,solution,analyses) % {{{
    4343
    4444                        %Early return
    4545                        if (~ismember(ThermalAnalysisEnum,analyses) & ~ismember(EnthalpyAnalysisEnum,analyses)) | (solution==TransientSolutionEnum & md.transient.isthermal==0), return; end
    4646
    47                         checkfield(md,'thermal.stabilization','numel',1,'values',[0 1 2]);
    48                         checkfield(md,'thermal.spctemperature','forcing',1);
     47                        md = checkfield(md,'thermal.stabilization','numel',1,'values',[0 1 2]);
     48                        md = checkfield(md,'thermal.spctemperature','forcing',1);
    4949                        if (ismember(EnthalpyAnalysisEnum,analyses) & md.thermal.isenthalpy & md.mesh.dimension==3),
    50                         checkfield(md,'thermal.spctemperature','<',md.materials.meltingpoint-md.materials.beta*md.materials.rho_ice*md.constants.g*(md.geometry.surface-md.mesh.z),'message','spctemperature should be below the adjusted melting point');
    51                         checkfield(md,'thermal.isenthalpy','numel',1,'values',[0 1]);
     50                        md = checkfield(md,'thermal.spctemperature','<',md.materials.meltingpoint-md.materials.beta*md.materials.rho_ice*md.constants.g*(md.geometry.surface-md.mesh.z),'message','spctemperature should be below the adjusted melting point');
     51                        md = checkfield(md,'thermal.isenthalpy','numel',1,'values',[0 1]);
    5252                        end
    5353                end % }}}
  • issm/trunk-jpl/src/m/classes/timestepping.m

    r11869 r12663  
    3333                        obj.cfl_coefficient=.5;
    3434                end % }}}
    35                 function checkconsistency(obj,md,solution,analyses) % {{{
     35                function md = checkconsistency(obj,md,solution,analyses) % {{{
    3636
    37                         checkfield(md,'timestepping.start_time','numel',1,'NaN',1);
    38                         checkfield(md,'timestepping.final_time','numel',1,'NaN',1);
    39                         checkfield(md,'timestepping.time_step','numel',1,'>=',0,'NaN',1);
    40                         checkfield(md,'timestepping.time_adapt','numel',1,'values',[0 1]);
    41                         checkfield(md,'timestepping.cfl_coefficient','numel',1,'>',0,'<=',1);
     37                        md = checkfield(md,'timestepping.start_time','numel',1,'NaN',1);
     38                        md = checkfield(md,'timestepping.final_time','numel',1,'NaN',1);
     39                        md = checkfield(md,'timestepping.time_step','numel',1,'>=',0,'NaN',1);
     40                        md = checkfield(md,'timestepping.time_adapt','numel',1,'values',[0 1]);
     41                        md = checkfield(md,'timestepping.cfl_coefficient','numel',1,'>',0,'<=',1);
    4242                        if obj.final_time-obj.start_time<0,
    43                                 checkmessage('timestepping.final_time should be larger than timestepping.start_time');
     43                                md = checkmessage(md,'timestepping.final_time should be larger than timestepping.start_time');
    4444                        end
    4545                end % }}}
  • issm/trunk-jpl/src/m/classes/transient.m

    r11869 r12663  
    3030
    3131                end % }}}
    32                 function checkconsistency(obj,md,solution,analyses) % {{{
     32                function md = checkconsistency(obj,md,solution,analyses) % {{{
    3333
    3434                        %Early return
    3535                        if solution~=TransientSolutionEnum, return; end
    3636
    37                         checkfield(md,'transient.isprognostic','numel',1,'values',[0 1]);
    38                         checkfield(md,'transient.isdiagnostic','numel',1,'values',[0 1]);
    39                         checkfield(md,'transient.isthermal','numel',1,'values',[0 1]);
    40                         checkfield(md,'transient.isgroundingline','numel',1,'values',[0 1]);
     37                        md = checkfield(md,'transient.isprognostic','numel',1,'values',[0 1]);
     38                        md = checkfield(md,'transient.isdiagnostic','numel',1,'values',[0 1]);
     39                        md = checkfield(md,'transient.isthermal','numel',1,'values',[0 1]);
     40                        md = checkfield(md,'transient.isgroundingline','numel',1,'values',[0 1]);
    4141
    4242                end % }}}
  • issm/trunk-jpl/src/m/classes/verbose.m

    r12365 r12663  
    9999                end
    100100                %}}}
    101                 function checkconsistency(obj,md,solution,analyses) % {{{
     101                function md = checkconsistency(obj,md,solution,analyses) % {{{
    102102
    103103                end % }}}
Note: See TracChangeset for help on using the changeset viewer.