Changeset 8049
- Timestamp:
- Oct 22, 2010, 10:36:57 AM (14 years ago)
- Location:
- trunk/anuga_core/source/anuga/structures
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/structures/inlet.py
r8048 r8049 1 from anuga.geometry.polygon import inside_polygon, is_inside_polygon, poly gon_overlap, polyline_overlap1 from anuga.geometry.polygon import inside_polygon, is_inside_polygon, polyline_overlap 2 2 from anuga.config import velocity_protection, g 3 3 import math … … 43 43 44 44 if len(self.triangle_indices) == 0: 45 region = 'Inlet polyline=%s' % (self.polyline)46 msg = 'No triangles have been identified in region'45 msg = 'Inlet polyline=%s ' % (self.polyline) 46 msg += 'No triangles intersecting polyline ' 47 47 raise Exception, msg 48 48 49 49 self.enquiry_index = self.domain.get_triangle_containing_point(self.enquiry_pt) 50 50 51 if self.enquiry_index in self.triangle_indices: 52 msg = 'Enquiry point %s' % (self.enquiry_pt) 53 msg += 'is in an inlet triangle' 54 raise Exception, msg 51 55 52 56 def compute_area(self): … … 92 96 93 97 def get_average_elevation(self): 94 95 98 96 99 return num.sum(self.get_elevations()*self.get_areas())/self.area -
trunk/anuga_core/source/anuga/structures/structure_operator.py
r8048 r8049 83 83 self.driving_energy = 0.0 84 84 85 self.__create_exchange_poly gons()85 self.__create_exchange_polylines() 86 86 87 87 self.inlets = [] … … 194 194 195 195 196 def __create_exchange_poly gons(self):196 def __create_exchange_polylines(self): 197 197 198 198 """Create polylines at the end of a culvert inlet and outlet. … … 222 222 223 223 #gap = 1.5*h + self.enquiry_gap 224 gap = 1.5*self.culvert_vector + self.enquiry_gap224 gap = (self.apron+ self.enquiry_gap)*self.culvert_vector 225 225 226 226 self.inlet_polylines = [] 227 227 self.inlet_equiry_points = [] 228 228 229 # Build exchange poly gonand enquiry point229 # Build exchange polyline and enquiry point 230 230 for i in [0, 1]: 231 231 i0 = (2*i-1) #i0 determines the sign of the points … … 267 267 message += '\n' 268 268 269 message += 'poly gon\n'269 message += 'polyline\n' 270 270 message += '%s' % inlet.polyline 271 271 message += '\n'
Note: See TracChangeset
for help on using the changeset viewer.