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

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

CHG: pyhton 3 migration (not opperational yet)

File size: 1.4 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 string="%s\n%s"%(string,fielddisplay(self,"coefficient","friction coefficient [SI]"))
23 return string
24 #}}}
25
26 def extrude(self,md): # {{{
27 self.coefficient=project3d(md,'vector',self.coefficient,'type','node','layer',1)
28 return self
29 #}}}
30
31 def setdefaultparameters(self): # {{{
32 return self
33 #}}}
34
35 def checkconsistency(self,md,solution,analyses): # {{{
36 #Early return
37 if 'StressbalanceAnalysis' not in analyses and 'ThermalAnalysis' not in analyses:
38 return md
39
40 md = checkfield(md,'fieldname','friction.coefficient','timeseries',1,'NaN',1,'Inf',1)
41 return md
42 # }}}
43
44 def marshall(self,prefix,md,fid): # {{{
45 yts=md.constants.yts
46 WriteData(fid,prefix,'name','md.friction.law','data',8,'format','Integer')
47 WriteData(fid,prefix,'object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
48 # }}}
Note: See TracBrowser for help on using the repository browser.