Changeset 21245
- Timestamp:
- 10/06/16 08:05:24 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/rifts.py
r21049 r21245 47 47 md.checkmessage("model should be processed for rifts (run meshprocessrifts)!") 48 48 for i,rift in enumerate(self.riftstruct): 49 md = checkfield(md,'fieldname',"rifts.riftstruct[%d]['fill']" % i,'values',['Water','Air','Ice','Melange' ])49 md = checkfield(md,'fieldname',"rifts.riftstruct[%d]['fill']" % i,'values',['Water','Air','Ice','Melange',0,1,2,3]) 50 50 else: 51 51 if self.riftstruct and numpy.any(numpy.logical_not(isnans(self.riftstruct))): … … 67 67 68 68 # Convert strings in riftstruct to hard coded numbers 69 for i,rift in enumerate(self.riftstruct): 70 if rift['fill'] == 'Air': 71 rift['fill'] = 0; 72 elif rift['fill'] == 'Ice': 73 rift['fill'] = 1; 74 elif rift['fill'] == 'Melange': 75 rift['fill'] = 2; 76 elif rift['fill'] == 'Water': 77 rift['fill'] = 3; 78 else: 79 error('Could not convert strings in riftstruct to integers for marshalling') 69 FillDict={'Air':0, 70 'Ice':1, 71 'Melange':2, 72 'Water':3} 73 for rift in self.riftstruct: 74 if rift['fill'] in ['Air','Ice','Melange','Water']: 75 rift['fill'] = FillDict[rift['fill']] 80 76 81 77 # 2 for nodes + 2 for elements+ 2 for normals + 1 for length + 1 for fill + 1 for friction + 1 for fraction + 1 for fractionincrement + 1 for state.
Note:
See TracChangeset
for help on using the changeset viewer.