[25970] | 1 | %FRICTIONCOULOMB2 class definition
|
---|
| 2 | %
|
---|
| 3 | % Usage:
|
---|
| 4 | % frictioncoulomb=frictioncoulomb2();
|
---|
| 5 |
|
---|
[25973] | 6 | classdef frictioncoulomb2
|
---|
[25970] | 7 | properties (SetAccess=public)
|
---|
[25974] | 8 | C = NaN;
|
---|
[25970] | 9 | m = NaN;
|
---|
| 10 | coupling = 0;
|
---|
| 11 | effective_pressure = NaN;
|
---|
| 12 | effective_pressure_limit = 0;
|
---|
| 13 | end
|
---|
[26083] | 14 | methods (Static)
|
---|
| 15 | function self = loadobj(self) % {{{
|
---|
| 16 | if isstruct(self)
|
---|
| 17 | disp('Recovering frictioncoulomb2 from older version');
|
---|
| 18 | if isfield(self,'coefficient')
|
---|
| 19 | self.C = self.coefficient;
|
---|
| 20 | end
|
---|
| 21 | self = structtoobj(frictioncoulomb2(),self);
|
---|
| 22 | end
|
---|
| 23 | end% }}}
|
---|
| 24 | end
|
---|
[25970] | 25 | methods
|
---|
| 26 | function self = extrude(self,md) % {{{
|
---|
[25974] | 27 | self.C=project3d(md,'vector',self.C,'type','node','layer',1);
|
---|
[25970] | 28 | self.m=project3d(md,'vector',self.m,'type','element');
|
---|
| 29 | switch self.coupling
|
---|
| 30 | case 0
|
---|
| 31 | case 1
|
---|
| 32 | self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1);
|
---|
| 33 | case 2
|
---|
| 34 | error('not implemented yet');
|
---|
| 35 | otherwise
|
---|
| 36 | error('not supported yet');
|
---|
| 37 | end
|
---|
| 38 | end % }}}
|
---|
| 39 | function self = frictioncoulomb(varargin) % {{{
|
---|
| 40 | switch nargin
|
---|
| 41 | case 0
|
---|
| 42 | self=setdefaultparameters(self);
|
---|
| 43 | otherwise
|
---|
| 44 | error('constructor not supported');
|
---|
| 45 | end
|
---|
| 46 | end % }}}
|
---|
| 47 | function self = setdefaultparameters(self) % {{{
|
---|
| 48 |
|
---|
| 49 | self.effective_pressure_limit = 0;
|
---|
| 50 |
|
---|
| 51 | end % }}}
|
---|
| 52 | function md = checkconsistency(self,md,solution,analyses) % {{{
|
---|
| 53 |
|
---|
| 54 | %Early return
|
---|
| 55 | if ~ismember('StressbalanceAnalysis',analyses) & ~ismember('ThermalAnalysis',analyses), return; end
|
---|
[25974] | 56 | md = checkfield(md,'fieldname','friction.C','timeseries',1,'NaN',1,'Inf',1);
|
---|
[25970] | 57 | md = checkfield(md,'fieldname','friction.m','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
|
---|
| 58 | md = checkfield(md,'fieldname','friction.coupling','numel',[1],'values',[0 1 2]);
|
---|
| 59 | md = checkfield(md,'fieldname','friction.effective_pressure_limit','numel',[1],'>=',0);
|
---|
| 60 | switch self.coupling
|
---|
| 61 | case 0
|
---|
| 62 | case 1
|
---|
| 63 | md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1);
|
---|
| 64 | case 2
|
---|
| 65 | error('not implemented yet');
|
---|
| 66 | otherwise
|
---|
| 67 | error('not supported yet');
|
---|
| 68 | end
|
---|
| 69 | end % }}}
|
---|
| 70 | function disp(self) % {{{
|
---|
| 71 | disp('Coulomb limited sliding law parameters:');
|
---|
| 72 | disp(' ');
|
---|
| 73 | disp(' C^2 |u_b|^(m-1) * (.5*N) ');
|
---|
| 74 | disp(' tau_b = - _________________________________ u_b ');
|
---|
| 75 | disp(' (C^(2/m) |u_b| + (0.5*N)^(1/m) )^m ');
|
---|
| 76 | disp(' ');
|
---|
[25974] | 77 | fielddisplay(self,'C','friction coefficient [SI]');
|
---|
[25970] | 78 | fielddisplay(self,'m','m exponent (Weertman would be 1/3)');
|
---|
| 79 | fielddisplay(self,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]');
|
---|
| 80 | fielddisplay(self,'coupling','Coupling flag: 0 for default, 1 for forcing(provide md.friction.effective_pressure) and 2 for coupled (not implemented yet)');
|
---|
| 81 | fielddisplay(self,'effective_pressure_limit','Neff do not allow to fall below a certain limit: effective_pressure_limit*rho_ice*g*thickness (default 0)');
|
---|
| 82 | end % }}}
|
---|
| 83 | function marshall(self,prefix,md,fid) % {{{
|
---|
| 84 |
|
---|
| 85 | WriteData(fid,prefix,'name','md.friction.law','data',13,'format','Integer');
|
---|
[25974] | 86 | WriteData(fid,prefix,'object',self,'fieldname','C','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
|
---|
[25970] | 87 | WriteData(fid,prefix,'object',self,'fieldname','m','format','DoubleMat','mattype',2);
|
---|
| 88 | WriteData(fid,prefix,'class','friction','object',self,'fieldname','coupling','format','Integer');
|
---|
| 89 | WriteData(fid,prefix,'object',self,'class','friction','fieldname','effective_pressure_limit','format','Double');
|
---|
| 90 | switch self.coupling
|
---|
| 91 | case 0
|
---|
| 92 | case 1
|
---|
| 93 | WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
|
---|
| 94 | case 2
|
---|
| 95 | error('not implemented yet');
|
---|
| 96 | otherwise
|
---|
| 97 | error('not supported yet');
|
---|
| 98 | end
|
---|
| 99 |
|
---|
| 100 | end % }}}
|
---|
| 101 | end
|
---|
| 102 | end
|
---|