Changeset 7861
- Timestamp:
- Jun 18, 2010, 6:05:23 PM (14 years ago)
- Location:
- trunk/anuga_core/source/anuga
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/file/sww.py
r7858 r7861 790 790 outfile.variables[q][slice_index] = x 791 791 792 793 792 # This updates the _range values 794 793 q_range = outfile.variables[q + Write_sww.RANGE][:] -
trunk/anuga_core/source/anuga/file_conversion/test_csv2sts.py
r7853 r7861 1 1 #external modules 2 2 import os 3 import sys 3 4 import unittest 4 5 import numpy as num … … 75 76 Make sure that the python file functions as a command-line tool. 76 77 """ 77 cmd = 'python csv2sts.py --latitude ' + str(lat) + ' --lon ' + str(lon) 78 cmd += ' ' + testfile_csv + ' ' + sts_out 79 print cmd 78 79 cmd = 'python ' + sys.path[0] + os.sep +'csv2sts.py --latitude ' 80 cmd += '%s --lon %s %s %s' % (str(lat), str(lon), testfile_csv, sts_out) 81 80 82 os.system(cmd) 81 83 self._check_generated_sts() -
trunk/anuga_core/source/anuga/geometry/aabb.py
r7858 r7861 24 24 ymax is maximum y (absolute coord, ie, not size) 25 25 """ 26 if not xmax:26 if xmax is None: 27 27 # try treating first arg as a list of points 28 28 try: -
trunk/anuga_core/source/anuga/pmesh/test_meshquad.py
r7751 r7861 2 2 import numpy as num 3 3 4 from a abb import AABB4 from anuga.geometry.aabb import AABB 5 5 from quad import Cell 6 6 from mesh_quadtree import MeshQuadtree -
trunk/anuga_core/source/anuga/shallow_water/boundaries.py
r7765 r7861 182 182 return sea_level + normalized_amplitude/cosh(t-25)**2 183 183 184 Bts = Transmissive_n_momentum_zero_t_momentum_set_stage_boundary(domain, waveform) 184 Bts = Transmissive_n_momentum_zero_t_momentum_set_stage_boundary\ 185 (domain, waveform) 185 186 186 187 Underlying domain must be specified when boundary is instantiated … … 243 244 x = float(value[0]) 244 245 245 ## import math246 ## if vol_id == 9433:247 ## print 'vol_id = ',vol_id, ' edge_id = ',edge_id, 'q = ', q, ' x = ',x248 ## print 'normal = ', normal249 ## print 'n . p = ', (normal[0]*q[1] + normal[1]*q[2])250 ## print 't . p = ', (normal[1]*q[1] - normal[0]*q[2])251 252 253 246 q[0] = x 254 247 ndotq = (normal[0]*q[1] + normal[1]*q[2]) … … 398 391 # Where v is velocity, n is manning's coefficient, h is depth 399 392 # and S is the slope into the domain. 400 # Let mu be the momentum (vh), then this equation becomes: mu = 1/n h^{5/3} sqrt(S) 393 # Let mu be the momentum (vh), then this equation becomes: 394 # mu = 1/n h^{5/3} sqrt(S) 401 395 # from which we can isolate depth to get 402 # h = (mu n/sqrt(S) )^{3/5}396 # h = (mu n/sqrt(S) )^{3/5} 403 397 404 398 slope = 0 # get gradient for this triangle dot normal 405 399 406 400 # get manning coef from this triangle 407 friction = self.domain.get_quantity('friction').get_values( location='edges',408 401 friction = self.domain.get_quantity('friction').get_values(\ 402 location='edges', indices=[vol_id])[0] 409 403 mannings_n = friction[edge_id] 410 404 411 405 if slope > epsilon and mannings_n > epsilon: 412 depth = pow(self.average_momentum * mannings_n/math.sqrt(slope), 3.0/5) 406 depth = pow(self.average_momentum * mannings_n/math.sqrt(slope), \ 407 3.0/5) 413 408 else: 414 409 depth = 1.0 … … 416 411 # Elevation on this edge 417 412 418 z = self.domain.get_quantity('elevation').get_values( location='edges',419 413 z = self.domain.get_quantity('elevation').get_values(\ 414 location='edges', indices=[vol_id])[0] 420 415 elevation = z[edge_id] 421 416
Note: See TracChangeset
for help on using the changeset viewer.