[2326] | 1 | function ismodelselfconsistent(md),
|
---|
[1] | 2 | %ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
|
---|
| 3 | %
|
---|
| 4 | % Usage:
|
---|
[2326] | 5 | % ismodelselfconsistent(md),
|
---|
[1] | 6 |
|
---|
[9730] | 7 | %initialize consistency as true
|
---|
[12664] | 8 | md.private.isconsistent=true;
|
---|
[9730] | 9 |
|
---|
[9853] | 10 | %Get solution and associated analyses
|
---|
| 11 | solution=md.private.solution;
|
---|
[16529] | 12 | [analyses]=AnalysisConfiguration(solution);
|
---|
[9853] | 13 |
|
---|
[12755] | 14 | %Go through a model field, check that it is a class, and call checkconsistency
|
---|
[11221] | 15 | fields=properties('model');
|
---|
[9739] | 16 | for i=1:length(fields),
|
---|
| 17 | field=fields{i};
|
---|
[9853] | 18 |
|
---|
| 19 | %Some properties do not need to be checked
|
---|
[9751] | 20 | if ismember(field,{'results' 'debug' 'radaroverlay'}),
|
---|
[9739] | 21 | continue;
|
---|
| 22 | end
|
---|
[9853] | 23 |
|
---|
| 24 | %Check that current field is an object
|
---|
[9739] | 25 | if ~isobject(md.(field))
|
---|
[12664] | 26 | md=checkmessage(md,['field ''' char(field) ''' is not an object']);
|
---|
[16821] | 27 | continue;
|
---|
[9739] | 28 | end
|
---|
[9853] | 29 |
|
---|
| 30 | %Check consistency of the object
|
---|
[13729] | 31 | md=checkconsistency(md.(field),md,solution,analyses);
|
---|
[9732] | 32 | end
|
---|
| 33 |
|
---|
[9730] | 34 | %error message if mode is not consistent
|
---|
[12664] | 35 | if md.private.isconsistent==false,
|
---|
| 36 | error('Model not consistent, see messages above');
|
---|
[9730] | 37 | end
|
---|
[13005] | 38 | end
|
---|
| 39 |
|
---|
[16529] | 40 | function [analyses]=AnalysisConfiguration(solutiontype), % {{{
|
---|
[13005] | 41 | %ANALYSISCONFIGURATION - return type of analyses, number of analyses
|
---|
| 42 | %
|
---|
| 43 | % Usage:
|
---|
[16529] | 44 | % [analyses]=AnalysisConfiguration(solutiontype);
|
---|
[13005] | 45 |
|
---|
[21049] | 46 | if strcmp(solutiontype,'StressbalanceSolution')
|
---|
| 47 | analyses={'StressbalanceAnalysis','StressbalanceVerticalAnalysis','StressbalanceSIAAnalysis','L2ProjectionBaseAnalysis'};
|
---|
| 48 | elseif strcmp(solutiontype,'SteadystateSolution')
|
---|
| 49 | analyses={'StressbalanceAnalysis','StressbalanceVerticalAnalysis','StressbalanceSIAAnalysis','L2ProjectionBaseAnalysis','ThermalAnalysis','MeltingAnalysis','EnthalpyAnalysis'};
|
---|
| 50 | elseif strcmp(solutiontype,'ThermalSolution')
|
---|
| 51 | analyses={'EnthalpyAnalysis','ThermalAnalysis','MeltingAnalysis'};
|
---|
| 52 | elseif strcmp(solutiontype,'MasstransportSolution')
|
---|
| 53 | analyses={'MasstransportAnalysis'};
|
---|
| 54 | elseif strcmp(solutiontype,'BalancethicknessSolution')
|
---|
| 55 | analyses={'BalancethicknessAnalysis'};
|
---|
| 56 | elseif strcmp(solutiontype,'Balancethickness2Solution')
|
---|
| 57 | analyses={'Balancethickness2Analysis'};
|
---|
| 58 | elseif strcmp(solutiontype,'BalancethicknessSoftSolution')
|
---|
| 59 | analyses={'BalancethicknessAnalysis'};
|
---|
| 60 | elseif strcmp(solutiontype,'BalancevelocitySolution')
|
---|
| 61 | analyses={'BalancevelocityAnalysis'};
|
---|
| 62 | elseif strcmp(solutiontype,'SurfaceSlopeSolution')
|
---|
| 63 | analyses={'L2ProjectionBaseAnalysis'};
|
---|
| 64 | elseif strcmp(solutiontype,'BedSlopeSolution')
|
---|
| 65 | analyses={'L2ProjectionBaseAnalysis'};
|
---|
[21530] | 66 | elseif strcmp(solutiontype,'GiaIvinsSolution')
|
---|
| 67 | analyses={'GiaIvinsAnalysis'};
|
---|
[21260] | 68 | elseif strcmp(solutiontype,'EsaSolution')
|
---|
| 69 | analyses={'EsaAnalysis'};
|
---|
[21049] | 70 | elseif strcmp(solutiontype,'TransientSolution')
|
---|
| 71 | analyses={'StressbalanceAnalysis','StressbalanceVerticalAnalysis','StressbalanceSIAAnalysis','L2ProjectionBaseAnalysis','ThermalAnalysis','MeltingAnalysis','EnthalpyAnalysis','MasstransportAnalysis','HydrologySommersAnalysis'};
|
---|
| 72 | elseif strcmp(solutiontype,'SealevelriseSolution')
|
---|
| 73 | analyses={'SealevelriseAnalysis'};
|
---|
| 74 | elseif strcmp(solutiontype,'HydrologySolution')
|
---|
| 75 | analyses={'L2ProjectionBaseAnalysis','HydrologyShreveAnalysis','HydrologyDCInefficientAnalysis','HydrologyDCEfficientAnalysis'};
|
---|
| 76 | elseif strcmp(solutiontype,'DamageEvolutionSolution')
|
---|
| 77 | analyses={'DamageEvolutionAnalysis'};
|
---|
| 78 | else
|
---|
| 79 | error(' solution type: %s' , solutiontype, ' not supported yet!');
|
---|
[13018] | 80 | end
|
---|
[13005] | 81 | end % }}}
|
---|