Changeset 4095
- Timestamp:
- Dec 19, 2006, 3:30:43 PM (18 years ago)
- Location:
- anuga_core/source/anuga
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/geospatial_data/geospatial_data.py
r4061 r4095 610 610 def split(self, factor=0.5): 611 611 """Returns two geospatial_data object, first is size of the 'factor' 612 smaller the original oneand the second is the remainer. The two new612 smaller the original and the second is the remainer. The two new 613 613 object are disjoin set of each other. 614 614 -
anuga_core/source/anuga/utilities/polygon.py
r3803 r4095 732 732 return point 733 733 734 def number_mesh_triangles(interior_regions, bounding_poly, remainder_res): 735 """Calcalutes the approximate number of triangles inside the bounding polygon 736 and the other interior regions 737 FIXME: Add tests for this function 738 """ 739 import polygon_area 740 741 # TO DO check if any of the regions fall inside one another 742 no_triangles = 0.0 743 area = polygon_area(bounding_poly) 744 for i,j in interior_regions: 745 this_area = polygon_area(i) 746 no_triangles += this_area/j 747 area -= this_area 748 #convert to square Kms 749 print 'area of ',j, this_area/1000000., area/1000000. 750 no_triangles += area/remainder_res 751 return int(no_triangles/0.7) 752 734 753 735 754
Note: See TracChangeset
for help on using the changeset viewer.