Changeset 8251
Legend:
 Unmodified
 Added
 Removed

trunk/anuga_core/source/anuga/version.py
r6878 r8251 1 ## Subversion keywords: 2 3 author_string = '$Author$' 4 date_string = '$Date$' 5 revision_string = '$LastChangedRevision$' 1 #! /usr/bin/python 6 2 7 #$LastChangedDate$ 8 #$LastChangedRevision$ 9 #$LastChangedBy$ 3 # To change this template, choose Tools  Templates 4 # and open the template in the editor. 10 5 11 def get_version(): 12 """Extract version info from keyword strings 13 """ 14 15 pass 6 __author__="steve" 7 __date__ ="$18/11/2011 11:35:22 AM$" 8 9 if __name__ == "__main__": 10 import anuga 11 print 'Anuga version:',anuga.__version__ 
trunk/anuga_work/development/2010projects/anuga_1d/base/generic_domain.py
r7884 r8251 1059 1059 """ 1060 1060 1061 import numpy as np 1062 Stage = self.quantities['stage'] 1063 print 'w_ex_update', np.any(np.isnan(Stage.explicit_update)) 1061 1064 1062 1065 # Compute fluxes across each element edge 1063 1066 self.compute_fluxes() 1064 1067 1068 print 'w_ex_update', np.any(np.isnan(Stage.explicit_update)) 1069 1065 1070 # Update timestep to fit yieldstep and finaltime 1066 self.update_timestep(yieldstep, finaltime) 1071 self.update_timestep(yieldstep, finaltime) 1067 1072 1068 1073 # Update conserved quantities … … 1390 1395 1391 1396 1397 Stage = self.quantities['stage'] 1398 Xmom = self.quantities['xmomentum'] 1399 Bed = self.quantities['elevation'] 1400 Height = self.quantities['height'] 1401 Velocity = self.quantities['velocity'] 1402 1403 #Arrays 1404 w_C = Stage.centroid_values 1405 uh_C = Xmom.centroid_values 1406 z_C = Bed.centroid_values 1407 h_C = Height.centroid_values 1408 u_C = Velocity.centroid_values 1409 1410 import numpy as np 1411 print '== before forcing =======' 1412 print 'w_C', np.any(np.isnan(w_C)) 1413 print 'uh_C', np.any(np.isnan(uh_C)) 1414 print 'z_C', np.any(np.isnan(z_C)) 1415 print 'h_C', np.any(np.isnan(h_C)) 1416 print 'u_C', np.any(np.isnan(u_C)) 1417 print 'w_ex_update', np.any(np.isnan(Stage.explicit_update)) 1418 1392 1419 timestep = self.timestep 1420 1421 1393 1422 1394 1423 #Compute forcing terms 1395 1424 self.compute_forcing_terms() 1425 1426 print '==after forcing =======' 1427 print 'w_C', np.any(np.isnan(w_C)) 1428 print 'uh_C', np.any(np.isnan(uh_C)) 1429 print 'z_C', np.any(np.isnan(z_C)) 1430 print 'h_C', np.any(np.isnan(h_C)) 1431 print 'u_C', np.any(np.isnan(u_C)) 1432 print 'w_ex_update', np.any(np.isnan(Stage.explicit_update)) 1396 1433 1397 1434 #Update conserved_quantities … … 1400 1437 Q.update(timestep) 1401 1438 1402 1439 print '==after quantity update =======' 1440 print 'w_C', np.any(np.isnan(w_C)) 1441 print 'uh_C', np.any(np.isnan(uh_C)) 1442 print 'z_C', np.any(np.isnan(z_C)) 1443 print 'h_C', np.any(np.isnan(h_C)) 1444 print 'u_C', np.any(np.isnan(u_C)) 1445 print 'w_ex_update', np.any(np.isnan(Stage.explicit_update)) 1403 1446 1404 1447 if __name__ == "__main__": 
trunk/anuga_work/development/2010projects/anuga_1d/sww/sww_domain.py
r8225 r8251 90 90 self.quantities_to_be_stored = ['stage','xmomentum'] 91 91 92 92 self.__doc__ = 'sww_domain' 93 93 94 94 self.set_spatial_order(2) … … 166 166 167 167 168 169 170 168 def distribute_to_vertices_and_edges(self): 171 169 #Call correct module function 172 170 #(either from this module or Cextension) 173 171 distribute_to_vertices_and_edges(self) 172 174 173 175 174 def evolve(self, yieldstep = None, finaltime = None, duration = None, … … 223 222 224 223 import sys 224 import numpy as np 225 225 from anuga_1d.config import epsilon, h0 226 226 … … 240 240 h_C = Height.centroid_values 241 241 u_C = Velocity.centroid_values 242 243 w_V = domain.quantities['stage'].vertex_values 244 z_V = domain.quantities['elevation'].vertex_values 245 h_V = domain.quantities['height'].vertex_values 246 u_V = domain.quantities['velocity'].vertex_values 247 uh_V = domain.quantities['xmomentum'].vertex_values 248 249 250 # print 'w_C', np.any(np.isnan(w_C)) 251 # print 'uh_C', np.any(np.isnan(uh_C)) 252 # print 'z_C', np.any(np.isnan(z_C)) 253 # print 'h_C', np.any(np.isnan(h_C)) 254 # print 'u_C', np.any(np.isnan(u_C)) 255 # 256 # print 'w_V', np.any(np.isnan(w_V)) 257 # print 'uh_V', np.any(np.isnan(uh_V)) 258 # print 'z_V', np.any(np.isnan(z_V)) 259 # print 'h_V', np.any(np.isnan(h_V)) 260 # print 'u_V', np.any(np.isnan(u_V)) 242 261 243 262 #Calculate height (and fix negatives)better be nonnegative! … … 245 264 h_C[:] = w_C  z_C 246 265 247 #h0 = 1.0e12248 u_C[:] = uh_C/(h_C + h0/(h_C + 1.0e16))266 u_C[:] = numpy.where(h_C <= 1.0e14, 0.0, uh_C/h_C) 267 249 268 250 269 #print 'domain.order', domain.order … … 263 282 264 283 265 stage_V = domain.quantities['stage'].vertex_values 266 bed_V = domain.quantities['elevation'].vertex_values 267 h_V = domain.quantities['height'].vertex_values 268 u_V = domain.quantities['velocity'].vertex_values 269 xmom_V = domain.quantities['xmomentum'].vertex_values 270 271 h_V[:,:] = stage_V  bed_V 272 284 # print 'w_C', np.any(np.isnan(w_C)) 285 # print 'uh_C', np.any(np.isnan(uh_C)) 286 # print 'z_C', np.any(np.isnan(z_C)) 287 # print 'h_C', np.any(np.isnan(h_C)) 288 # print 'u_C', np.any(np.isnan(u_C)) 289 290 291 292 h_V[:,:] = w_V  z_V 273 293 274 294 #print 'any' ,numpy.any( h_V[:,0] < 0.0) … … 306 326 # 307 327 # 308 stage_V[:,:] = bed_V + h_V328 w_V[:,:] = z_V + h_V 309 329 #bed_V[:,:] = stage_V  h_V 310 xmom_V[:,:] = u_V * h_V 330 uh_V[:,:] = u_V * h_V 331 332 333 # print 'w_V', np.any(np.isnan(w_V)) 334 # print 'uh_V', np.any(np.isnan(uh_V)) 335 # print 'z_V', np.any(np.isnan(z_V)) 336 # print 'h_V', np.any(np.isnan(h_V)) 337 # print 'u_V', np.any(np.isnan(u_V)) 311 338 312 339 return
Note: See TracChangeset
for help on using the changeset viewer.