- Timestamp:
- Dec 2, 2008, 9:46:45 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/anuga_1d/shallow_water_vel_domain.py
r5845 r6042 92 92 93 93 94 def set_quantities_to_be_stored(self, q):95 """Specify which quantities will be stored in the sww file.96 97 q must be either:98 - the name of a quantity99 - a list of quantity names100 - None101 102 In the two first cases, the named quantities will be stored at each103 yieldstep104 (This is in addition to the quantities elevation and friction)105 If q is None, storage will be switched off altogether.106 """107 108 109 if q is None:110 self.quantities_to_be_stored = []111 self.store = False112 return113 114 if isinstance(q, basestring):115 q = [q] # Turn argument into a list116 117 #Check correcness118 for quantity_name in q:119 msg = 'Quantity %s is not a valid conserved quantity' %quantity_name120 assert quantity_name in self.conserved_quantities, msg121 122 self.quantities_to_be_stored = q123 124 94 125 95 def check_integrity(self): … … 205 175 206 176 177 207 178 #-------------------------------------------------------------------------- 208 179 def distribute_to_vertices_and_edges_limit_w_u(domain): … … 255 226 256 227 #print id(h_C) 257 for i in range(N):258 h_C[i] = w_C[i] - z_C[i]259 if h_C[i] <= 1.0e-12:260 #print 'h_C[%d]= %15.5e\n' % (i,h_C[i])261 h_C[i] = 0.0262 w_C[i] = z_C[i]263 #uh_C[i] = 0.0228 ## for i in range(N): 229 ## h_C[i] = w_C[i] - z_C[i] 230 ## if h_C[i] <= 1.0e-12: 231 ## #print 'h_C[%d]= %15.5e\n' % (i,h_C[i]) 232 ## h_C[i] = 0.0 233 ## w_C[i] = z_C[i] 234 ## #uh_C[i] = 0.0 264 235 265 # u_C[i] = 0.0266 # else:267 # u_C[i] = uh_C[i]/h_C[i]236 ## # u_C[i] = 0.0 237 ## # else: 238 ## # u_C[i] = uh_C[i]/h_C[i] 268 239 269 240 h0 = 1.0e-12 270 for i in range(len(h_C)): 241 for i in range(N): 242 h_C[i] = w_C[i] - z_C[i] 271 243 if h_C[i] < 1.0e-12: 272 244 u_C[i] = 0.0 #Could have been negative 273 245 h_C[i] = 0.0 246 w_C[i] = z_C[i] 274 247 else: 275 u_C[i] = uh_C[i]/(h_C[i] + h0/h_C[i])276 #u_C[i] = uh_C[i]/h_C[i]248 #u_C[i] = uh_C[i]/(h_C[i] + h0/h_C[i]) 249 u_C[i] = uh_C[i]/h_C[i] 277 250 278 251 for name in [ 'velocity', 'stage' ]:
Note: See TracChangeset
for help on using the changeset viewer.