[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;
|
---|
| 12 | [analyses,numanalyses]=AnalysisConfiguration(solution);
|
---|
| 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']);
|
---|
[9739] | 27 | end
|
---|
[9853] | 28 |
|
---|
| 29 | %Check consistency of the object
|
---|
[13729] | 30 | md=checkconsistency(md.(field),md,solution,analyses);
|
---|
[9732] | 31 | end
|
---|
| 32 |
|
---|
[9730] | 33 | %error message if mode is not consistent
|
---|
[12664] | 34 | if md.private.isconsistent==false,
|
---|
| 35 | error('Model not consistent, see messages above');
|
---|
[9730] | 36 | end
|
---|
[13005] | 37 | end
|
---|
| 38 |
|
---|
| 39 | function [analyses,numanalyses]=AnalysisConfiguration(solutiontype), % {{{
|
---|
| 40 | %ANALYSISCONFIGURATION - return type of analyses, number of analyses
|
---|
| 41 | %
|
---|
| 42 | % Usage:
|
---|
| 43 | % [analyses, numanalyses]=AnalysisConfiguration(solutiontype);
|
---|
| 44 |
|
---|
| 45 | switch solutiontype,
|
---|
| 46 |
|
---|
[13043] | 47 | case DiagnosticSolutionEnum(),
|
---|
[13005] | 48 | numanalyses=5;
|
---|
[15564] | 49 | analyses=[DiagnosticHorizAnalysisEnum();DiagnosticVertAnalysisEnum();DiagnosticSIAAnalysisEnum();SurfaceSlopeAnalysisEnum();BedSlopeAnalysisEnum()];
|
---|
[13005] | 50 |
|
---|
[13043] | 51 | case SteadystateSolutionEnum(),
|
---|
[13005] | 52 | numanalyses=7;
|
---|
[15564] | 53 | analyses=[DiagnosticHorizAnalysisEnum();DiagnosticVertAnalysisEnum();DiagnosticSIAAnalysisEnum();SurfaceSlopeAnalysisEnum();BedSlopeAnalysisEnum();ThermalAnalysisEnum();MeltingAnalysisEnum()];
|
---|
[13005] | 54 |
|
---|
[13043] | 55 | case ThermalSolutionEnum(),
|
---|
[13005] | 56 | numanalyses=2;
|
---|
[13043] | 57 | analyses=[ThermalAnalysisEnum();MeltingAnalysisEnum()];
|
---|
[13005] | 58 |
|
---|
[13043] | 59 | case EnthalpySolutionEnum(),
|
---|
[13005] | 60 | numanalyses=1;
|
---|
[13043] | 61 | analyses=[EnthalpyAnalysisEnum()];
|
---|
[13005] | 62 |
|
---|
[13043] | 63 | case PrognosticSolutionEnum(),
|
---|
[13005] | 64 | numanalyses=1;
|
---|
[13043] | 65 | analyses=[PrognosticAnalysisEnum()];
|
---|
[13005] | 66 |
|
---|
[13043] | 67 | case BalancethicknessSolutionEnum(),
|
---|
[13005] | 68 | numanalyses=1;
|
---|
[13043] | 69 | analyses=[BalancethicknessAnalysisEnum()];
|
---|
[13005] | 70 |
|
---|
[15339] | 71 | case BalancethicknessSoftSolutionEnum(),
|
---|
[14162] | 72 | numanalyses=1;
|
---|
| 73 | analyses=[BalancethicknessAnalysisEnum()];
|
---|
| 74 |
|
---|
[13043] | 75 | case SurfaceSlopeSolutionEnum(),
|
---|
[13005] | 76 | numanalyses=1;
|
---|
[13043] | 77 | analyses=[SurfaceSlopeAnalysisEnum()];
|
---|
[13005] | 78 |
|
---|
[13043] | 79 | case BedSlopeSolutionEnum(),
|
---|
[13005] | 80 | numanalyses=1;
|
---|
[13043] | 81 | analyses=[BedSlopeAnalysisEnum()];
|
---|
[15106] | 82 |
|
---|
[14538] | 83 | case GiaSolutionEnum(),
|
---|
| 84 | numanalyses=1;
|
---|
| 85 | analyses=[GiaAnalysisEnum()];
|
---|
[13005] | 86 |
|
---|
[13043] | 87 | case TransientSolutionEnum(),
|
---|
[13005] | 88 | numanalyses=9;
|
---|
[15564] | 89 | analyses=[DiagnosticHorizAnalysisEnum();DiagnosticVertAnalysisEnum();DiagnosticSIAAnalysisEnum();SurfaceSlopeAnalysisEnum();BedSlopeAnalysisEnum();ThermalAnalysisEnum();MeltingAnalysisEnum();EnthalpyAnalysisEnum();PrognosticAnalysisEnum()];
|
---|
[13005] | 90 |
|
---|
[13043] | 91 | case FlaimSolutionEnum(),
|
---|
[13005] | 92 | numanalyses=1;
|
---|
[13043] | 93 | analyses=[FlaimAnalysisEnum()];
|
---|
[13005] | 94 |
|
---|
[13043] | 95 | case HydrologySolutionEnum(),
|
---|
[13005] | 96 | numanalyses=3;
|
---|
[14771] | 97 | analyses=[BedSlopeAnalysisEnum();SurfaceSlopeAnalysisEnum();HydrologyShreveAnalysisEnum();HydrologyDCInefficientAnalysisEnum();HydrologyDCEfficientAnalysisEnum()];
|
---|
[13005] | 98 |
|
---|
| 99 | otherwise
|
---|
| 100 | error('%s%s%s',' solution type: ',EnumToString(solutiontype),' not supported yet!');
|
---|
| 101 |
|
---|
[13018] | 102 | end
|
---|
[13005] | 103 | end % }}}
|
---|