Changeset 1043 for inundation/ga/storm_surge/pyvolution/domain.py
- Timestamp:
- Mar 8, 2005, 5:54:25 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/domain.py
r1036 r1043 253 253 254 254 self.boundary_objects = [] 255 self.boundary_map = boundary_map #Store for use with eg. boundary_stats. 255 256 256 257 #FIXME: Try to remove the sorting and fix test_mesh.py … … 316 317 self.number_of_first_order_steps) 317 318 319 def boundary_stats(self, quantities = None, tag = None): 320 """Output statistics about boundary forcing 321 322 323 """ 324 325 if quantities is None: 326 quantities = self.conserved_quantities 327 328 329 print 'Boundary values at time %.4f:' %self.time 330 for name in quantities: 331 q = self.quantities[name] 332 333 if tag is None: 334 #Take entire boundary 335 print ' Quantity %s: min = %12.8f, max = %12.8f'\ 336 %(name, min(q.boundary_values), max(q.boundary_values)) 337 else: 338 #Take only boundary associated with tag 339 maxval = minval = None 340 for i, ((vol_id, edge_id), B) in enumerate(self.boundary_objects): 341 if self.boundary[(vol_id, edge_id)] == tag: 342 v = q.boundary_values[i] 343 if minval is None or v < minval: minval = v 344 if maxval is None or v > maxval: maxval = v 345 346 if minval is None or maxval is None: 347 print 'Sorry no information about tag %s' %tag 348 else: 349 print ' Quantity %s, tag %s: min = %12.8f, max = %12.8f'\ 350 %(name, tag, minval, maxval) 351 352 353 354 355 356 357 358 359 318 360 319 361 def get_name(self):
Note: See TracChangeset
for help on using the changeset viewer.