Changeset 7824 for anuga_work/development/pipeflow/test_sww_vel_domain.py
 Timestamp:
 Jun 11, 2010, 7:45:03 PM (13 years ago)
 File:

 1 moved
Legend:
 Unmodified
 Added
 Removed

anuga_work/development/pipeflow/test_sww_vel_domain.py
r7823 r7824 5 5 6 6 7 from shallow_water_vel_domain import * 8 9 10 from Numeric import allclose, array, ones, Float, maximum, zeros 7 from sww_vel_domain import * 8 9 10 from numpy import allclose, array, ones, maximum, zeros 11 import numpy 11 12 12 13 … … 110 111 domain.update_boundary() 111 112 112 stage_ud, xmom_ud = local_compute_fluxes(domain) 113 import sww_python 114 stage_ud, xmom_ud = sww_python.compute_fluxes(domain) 113 115 114 116 domain.compute_fluxes() … … 126 128 # print domain.quantities['velocity'].boundary_values 127 129 128 print domain.quantities['stage'].explicit_update129 print domain.quantities['xmomentum'].explicit_update130 131 print stage_ud132 print xmom_ud133 130 134 131 assert allclose( domain.quantities['stage'].explicit_update, stage_ud ) … … 138 135 def test_local_flux_function(self): 139 136 normal = 1.0 140 ql = array([1.0, 2.0], Float)141 qr = array([1.0, 2.0], Float)137 ql = array([1.0, 2.0],numpy.float) 138 qr = array([1.0, 2.0],numpy.float) 142 139 zl = 0.0 143 140 zr = 0.0 144 141 145 142 #This assumes h0 = 1.0e3!! 146 edgeflux, maxspeed = local_flux_function(normal, ql,qr,zl,zr) 143 import sww_python 144 edgeflux, maxspeed = sww_python.flux_function(normal, ql,qr,zl,zr) 147 145 #print maxspeed 148 146 #print edgeflux 149 147 150 assert allclose( array([2.0, 8.9],Float), edgeflux, rtol=1.0e005)148 assert allclose([2.0, 8.9], edgeflux, rtol=1.0e005) 151 149 assert allclose(5.1305, maxspeed, rtol=1.0e005) 152 150 153 151 normal = 1.0 154 ql = array([1.0, 2.0], Float)155 qr = array([1.0, 2.0], Float)152 ql = array([1.0, 2.0],numpy.float) 153 qr = array([1.0, 2.0],numpy.float) 156 154 zl = 0.0 157 155 zr = 0.0 158 156 159 edgeflux, maxspeed = local_flux_function(normal, ql,qr,zl,zr)157 edgeflux, maxspeed = sww_python.flux_function(normal, ql,qr,zl,zr) 160 158 161 159 … … 163 161 #print edgeflux 164 162 165 assert allclose( array([2.0, 8.9],Float), edgeflux, rtol=1.0e005)163 assert allclose([2.0, 8.9], edgeflux, rtol=1.0e005) 166 164 assert allclose(5.1305, maxspeed, rtol=1.0e005) 167 165 … … 189 187 #print domain.quantities['xmomentum'].explicit_update 190 188 191 assert allclose( array([34.3, 24.5, 14.7], Float), domain.quantities['xmomentum'].explicit_update )189 assert allclose( [34.3, 24.5, 14.7], domain.quantities['xmomentum'].explicit_update ) 192 190 193 191
Note: See TracChangeset
for help on using the changeset viewer.