Changeset 7861


Ignore:
Timestamp:
Jun 18, 2010, 6:05:23 PM (10 years ago)
Author:
hudson
Message:

Fixed AABB parameter passing bug.

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

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/file/sww.py

    r7858 r7861  
    790790                outfile.variables[q][slice_index] = x
    791791                   
    792        
    793792                # This updates the _range values
    794793                q_range = outfile.variables[q + Write_sww.RANGE][:]
  • trunk/anuga_core/source/anuga/file_conversion/test_csv2sts.py

    r7853 r7861  
    11#external modules
    22import os
     3import sys
    34import unittest
    45import numpy as num
     
    7576        Make sure that the python file functions as a command-line tool.
    7677        """
    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       
    8082        os.system(cmd)
    8183        self._check_generated_sts()
  • trunk/anuga_core/source/anuga/geometry/aabb.py

    r7858 r7861  
    2424            ymax is maximum y (absolute coord, ie, not size)
    2525        """
    26         if not xmax:
     26        if xmax is None:
    2727            # try treating first arg as a list of points
    2828            try:
  • trunk/anuga_core/source/anuga/pmesh/test_meshquad.py

    r7751 r7861  
    22import numpy as num
    33
    4 from aabb import AABB
     4from anuga.geometry.aabb import AABB
    55from quad import Cell
    66from mesh_quadtree import MeshQuadtree
  • trunk/anuga_core/source/anuga/shallow_water/boundaries.py

    r7765 r7861  
    182182        return sea_level + normalized_amplitude/cosh(t-25)**2
    183183
    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)
    185186
    186187    Underlying domain must be specified when boundary is instantiated
     
    243244            x = float(value[0])
    244245
    245         ## import math
    246         ## if vol_id == 9433:
    247         ##     print 'vol_id = ',vol_id, ' edge_id = ',edge_id, 'q = ', q, ' x = ',x
    248         ##     print 'normal = ', normal
    249         ##     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 
    253246        q[0] = x
    254247        ndotq = (normal[0]*q[1] + normal[1]*q[2])
     
    398391        # Where v is velocity, n is manning's coefficient, h is depth
    399392        # 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)
    401395        # from which we can isolate depth to get
    402         # h = (mu n/sqrt(S) )^{3/5}
     396        #             h = (mu n/sqrt(S) )^{3/5}
    403397       
    404398        slope = 0 # get gradient for this triangle dot normal
    405399       
    406400        # get manning coef from this triangle
    407         friction = self.domain.get_quantity('friction').get_values(location='edges',
    408                                                                   indices=[vol_id])[0]
     401        friction = self.domain.get_quantity('friction').get_values(\
     402                    location='edges', indices=[vol_id])[0]
    409403        mannings_n = friction[edge_id]
    410404
    411405        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)
    413408        else:
    414409            depth = 1.0
     
    416411        # Elevation on this edge   
    417412       
    418         z = self.domain.get_quantity('elevation').get_values(location='edges',
    419                                                             indices=[vol_id])[0]
     413        z = self.domain.get_quantity('elevation').get_values(\
     414                    location='edges', indices=[vol_id])[0]
    420415        elevation = z[edge_id]
    421416           
Note: See TracChangeset for help on using the changeset viewer.