source: issm/trunk/src/m/classes/basalforcings.m@ 9853

Last change on this file since 9853 was 9853, checked in by Mathieu Morlighem, 13 years ago

Checkmodelconsistency passes solution and analyses to the objects for further checks

File size: 1.6 KB
RevLine 
[9612]1%BASAL FORCINGS class definition
2%
3% Usage:
4% basalforcings=basalforcings();
5
6classdef basalforcings
7 properties (SetAccess=public)
8 melting_rate = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',1);
9 melting_rate_correction = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',1);
10 geothermalflux = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',1);
11 end
12 methods
13 function obj = basalforcings(varargin) % {{{
14 switch nargin
15 case 0
16 obj=setdefaultparameters(obj);
17 case 1
18 in=varargin{1};
19 if (isa(in,'numeric') & in==0),
20 % requesting templates do nothing
21 else
22 error('constructor not supported');
23 end
24 otherwise
25 error('constructor not supported');
26 end
27 end % }}}
28 function obj = setdefaultparameters(obj) % {{{
29
30 %first, use the defaults provided by the properties definition above.
31 fieldnames=fields(obj);
32 for i=1:length(fieldnames),
33 fieldname=fieldnames{i};
34 obj.(fieldname)=obj.(fieldname).default;
35 end
36 end % }}}
[9853]37 function checkconsistency(obj,md,solution,analyses) % {{{
[9739]38
[9778]39 fields={'melting_rate','geothermalflux'};
40 %checksize(md,'basalforcings',fields,[md.mesh.numberofvertices 1]);
[9739]41 end % }}}
[9799]42 function disp(obj) % {{{
43 disp(sprintf(' basal forcings parameters:'));
44
45 fielddisplay(obj,'melting_rate','basal melting rate (positive if melting)');
46 fielddisplay(obj,'melting_rate_correction','additional melting applied when the grounding line retreats');
47 fielddisplay(obj,'geothermalflux','geothermal heat flux [W/m^2]');
48
49 end % }}}
[9612]50 end
51end
Note: See TracBrowser for help on using the repository browser.