Changeset 8873
- Timestamp:
- May 22, 2013, 5:16:27 PM (11 years ago)
- Location:
- trunk/anuga_core/source/anuga
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/operators/run_set_elevation.py
r8872 r8873 104 104 #------------------------------------------------------------------------------ 105 105 106 from anuga.operators.set_elevation_operators import Circular_set_elevation_operator106 from anuga.operators.set_elevation_operators import Set_elevation_operator 107 107 108 op1 = Circular_set_elevation_operator(domain, elevation=pole, radius=0.5, center = (12.0,3.0))108 op1 = Set_elevation_operator(domain, elevation=pole, radius=0.5, center = (12.0,3.0)) 109 109 110 110 from anuga.operators.set_elevation_operators import Set_elevation -
trunk/anuga_core/source/anuga/structures/inlet.py
r8623 r8873 10 10 """ 11 11 12 def __init__(self, domain, line, verbose=False):12 def __init__(self, domain, poly, verbose=False): 13 13 14 14 self.domain = domain 15 15 self.domain_bounding_polygon = self.domain.get_boundary_polygon() 16 self. line = num.asarray(line, dtype=num.float64)16 self.poly = num.asarray(poly, dtype=num.float64) 17 17 self.verbose = verbose 18 19 self.line = True 20 if len(self.poly) > 2: 21 self.line = False 18 22 19 23 self.compute_triangle_indices() 20 24 self.compute_area() 21 self.compute_inlet_length()25 #self.compute_inlet_length() 22 26 23 27 … … 30 34 vertex_coordinates = self.domain.get_vertex_coordinates(absolute=True) 31 35 32 # Check that line lies within the mesh. 33 for point in self.line: 36 if self.line: # poly is a line 37 # Check that line lies within the mesh. 38 for point in self.poly: 34 39 msg = 'Point %s ' % str(point) 35 40 msg += ' did not fall within the domain boundary.' 36 41 assert is_inside_polygon(point, bounding_polygon), msg 37 42 38 39 40 self.triangle_indices = line_intersect(vertex_coordinates, self.line) 43 self.triangle_indices = line_intersect(vertex_coordinates, self.poly) 44 45 else: # poly is a polygon 46 47 self.triangle_indices = inside_polygon(domain_centroids, self.poly) 41 48 42 49 if len(self.triangle_indices) == 0: 43 msg = 'Inlet line=%s ' % (self.line)50 msg = 'Inlet poly=%s ' % (self.poly) 44 51 msg += 'No triangles intersecting line ' 45 52 raise Exception, msg 53 46 54 47 55 … … 66 74 67 75 68 def compute_inlet_length(self): 69 """ Compute the length of the inlet (as 70 defined by the input line 71 """ 72 73 point0 = self.line[0] 74 point1 = self.line[1] 75 76 self.inlet_length = anuga.geometry.polygon.line_length(self.line) 77 78 79 def get_inlet_length(self): 80 81 return self.inlet_length 82 83 def get_line(self): 84 85 return self.line 76 # def compute_inlet_length(self): 77 # """ Compute the length of the inlet (as 78 # defined by the input line 79 # """ 80 # 81 # self.inlet_length = anuga.geometry.polygon.line_length(self.poly) 82 83 84 # def get_inlet_length(self): 85 # 86 # return self.inlet_length 87 88 89 90 def get_poly(self): 91 92 return self.poly 86 93 87 94 def get_area(self): -
trunk/anuga_core/source/anuga/structures/inlet_enquiry.py
r8680 r8873 11 11 """ 12 12 13 def __init__(self, domain, polyline, enquiry_pt, outward_culvert_vector=None, verbose=False): 13 def __init__(self, 14 domain, 15 poly, 16 enquiry_pt, 17 invert_elevation = None, 18 outward_culvert_vector=None, 19 verbose=False): 20 """ 21 poly can be a line or a polygon 22 """ 14 23 15 24 16 inlet.Inlet.__init__(self, domain, polyline, verbose) 17 25 inlet.Inlet.__init__(self, domain, poly, verbose) 18 26 19 27 self.enquiry_pt = enquiry_pt 28 self.invert_elevation = invert_elevation 20 29 self.outward_culvert_vector = outward_culvert_vector 21 22 30 23 31 self.compute_enquiry_index() … … 78 86 79 87 88 def get_enquiry_invert_elevation(self): 89 90 if self.invert_elevation == None: 91 return self.get_enquiry_elevation() 92 else: 93 return self.invert_elevation 94 95 80 96 def get_enquiry_velocity(self): 81 97 -
trunk/anuga_core/source/anuga/structures/run_wide_bridge.py
r8851 r8873 48 48 domain = Domain(points, vertices, boundary) 49 49 domain.set_name('Test_WIDE_BRIDGE') # Output name 50 domain.set_default_order(2) 51 domain.H0 = 0.01 52 domain.tight_slope_limiters = 1 50 #domain.set_default_order(2) 51 #omain.H0 = 0.01 52 #domain.tight_slope_limiters = 1 53 54 domain.set_flow_algorithm('2_0') 53 55 54 56 print 'Size', len(domain) … … 184 186 culvert_width = 50.0/number_of_culverts 185 187 y = 100-i*culvert_width - culvert_width/2.0 186 ep0 = num.array([ 40.0, y])187 ep1 = num.array([5 0.0, y])188 ep0 = num.array([37.0, y]) 189 ep1 = num.array([53.0, y]) 188 190 culverts.append(anuga.Boyd_box_operator(domain, 189 191 losses=1.5, … … 255 257 for i, culvert in enumerate(culverts): 256 258 print 'culvert: ', i 257 print culvert. statistics()259 print culvert.timestepping_statistics() 258 260 259 261 -
trunk/anuga_core/source/anuga/structures/structure_operator.py
r8861 r8873 116 116 self.inlets = [] 117 117 line0 = self.exchange_lines[0] #self.inlet_lines[0] 118 if self.invert_elevations is None: 119 invert_elevation0 = None 120 else: 121 invert_elevation0 = self.invert_elevations[0] 122 118 123 enquiry_point0 = self.enquiry_points[0] 124 119 125 #outward_vector0 = - self.culvert_vector 120 self.inlets.append(inlet_enquiry.Inlet_enquiry(self.domain, line0, 121 enquiry_point0, self.outward_vector_0, self.verbose)) 126 self.inlets.append(inlet_enquiry.Inlet_enquiry( 127 self.domain, 128 line0, 129 enquiry_point0, 130 invert_elevation = invert_elevation0, 131 outward_culvert_vector = self.outward_vector_0, 132 verbose = self.verbose)) 133 134 122 135 123 136 line1 = self.exchange_lines[1] 137 if self.invert_elevations is None: 138 invert_elevation1 = None 139 else: 140 invert_elevation1 = self.invert_elevations[1] 124 141 enquiry_point1 = self.enquiry_points[1] 142 125 143 #outward_vector1 = - self.culvert_vector 126 self.inlets.append(inlet_enquiry.Inlet_enquiry(self.domain, line1, 127 enquiry_point1, self.outward_vector_1, self.verbose)) 144 self.inlets.append(inlet_enquiry.Inlet_enquiry( 145 self.domain, 146 line1, 147 enquiry_point1, 148 invert_elevation = invert_elevation1, 149 outward_culvert_vector = self.outward_vector_1, 150 verbose = self.verbose)) 128 151 129 152 self.set_logging(logging) 153 154 155 130 156 131 157 def __call__(self):
Note: See TracChangeset
for help on using the changeset viewer.