source: issm/trunk-jpl/src/m/classes/slr.m@ 19984

Last change on this file since 19984 was 19984, checked in by Eric.Larour, 9 years ago

CHG: new sea level rise solution. Not valdated yet!

This solution requires one Sealevelrise analysis (so added the corresponding EnumToAnalysis and analysis.h files + SealevelriseAnalysis.* files).
In terms of solution core: we have a new sealevelrise_core.cpp files + corresponding hook up in CorePointerFromSolutionEnum.
This core calls the new FemModel Sealevelrise module, which loops through the elements, hence the mods to Element.* along with all
derivatives classes, in particular Tria.
In terms of ModelProcessorx, we have a modified CreateElementsVerticesAndMaterials to include lat,long and radius, which also translsates
into modifications for the Vertex object. The VertexCoordinatesx module is also modified, to be able to retrieve x,y,z but also lat,long,r
from vertices.
Of course, this is all driven from matlab, where we have a new field in the model, the slr class.

File size: 4.0 KB
Line 
1%SLR class definition
2%
3% Usage:
4% slr=slr();
5
6classdef slr
7 properties (SetAccess=public)
8 deltathickness = NaN;
9 maxiter = 0;
10 reltol = 0;
11 abstol = 0;
12 love_h = 0; %provided by PREM model
13 love_k = 0; %ideam
14 rigid = 0;
15 elastic = 0;
16 eustatic = 0;
17 end
18 methods
19 function self = slr(varargin) % {{{
20 switch nargin
21 case 0
22 self=setdefaultparameters(self);
23 otherwise
24 error('constructor not supported');
25 end
26 end % }}}
27 function self = setdefaultparameters(self) % {{{
28
29 %Convergence criterion: absolute, relative and residual
30 self.reltol=0.01; %1 percent
31 self.abstol=0.001; %1 mm of sea level rise
32
33 %maximum of non-linear iterations.
34 self.maxiter=5;
35
36 %computational flags:
37 self.rigid=1;
38 self.elastic=1;
39 self.eustatic=1;
40
41 end % }}}
42 function md = checkconsistency(self,md,solution,analyses) % {{{
43
44 if ~ismember(SealevelriseAnalysisEnum(),analyses), return; end
45 md = checkfield(md,'fieldname','slr.deltathickness','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
46 md = checkfield(md,'fieldname','slr.love_h','NaN',1,'Inf',1);
47 md = checkfield(md,'fieldname','slr.love_k','NaN',1,'Inf',1);
48 md = checkfield(md,'fieldname','slr.reltol','size',[1 1]);
49 md = checkfield(md,'fieldname','slr.abstol','size',[1 1]);
50 md = checkfield(md,'fieldname','slr.maxiter','size',[1 1],'>=',1);
51
52 %check that love numbers are provided at the same level of accuracy:
53 if (size(self.love_h,1) ~= size(self.love_k,1)),
54 error('slr error message: love numbers should be provided at the same level of accuracy');
55 end
56
57 end % }}}
58 function disp(self) % {{{
59 disp(sprintf(' slr parameters:'));
60
61 fielddisplay(self,'deltathickness','thickness change (main loading of the slr solution core [m]');
62 fielddisplay(self,'reltol','sea level rise relative convergence criterion, NaN: not applied');
63 fielddisplay(self,'abstol','sea level rise absolute convergence criterion, NaN: not applied');
64 fielddisplay(self,'maxiter','maximum number of nonlinear iterations');
65 fielddisplay(self,'love_h','love load number for radial displacement');
66 fielddisplay(self,'love_k','love load number for gravitational potential perturbation');
67 fielddisplay(self,'rigid','rigid earth graviational potential perturbation');
68 fielddisplay(self,'elastic','elastic earth graviational potential perturbation');
69 fielddisplay(self,'eustatic','eustatic sea level rise');
70
71 end % }}}
72 function marshall(self,md,fid) % {{{
73 WriteData(fid,'object',self,'class','sealevelrise','fieldname','deltathickness','format','DoubleMat','mattype',1);
74 WriteData(fid,'object',self,'class','sealevelrise','fieldname','reltol','format','Double');
75 WriteData(fid,'object',self,'class','sealevelrise','fieldname','abstol','format','Double');
76 WriteData(fid,'object',self,'class','sealevelrise','fieldname','maxiter','format','Integer');
77 WriteData(fid,'object',self,'class','sealevelrise','fieldname','love_h','format','DoubleMat','mattype',1);
78 WriteData(fid,'object',self,'class','sealevelrise','fieldname','love_k','format','DoubleMat','mattype',1);
79 WriteData(fid,'object',self,'class','sealevelrise','fieldname','rigid','format','Boolean');
80 WriteData(fid,'object',self,'class','sealevelrise','fieldname','elastic','format','Boolean');
81 WriteData(fid,'object',self,'class','sealevelrise','fieldname','eustatic','format','Boolean');
82 end % }}}
83 function savemodeljs(self,fid,modelname) % {{{
84
85 writejs1Darray(fid,[modelname '.srl.deltathickness'],self.deltathickness);
86 writejsdouble(fid,[modelname '.slr.reltol'],self.reltol);
87 writejsdouble(fid,[modelname '.slr.abstol'],self.abstol);
88 writejsdouble(fid,[modelname '.slr.maxiter'],self.maxiter);
89 writejs1Darray(fid,[modelname '.srl.love_h'],self.love_h);
90 writejs1Darray(fid,[modelname '.srl.love_k'],self.love_k);
91 writejsdouble(fid,[modelname '.slr.rigid'],self.rigid);
92 writejsdouble(fid,[modelname '.slr.eustatic'],self.eustatic);
93
94 end % }}}
95 end
96end
Note: See TracBrowser for help on using the repository browser.