source: issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.m@ 22004

Last change on this file since 22004 was 22004, checked in by Eric.Larour, 8 years ago

ADD and CHG: introducing new love solution. This involves a new fourierlove class, a new .love field
in the model, new enums, new materials class in particular, which can now dynamically, during the constructor
phase, initialize internal structure fields relevant to only 'ice', 'litho', or any other material. The
goal is to fade away the m/classes/material classes (matice, maticeenhanced, etc...) in favor of the @materials
class, which will be all encompassing. New love_core core, and new FourierLoveCorex module, where all of the
fortran files from Lambert Caron are placed, with all his love solution code. Interfacing is done between C++
and Fortran in this module. Also, rheology_law now taken out of the parameters, should be in the materials themeselves.

File size: 3.3 KB
Line 
1function 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
8md.private.isconsistent=true;
9
10%Get solution and associated analyses
11solution=md.private.solution;
12[analyses]=AnalysisConfiguration(solution);
13
14%Go through a model field, check that it is a class, and call checkconsistency
15fields=properties('model');
16for 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);
32end
33
34%error message if mode is not consistent
35if md.private.isconsistent==false,
36 error('Model not consistent, see messages above');
37end
38end
39
40function [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
83end % }}}
Note: See TracBrowser for help on using the repository browser.