1 | function ismodelselfconsistent(md),
|
---|
2 | %ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
|
---|
3 | %
|
---|
4 | % Usage:
|
---|
5 | % ismodelselfconsistent(md),
|
---|
6 |
|
---|
7 | %initialize consistency as true
|
---|
8 | md.private.isconsistent=true;
|
---|
9 |
|
---|
10 | %Get solution and associated analyses
|
---|
11 | solution=md.private.solution;
|
---|
12 | [analyses]=AnalysisConfiguration(solution);
|
---|
13 |
|
---|
14 | %Go through a model field, check that it is a class, and call checkconsistency
|
---|
15 | fields=properties('model');
|
---|
16 | for i=1:length(fields),
|
---|
17 | field=fields{i};
|
---|
18 |
|
---|
19 | %Some properties do not need to be checked
|
---|
20 | if ismember(field,{'results' 'debug' 'radaroverlay'}),
|
---|
21 | continue;
|
---|
22 | end
|
---|
23 |
|
---|
24 | %Check that current field is an object
|
---|
25 | if ~isobject(md.(field))
|
---|
26 | md=checkmessage(md,['field ''' char(field) ''' is not an object']);
|
---|
27 | continue;
|
---|
28 | end
|
---|
29 |
|
---|
30 | %Check consistency of the object
|
---|
31 | md=checkconsistency(md.(field),md,solution,analyses);
|
---|
32 | end
|
---|
33 |
|
---|
34 | %error message if mode is not consistent
|
---|
35 | if md.private.isconsistent==false,
|
---|
36 | error('Model not consistent, see messages above');
|
---|
37 | end
|
---|
38 | end
|
---|
39 |
|
---|
40 | function [analyses]=AnalysisConfiguration(solutiontype), % {{{
|
---|
41 | %ANALYSISCONFIGURATION - return type of analyses, number of analyses
|
---|
42 | %
|
---|
43 | % Usage:
|
---|
44 | % [analyses]=AnalysisConfiguration(solutiontype);
|
---|
45 |
|
---|
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'};
|
---|
66 | elseif strcmp(solutiontype,'GiaSolution')
|
---|
67 | analyses={'GiaIvinsAnalysis'};
|
---|
68 | elseif strcmp(solutiontype,'LoveSolution')
|
---|
69 | analyses={'LoveAnalysis'};
|
---|
70 | elseif strcmp(solutiontype,'EsaSolution')
|
---|
71 | analyses={'EsaAnalysis'};
|
---|
72 | elseif strcmp(solutiontype,'TransientSolution')
|
---|
73 | analyses={'StressbalanceAnalysis','StressbalanceVerticalAnalysis','StressbalanceSIAAnalysis','L2ProjectionBaseAnalysis','ThermalAnalysis','MeltingAnalysis','EnthalpyAnalysis','MasstransportAnalysis','HydrologySommersAnalysis'};
|
---|
74 | elseif strcmp(solutiontype,'SealevelriseSolution')
|
---|
75 | analyses={'SealevelriseAnalysis'};
|
---|
76 | elseif strcmp(solutiontype,'HydrologySolution')
|
---|
77 | analyses={'L2ProjectionBaseAnalysis','HydrologyShreveAnalysis','HydrologyDCInefficientAnalysis','HydrologyDCEfficientAnalysis'};
|
---|
78 | elseif strcmp(solutiontype,'DamageEvolutionSolution')
|
---|
79 | analyses={'DamageEvolutionAnalysis'};
|
---|
80 | else
|
---|
81 | error(' solution type: %s' , solutiontype, ' not supported yet!');
|
---|
82 | end
|
---|
83 | end % }}}
|
---|