Changeset 5741 for anuga_work/development/shallow_water_1d_old/quantity.py
 Timestamp:
 Sep 5, 2008, 9:16:45 PM (15 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

anuga_work/development/shallow_water_1d_old/quantity.py
r4959 r5741 56 56 #Intialise centroid values 57 57 self.interpolate() 58 59 60 from Numeric import zeros, Float 61 62 #Allocate space for boundary values 63 #L = len(domain.boundary) 64 self.boundary_values = zeros(2, Float) #assumes no parrellism 65 66 #Allocate space for updates of conserved quantities by 67 #flux calculations and forcing functions 68 69 N = domain.number_of_elements 70 self.explicit_update = zeros(N, Float ) 71 self.semi_implicit_update = zeros(N, Float ) 72 73 self.gradients = zeros(N, Float) 74 self.qmax = zeros(self.centroid_values.shape, Float) 75 self.qmin = zeros(self.centroid_values.shape, Float) 76 77 self.beta = domain.beta 58 78 59 79 #Methods for operator overloading … … 381 401 return integral 382 402 383 class Conserved_quantity(Quantity):384 """Class conserved quantity adds to Quantity:385 386 storage and method for updating, and387 methods for extrapolation from centropid to vertices inluding388 gradients and limiters389 """390 391 def __init__(self, domain, vertex_values=None):392 Quantity.__init__(self, domain, vertex_values)393 394 from Numeric import zeros, Float395 396 #Allocate space for boundary values397 #L = len(domain.boundary)398 self.boundary_values = zeros(2, Float) #assumes no parrellism399 400 #Allocate space for updates of conserved quantities by401 #flux calculations and forcing functions402 403 N = domain.number_of_elements404 self.explicit_update = zeros(N, Float )405 self.semi_implicit_update = zeros(N, Float )406 407 self.gradients = zeros(N, Float)408 self.qmax = zeros(self.centroid_values.shape, Float)409 self.qmin = zeros(self.centroid_values.shape, Float)410 411 self.beta = domain.beta412 403 413 404 def update(self, timestep): … … 863 854 else: 864 855 qv[k,i] = qc[k] 856 857 858 class Conserved_quantity(Quantity): 859 """Class conserved quantity adds to Quantity: 860 861 storage and method for updating, and 862 methods for extrapolation from centropid to vertices inluding 863 gradients and limiters 864 """ 865 866 def __init__(self, domain, vertex_values=None): 867 Quantity.__init__(self, domain, vertex_values) 868 869 print "Use Quantity instead of Conserved_quantity" 870 865 871 866 872
Note: See TracChangeset
for help on using the changeset viewer.