Changeset 12663
- Timestamp:
- 07/19/12 15:32:17 (13 years ago)
- Location:
- issm/trunk-jpl/src/m/classes
- Files:
-
- 39 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/autodiff.m
r11869 r12663 22 22 23 23 end % }}} 24 function checkconsistency(obj,md,solution,analyses) % {{{24 function md = checkconsistency(obj,md,solution,analyses) % {{{ 25 25 26 26 end % }}} -
issm/trunk-jpl/src/m/classes/balancethickness.m
r11869 r12663 25 25 26 26 end % }}} 27 function checkconsistency(obj,md,solution,analyses) % {{{27 function md = checkconsistency(obj,md,solution,analyses) % {{{ 28 28 %Early return 29 29 if solution~=BalancethicknessSolutionEnum, return; end 30 30 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]); 34 34 end % }}} 35 35 function disp(obj) % {{{ -
issm/trunk-jpl/src/m/classes/basalforcings.m
r11869 r12663 22 22 23 23 end % }}} 24 function checkconsistency(obj,md,solution,analyses) % {{{24 function md = checkconsistency(obj,md,solution,analyses) % {{{ 25 25 26 26 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); 28 28 end 29 29 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]); 31 31 end 32 32 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); 35 35 end 36 36 end % }}} -
issm/trunk-jpl/src/m/classes/clusters/acenet.m
r12371 r12663 47 47 end 48 48 %}}} 49 function checkconsistency(cluster,md,solution,analyses) % {{{49 function md = checkconsistency(cluster,md,solution,analyses) % {{{ 50 50 51 51 available_queues={'debug','shortq','longq'}; -
issm/trunk-jpl/src/m/classes/clusters/castor.m
r12372 r12663 37 37 end 38 38 %}}} 39 function checkconsistency(cluster,md,solution,analyses) % {{{39 function md = checkconsistency(cluster,md,solution,analyses) % {{{ 40 40 41 41 available_queues={'shortc','longc'}; -
issm/trunk-jpl/src/m/classes/clusters/cosmos.m
r12371 r12663 37 37 end 38 38 %}}} 39 function checkconsistency(cluster,md,solution,analyses) % {{{39 function md = checkconsistency(cluster,md,solution,analyses) % {{{ 40 40 41 41 available_queues={'debug','shortq','longq'}; -
issm/trunk-jpl/src/m/classes/clusters/discover.m
r12621 r12663 56 56 end 57 57 %}}} 58 function checkconsistency(cluster,md,solution,analyses) % {{{58 function md = checkconsistency(cluster,md,solution,analyses) % {{{ 59 59 60 60 available_queues={'general_long','general','general_small','debug'}; … … 65 65 66 66 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'); 68 68 end 69 69 %now, check cluster.cpuspernode according to processor type 70 70 if ( strcmpi(cluster.processor,'neha')), 71 71 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'); 73 73 end 74 74 elseif strcmpi(cluster.processor,'west'), 75 75 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'); 77 77 end 78 78 else 79 checkmessage('unknown processor type, should be ''neha'' or ''west'' ');79 md = checkmessage(md,'unknown processor type, should be ''neha'' or ''west'' '); 80 80 end 81 81 82 82 %Miscelaneous 83 if isempty(cluster.login), checkmessage('login empty'); end84 if isempty(cluster.codepath), checkmessage('codepath empty'); end85 if isempty(cluster.executionpath), checkmessage('executionpath empty'); end83 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 86 86 87 87 end -
issm/trunk-jpl/src/m/classes/clusters/gemini.m
r12371 r12663 37 37 end 38 38 %}}} 39 function checkconsistency(cluster,md,solution,analyses) % {{{39 function md = checkconsistency(cluster,md,solution,analyses) % {{{ 40 40 41 41 available_queues={'debug','shortg','longg'}; -
issm/trunk-jpl/src/m/classes/clusters/generic.m
r12380 r12663 50 50 end 51 51 %}}} 52 function checkconsistency(cluster,md,solution,analyses) % {{{52 function md = checkconsistency(cluster,md,solution,analyses) % {{{ 53 53 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']); 55 55 end 56 56 if isnan(cluster.np), -
issm/trunk-jpl/src/m/classes/clusters/greenplanet.m
r12371 r12663 48 48 end 49 49 %}}} 50 function checkconsistency(cluster,md,solution,analyses) % {{{50 function md = checkconsistency(cluster,md,solution,analyses) % {{{ 51 51 52 52 available_queues={'rignot','default'}; … … 57 57 58 58 %Miscelaneous 59 if isempty(cluster.login), checkmessage('login empty'); end60 if isempty(cluster.codepath), checkmessage('codepath empty'); end61 if isempty(cluster.executionpath), checkmessage('executionpath empty'); end59 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 62 62 63 63 end -
issm/trunk-jpl/src/m/classes/clusters/pfe.m
r12373 r12663 56 56 end 57 57 %}}} 58 function checkconsistency(cluster,md,solution,analyses) % {{{58 function md = checkconsistency(cluster,md,solution,analyses) % {{{ 59 59 60 60 available_queues={'long','normal','debug'}; … … 68 68 if cluster.hyperthreading, 69 69 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'); 71 71 end 72 72 else 73 73 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'); 75 75 end 76 76 end … … 78 78 if cluster.hyperthreading, 79 79 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'); 81 81 end 82 82 else 83 83 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'''); 89 89 end 90 90 91 91 %Miscelaneous 92 if isempty(cluster.login), checkmessage('login empty'); end93 if isempty(cluster.codepath), checkmessage('codepath empty'); end94 if isempty(cluster.executionpath), checkmessage('executionpath empty'); end92 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 95 95 96 96 end -
issm/trunk-jpl/src/m/classes/clusters/pollux.m
r12371 r12663 37 37 end 38 38 %}}} 39 function checkconsistency(cluster,md,solution,analyses) % {{{39 function md = checkconsistency(cluster,md,solution,analyses) % {{{ 40 40 41 41 available_queues={'shortp','longp'}; -
issm/trunk-jpl/src/m/classes/constants.m
r11869 r12663 31 31 32 32 end % }}} 33 function flag= checkconsistency(obj,md,solution,analyses) % {{{33 function md = checkconsistency(obj,md,solution,analyses) % {{{ 34 34 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]); 38 38 39 39 end % }}} -
issm/trunk-jpl/src/m/classes/diagnostic.m
r11994 r12663 64 64 65 65 end % }}} 66 function checkconsistency(obj,md,solution,analyses) % {{{66 function md = checkconsistency(obj,md,solution,analyses) % {{{ 67 67 68 68 %Early return … … 70 70 %if ~ismember(DiagnosticHorizAnalysisEnum,analyses) | (solution==TransientSolutionEnum & md.transient.isdiagnostic==0), return; end 71 71 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); end75 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); 81 81 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); 83 83 else 84 checkfield(md,'diagnostic.icefront','size',[NaN 6],'NaN',1);84 md = checkfield(md,'diagnostic.icefront','size',[NaN 6],'NaN',1); 85 85 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]); 89 89 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]); 91 91 end 92 92 93 93 %singular solution 94 94 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!']); 96 96 end 97 97 %CHECK THAT EACH LINES CONTAINS ONLY NAN VALUES OR NO NAN VALUES 98 98 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']); 100 100 end 101 101 %CHECK THAT THE TWO VECTORS PROVIDED ARE ORTHOGONAL … … 103 103 pos=find(sum(isnan(md.diagnostic.referential),2)==0); 104 104 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']); 106 106 end 107 107 end … … 110 110 pos=find(md.mask.vertexongroundedice & md.mesh.vertexonbed); 111 111 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']); 113 113 end 114 114 end -
issm/trunk-jpl/src/m/classes/flaim.m
r11869 r12663 32 32 33 33 end % }}} 34 function checkconsistency(obj,md,solution,analyses) % {{{34 function md = checkconsistency(obj,md,solution,analyses) % {{{ 35 35 36 36 %Early return 37 37 if solution~=FlaimSolutionEnum, return; end 38 38 39 checkfield(md,'flaim.tracks','file',1);39 md = checkfield(md,'flaim.tracks','file',1); 40 40 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); 42 42 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]); 44 44 end 45 45 -
issm/trunk-jpl/src/m/classes/flowequation.m
r11869 r12663 27 27 28 28 end % }}} 29 function checkconsistency(obj,md,solution,analyses) % {{{29 function md = checkconsistency(obj,md,solution,analyses) % {{{ 30 30 31 31 if ismember(DiagnosticHorizAnalysisEnum,analyses), 32 32 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]); 39 39 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]); 42 42 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]); 45 45 end 46 46 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']); 48 48 end 49 49 end 50 50 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 53 55 end 54 56 end -
issm/trunk-jpl/src/m/classes/friction.m
r11869 r12663 22 22 23 23 end % }}} 24 function checkconsistency(obj,md,solution,analyses) % {{{24 function md = checkconsistency(obj,md,solution,analyses) % {{{ 25 25 26 26 %Early return 27 27 if ~ismember(DiagnosticHorizAnalysisEnum,analyses) & ~ismember(ThermalAnalysisEnum,analyses), return; end 28 28 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]); 32 32 end % }}} 33 33 function disp(obj) % {{{ -
issm/trunk-jpl/src/m/classes/geometry.m
r11869 r12663 24 24 25 25 end % }}} 26 function checkconsistency(obj,md,solution,analyses) % {{{26 function md = checkconsistency(obj,md,solution,analyses) % {{{ 27 27 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); 31 31 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']); 33 33 end 34 34 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]); 36 36 end 37 37 end % }}} -
issm/trunk-jpl/src/m/classes/groundingline.m
r12149 r12663 28 28 29 29 end % }}} 30 function checkconsistency(obj,md,solution,analyses) % {{{30 function md = checkconsistency(obj,md,solution,analyses) % {{{ 31 31 32 checkfield(md,'groundingline.migration','values',{'None' 'AgressiveMigration' 'SoftMigration'});32 md = checkfield(md,'groundingline.migration','values',{'None' 'AgressiveMigration' 'SoftMigration'}); 33 33 34 34 if ~strcmp(obj.migration,'None'), 35 35 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!']); 37 37 end 38 38 pos=find(md.mask.vertexongroundedice); 39 39 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 !']); 41 41 end 42 42 pos=find(md.mask.vertexonfloatingice); 43 43 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 !']); 45 45 end 46 46 end -
issm/trunk-jpl/src/m/classes/hydrology.m
r11869 r12663 35 35 obj.stabilization=1; 36 36 end % }}} 37 function checkconsistency(obj,md,solution,analyses) % {{{37 function md = checkconsistency(obj,md,solution,analyses) % {{{ 38 38 39 39 %Early return 40 40 if ~ismember(HydrologyAnalysisEnum,analyses), return; end 41 41 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); 44 44 end % }}} 45 45 function disp(obj) % {{{ -
issm/trunk-jpl/src/m/classes/initialization.m
r12402 r12663 27 27 28 28 end % }}} 29 function checkconsistency(obj,md,solution,analyses) % {{{29 function md = checkconsistency(obj,md,solution,analyses) % {{{ 30 30 if ismember(DiagnosticHorizAnalysisEnum,analyses) 31 31 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]); 34 34 end 35 35 end 36 36 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]); 39 39 end 40 40 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]); 42 42 end 43 43 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]); 46 46 %Triangle with zero velocity 47 47 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'); 49 49 end 50 50 end 51 51 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]); 56 56 end 57 57 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]); 59 59 end 60 60 end % }}} -
issm/trunk-jpl/src/m/classes/inversion.m
r11869 r12663 75 75 76 76 end % }}} 77 function checkconsistency(obj,md,solution,analyses) % {{{77 function md = checkconsistency(obj,md,solution,analyses) % {{{ 78 78 79 79 %Early return … … 83 83 num_costfunc=size(md.inversion.cost_functions,2); 84 84 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]); 98 98 99 99 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); 101 101 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); 104 104 end 105 105 end % }}} -
issm/trunk-jpl/src/m/classes/mask.m
r11869 r12663 25 25 26 26 end % }}} 27 function checkconsistency(obj,md,solution,analyses) % {{{27 function md = checkconsistency(obj,md,solution,analyses) % {{{ 28 28 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]); 35 35 end % }}} 36 36 function disp(obj) % {{{ -
issm/trunk-jpl/src/m/classes/materials.m
r12361 r12663 69 69 obj.rheology_law='Paterson'; 70 70 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'}); 79 79 end % }}} 80 80 function disp(obj) % {{{ -
issm/trunk-jpl/src/m/classes/mesh.m
r11869 r12663 64 64 obj.average_vertex_connectivity=25; 65 65 end % }}} 66 function checkconsistency(obj,md,solution,analyses) % {{{66 function md = checkconsistency(obj,md,solution,analyses) % {{{ 67 67 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); 72 72 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]); 74 74 else 75 checkfield(md,'mesh.elements','size',[md.mesh.numberofelements 6]);75 md = checkfield(md,'mesh.elements','size',[md.mesh.numberofelements 6]); 76 76 end 77 77 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'); 79 79 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); 84 84 %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]); 89 89 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'); 91 91 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'); 93 93 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); 95 95 96 96 %Solution specific checks … … 98 98 case PrognosticSolutionEnum, 99 99 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); 103 103 end 104 104 case BalancethicknessSolutionEnum, 105 105 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); 109 109 end 110 110 case TransientSolutionEnum, 111 111 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); 115 115 end 116 116 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'); 118 118 end 119 119 end % }}} -
issm/trunk-jpl/src/m/classes/miscellaneous.m
r11869 r12663 19 19 end 20 20 end % }}} 21 function checkconsistency(obj,md,solution,analyses) % {{{21 function md = checkconsistency(obj,md,solution,analyses) % {{{ 22 22 23 checkfield(md,'miscellaneous.name','empty',1);23 md = checkfield(md,'miscellaneous.name','empty',1); 24 24 25 25 end % }}} -
issm/trunk-jpl/src/m/classes/model/model.m
r12365 r12663 83 83 error('model constructor error message: 0 of 1 argument only in input.'); 84 84 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; 85 91 end 86 92 %}}} -
issm/trunk-jpl/src/m/classes/private.m
r11869 r12663 6 6 classdef private 7 7 properties (SetAccess=public) 8 runtimename = ''; 9 bamg = struct(); 10 solution = ''; 8 isconsistent = true; 9 runtimename = ''; 10 bamg = struct(); 11 solution = ''; 11 12 end 12 13 methods … … 22 23 23 24 end % }}} 24 function checkconsistency(obj,md,solution,analyses) % {{{25 function md = checkconsistency(obj,md,solution,analyses) % {{{ 25 26 26 27 end % }}} … … 28 29 disp(sprintf(' private parameters: do not change')); 29 30 31 fielddisplay(obj,'isconsistent','is model self consistent'); 30 32 fielddisplay(obj,'runtimename','name of the run launched'); 31 33 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 36 36 obj.hydrostatic_adjustment='Absolute'; 37 37 end % }}} 38 function checkconsistency(obj,md,solution,analyses) % {{{38 function md = checkconsistency(obj,md,solution,analyses) % {{{ 39 39 40 40 %Early return, 41 41 if ~ismember(PrognosticAnalysisEnum,analyses) | (solution==TransientSolutionEnum & md.transient.isprognostic==0), return; end 42 42 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); 47 47 48 48 end % }}} -
issm/trunk-jpl/src/m/classes/qmu.m
r11924 r12663 35 35 36 36 end % }}} 37 function checkconsistency(obj,md,solution,analyses) % {{{37 function md = checkconsistency(obj,md,solution,analyses) % {{{ 38 38 39 39 %Early return … … 41 41 42 42 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']); 44 44 end 45 45 if ~isempty(md.qmu.partition), 46 46 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 ']); 48 48 end 49 49 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)']); 51 51 end 52 52 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']); 54 54 end 55 55 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']); 57 57 end 58 58 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']); 60 60 end 61 61 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']); 63 63 end 64 64 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']); 66 66 end 67 67 end … … 69 69 if ~strcmpi(md.cluster.name,'none'), 70 70 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!']); 72 72 end 73 73 end -
issm/trunk-jpl/src/m/classes/rifts.m
r11924 r12663 21 21 22 22 end % }}} 23 function checkconsistency(obj,md,solution,analyses) % {{{23 function md = checkconsistency(obj,md,solution,analyses) % {{{ 24 24 if isempty(obj.riftstruct) | isnans(obj.riftstruct), 25 25 numrifts=0; … … 29 29 if numrifts, 30 30 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!']); 32 32 end 33 33 if ~isstruct(obj.riftstruct), 34 checkmessage(['rifts.riftstruct should be a structure!']);34 md = checkmessage(md,['rifts.riftstruct should be a structure!']); 35 35 end 36 36 if ~isempty(find(md.mesh.segmentmarkers>=2)), 37 37 %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)!']); 39 39 end 40 checkfield(md,'rifts.riftstruct.fill','values',[WaterEnum() AirEnum() IceEnum() MelangeEnum()]);40 md = checkfield(md,'rifts.riftstruct.fill','values',[WaterEnum() AirEnum() IceEnum() MelangeEnum()]); 41 41 else 42 42 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!']); 44 44 end 45 45 end -
issm/trunk-jpl/src/m/classes/settings.m
r11869 r12663 41 41 obj.waitonlock=Inf; 42 42 end % }}} 43 function checkconsistency(obj,md,solution,analyses) % {{{43 function md = checkconsistency(obj,md,solution,analyses) % {{{ 44 44 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); 50 50 51 51 end % }}} -
issm/trunk-jpl/src/m/classes/solver.m
r12365 r12663 54 54 end 55 55 end % }}} 56 function checkconsistency(obj,md,solution,analyses) % {{{56 function md = checkconsistency(obj,md,solution,analyses) % {{{ 57 57 analyses=properties(obj); 58 58 for i=1:numel(analyses), 59 59 if isempty(fieldnames(obj.(analyses{i}))) 60 checkmessage(['md.solver.' analyses{i} ' is empty']);60 md = checkmessage(md,['md.solver.' analyses{i} ' is empty']); 61 61 end 62 62 end -
issm/trunk-jpl/src/m/classes/steadystate.m
r11924 r12663 26 26 obj.reltol=0.01; 27 27 end % }}} 28 function checkconsistency(obj,md,solution,analyses) % {{{28 function md = checkconsistency(obj,md,solution,analyses) % {{{ 29 29 30 30 %Early return … … 32 32 33 33 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.']); 35 35 end 36 36 37 37 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!']); 39 39 end 40 40 end % }}} -
issm/trunk-jpl/src/m/classes/surfaceforcings.m
r12326 r12663 26 26 27 27 end % }}} 28 function checkconsistency(obj,md,solution,analyses) % {{{28 function md = checkconsistency(obj,md,solution,analyses) % {{{ 29 29 30 30 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]); 32 32 if(obj.ispdd) 33 checkfield(md,'surfaceforcings.monthlytemperatures','forcing',1,'NaN',1);33 md = checkfield(md,'surfaceforcings.monthlytemperatures','forcing',1,'NaN',1); 34 34 else 35 checkfield(md,'surfaceforcings.mass_balance','forcing',1,'NaN',1);35 md = checkfield(md,'surfaceforcings.mass_balance','forcing',1,'NaN',1); 36 36 end 37 37 end 38 38 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); 40 40 end 41 41 end % }}} -
issm/trunk-jpl/src/m/classes/thermal.m
r12423 r12663 40 40 obj.isenthalpy=0; 41 41 end % }}} 42 function checkconsistency(obj,md,solution,analyses) % {{{42 function md = checkconsistency(obj,md,solution,analyses) % {{{ 43 43 44 44 %Early return 45 45 if (~ismember(ThermalAnalysisEnum,analyses) & ~ismember(EnthalpyAnalysisEnum,analyses)) | (solution==TransientSolutionEnum & md.transient.isthermal==0), return; end 46 46 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); 49 49 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]); 52 52 end 53 53 end % }}} -
issm/trunk-jpl/src/m/classes/timestepping.m
r11869 r12663 33 33 obj.cfl_coefficient=.5; 34 34 end % }}} 35 function checkconsistency(obj,md,solution,analyses) % {{{35 function md = checkconsistency(obj,md,solution,analyses) % {{{ 36 36 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); 42 42 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'); 44 44 end 45 45 end % }}} -
issm/trunk-jpl/src/m/classes/transient.m
r11869 r12663 30 30 31 31 end % }}} 32 function checkconsistency(obj,md,solution,analyses) % {{{32 function md = checkconsistency(obj,md,solution,analyses) % {{{ 33 33 34 34 %Early return 35 35 if solution~=TransientSolutionEnum, return; end 36 36 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]); 41 41 42 42 end % }}} -
issm/trunk-jpl/src/m/classes/verbose.m
r12365 r12663 99 99 end 100 100 %}}} 101 function checkconsistency(obj,md,solution,analyses) % {{{101 function md = checkconsistency(obj,md,solution,analyses) % {{{ 102 102 103 103 end % }}}
Note:
See TracChangeset
for help on using the changeset viewer.