source: issm/trunk-jpl/src/py3/classes/frictionshakti.py@ 23677

Last change on this file since 23677 was 23677, checked in by bdef, 6 years ago

CHG: adding missing directories and cleaning code

File size: 1.5 KB
Line 
1from fielddisplay import fielddisplay
2from project3d import project3d
3from checkfield import checkfield
4from WriteData import WriteData
5
6class frictionshakti(object):
7 """
8 FRICTIONSHAKTI class definition
9
10 Usage:
11 friction=frictionshakti()
12 """
13
14 def __init__(self,md): # {{{
15 self.coefficient = md.friction.coefficient
16 #set defaults
17 self.setdefaultparameters()
18
19 #}}}
20 def __repr__(self): # {{{
21 string="Basal shear stress parameters: Sigma_b = coefficient^2 * Neff * u_b\n(effective stress Neff=rho_ice*g*thickness+rho_water*g*(head-b))"
22
23 string="%s\n%s"%(string,fielddisplay(self,"coefficient","friction coefficient [SI]"))
24 return string
25 #}}}
26 def extrude(self,md): # {{{
27 self.coefficient=project3d(md,'vector',self.coefficient,'type','node','layer',1)
28 return self
29 #}}}
30 def setdefaultparameters(self): # {{{
31 return self
32 #}}}
33 def checkconsistency(self,md,solution,analyses): # {{{
34
35 #Early return
36 if 'StressbalanceAnalysis' not in analyses and 'ThermalAnalysis' not in analyses:
37 return md
38
39 md = checkfield(md,'fieldname','friction.coefficient','timeseries',1,'NaN',1,'Inf',1)
40 return md
41
42 # }}}
43 def marshall(self,prefix,md,fid): # {{{
44 yts=md.constants.yts
45 WriteData(fid,prefix,'name','md.friction.law','data',8,'format','Integer')
46 WriteData(fid,prefix,'object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
47 # }}}
Note: See TracBrowser for help on using the repository browser.