[22267] | 1 | from fielddisplay import fielddisplay
|
---|
| 2 | from project3d import project3d
|
---|
| 3 | from checkfield import checkfield
|
---|
| 4 | from WriteData import WriteData
|
---|
| 5 |
|
---|
[23020] | 6 | class frictionshakti(object):
|
---|
[22267] | 7 | """
|
---|
[23020] | 8 | FRICTIONSHAKTI class definition
|
---|
[22267] | 9 |
|
---|
| 10 | Usage:
|
---|
[23020] | 11 | friction=frictionshakti()
|
---|
[22267] | 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 | # }}}
|
---|