Changeset 8056 for trunk/anuga_core/source/anuga/structures/inlet.py
- Timestamp:
- Oct 29, 2010, 11:08:43 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/structures/inlet.py
r8050 r8056 1 from anuga.geometry.polygon import inside_polygon, is_inside_polygon, polyline_overlap1 from anuga.geometry.polygon import inside_polygon, is_inside_polygon, line_intersect 2 2 from anuga.config import velocity_protection, g 3 3 import math … … 9 9 """ 10 10 11 def __init__(self, domain, polyline, verbose=False):11 def __init__(self, domain, line, verbose=False): 12 12 13 13 self.domain = domain 14 14 self.domain_bounding_polygon = self.domain.get_boundary_polygon() 15 self. polyline = polyline15 self.line = line 16 16 self.verbose = verbose 17 17 … … 27 27 vertex_coordinates = self.domain.get_vertex_coordinates(absolute=True) 28 28 29 # Check that polyline lies within the mesh.30 for point in self. polyline:29 # Check that line lies within the mesh. 30 for point in self.line: 31 31 msg = 'Point %s ' % str(point) 32 32 msg += ' did not fall within the domain boundary.' … … 35 35 36 36 37 self.triangle_indices = polyline_overlap(vertex_coordinates, self.polyline)37 self.triangle_indices = line_intersect(vertex_coordinates, self.line) 38 38 39 39 if len(self.triangle_indices) == 0: 40 msg = 'Inlet polyline=%s ' % (self.polyline)41 msg += 'No triangles intersecting polyline '40 msg = 'Inlet line=%s ' % (self.line) 41 msg += 'No triangles intersecting line ' 42 42 raise Exception, msg 43 43 … … 47 47 48 48 # Compute inlet area as the sum of areas of triangles identified 49 # by polyline. Must be called after compute_inlet_triangle_indices().49 # by line. Must be called after compute_inlet_triangle_indices(). 50 50 if len(self.triangle_indices) == 0: 51 region = 'Inlet polyline=%s' % (self.inlet_polyline)51 region = 'Inlet line=%s' % (self.inlet_line) 52 52 msg = 'No triangles have been identified in region ' 53 53 raise Exception, msg
Note: See TracChangeset
for help on using the changeset viewer.