[9678] | 1 | %TRANSIENT class definition
|
---|
| 2 | %
|
---|
| 3 | % Usage:
|
---|
| 4 | % transient=transient();
|
---|
| 5 |
|
---|
| 6 | classdef transient
|
---|
| 7 | properties (SetAccess=public)
|
---|
[10969] | 8 | isprognostic = 0;
|
---|
| 9 | isdiagnostic = 0;
|
---|
| 10 | isthermal = 0;
|
---|
| 11 | isgroundingline = 0;
|
---|
| 12 | requested_outputs = NaN;
|
---|
[9678] | 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 % }}}
|
---|
[12878] | 32 | function md = checkconsistency(obj,md,solution,analyses) % {{{
|
---|
[9854] | 33 |
|
---|
| 34 | %Early return
|
---|
[13101] | 35 | if solution~=TransientSolutionEnum(), return; end
|
---|
[9854] | 36 |
|
---|
[13101] | 37 | md = checkfield(md,'transient.isprognostic','numel',[1],'values',[0 1]);
|
---|
| 38 | md = checkfield(md,'transient.isdiagnostic','numel',[1],'values',[0 1]);
|
---|
| 39 | md = checkfield(md,'transient.isthermal','numel',[1],'values',[0 1]);
|
---|
| 40 | md = checkfield(md,'transient.isgroundingline','numel',[1],'values',[0 1]);
|
---|
[12878] | 41 | md = checkfield(md,'transient.requested_outputs','size',[NaN 1]);
|
---|
[9739] | 42 |
|
---|
| 43 | end % }}}
|
---|
[9821] | 44 | function disp(obj) % {{{
|
---|
[10882] | 45 | disp(sprintf(' transient solution parameters:'));
|
---|
[9821] | 46 |
|
---|
| 47 | fielddisplay(obj,'isprognostic','indicates if a prognostic solution is used in the transient');
|
---|
| 48 | fielddisplay(obj,'isthermal','indicates if a thermal solution is used in the transient');
|
---|
| 49 | fielddisplay(obj,'isdiagnostic','indicates if a diagnostic solution is used in the transient');
|
---|
| 50 | fielddisplay(obj,'isgroundingline','indicates if a groundingline migration is used in the transient');
|
---|
[9958] | 51 | fielddisplay(obj,'requested_outputs','list of additional outputs requested');
|
---|
[9821] | 52 |
|
---|
| 53 | end % }}}
|
---|
[10969] | 54 | function marshall(obj,fid) % {{{
|
---|
| 55 | WriteData(fid,'object',obj,'fieldname','isprognostic','format','Boolean');
|
---|
| 56 | WriteData(fid,'object',obj,'fieldname','isdiagnostic','format','Boolean');
|
---|
| 57 | WriteData(fid,'object',obj,'fieldname','isthermal','format','Boolean');
|
---|
| 58 | WriteData(fid,'object',obj,'fieldname','isgroundingline','format','Boolean');
|
---|
| 59 | WriteData(fid,'object',obj,'fieldname','requested_outputs','format','DoubleMat','mattype',3);
|
---|
| 60 | end % }}}
|
---|
[9678] | 61 | end
|
---|
| 62 | end
|
---|