Changeset 5918
- Timestamp:
- Nov 6, 2008, 5:18:31 PM (16 years ago)
- Location:
- anuga_core/source_numpy_conversion/anuga/culvert_flows
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source_numpy_conversion/anuga/culvert_flows/Test_Culvert_Flat_Water_Lev.py
r5868 r5918 25 25 26 26 from math import pi,pow,sqrt 27 from Numeric import choose, greater, ones, sin, exp, cosh 27 import numpy 28 29 28 30 #------------------------------------------------------------------------------ 29 31 # Setup computational domain … … 149 151 Br = Reflective_boundary(domain) # Solid reflective wall 150 152 Bo = Dirichlet_boundary([-5, 0, 0]) # Outflow 151 Btus = Time_boundary(domain, lambda t: [0.0+ 1.25*(1+ sin(2*pi*(t-4)/10)), 0.0, 0.0])152 Btds = Time_boundary(domain, lambda t: [0.0+ 0.75*(1+ sin(2*pi*(t-4)/20)), 0.0, 0.0])153 Btus = Time_boundary(domain, lambda t: [0.0+ 1.25*(1+numpy.sin(2*pi*(t-4)/10)), 0.0, 0.0]) 154 Btds = Time_boundary(domain, lambda t: [0.0+ 0.75*(1+numpy.sin(2*pi*(t-4)/20)), 0.0, 0.0]) 153 155 domain.set_boundary({'left': Btus, 'right': Btds, 'top': Br, 'bottom': Br}) 154 156 -
anuga_core/source_numpy_conversion/anuga/culvert_flows/culvert_class.py
r5777 r5918 5 5 from anuga.utilities.polygon import is_inside_polygon 6 6 from anuga.utilities.polygon import plot_polygons 7 8 7 9 8 … … 66 65 verbose=False): 67 66 68 from Numeric import sqrt, sum69 70 67 # Input check 71 68 if diameter is not None: … … 236 233 237 234 from anuga.config import g, epsilon 238 from Numeric import take, sqrt239 235 from anuga.config import velocity_protection 240 236 -
anuga_core/source_numpy_conversion/anuga/culvert_flows/culvert_polygons.py
r5585 r5918 4 4 # Import necessary modules 5 5 from math import sqrt 6 from Numeric import array, sum 6 import numpy 7 7 8 8 9 def create_culvert_polygons(end_point0, … … 54 55 dy = y1-y0 55 56 56 vector = array([dx, dy])57 length = sqrt( sum(vector**2))57 vector = numpy.array([dx, dy]) 58 length = sqrt(numpy.sum(vector**2)) 58 59 59 60 # Adjust polygon width to number of barrels in this culvert … … 63 64 # Unit direction vector and normal 64 65 vector /= length 65 normal = array([-dy, dx])/length66 normal = numpy.array([-dy, dx])/length 66 67 67 68 … … 76 77 p2 = p1 - h 77 78 p3 = p0 - h 78 culvert_polygons['exchange_polygon0'] = array([p0,p1,p2,p3])79 culvert_polygons['exchange_polygon0'] = numpy.array([p0,p1,p2,p3]) 79 80 80 81 … … 84 85 p2 = p1 + h 85 86 p3 = p0 + h 86 culvert_polygons['exchange_polygon1'] = array([p0,p1,p2,p3])87 culvert_polygons['exchange_polygon1'] = numpy.array([p0,p1,p2,p3]) 87 88 88 89 … … 98 99 p2 = p1 - h 99 100 p3 = p0 - h 100 culvert_polygons['enquiry_polygon0'] = array([p0,p1,p2,p3])101 culvert_polygons['enquiry_polygon0'] = numpy.array([p0,p1,p2,p3]) 101 102 102 103 # Build enquiry polygon 1 … … 105 106 p2 = p1 + h 106 107 p3 = p0 + h 107 culvert_polygons['enquiry_polygon1'] = array([p0,p1,p2,p3])108 culvert_polygons['enquiry_polygon1'] = numpy.array([p0,p1,p2,p3]) 108 109 109 110 # Return results
Note: See TracChangeset
for help on using the changeset viewer.