Changeset 7976


Ignore:
Timestamp:
Aug 26, 2010, 10:50:36 AM (8 years ago)
Author:
habili
Message:

Clean up of code. Removed references to enquiry point.

Location:
trunk/anuga_core/source/anuga/structures
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/structures/culvert_operator.py

    r7975 r7976  
    1 import sys
    2 
    3 from anuga.shallow_water.forcing import Inflow, General_forcing
    4 from anuga.utilities.system_tools import log_to_file
    5 from anuga.geometry.polygon import inside_polygon, is_inside_polygon
    6 from anuga.geometry.polygon import plot_polygons, polygon_area
    7 
    8 from anuga.utilities.numerical_tools import mean
    9 from anuga.utilities.numerical_tools import ensure_numeric, sign
    10        
    11 from anuga.config import g, epsilon
    12 from anuga.config import minimum_allowed_height, velocity_protection       
     1from anuga.geometry.polygon import inside_polygon, polygon_area
     2from anuga.config import g
    133import anuga.utilities.log as log
    14 
    154import inlet
    16 
    175import numpy as num
    186import math
     
    3725                 end_point0=None,
    3826                 end_point1=None,
    39                  enquiry_gap_factor=0.2,
    4027                 width=None,
    4128                 height=None,
     
    4936
    5037        self.end_points = [end_point0, end_point1]
    51         self.enquiry_gap_factor = enquiry_gap_factor
    5238       
    5339        if height is None:
     
    5844       
    5945        self.verbose=verbose
    60         self.filename = None
    6146       
    6247        # Create the fundamental culvert polygons and create inlet objects
     
    6651        self.inlets = []
    6752        polygon0 = self.inlet_polygons[0]
    68         enquiry_pt0 = self.enquiry_points[0]
    6953        inlet0_vector = self.culvert_vector
    70         self.inlets.append(inlet.Inlet(self.domain, polygon0, enquiry_pt0, inlet0_vector))
     54        self.inlets.append(inlet.Inlet(self.domain, polygon0))
    7155
    7256        polygon1 = self.inlet_polygons[1]
    73         enquiry_pt1 = self.enquiry_points[1]
    7457        inlet1_vector = - self.culvert_vector
    75         self.inlets.append(inlet.Inlet(self.domain, polygon1, enquiry_pt1, inlet1_vector))
    76  
    77 
     58        self.inlets.append(inlet.Inlet(self.domain, polygon1))
    7859   
    7960        self.print_stats()
     
    146127        print 'Generic Culvert Operator'
    147128        print '====================================='
    148         print "enquiry_gap_factor"
    149         print self.enquiry_gap_factor
    150129       
    151130        for i, inlet in enumerate(self.inlets):
     
    161140            print inlet.polygon
    162141
    163             print 'enquiry_point'
    164             print inlet.enquiry_point
    165 
    166142        print '====================================='
    167143
     
    196172        h = self.height*self.culvert_vector    # Vector of length=height in the
    197173                             # direction of the culvert
    198         gap = (1 + self.enquiry_gap_factor)*h
    199174
    200175        self.inlet_polygons = []
    201         self.enquiry_points = []
    202176
    203177        # Build exchange polygon and enquiry points 0 and 1
     
    209183            p3 = p0 + i0*h
    210184            self.inlet_polygons.append(num.array([p0, p1, p2, p3]))
    211             self.enquiry_points.append(self.end_points[i] + i0*gap)
    212185
    213186        # Check that enquiry points are outside inlet polygons
     
    219192            area = polygon_area(polygon)
    220193           
    221 
    222194            msg = 'Polygon %s ' %(polygon)
    223195            msg += ' has area = %f' % area
    224196            assert area > 0.0, msg
    225 
    226             for j in [0,1]:
    227                 point = self.enquiry_points[j]
    228                 msg = 'Enquiry point falls inside a culvert polygon.'
    229 
    230                 assert not inside_polygon(point, polygon), msg
    231 
    232197   
    233198
  • trunk/anuga_core/source/anuga/structures/inlet.py

    r7975 r7976  
    1010    """
    1111
    12     def __init__(self, domain, polygon, enquiry_point, inlet_vector):
     12    def __init__(self, domain, polygon):
    1313
    1414        self.domain = domain
    1515        self.domain_bounding_polygon = self.domain.get_boundary_polygon()
    1616        self.polygon = polygon
    17         self.enquiry_point = enquiry_point
    18         self.inlet_vector = inlet_vector
    1917
    2018        # FIXME (SR) Using get_triangle_containing_point which needs to be sped up
    21         self.enquiry_index = self.domain.get_triangle_containing_point(self.enquiry_point)
    2219
    2320        self.compute_triangle_indices()
Note: See TracChangeset for help on using the changeset viewer.