source: issm/trunk-jpl/src/m/classes/hydrologyshreve.m@ 26800

Last change on this file since 26800 was 26800, checked in by caronlam, 3 years ago

BUG: Sealevelchange core: load weights did not add up correctly; BUG: Sealevel change core viscous stacks were offset in time; partial load area phi was double counted, appearing both in Green functions and loads; NEW: love core optimization, paralelization supported, support for viscous rotational feedback; NEW:Sea level change core: support for viscous rotational feedback; CHG: grd loads now contain the average kg.m-2 over the (sub-)elemental area they apply in, not the average*phi, phi is simply accounted for in the loadarea or Green's function; NEW: nightly runs 2070, 2071, 2072, 2091, 2092 test Spada et al (2011) benchmark cases

File size: 2.6 KB
Line 
1%HYDROLOGYSHREVE class definition
2%
3% Usage:
4% hydrologyshreve=hydrologyshreve();
5
6classdef hydrologyshreve
7 properties (SetAccess=public)
8 spcwatercolumn = NaN;
9 stabilization = 0;
10 requested_outputs = {};
11 end
12 methods
13 function self = hydrologyshreve(varargin) % {{{
14 switch nargin
15 case 0
16 self=setdefaultparameters(self);
17 case 1
18 self=structtoobj(self,varargin{1});
19 otherwise
20 error('constructor not supported');
21 end
22 end % }}}
23 function disp(self) % {{{
24 disp(sprintf(' hydrologyshreve solution parameters:'));
25 fielddisplay(self,'spcwatercolumn','water thickness constraints (NaN means no constraint) [m]');
26 fielddisplay(self,'stabilization','artificial diffusivity (default: 1). can be more than 1 to increase diffusivity.');
27 fielddisplay(self,'requested_outputs','additional outputs requested');
28
29 end % }}}
30 function self = setdefaultparameters(self) % {{{
31
32 %Type of stabilization to use 0:nothing 1:artificial_diffusivity
33 self.stabilization = 1;
34 self.requested_outputs = {'default'};
35 end % }}}
36 function md = checkconsistency(self,md,solution,analyses) % {{{
37 %Early return
38 if ~ismember('HydrologyShreveAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.ishydrology==0), return; end
39
40 md = checkfield(md,'fieldname','hydrology.spcwatercolumn','Inf',1,'timeseries',1);
41 md = checkfield(md,'fieldname','hydrology.stabilization','>=',0);
42 end % }}}
43 function list = defaultoutputs(self,md) % {{{
44 list = {'Watercolumn','HydrologyWaterVx','HydrologyWaterVy'};
45 end % }}}
46 function marshall(self,prefix,md,fid) % {{{
47 WriteData(fid,prefix,'name','md.hydrology.model','data',2,'format','Integer');
48 WriteData(fid,prefix,'object',self,'fieldname','spcwatercolumn','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
49 WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Double');
50 outputs = self.requested_outputs;
51 pos = find(ismember(outputs,'default'));
52 if ~isempty(pos),
53 outputs(pos) = []; %remove 'default' from outputs
54 outputs = [outputs defaultoutputs(self,md)]; %add defaults
55 end
56 WriteData(fid,prefix,'data',outputs,'name','md.hydrology.requested_outputs','format','StringArray');
57 end % }}}
58 function self = extrude(self,md) % {{{
59 end % }}}
60 function savemodeljs(self,fid,modelname) % {{{
61
62 writejs1Darray(fid,[modelname '.hydrology.spcwatercolumn'],self.spcwatercolumn);
63 writejsdouble(fid,[modelname '.hydrology.stabilization'],self.stabilization);
64
65 end % }}}
66 end
67end
68
Note: See TracBrowser for help on using the repository browser.