Ignore:
Timestamp:
Oct 29, 2010, 11:08:43 AM (13 years ago)
Author:
habili
Message:

The variables end_points, exchange_lines and enquiry_points are now all user defined. Either end_points or exchange_lines must be defined. Use example in test_boyd_box_operator.py

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_overlap
     1from anuga.geometry.polygon import inside_polygon, is_inside_polygon, line_intersect
    22from anuga.config import velocity_protection, g
    33import math
     
    99    """
    1010
    11     def __init__(self, domain, polyline, verbose=False):
     11    def __init__(self, domain, line, verbose=False):
    1212
    1313        self.domain = domain
    1414        self.domain_bounding_polygon = self.domain.get_boundary_polygon()
    15         self.polyline = polyline
     15        self.line = line
    1616        self.verbose = verbose
    1717
     
    2727        vertex_coordinates = self.domain.get_vertex_coordinates(absolute=True)
    2828
    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: 
    3131                msg = 'Point %s ' %  str(point)
    3232                msg += ' did not fall within the domain boundary.'
     
    3535
    3636
    37         self.triangle_indices = polyline_overlap(vertex_coordinates, self.polyline)
     37        self.triangle_indices = line_intersect(vertex_coordinates, self.line)
    3838
    3939        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 '
    4242            raise Exception, msg
    4343
     
    4747       
    4848        # 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().
    5050        if len(self.triangle_indices) == 0:
    51             region = 'Inlet polyline=%s' % (self.inlet_polyline)
     51            region = 'Inlet line=%s' % (self.inlet_line)
    5252            msg = 'No triangles have been identified in region '
    5353            raise Exception, msg
Note: See TracChangeset for help on using the changeset viewer.