Ignore:
Timestamp:
Dec 2, 2008, 9:46:45 AM (16 years ago)
Author:
steve
Message:

Found bug associated with changing max_speed_array to an integer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/development/anuga_1d/shallow_water_vel_domain.py

    r5845 r6042  
    9292
    9393
    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 quantity
    99           - a list of quantity names
    100           - None
    101 
    102         In the two first cases, the named quantities will be stored at each
    103         yieldstep
    104         (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 = False
    112             return
    113 
    114         if isinstance(q, basestring):
    115             q = [q] # Turn argument into a list
    116 
    117         #Check correcness   
    118         for quantity_name in q:
    119             msg = 'Quantity %s is not a valid conserved quantity' %quantity_name
    120             assert quantity_name in self.conserved_quantities, msg
    121        
    122         self.quantities_to_be_stored = q
    123        
    12494
    12595    def check_integrity(self):
     
    205175
    206176
     177
    207178#--------------------------------------------------------------------------
    208179def distribute_to_vertices_and_edges_limit_w_u(domain):
     
    255226       
    256227    #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.0
    262             w_C[i] = z_C[i]
    263             #uh_C[i] = 0.0
     228##     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
    264235           
    265  #           u_C[i] = 0.0
    266  #       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]
    268239               
    269240    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]                                               
    271243        if h_C[i] < 1.0e-12:
    272244            u_C[i] = 0.0  #Could have been negative
    273245            h_C[i] = 0.0
     246            w_C[i] = z_C[i]
    274247        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]
    277250       
    278251    for name in [ 'velocity', 'stage' ]:
Note: See TracChangeset for help on using the changeset viewer.