# Changeset 8873

Ignore:
Timestamp:
May 22, 2013, 5:16:27 PM (10 years ago)
Message:

Location:
trunk/anuga_core/source/anuga
Files:
5 edited

Unmodified
Removed
• ## trunk/anuga_core/source/anuga/operators/run_set_elevation.py

 r8872 #------------------------------------------------------------------------------ from anuga.operators.set_elevation_operators import Circular_set_elevation_operator from anuga.operators.set_elevation_operators import Set_elevation_operator op1 = Circular_set_elevation_operator(domain, elevation=pole, radius=0.5, center = (12.0,3.0)) op1 = Set_elevation_operator(domain, elevation=pole, radius=0.5, center = (12.0,3.0)) from anuga.operators.set_elevation_operators import Set_elevation
• ## trunk/anuga_core/source/anuga/structures/inlet.py

 r8623 """ def __init__(self, domain, line, verbose=False): def __init__(self, domain, poly, verbose=False): self.domain = domain self.domain_bounding_polygon = self.domain.get_boundary_polygon() self.line = num.asarray(line, dtype=num.float64) self.poly = num.asarray(poly, dtype=num.float64) self.verbose = verbose self.line = True if len(self.poly) > 2: self.line = False self.compute_triangle_indices() self.compute_area() self.compute_inlet_length() #self.compute_inlet_length() vertex_coordinates = self.domain.get_vertex_coordinates(absolute=True) # Check that line lies within the mesh. for point in self.line: if self.line: # poly is a line # Check that line lies within the mesh. for point in self.poly: msg = 'Point %s ' %  str(point) msg += ' did not fall within the domain boundary.' assert is_inside_polygon(point, bounding_polygon), msg self.triangle_indices = line_intersect(vertex_coordinates, self.line) self.triangle_indices = line_intersect(vertex_coordinates, self.poly) else: # poly is a polygon self.triangle_indices = inside_polygon(domain_centroids, self.poly) if len(self.triangle_indices) == 0: msg = 'Inlet line=%s ' % (self.line) msg = 'Inlet poly=%s ' % (self.poly) msg += 'No triangles intersecting line ' raise Exception, msg def compute_inlet_length(self): """ Compute the length of the inlet (as defined by the input line """ point0 = self.line[0] point1 = self.line[1] self.inlet_length = anuga.geometry.polygon.line_length(self.line) def get_inlet_length(self): return self.inlet_length def get_line(self): return self.line #    def compute_inlet_length(self): #        """ Compute the length of the inlet (as #        defined by the input line #        """ # #        self.inlet_length = anuga.geometry.polygon.line_length(self.poly) #    def get_inlet_length(self): # #        return self.inlet_length def get_poly(self): return self.poly def get_area(self):
• ## trunk/anuga_core/source/anuga/structures/inlet_enquiry.py

 r8680 """ def __init__(self, domain, polyline, enquiry_pt, outward_culvert_vector=None, verbose=False): def __init__(self, domain, poly, enquiry_pt, invert_elevation = None, outward_culvert_vector=None, verbose=False): """ poly can be a line or a polygon """ inlet.Inlet.__init__(self, domain, polyline, verbose) inlet.Inlet.__init__(self, domain, poly, verbose) self.enquiry_pt = enquiry_pt self.invert_elevation = invert_elevation self.outward_culvert_vector = outward_culvert_vector self.compute_enquiry_index() def get_enquiry_invert_elevation(self): if  self.invert_elevation == None: return self.get_enquiry_elevation() else: return self.invert_elevation def get_enquiry_velocity(self):
• ## trunk/anuga_core/source/anuga/structures/run_wide_bridge.py

 r8851 domain = Domain(points, vertices, boundary) domain.set_name('Test_WIDE_BRIDGE')                 # Output name domain.set_default_order(2) domain.H0 = 0.01 domain.tight_slope_limiters = 1 #domain.set_default_order(2) #omain.H0 = 0.01 #domain.tight_slope_limiters = 1 domain.set_flow_algorithm('2_0') print 'Size', len(domain) culvert_width = 50.0/number_of_culverts y = 100-i*culvert_width - culvert_width/2.0 ep0 = num.array([40.0, y]) ep1 = num.array([50.0, y]) ep0 = num.array([37.0, y]) ep1 = num.array([53.0, y]) culverts.append(anuga.Boyd_box_operator(domain, losses=1.5, for i, culvert in enumerate(culverts): print 'culvert: ', i print culvert.statistics() print culvert.timestepping_statistics()
• ## trunk/anuga_core/source/anuga/structures/structure_operator.py

 r8861 self.inlets = [] line0 = self.exchange_lines[0] #self.inlet_lines[0] if self.invert_elevations is None: invert_elevation0 = None else: invert_elevation0 = self.invert_elevations[0] enquiry_point0 = self.enquiry_points[0] #outward_vector0 = - self.culvert_vector self.inlets.append(inlet_enquiry.Inlet_enquiry(self.domain, line0, enquiry_point0, self.outward_vector_0, self.verbose)) self.inlets.append(inlet_enquiry.Inlet_enquiry( self.domain, line0, enquiry_point0, invert_elevation = invert_elevation0, outward_culvert_vector = self.outward_vector_0, verbose = self.verbose)) line1 = self.exchange_lines[1] if self.invert_elevations is None: invert_elevation1 = None else: invert_elevation1 = self.invert_elevations[1] enquiry_point1 = self.enquiry_points[1] #outward_vector1  = - self.culvert_vector self.inlets.append(inlet_enquiry.Inlet_enquiry(self.domain, line1, enquiry_point1, self.outward_vector_1, self.verbose)) self.inlets.append(inlet_enquiry.Inlet_enquiry( self.domain, line1, enquiry_point1, invert_elevation = invert_elevation1, outward_culvert_vector = self.outward_vector_1, verbose = self.verbose)) self.set_logging(logging) def __call__(self):
Note: See TracChangeset for help on using the changeset viewer.