Changeset 7825
- Timestamp:
- Jun 11, 2010, 7:46:04 PM (14 years ago)
- Location:
- anuga_work/development/anuga_1d
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/anuga_1d/domain.py
r7793 r7825 661 661 662 662 663 #Do the expression stuff664 if kwargs.has_key('expression'):665 expression = kwargs['expression']666 del kwargs['expression']667 668 Q = self.create_quantity_from_expression(expression)669 kwargs['quantity'] = Q663 # #Do the expression stuff 664 # if kwargs.has_key('expression'): 665 # expression = kwargs['expression'] 666 # del kwargs['expression'] 667 # 668 # Q = self.create_quantity_from_expression(expression) 669 # kwargs['quantity'] = Q 670 670 671 671 #Assign values … … 1570 1570 for name in self.conserved_quantities: 1571 1571 Q = self.quantities[name] 1572 Q.explicit_update[: ] = 0.01572 Q.explicit_update[:,] = 0.0 1573 1573 1574 1574 for f in self.forcing_terms: -
anuga_work/development/anuga_1d/quantity.py
r7818 r7825 237 237 def set_values_from_constant(self,numeric): 238 238 239 self.vertex_values[: ] = numeric240 self.centroid_values[: ] = numeric239 self.vertex_values[:,:] = numeric 240 self.centroid_values[:,] = numeric 241 241 242 242 243 243 def set_values_from_array(self,numeric): 244 244 245 self.vertex_values[: ] = numeric245 self.vertex_values[:,:] = numeric 246 246 self.interpolate() 247 247 … … 249 249 def set_values_from_quantity(self,quantity): 250 250 251 self.vertex_values[: ] = quantity.vertex_values252 self.centroid_values[: ] = quantity.centroid_values251 self.vertex_values[:,:] = quantity.vertex_values 252 self.centroid_values[:,] = quantity.centroid_values 253 253 254 254 def set_values_from_function(self,function): 255 255 256 self.vertex_values[: ] = map(function, self.domain.vertices)257 self.centroid_values[: ] = map(function, self.domain.centroids)256 self.vertex_values[:,:] = map(function, self.domain.vertices) 257 self.centroid_values[:,] = map(function, self.domain.centroids) 258 258 259 259 … … 1097 1097 #backup_centroid_values(self) 1098 1098 1099 self.centroid_backup_values[: ] = (self.centroid_values).astype('f')1099 self.centroid_backup_values[:,] = (self.centroid_values).astype('f') 1100 1100 1101 1101 def saxpy_centroid_values(self,a,b): 1102 1102 # Call correct module function 1103 1103 # (either from this module or C-extension) 1104 self.centroid_values[: ] = (a*self.centroid_values + b*self.centroid_backup_values).astype('f')1104 self.centroid_values[:,] = (a*self.centroid_values + b*self.centroid_backup_values).astype('f') 1105 1105 1106 1106 -
anuga_work/development/anuga_1d/shallow_water_domain.py
r5832 r7825 412 412 for k in range(N): 413 413 414 flux[: ] = 0. #Reset work array414 flux[:,] = 0. #Reset work array 415 415 for i in range(2): 416 416 #Quantities inside volume facing neighbour i … … 507 507 for k in range(N): 508 508 509 flux[: ] = 0. #Reset work array509 flux[:,] = 0. #Reset work array 510 510 #for i in range(3): 511 511 for i in range(2): -
anuga_work/development/anuga_1d/shallow_water_vel_domain.py
r6042 r7825 264 264 uh_V = domain.quantities['xmomentum'].vertex_values 265 265 266 h_V[:] = w_V - z_V 266 #print w_V 267 #print z_V 268 269 h_V[:,:] = w_V - z_V 267 270 for i in range(len(h_C)): 268 271 for j in range(2): … … 275 278 w_V[i,(j+1)%2] = w_V[i,(j+1)%2] + dh 276 279 277 uh_V[: ] = u_V * h_V280 uh_V[:,:] = u_V * h_V 278 281 279 282 … … 341 344 uh_V = domain.quantities['xmomentum'].vertex_values 342 345 343 h_V[: ] = w_V - z_V346 h_V[:,:] = w_V - z_V 344 347 345 348 for i in range(len(h_C)): -
anuga_work/development/anuga_1d/test_quantity.py
r7818 r7825 578 578 #Set explicit_update 579 579 explicit_update = array( [4.,3.,2.,1.] ) 580 quantity.explicit_update[: ] = explicit_update580 quantity.explicit_update[:,] = explicit_update 581 581 582 582 #Set semi implicit update 583 583 semi_implicit_update = array( [1.,1.,1.,1.] ) 584 quantity.semi_implicit_update[: ] = semi_implicit_update584 quantity.semi_implicit_update[:,] = semi_implicit_update 585 585 586 586 #Update with given timestep -
anuga_work/development/anuga_1d/test_shallow_water_domain.py
r5844 r7825 275 275 for k in range(N): 276 276 277 flux[: ] = 0. #Reset work array277 flux[:,] = 0. #Reset work array 278 278 #for i in range(3): 279 279 for i in range(2): -
anuga_work/development/anuga_1d/test_shallow_water_vel_domain.py
r6042 r7825 114 114 domain.compute_fluxes() 115 115 116 print domain.quantities['stage'].vertex_values117 print domain.quantities['xmomentum'].vertex_values118 print domain.quantities['elevation'].vertex_values119 print domain.quantities['height'].vertex_values120 print domain.quantities['velocity'].vertex_values121 122 print domain.quantities['stage'].boundary_values123 print domain.quantities['xmomentum'].boundary_values124 print domain.quantities['elevation'].boundary_values125 print domain.quantities['height'].boundary_values126 print domain.quantities['velocity'].boundary_values116 # print domain.quantities['stage'].vertex_values 117 # print domain.quantities['xmomentum'].vertex_values 118 # print domain.quantities['elevation'].vertex_values 119 # print domain.quantities['height'].vertex_values 120 # print domain.quantities['velocity'].vertex_values 121 # 122 # print domain.quantities['stage'].boundary_values 123 # print domain.quantities['xmomentum'].boundary_values 124 # print domain.quantities['elevation'].boundary_values 125 # print domain.quantities['height'].boundary_values 126 # print domain.quantities['velocity'].boundary_values 127 127 128 128 print domain.quantities['stage'].explicit_update 129 129 print domain.quantities['xmomentum'].explicit_update 130 130 131 print stage_ud 131 132 print xmom_ud … … 343 344 for k in range(N): 344 345 345 flux[: ] = 0. #Reset work array346 flux[:,] = 0. #Reset work array 346 347 #for i in range(3): 347 348 for i in range(2):
Note: See TracChangeset
for help on using the changeset viewer.