[9642] | 1 | %PROGNOSTIC class definition
|
---|
| 2 | %
|
---|
| 3 | % Usage:
|
---|
| 4 | % prognostic=prognostic();
|
---|
| 5 |
|
---|
| 6 | classdef prognostic
|
---|
| 7 | properties (SetAccess=public)
|
---|
[10981] | 8 | spcthickness = NaN;
|
---|
[11237] | 9 | min_thickness = 0;
|
---|
[10981] | 10 | hydrostatic_adjustment = 0;
|
---|
| 11 | stabilization = 0;
|
---|
| 12 | vertex_pairing = NaN;
|
---|
| 13 | penalty_factor = 0;
|
---|
[9642] | 14 | end
|
---|
| 15 | methods
|
---|
| 16 | function obj = prognostic(varargin) % {{{
|
---|
| 17 | switch nargin
|
---|
| 18 | case 0
|
---|
| 19 | obj=setdefaultparameters(obj);
|
---|
| 20 | otherwise
|
---|
| 21 | error('constructor not supported');
|
---|
| 22 | end
|
---|
| 23 | end % }}}
|
---|
| 24 | function obj = setdefaultparameters(obj) % {{{
|
---|
| 25 |
|
---|
| 26 | %Type of stabilization to use 0:nothing 1:artificial_diffusivity 3:Discontinuous Galerkin
|
---|
| 27 | obj.stabilization=1;
|
---|
| 28 |
|
---|
| 29 | %Factor applied to compute the penalties kappa=max(stiffness matrix)*10^penalty_factor
|
---|
| 30 | obj.penalty_factor=3;
|
---|
| 31 |
|
---|
[11237] | 32 | %Minimum ice thickness that can be used
|
---|
| 33 | obj.min_thickness=1;
|
---|
| 34 |
|
---|
[9642] | 35 | %Hydrostatic adjustment
|
---|
| 36 | obj.hydrostatic_adjustment='Absolute';
|
---|
| 37 | end % }}}
|
---|
[12706] | 38 | function md = checkconsistency(obj,md,solution,analyses) % {{{
|
---|
[9854] | 39 |
|
---|
[13395] | 40 | %Early return
|
---|
| 41 | if ~ismember(PrognosticAnalysisEnum(),analyses) | (solution==TransientSolutionEnum() & md.transient.isprognostic==0), return; end
|
---|
[9854] | 42 |
|
---|
[12706] | 43 | md = checkfield(md,'prognostic.spcthickness','forcing',1);
|
---|
| 44 | md = checkfield(md,'prognostic.hydrostatic_adjustment','values',{'Absolute' 'Incremental'});
|
---|
| 45 | md = checkfield(md,'prognostic.stabilization','values',[0 1 2 3]);
|
---|
| 46 | md = checkfield(md,'prognostic.min_thickness','>',0);
|
---|
[9854] | 47 |
|
---|
[9739] | 48 | end % }}}
|
---|
[9642] | 49 | function disp(obj) % {{{
|
---|
| 50 | disp(sprintf(' Prognostic solution parameters:'));
|
---|
[9821] | 51 | fielddisplay(obj,'spcthickness','thickness constraints (NaN means no constraint)');
|
---|
[11237] | 52 | fielddisplay(obj,'min_thickness','minimum ice thickness allowed');
|
---|
[9821] | 53 | fielddisplay(obj,'hydrostatic_adjustment','adjustment of ice shelves surface and bed elevations: ''Incremental'' or ''Absolute'' ');
|
---|
[11995] | 54 | fielddisplay(obj,'stabilization','0->no, 1->artificial_diffusivity, 2->streamline upwinding, 3->discontinuous Galerkin');
|
---|
[9642] | 55 |
|
---|
[9821] | 56 | disp(sprintf('\n %s','Penalty options:'));
|
---|
| 57 | fielddisplay(obj,'penalty_factor','offset used by penalties: penalty = Kmax*10^offset');
|
---|
| 58 | fielddisplay(obj,'vertex_pairing','pairs of vertices that are penalized');
|
---|
[9642] | 59 |
|
---|
| 60 | end % }}}
|
---|
[10981] | 61 | function marshall(obj,fid) % {{{
|
---|
| 62 | WriteData(fid,'object',obj,'fieldname','spcthickness','format','DoubleMat','mattype',1);
|
---|
[11237] | 63 | WriteData(fid,'object',obj,'fieldname','min_thickness','format','Double');
|
---|
[13395] | 64 | WriteData(fid,'data',StringToEnum(obj.hydrostatic_adjustment),'format','Integer','enum',PrognosticHydrostaticAdjustmentEnum());
|
---|
[10981] | 65 | WriteData(fid,'object',obj,'fieldname','stabilization','format','Integer');
|
---|
| 66 | WriteData(fid,'object',obj,'fieldname','vertex_pairing','format','DoubleMat','mattype',3);
|
---|
| 67 | WriteData(fid,'object',obj,'fieldname','penalty_factor','format','Double');
|
---|
| 68 | end % }}}
|
---|
[9642] | 69 | end
|
---|
| 70 | end
|
---|