Changeset 22052
- Timestamp:
- 09/06/17 05:04:18 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/frictioncoulomb.py
r21591 r22052 17 17 self.p = float('NaN') 18 18 self.q = float('NaN') 19 19 self.coupling = 0 20 self.effective_pressure = float('NaN') 20 21 #set defaults 21 22 self.setdefaultparameters() … … 29 30 string="%s\n%s"%(string,fielddisplay(self,"p","p exponent")) 30 31 string="%s\n%s"%(string,fielddisplay(self,"q","q exponent")) 32 string="%s\n%s"%(string,fielddisplay(self,'coupling','Coupling flag: 0 for default, 1 for forcing(provide md.friction.effective_pressure) and 2 for coupled(not implemented yet)')) 33 string="%s\n%s"%(string,fielddisplay(self,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]')) 31 34 return string 32 35 #}}} … … 36 39 self.p=project3d(md,'vector',self.p,'type','element') 37 40 self.q=project3d(md,'vector',self.q,'type','element') 41 if self.coupling==1: 42 self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1) 43 elif self.coupling==2: 44 raise ValueError('coupling not supported yet') 45 elif self.coupling > 2: 46 raise ValueError('md.friction.coupling larger than 2, not supported yet') 38 47 return self 39 48 #}}} … … 51 60 md = checkfield(md,'fieldname','friction.q','NaN',1,'Inf',1,'size',[md.mesh.numberofelements]) 52 61 md = checkfield(md,'fieldname','friction.p','NaN',1,'Inf',1,'size',[md.mesh.numberofelements]) 62 if self.coupling==1: 63 md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1) 64 elif self.coupling==2: 65 raise ValueError('coupling not supported yet') 66 elif self.coupling > 2: 67 raise ValueError('md.friction.coupling larger than 2, not supported yet') 68 return md 53 69 54 return md55 70 # }}} 56 71 def marshall(self,prefix,md,fid): # {{{ … … 60 75 WriteData(fid,prefix,'object',self,'fieldname','p','format','DoubleMat','mattype',2) 61 76 WriteData(fid,prefix,'object',self,'fieldname','q','format','DoubleMat','mattype',2) 77 WriteData(fid,prefix,'class','friction','object',self,'fieldname','coupling','format','Integer') 78 if self.coupling==1: 79 WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts) 80 elif self.coupling==2: 81 raise ValueError('coupling not supported yet') 82 elif self.coupling > 2: 83 raise ValueError('md.friction.coupling larger than 2, not supported yet') 62 84 # }}}
Note:
See TracChangeset
for help on using the changeset viewer.