Changeset 462
- Timestamp:
- Oct 28, 2004, 5:13:46 PM (20 years ago)
- Location:
- inundation/ga/storm_surge/pyvolution
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/domain.py
r459 r462 31 31 32 32 if other_quantities is None: 33 other_quantities = [] 33 self.other_quantities = [] 34 else: 35 self.other_quantities = other_quantities 36 34 37 35 38 #Build dictionary of Quantity instances keyed by quantity names 36 39 self.quantities = {} 40 41 #FIXME: remove later 37 42 for name in self.conserved_quantities: 38 43 self.quantities[name] = Conserved_quantity(self) 39 for name in other_quantities:44 for name in self.other_quantities: 40 45 self.quantities[name] = Quantity(self) 41 46 … … 139 144 """ 140 145 for key in quantity_dict.keys(): 141 self.set_quantity(key, quantity_dict[key], location='vertices')146 self.set_quantity(key, quantity_dict[key], location='vertices') 142 147 143 148 def set_quantity(self, name, X, location='vertices'): … … 157 162 """ 158 163 164 from quantity import Quantity, Conserved_quantity 165 166 #Create appropriate quantity object 167 ##if name in self.conserved_quantities: 168 ## self.quantities[name] = Conserved_quantity(self) 169 ##else: 170 ## self.quantities[name] = Quantity(self) 171 172 #Set value 159 173 self.quantities[name].set_values(X, location) 160 174 … … 247 261 248 262 263 #def set_defaults(self): 264 # """Set default values for uninitialised quantities. 265 # Should be overridden or specialised by specific modules 266 # """# 267 # 268 # for name in self.conserved_quantities + self.other_quantities: 269 # self.set_quantity(name, 0.0) 270 249 271 250 272 ########################### … … 267 289 from config import min_timestep, max_timestep, epsilon 268 290 291 292 ##self.set_defaults() 293 269 294 if yieldstep is None: 270 295 yieldstep = max_timestep 271 296 272 273 297 self.order = self.default_order 274 298 275 299 276 300 self.yieldtime = 0.0 #Time between 'yields' 277 301 -
inundation/ga/storm_surge/pyvolution/shallow_water.py
r458 r462 54 54 55 55 #Establish shortcuts to relevant quantities (for efficiency) 56 self.w = self.quantities['level']57 self.uh = self.quantities['xmomentum']58 self.vh = self.quantities['ymomentum']59 self.z = self.quantities['elevation']60 self.eta = self.quantities['friction']56 #self.w = self.quantities['level'] 57 #self.uh = self.quantities['xmomentum'] 58 #self.vh = self.quantities['ymomentum'] 59 #self.z = self.quantities['elevation'] 60 #self.eta = self.quantities['friction'] 61 61 62 62 def check_integrity(self): … … 99 99 #(either from this module or C-extension) 100 100 distribute_to_vertices_and_edges(self) 101 102 103 #FIXME: Under construction 104 # def set_defaults(self): 105 # """Set default values for uninitialised quantities. 106 # This is specific to the shallow water wave equation 107 # Defaults for 'elevation', 'friction', 'xmomentum' and 'ymomentum' 108 # are 0.0. Default for 'level' is whatever the value of 'elevation'. 109 # """ 110 111 # for name in self.other_quantities + self.conserved_quantities: 112 # print name 113 # print self.quantities.keys() 114 # if not self.quantities.has_key(name): 115 # if name == 'level': 116 117 # if self.quantities.has_key('elevation'): 118 # z = self.quantities['elevation'].vertex_values 119 # self.set_quantity(name, z) 120 # else: 121 # self.set_quantity(name, 0.0) 122 # else: 123 # self.set_quantity(name, 0.0) 124 125 126 127 # #Lift negative heights up 128 # #z = self.quantities['elevation'].vertex_values 129 # #w = self.quantities['level'].vertex_values 130 131 # #h = w-z 132 133 # #for k in range(h.shape[0]): 134 # # for i in range(3): 135 # # if h[k, i] < 0.0: 136 # # w[k, i] = z[k, i] 137 138 139 # #self.quantities['level'].interpolate() 140 101 141 102 142
Note: See TracChangeset
for help on using the changeset viewer.