[22292] | 1 | %CALVINCREVASSEDEPTH class definition
|
---|
| 2 | %
|
---|
| 3 | % Usage:
|
---|
| 4 | % calvingcrevassedepth=calvingcrevassedepth();
|
---|
| 5 |
|
---|
| 6 | classdef calvingcrevassedepth
|
---|
| 7 | properties (SetAccess=public)
|
---|
[26744] | 8 | crevasse_opening_stress=1;
|
---|
| 9 | crevasse_threshold =1.;
|
---|
[22292] | 10 | water_height = 0.;
|
---|
| 11 | end
|
---|
| 12 | methods
|
---|
| 13 | function self = calvingcrevassedepth(varargin) % {{{
|
---|
| 14 | switch nargin
|
---|
| 15 | case 0
|
---|
| 16 | self=setdefaultparameters(self);
|
---|
| 17 | case 1
|
---|
| 18 | inputstruct=varargin{1};
|
---|
| 19 | list1 = properties('calvingcrevassedepth');
|
---|
| 20 | list2 = fieldnames(inputstruct);
|
---|
| 21 | for i=1:length(list1)
|
---|
| 22 | fieldname = list1{i};
|
---|
| 23 | if ismember(fieldname,list2),
|
---|
| 24 | self.(fieldname) = inputstruct.(fieldname);
|
---|
| 25 | end
|
---|
| 26 | end
|
---|
| 27 | otherwise
|
---|
| 28 | error('constructor not supported');
|
---|
| 29 | end
|
---|
| 30 | end % }}}
|
---|
| 31 | function self = extrude(self,md) % {{{
|
---|
| 32 | end % }}}
|
---|
| 33 | function self = setdefaultparameters(self) % {{{
|
---|
[24313] | 34 |
|
---|
[26744] | 35 | crevasse_threshold = 1.;
|
---|
| 36 | crevasse_opening_stress = 1;
|
---|
| 37 | self.water_height = 0.;
|
---|
[22292] | 38 | end % }}}
|
---|
| 39 | function md = checkconsistency(self,md,solution,analyses) % {{{
|
---|
| 40 | %Early return
|
---|
| 41 | if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
|
---|
| 42 |
|
---|
[24313] | 43 | md = checkfield(md,'fieldname','calving.crevasse_opening_stress','numel',[1],'values',[0,1]);
|
---|
[26744] | 44 | md = checkfield(md,'fieldname','calving.crevasse_threshold','numel',[1],'>',0,'<=',1);
|
---|
[22292] | 45 | md = checkfield(md,'fieldname','calving.water_height','NaN',1,'Inf',1,'timeseries',1,'>=',0);
|
---|
| 46 | end % }}}
|
---|
| 47 | function disp(self) % {{{
|
---|
| 48 | disp(sprintf(' Calving Pi parameters:'));
|
---|
[24313] | 49 | fielddisplay(self,'crevasse_opening_stress','0: stress only in the ice-flow direction, 1: max principal');
|
---|
[26744] | 50 | fielddisplay(self,'crevasse_threshold','ratio of full thickness to calve (e.g. 0.75 is for 75% of the total ice thickness)');
|
---|
[22292] | 51 | fielddisplay(self,'water_height','water height in the crevasse [m]');
|
---|
| 52 |
|
---|
| 53 | end % }}}
|
---|
| 54 | function marshall(self,prefix,md,fid) % {{{
|
---|
| 55 | yts=md.constants.yts;
|
---|
| 56 | WriteData(fid,prefix,'name','md.calving.law','data',6,'format','Integer');
|
---|
[24313] | 57 | WriteData(fid,prefix,'object',self,'fieldname','crevasse_opening_stress','format','Integer');
|
---|
[26744] | 58 | WriteData(fid,prefix,'object',self,'fieldname','crevasse_threshold','format','Double');
|
---|
[22489] | 59 | WriteData(fid,prefix,'object',self,'fieldname','water_height','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
|
---|
[22292] | 60 | end % }}}
|
---|
| 61 | end
|
---|
| 62 | end
|
---|