Changeset 23838
- Timestamp:
- 04/09/19 13:27:11 (7 years ago)
- Location:
- issm/trunk-jpl
- Files:
-
- 2 edited
-
src/m/classes/calvingvonmises.py (modified) (1 diff)
-
test/Par/Pig.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/calvingvonmises.py
r23824 r23838 5 5 6 6 class calvingvonmises(object): 7 """8 CALVINGVONMISES class definition7 """ 8 CALVINGVONMISES class definition 9 9 10 Usage:11 calvingvonmises=calvingvonmises()12 """10 Usage: 11 calvingvonmises=calvingvonmises() 12 """ 13 13 14 def __init__(self): # {{{14 def __init__(self): # {{{ 15 15 16 self.stress_threshold_groundedice = 0.17 self.stress_threshold_floatingice = 0.18 self.meltingrate = float('NaN')19 self.min_thickness = 0.16 self.stress_threshold_groundedice = 0. 17 self.stress_threshold_floatingice = 0. 18 self.meltingrate = float('NaN') 19 self.min_thickness = 0. 20 20 21 #set defaults22 self.setdefaultparameters()21 #set defaults 22 self.setdefaultparameters() 23 23 24 #}}}25 def __repr__(self): # {{{26 string=' Calving VonMises parameters:'27 string="%s\n%s"%(string,fielddisplay(self,'stress_threshold_groundedice','sigma_max applied to grounded ice only [Pa]'))28 string="%s\n%s"%(string,fielddisplay(self,'stress_threshold_floatingice','sigma_max applied to floating ice only [Pa]'))29 string="%s\n%s"%(string,fielddisplay(self,'min_thickness','minimum thickness below which no ice is allowed [m]'))24 #}}} 25 def __repr__(self): # {{{ 26 string=' Calving VonMises parameters:' 27 string="%s\n%s"%(string,fielddisplay(self,'stress_threshold_groundedice','sigma_max applied to grounded ice only [Pa]')) 28 string="%s\n%s"%(string,fielddisplay(self,'stress_threshold_floatingice','sigma_max applied to floating ice only [Pa]')) 29 string="%s\n%s"%(string,fielddisplay(self,'min_thickness','minimum thickness below which no ice is allowed [m]')) 30 30 31 return string32 #}}}33 def extrude(self,md): # {{{34 return self35 #}}}36 def setdefaultparameters(self): # {{{37 #Default sigma max38 self.stress_threshold_groundedice = 1e639 self.stress_threshold_floatingice = 150e331 return string 32 #}}} 33 def extrude(self,md): # {{{ 34 return self 35 #}}} 36 def setdefaultparameters(self): # {{{ 37 #Default sigma max 38 self.stress_threshold_groundedice = 1e6 39 self.stress_threshold_floatingice = 150e3 40 40 41 #turn off min_thickness by default.42 self.min_thickness=0.43 return self44 #}}}45 def checkconsistency(self,md,solution,analyses): # {{{46 #Early return47 if solution == 'TransientSolution' or md.transient.ismovingfront == 0:48 return41 #turn off min_thickness by default. 42 self.min_thickness=0. 43 return self 44 #}}} 45 def checkconsistency(self,md,solution,analyses): # {{{ 46 #Early return 47 if solution == 'TransientSolution' or md.transient.ismovingfront == 0: 48 return 49 49 50 md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,'nan',1,'Inf',1)51 md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'nan',1,'Inf',1)52 md = checkfield(md,'fieldname','calving.min_thickness','>=',0,'NaN',1,'Inf',1,'numel',[1]);50 md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,'nan',1,'Inf',1) 51 md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'nan',1,'Inf',1) 52 md = checkfield(md,'fieldname','calving.min_thickness','>=',0,'NaN',1,'Inf',1,'numel',[1]); 53 53 54 return md55 # }}}56 def marshall(self,prefix,md,fid): # {{{57 yts=md.constants.yts54 return md 55 # }}} 56 def marshall(self,prefix,md,fid): # {{{ 57 yts=md.constants.yts 58 58 59 WriteData(fid,prefix,'name','md.calving.law','data',2,'format','Integer')60 WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_groundedice','format','DoubleMat','mattype',1)61 WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_floatingice','format','DoubleMat','mattype',1)62 WriteData(fid,prefix,'object',self,'fieldname','min_thickness','format','Double');63 # }}}59 WriteData(fid,prefix,'name','md.calving.law','data',2,'format','Integer') 60 WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_groundedice','format','DoubleMat','mattype',1) 61 WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_floatingice','format','DoubleMat','mattype',1) 62 WriteData(fid,prefix,'object',self,'fieldname','min_thickness','format','Double'); 63 # }}} -
issm/trunk-jpl/test/Par/Pig.py
r23835 r23838 25 25 md.geometry.thickness=InterpFromMeshToMesh2d(index,x,y,thickness,md.mesh.x,md.mesh.y)[0][:,0] 26 26 md.geometry.base=md.geometry.surface-md.geometry.thickness 27 md.geometry.bed = md.geometry.base28 pos = np.where(md.mask.groundedice_levelset<0.) [0]29 md.geometry.bed[pos] =InterpFromMeshToMesh2d(index,x,y,bed,md.mesh.x[pos],md.mesh.y[pos]) 27 md.geometry.bed =numpy.array(md.geometry.base) 28 pos = np.where(md.mask.groundedice_levelset<0.) 29 md.geometry.bed[pos] =InterpFromMeshToMesh2d(index,x,y,bed,md.mesh.x[pos],md.mesh.y[pos])[0][:,0] 30 30 md.initialization.vx=md.inversion.vx_obs 31 31 md.initialization.vy=md.inversion.vy_obs
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/trac/issm/chrome/common/trac_banner.png)