- Timestamp:
- Nov 20, 2007, 5:38:57 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/abstract_2d_finite_volumes/domain.py
r4835 r4836 637 637 638 638 639 def timestepping_statistics(self, track_speeds=False): 639 def timestepping_statistics(self, 640 track_speeds=False, 641 triangle_id=None): 640 642 """Return string with time stepping statistics for printing or logging 641 643 642 644 Optional boolean keyword track_speeds decides whether to report 643 645 location of smallest timestep as well as a histogram and percentile 644 report. 646 report. 647 648 Optional keyword triangle_id can be used to specify a particular 649 triangle rather than the one with the largest speed. 645 650 """ 646 651 … … 716 721 717 722 # Find index of largest computed flux speed 718 k = self.k = argmax(self.max_speed) 723 if triangle_id is None: 724 k = self.k = argmax(self.max_speed) 725 else: 726 errmsg = 'Triangle_id %d does not exist in mesh: %s' %(triangle_id, 727 str(self)) 728 assert 0 <= triangle_id < len(self), errmsg 729 k = self.k = triangle_id 730 719 731 720 732 x, y = self.get_centroid_coordinates()[k] … … 725 737 msg += ' Triangle #%d with centroid (%.4f, %.4f), ' %(k, x, y) 726 738 msg += 'area = %.4f and radius = %.4f ' %(area, radius) 727 msg += 'had the largest computed speed: %.6f m/s ' %(max_speed) 728 msg += 'during last time interval. Quantities below ' 729 msg += 'are reported at their present value, and not what ' 730 msg += 'they were at the time the maximal speed was attained.' 731 msg += 'To see this, rerun the model with yieldsteps smaller ' 732 msg += 'than the smallest internal timestep reported.' 739 if triangle_id is None: 740 msg += 'had the largest computed speed: %.6f m/s ' %(max_speed) 741 else: 742 msg += 'had computed speed: %.6f m/s ' %(max_speed) 743 733 744 if max_speed > 0.0: 734 745 msg += '(timestep=%.6f)\n' %(radius/max_speed)
Note: See TracChangeset
for help on using the changeset viewer.