1 | %TRANSIENT class definition
|
---|
2 | %
|
---|
3 | % Usage:
|
---|
4 | % transient=transient();
|
---|
5 |
|
---|
6 | classdef transient
|
---|
7 | properties (SetAccess=public)
|
---|
8 | isprognostic = 0;
|
---|
9 | isdiagnostic = 0;
|
---|
10 | isthermal = 0;
|
---|
11 | isgroundingline = 0;
|
---|
12 | requested_outputs = NaN;
|
---|
13 | end
|
---|
14 | methods
|
---|
15 | function obj = transient(varargin) % {{{
|
---|
16 | switch nargin
|
---|
17 | case 0
|
---|
18 | obj=setdefaultparameters(obj);
|
---|
19 | otherwise
|
---|
20 | error('constructor not supported');
|
---|
21 | end
|
---|
22 | end % }}}
|
---|
23 | function obj = setdefaultparameters(obj) % {{{
|
---|
24 |
|
---|
25 | %full analysis: Diagnostic, Prognostic and Thermal but no groundingline migration for now
|
---|
26 | obj.isprognostic=1;
|
---|
27 | obj.isdiagnostic=1;
|
---|
28 | obj.isthermal=1;
|
---|
29 | obj.isgroundingline=0;
|
---|
30 |
|
---|
31 | end % }}}
|
---|
32 | function checkconsistency(obj,md,solution,analyses) % {{{
|
---|
33 |
|
---|
34 | %Early return
|
---|
35 | if solution~=TransientSolutionEnum, return; end
|
---|
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]);
|
---|
41 |
|
---|
42 | end % }}}
|
---|
43 | function disp(obj) % {{{
|
---|
44 | disp(sprintf(' transient solution parameters:'));
|
---|
45 |
|
---|
46 | fielddisplay(obj,'isprognostic','indicates if a prognostic solution is used in the transient');
|
---|
47 | fielddisplay(obj,'isthermal','indicates if a thermal solution is used in the transient');
|
---|
48 | fielddisplay(obj,'isdiagnostic','indicates if a diagnostic solution is used in the transient');
|
---|
49 | fielddisplay(obj,'isgroundingline','indicates if a groundingline migration is used in the transient');
|
---|
50 | fielddisplay(obj,'requested_outputs','list of additional outputs requested');
|
---|
51 |
|
---|
52 | end % }}}
|
---|
53 | function marshall(obj,fid) % {{{
|
---|
54 | WriteData(fid,'object',obj,'fieldname','isprognostic','format','Boolean');
|
---|
55 | WriteData(fid,'object',obj,'fieldname','isdiagnostic','format','Boolean');
|
---|
56 | WriteData(fid,'object',obj,'fieldname','isthermal','format','Boolean');
|
---|
57 | WriteData(fid,'object',obj,'fieldname','isgroundingline','format','Boolean');
|
---|
58 | WriteData(fid,'object',obj,'fieldname','requested_outputs','format','DoubleMat','mattype',3);
|
---|
59 | end % }}}
|
---|
60 | end
|
---|
61 | end
|
---|