[22004] | 1 | %FOURIERLOVE class definition
|
---|
| 2 | %
|
---|
| 3 | % Usage:
|
---|
| 4 | % md.love=fourierlove();
|
---|
| 5 |
|
---|
| 6 | classdef fourierlove
|
---|
| 7 | properties (SetAccess=public)
|
---|
[22388] | 8 | nfreq = 0;
|
---|
| 9 | frequencies = 0;
|
---|
| 10 | sh_nmax = 0;
|
---|
| 11 | sh_nmin = 0;
|
---|
| 12 | g0 = 0;
|
---|
| 13 | r0 = 0;
|
---|
| 14 | mu0 = 0;
|
---|
| 15 | allow_layer_deletion = 0;
|
---|
| 16 | love_kernels = 0;
|
---|
| 17 | forcing_type = 0;
|
---|
[22004] | 18 | end
|
---|
| 19 | methods (Static)
|
---|
| 20 | function self = loadobj(self) % {{{
|
---|
| 21 | % This function is directly called by matlab when a model object is
|
---|
| 22 | % loaded. Update old properties here
|
---|
| 23 | end% }}}
|
---|
| 24 | end
|
---|
| 25 | methods
|
---|
| 26 | function self = extrude(self,md) % {{{
|
---|
| 27 | end % }}}
|
---|
| 28 | function self = fourierlove(varargin) % {{{
|
---|
| 29 | switch nargin
|
---|
| 30 | case 0
|
---|
| 31 | self=setdefaultparameters(self);
|
---|
| 32 | otherwise
|
---|
| 33 | error('constructor not supported');
|
---|
| 34 | end
|
---|
| 35 | end % }}}
|
---|
| 36 | function self = setdefaultparameters(self) % {{{
|
---|
| 37 | %we setup an elastic love number computation by default.
|
---|
| 38 | self.nfreq=1;
|
---|
| 39 | self.frequencies=[0]; %Hz
|
---|
| 40 | self.sh_nmax=256; % .35 degree, 40 km at the equator.
|
---|
| 41 | self.sh_nmin=1;
|
---|
| 42 | self.g0=10; % m/s^2;
|
---|
| 43 | self.r0=6378*1e3; %m;
|
---|
| 44 | self.mu0=10^11; % Pa
|
---|
| 45 | self.allow_layer_deletion=1;
|
---|
[22383] | 46 | self.love_kernels=0;
|
---|
[22004] | 47 | self.forcing_type = 11;
|
---|
| 48 | end % }}}
|
---|
| 49 | function disp(self) % {{{
|
---|
| 50 | fielddisplay(self,'nfreq','number of frequencies sampled (default 1, elastic) [Hz]');
|
---|
| 51 | fielddisplay(self,'frequencies','frequencies sampled (convention defaults to 0 for the elastic case) [Hz]');
|
---|
| 52 | fielddisplay(self,'sh_nmax','maximum spherical harmonic degree (default 256, .35 deg, or 40 km at equator)');
|
---|
| 53 | fielddisplay(self,'sh_nmin','minimum spherical harmonic degree (default 1)');
|
---|
| 54 | fielddisplay(self,'g0','adimensioning constant for gravity (default 10) [m/s^2]');
|
---|
| 55 | fielddisplay(self,'r0','adimensioning constant for radius (default 6378*10^3) [m]');
|
---|
| 56 | fielddisplay(self,'mu0','adimensioning constant for stress (default 10^11) [Pa]');
|
---|
| 57 | fielddisplay(self,'allow_layer_deletion','allow for migration of the integration boundary with increasing spherical harmonics degree (default 1)');
|
---|
[22383] | 58 | fielddisplay(self,'love_kernels','compute love numbers at depth? (default 0)');
|
---|
[22004] | 59 | fielddisplay(self,'forcing_type',{'integer indicating the nature and depth of the forcing for the Love number calculation (default 11) :','1: Inner core boundary -- Volumic Potential','2: Inner core boundary -- Pressure','3: Inner core boundary -- Loading','4: Inner core boundary -- Tangential traction','5: Core mantle boundary -- Volumic Potential','6: Core mantle boundary -- Pressure','7: Core mantle boundary -- Loading','8: Core mantle boundary -- Tangential traction','9: Surface -- Volumic Potential','10: Surface -- Pressure','11: Surface -- Loading','12: Surface -- Tangential traction '});
|
---|
| 60 |
|
---|
| 61 | end % }}}
|
---|
| 62 | function md = checkconsistency(self,md,solution,analyses) % {{{
|
---|
| 63 |
|
---|
| 64 | md = checkfield(md,'fieldname','love.nfreq','NaN',1,'Inf',1,'numel',1,'>',0);
|
---|
| 65 | md = checkfield(md,'fieldname','love.frequencies','NaN',1,'Inf',1,'numel',md.love.nfreq);
|
---|
| 66 | md = checkfield(md,'fieldname','love.sh_nmax','NaN',1,'Inf',1,'numel',1,'>',0);
|
---|
| 67 | md = checkfield(md,'fieldname','love.sh_nmin','NaN',1,'Inf',1,'numel',1,'>',0);
|
---|
| 68 | md = checkfield(md,'fieldname','love.g0','NaN',1,'Inf',1,'numel',1,'>',0);
|
---|
| 69 | md = checkfield(md,'fieldname','love.r0','NaN',1,'Inf',1,'numel',1,'>',0);
|
---|
| 70 | md = checkfield(md,'fieldname','love.mu0','NaN',1,'Inf',1,'numel',1,'>',0);
|
---|
| 71 | md = checkfield(md,'fieldname','love.allow_layer_deletion','values',[0 1]);
|
---|
[22383] | 72 | md = checkfield(md,'fieldname','love.love_kernels','values',[0 1]);
|
---|
[22004] | 73 | md = checkfield(md,'fieldname','love.forcing_type','NaN',1,'Inf',1,'numel',1,'>',0, '<=', 12);
|
---|
| 74 | if md.love.sh_nmin<=1 & md.love.forcing_type==9
|
---|
| 75 | error('Degree 1 not supported for Volumetric Potential forcing. Use sh_min>=2 for this kind of calculation.')
|
---|
| 76 | end
|
---|
| 77 | end % }}}
|
---|
| 78 | function marshall(self,prefix,md,fid) % {{{
|
---|
| 79 |
|
---|
| 80 | WriteData(fid,prefix,'object',self,'fieldname','nfreq','format','Integer');
|
---|
| 81 | WriteData(fid,prefix,'object',self,'fieldname','frequencies','format','DoubleMat','mattype',3);
|
---|
| 82 | WriteData(fid,prefix,'object',self,'fieldname','sh_nmax','format','Integer');
|
---|
| 83 | WriteData(fid,prefix,'object',self,'fieldname','sh_nmin','format','Integer');
|
---|
| 84 | WriteData(fid,prefix,'object',self,'fieldname','g0','format','Double');
|
---|
| 85 | WriteData(fid,prefix,'object',self,'fieldname','r0','format','Double');
|
---|
| 86 | WriteData(fid,prefix,'object',self,'fieldname','mu0','format','Double');
|
---|
| 87 | WriteData(fid,prefix,'object',self,'fieldname','allow_layer_deletion','format','Boolean');
|
---|
[22383] | 88 | WriteData(fid,prefix,'object',self,'fieldname','love_kernels','format','Boolean');
|
---|
[22004] | 89 | WriteData(fid,prefix,'object',self,'fieldname','forcing_type','format','Integer');
|
---|
| 90 |
|
---|
| 91 | end % }}}
|
---|
| 92 | function savemodeljs(self,fid,modelname) % {{{
|
---|
| 93 | error('not implemented yet!');
|
---|
| 94 | end % }}}
|
---|
| 95 | end
|
---|
| 96 | end
|
---|