Ignore:
Timestamp:
Jun 22, 2010, 12:04:32 PM (15 years ago)
Author:
James Hudson
Message:

More swb tests passing. Cleaned up some pylint errors.

Location:
trunk/anuga_core/source/anuga/shallow_water_balanced
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/shallow_water_balanced/test_swb_basic.py

    r7575 r7866  
    66import tempfile
    77
     8import anuga
     9
    810from anuga.config import g, epsilon
    911from anuga.config import netcdf_mode_r, netcdf_mode_w, netcdf_mode_a
    1012from anuga.utilities.numerical_tools import mean
    11 from anuga.utilities.polygon import is_inside_polygon
     13from anuga.geometry.polygon import is_inside_polygon
    1214from anuga.coordinate_transforms.geo_reference import Geo_reference
    1315from anuga.abstract_2d_finite_volumes.quantity import Quantity
     
    20852087        can be controlled this way.
    20862088        """
    2087 
    2088         #---------------------------------------------------------------------
    2089         # Import necessary modules
    2090         #---------------------------------------------------------------------
    2091         from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular_cross
    2092         from anuga.shallow_water import Domain
    2093         from anuga.shallow_water import Reflective_boundary
    2094         from anuga.shallow_water import Dirichlet_boundary
    2095         from anuga.shallow_water import Time_boundary
    2096 
     2089       
    20972090        #---------------------------------------------------------------------
    20982091        # Setup computational domain
     
    21082101                                                       len1=length,
    21092102                                                       len2=width)
    2110         domain = Domain(points, vertices, boundary)
     2103        domain = anuga.Domain(points, vertices, boundary)
    21112104        domain.set_name('channel_variable_test')  # Output name
    21122105        domain.set_quantities_to_be_stored({'elevation': 2,
  • trunk/anuga_core/source/anuga/shallow_water_balanced/test_swb_boundary_condition.py

    r7616 r7866  
    99from anuga.config import netcdf_mode_r, netcdf_mode_w, netcdf_mode_a
    1010from anuga.utilities.numerical_tools import mean
    11 from anuga.utilities.polygon import is_inside_polygon
     11from anuga.geometry.polygon import is_inside_polygon
    1212from anuga.coordinate_transforms.geo_reference import Geo_reference
    1313from anuga.abstract_2d_finite_volumes.quantity import Quantity
  • trunk/anuga_core/source/anuga/shallow_water_balanced/test_swb_conservation.py

    r7733 r7866  
    66import tempfile
    77
     8import anuga
     9
    810from anuga.config import g, epsilon
    911from anuga.config import netcdf_mode_r, netcdf_mode_w, netcdf_mode_a
    1012from anuga.utilities.numerical_tools import mean
    11 from anuga.utilities.polygon import is_inside_polygon
     13from anuga.geometry.polygon import is_inside_polygon
    1214from anuga.coordinate_transforms.geo_reference import Geo_reference
    1315from anuga.abstract_2d_finite_volumes.quantity import Quantity
     
    6062
    6163        # Boundary conditions (reflective everywhere)
    62         Br = Reflective_boundary(domain)
     64        Br = anuga.Reflective_boundary(domain)
    6365        domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br})
    6466
     
    8890        """
    8991
    90         from mesh_factory import rectangular
    91 
    9292        # Create basic mesh
    93         points, vertices, boundary = rectangular(6, 6)
     93        points, vertices, boundary = anuga.rectangular(6, 6)
    9494
    9595        # Create shallow water domain
    96         domain = Domain(points, vertices, boundary)
     96        domain = anuga.Domain(points, vertices, boundary)
    9797        domain.smooth = False
    9898        domain.default_order = 2
     
    107107
    108108        # Boundary conditions (reflective everywhere)
    109         Br = Reflective_boundary(domain)
     109        Br = anuga.Reflective_boundary(domain)
    110110        domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br})
    111111
     
    140140
    141141        # Create shallow water domain
    142         domain = Domain(points, vertices, boundary)
     142        domain = anuga.Domain(points, vertices, boundary)
    143143        domain.smooth = False
    144144
     
    163163
    164164        # Boundary conditions (reflective everywhere)
    165         Br = Reflective_boundary(domain)
     165        Br = anuga.Reflective_boundary(domain)
    166166        domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br})
    167167
     
    200200        """
    201201
    202         from mesh_factory import rectangular
    203 
    204202        # Create basic mesh
    205         points, vertices, boundary = rectangular(6, 6)
     203        points, vertices, boundary = anuga.rectangular(6, 6)
    206204
    207205        # Create shallow water domain
    208         domain = Domain(points, vertices, boundary)
     206        domain = anuga.Domain(points, vertices, boundary)
    209207        domain.smooth = False
    210208        domain.default_order = 2
     
    232230
    233231        # Boundary conditions (reflective everywhere)
    234         Br = Reflective_boundary(domain)
     232        Br = anuga.Reflective_boundary(domain)
    235233        domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br})
    236234
     
    271269        """
    272270
    273         from mesh_factory import rectangular
    274 
    275271        # Create basic mesh
    276         points, vertices, boundary = rectangular(6, 6)
     272        points, vertices, boundary = anuga.rectangular(6, 6)
    277273
    278274        # Create shallow water domain
    279         domain = Domain(points, vertices, boundary)
     275        domain = anuga.Domain(points, vertices, boundary)
    280276        domain.smooth = False
    281277        domain.default_order = 2
     
    290286
    291287        # Boundary conditions (reflective everywhere)
    292         Br = Reflective_boundary(domain)
    293         Bleft = Dirichlet_boundary([0.5, 0, 0])
    294         Bright = Dirichlet_boundary([0.1, 0, 0])
     288        Br = anuga.Reflective_boundary(domain)
     289        Bleft = anuga.Dirichlet_boundary([0.5, 0, 0])
     290        Bright = anuga.Dirichlet_boundary([0.1, 0, 0])
    295291        domain.set_boundary({'left': Bleft, 'right': Bright,
    296292                             'top': Br, 'bottom': Br})
     
    362358
    363359        # Boundaries
    364         R = Reflective_boundary(domain)
     360        R = anuga.Reflective_boundary(domain)
    365361        domain.set_boundary({'left': R, 'right': R, 'top':R, 'bottom': R})
    366362
     
    384380        Test that total volume can be computed correctly
    385381        """           
    386 
    387         #----------------------------------------------------------------------
    388         # Import necessary modules
    389         #----------------------------------------------------------------------
    390         from anuga.abstract_2d_finite_volumes.mesh_factory \
    391                 import rectangular_cross
    392         from anuga.shallow_water import Domain
    393382
    394383        #----------------------------------------------------------------------
     
    449438        verbose = False
    450439
    451         #----------------------------------------------------------------------
    452         # Import necessary modules
    453         #----------------------------------------------------------------------
    454 
    455         from anuga.abstract_2d_finite_volumes.mesh_factory \
    456                 import rectangular_cross
    457         from anuga.shallow_water import Domain
    458         from anuga.shallow_water.shallow_water_domain import Reflective_boundary
    459         from anuga.shallow_water.shallow_water_domain import Dirichlet_boundary
    460         from anuga.shallow_water.forcing import Inflow
    461         from anuga.shallow_water.data_manager \
    462                 import get_flow_through_cross_section
     440
    463441
    464442        #----------------------------------------------------------------------
     
    500478        #----------------------------------------------------------------------
    501479
    502         Br = Reflective_boundary(domain)      # Solid reflective wall
     480        Br = anuga.Reflective_boundary(domain)      # Solid reflective wall
    503481               
    504482        # Constant flow in and out of domain
    505483        # Depth = 1m, uh=1 m/s, i.e. a flow of 20 m^3/s
    506         Bi = Dirichlet_boundary([d, uh, vh])
    507         Bo = Dirichlet_boundary([d, uh, vh])
     484        Bi = anuga.Dirichlet_boundary([d, uh, vh])
     485        Bo = anuga.Dirichlet_boundary([d, uh, vh])
    508486
    509487        domain.set_boundary({'left': Bi, 'right': Bo, 'top': Br, 'bottom': Br})
     
    544522       
    545523
    546         #---------------------------------------------------------------------
    547         # Import necessary modules
    548         #---------------------------------------------------------------------
    549         from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular_cross
    550         from anuga.shallow_water import Domain
    551         from anuga.shallow_water.shallow_water_domain import Reflective_boundary
    552         from anuga.shallow_water.shallow_water_domain import Dirichlet_boundary
    553         from anuga.shallow_water.forcing import Inflow
    554         from anuga.shallow_water.data_manager import get_flow_through_cross_section
    555 
    556524        #----------------------------------------------------------------------
    557525        # Setup computational domain
     
    569537
    570538
    571         domain = Domain(points, vertices, boundary)   
     539        domain = anuga.Domain(points, vertices, boundary)   
    572540        domain.set_name('Inflow_volume_test')              # Output name
    573541               
     
    593561
    594562        # Fixed Flowrate onto Area
    595         fixed_inflow = Inflow(domain,
     563        fixed_inflow = anuga.Inflow(domain,
    596564                              center=(10.0, 10.0),
    597565                              radius=5.00,
     
    604572        #----------------------------------------------------------------------
    605573
    606         Br = Reflective_boundary(domain) # Solid reflective wall
     574        Br = anuga.Reflective_boundary(domain) # Solid reflective wall
    607575        domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br})
    608576
     
    646614       
    647615
    648         #---------------------------------------------------------------------
    649         # Import necessary modules
    650         #---------------------------------------------------------------------
    651         from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular_cross
    652         from anuga.shallow_water import Domain
    653         from anuga.shallow_water.shallow_water_domain import Reflective_boundary
    654         from anuga.shallow_water.shallow_water_domain import Dirichlet_boundary
    655         from anuga.shallow_water.shallow_water_domain import Rainfall
    656         from anuga.shallow_water.data_manager import get_flow_through_cross_section
    657 
    658616        #----------------------------------------------------------------------
    659617        # Setup computational domain
     
    666624       
    667625
    668         points, vertices, boundary = rectangular_cross(int(length/dx),
     626        points, vertices, boundary = anuga.rectangular_cross(int(length/dx),
    669627                                                       int(width/dy),
    670628                                                       len1=length, len2=width)
    671629
    672630
    673         domain = Domain(points, vertices, boundary)   
     631        domain = anuga.Domain(points, vertices, boundary)   
    674632        domain.set_name('Rain_volume_test')              # Output name
    675633               
     
    695653
    696654        # Fixed rain onto small circular area
    697         fixed_rain = Rainfall(domain,
     655        fixed_rain = anuga.Rainfall(domain,
    698656                              center=(10.0, 10.0),
    699657                              radius=5.00,
     
    706664        #----------------------------------------------------------------------
    707665
    708         Br = Reflective_boundary(domain) # Solid reflective wall
     666        Br = anuga.Reflective_boundary(domain) # Solid reflective wall
    709667        domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br})
    710668
     
    755713       
    756714
    757         #---------------------------------------------------------------------
    758         # Import necessary modules
    759         #---------------------------------------------------------------------
    760         from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular_cross
    761         from anuga.shallow_water import Domain
    762         from anuga.shallow_water.shallow_water_domain import Reflective_boundary
    763         from anuga.shallow_water.shallow_water_domain import Dirichlet_boundary
    764         from anuga.shallow_water.shallow_water_domain import Rainfall
    765         from anuga.shallow_water.data_manager import get_flow_through_cross_section
    766 
    767715        #----------------------------------------------------------------------
    768716        # Setup computational domain
     
    815763        #----------------------------------------------------------------------
    816764
    817         Br = Reflective_boundary(domain) # Solid reflective wall
    818         Bt = Transmissive_stage_zero_momentum_boundary(domain)
    819         Bd = Dirichlet_boundary([-10, 0, 0])
     765        Br = anuga.Reflective_boundary(domain) # Solid reflective wall
     766        Bt = anuga.Transmissive_stage_zero_momentum_boundary(domain)
     767        Bd = anuga.Dirichlet_boundary([-10, 0, 0])
    820768        domain.set_boundary({'left': Bt, 'right': Bd, 'top': Bt, 'bottom': Bt})
    821769
  • trunk/anuga_core/source/anuga/shallow_water_balanced/test_swb_cross_sections.py

    r7559 r7866  
    66import tempfile
    77
     8import anuga
     9
    810from anuga.config import g, epsilon
    911from anuga.config import netcdf_mode_r, netcdf_mode_w, netcdf_mode_a
    1012from anuga.utilities.numerical_tools import mean
    11 from anuga.utilities.polygon import is_inside_polygon
     13from anuga.geometry.polygon import is_inside_polygon
    1214from anuga.coordinate_transforms.geo_reference import Geo_reference
    13 from anuga.abstract_2d_finite_volumes.quantity import Quantity
    14 from anuga.geospatial_data.geospatial_data import Geospatial_data
    15 from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular_cross
    1615
    1716from anuga.utilities.system_tools import get_pathname_from_package
     
    7675        uh = u*h
    7776
    78         Br = Reflective_boundary(domain)     # Side walls
    79         Bd = Dirichlet_boundary([w, uh, 0])  # 2 m/s across the 3 m inlet:
     77        Br = anuga.Reflective_boundary(domain)     # Side walls
     78        Bd = anuga.Dirichlet_boundary([w, uh, 0])  # 2 m/s across the 3 m inlet:
    8079
    8180
     
    161160        uh = u*h
    162161
    163         Br = Reflective_boundary(domain)       # Side walls
    164         Bd = Dirichlet_boundary([w, uh, 0])    # 2 m/s across the 3 m inlet:
     162        Br = anuga.Reflective_boundary(domain)     # Side walls
     163        Bd = anuga.Dirichlet_boundary([w, uh, 0])  # 2 m/s across the 3 m inlet:
    165164
    166165        # Initial conditions
     
    252251        uh = u*h
    253252
    254         Br = Reflective_boundary(domain)       # Side walls
    255         Bd = Dirichlet_boundary([w, uh, 0])    # 2 m/s across the 3 m inlet:
     253        Br = anuga.Reflective_boundary(domain)     # Side walls
     254        Bd = anuga.Dirichlet_boundary([w, uh, 0])  # 2 m/s across the 3 m inlet:
    256255
    257256        # Initial conditions
  • trunk/anuga_core/source/anuga/shallow_water_balanced/test_swb_distribute.py

    r7573 r7866  
    99from anuga.config import netcdf_mode_r, netcdf_mode_w, netcdf_mode_a
    1010from anuga.utilities.numerical_tools import mean
    11 from anuga.utilities.polygon import is_inside_polygon
     11from anuga.geometry.polygon import is_inside_polygon
    1212from anuga.coordinate_transforms.geo_reference import Geo_reference
    1313from anuga.abstract_2d_finite_volumes.quantity import Quantity
  • trunk/anuga_core/source/anuga/shallow_water_balanced/test_swb_forcing_terms.py

    r7733 r7866  
    55from math import pi, sqrt
    66import tempfile
     7import anuga
    78
    89from anuga.config import g, epsilon
    910from anuga.config import netcdf_mode_r, netcdf_mode_w, netcdf_mode_a
    1011from anuga.utilities.numerical_tools import mean
    11 from anuga.utilities.polygon import is_inside_polygon
     12from anuga.geometry.polygon import is_inside_polygon
    1213from anuga.coordinate_transforms.geo_reference import Geo_reference
    1314from anuga.abstract_2d_finite_volumes.quantity import Quantity
     
    394395        vertices = [[1,0,2], [1,2,4], [4,2,5], [3,1,4]]
    395396
    396         domain = Domain(points, vertices)
     397        domain = anuga.Domain(points, vertices)
    397398
    398399        #Flat surface with 1m of water
     
    401402        domain.set_quantity('friction', 0)
    402403
    403         Br = Reflective_boundary(domain)
     404        Br = anuga.Reflective_boundary(domain)
    404405        domain.set_boundary({'exterior': Br})
    405406
     
    408409        phi = 135
    409410        domain.forcing_terms = []
    410         domain.forcing_terms.append(Wind_stress(s, phi))
     411        domain.forcing_terms.append(anuga.Wind_stress(s, phi))
    411412
    412413        domain.compute_forcing_terms()
     
    450451        domain.set_quantity('friction', 0)
    451452
    452         Br = Reflective_boundary(domain)
     453        Br = anuga.Reflective_boundary(domain)
    453454        domain.set_boundary({'exterior': Br})
    454455
     
    459460        phi = 135
    460461        domain.forcing_terms = []
    461         domain.forcing_terms.append(Wind_stress(s=speed, phi=angle))
     462        domain.forcing_terms.append(anuga.Wind_stress(s=speed, phi=angle))
    462463
    463464        domain.compute_forcing_terms()
     
    522523        domain.set_quantity('friction', 0)
    523524
    524         Br = Reflective_boundary(domain)
     525        Br = anuga.Reflective_boundary(domain)
    525526        domain.set_boundary({'exterior': Br})
    526527
     
    543544        fid.close()
    544545
    545         # Convert ASCII file to NetCDF (Which is what we really like!)
    546         from data_manager import timefile2netcdf
    547 
    548         timefile2netcdf(filename)
     546        anuga.timefile2netcdf(filename+'.txt', filename+'.tms')
    549547        os.remove(filename + '.txt')
    550548
     
    616614        domain.set_quantity('friction', 0)
    617615
    618         Br = Reflective_boundary(domain)
     616        Br = anuga.Reflective_boundary(domain)
    619617        domain.set_boundary({'exterior': Br})
    620618
     
    623621        # Write wind stress file (ensure that domain.time is covered)
    624622        # Take x=1 and y=0
    625         filename = 'test_windstress_from_file'
     623        filename = 'test_windstress_from_file.txt'
     624        file_out = 'test_windstress_from_file.tms'
    626625        start = time.mktime(time.strptime('2000', '%Y'))
    627         fid = open(filename + '.txt', 'w')
     626        fid = open(filename, 'w')
    628627        dt = 0.5    # Half second interval
    629628        t = 0.0
     
    635634        fid.close()
    636635
    637         # Convert ASCII file to NetCDF (Which is what we really like!)
    638         from data_manager import timefile2netcdf
    639 
    640         timefile2netcdf(filename, time_as_seconds=True)
    641         os.remove(filename + '.txt')
     636        anuga.timefile2netcdf(filename, file_out, time_as_seconds=True)
     637        os.remove(filename)
    642638
    643639        # Setup wind stress
    644         F = file_function(filename + '.tms',
     640        F = file_function(file_out,
    645641                          quantities=['Attribute0', 'Attribute1'])
    646         os.remove(filename + '.tms')
    647 
    648         W = Wind_stress(F)
     642        os.remove(file_out)
     643
     644        W = anuga.Wind_stress(F)
    649645
    650646        domain.forcing_terms = []
     
    709705        domain.set_quantity('friction', 0)
    710706
    711         Br = Reflective_boundary(domain)
     707        Br = anuga.Reflective_boundary(domain)
    712708        domain.set_boundary({'exterior': Br})
    713709
     
    718714
    719715        try:
    720             domain.forcing_terms.append(Wind_stress(s=scalar_func_list,
     716            domain.forcing_terms.append(anuga.Wind_stress(s=scalar_func_list,
    721717                                                    phi=angle))
    722718        except AssertionError:
     
    763759        domain.set_quantity('friction', 0)
    764760
    765         Br = Reflective_boundary(domain)
     761        Br = anuga.Reflective_boundary(domain)
    766762        domain.set_boundary({'exterior': Br})
    767763
    768764        # Setup only one forcing term, constant rainfall
    769765        domain.forcing_terms = []
    770         domain.forcing_terms.append(Rainfall(domain, rate=2.0))
     766        domain.forcing_terms.append(anuga.Rainfall(domain, rate=2.0))
    771767
    772768        domain.compute_forcing_terms()
     
    795791        domain.set_quantity('friction', 0)
    796792
    797         Br = Reflective_boundary(domain)
     793        Br = anuga.Reflective_boundary(domain)
    798794        domain.set_boundary({'exterior': Br})
    799795
     
    801797        # restricted to a polygon enclosing triangle #1 (bce)
    802798        domain.forcing_terms = []
    803         R = Rainfall(domain, rate=2.0, polygon=[[1,1], [2,1], [2,2], [1,2]])
     799        R = anuga.Rainfall(domain, rate=2.0, polygon=[[1,1], [2,1], [2,2], [1,2]])
    804800
    805801        assert num.allclose(R.exchange_area, 2)
     
    826822        vertices = [[1,0,2], [1,2,4], [4,2,5], [3,1,4]]
    827823
    828         domain = Domain(points, vertices)
     824        domain = anuga.Domain(points, vertices)
    829825
    830826        # Flat surface with 1m of water
     
    833829        domain.set_quantity('friction', 0)
    834830
    835         Br = Reflective_boundary(domain)
     831        Br = anuga.Reflective_boundary(domain)
    836832        domain.set_boundary({'exterior': Br})
    837833
     
    839835        # restricted to a polygon enclosing triangle #1 (bce)
    840836        domain.forcing_terms = []
    841         R = Rainfall(domain,
     837        R = anuga.Rainfall(domain,
    842838                     rate=lambda t: 3*t + 7,
    843839                     polygon = [[1,1], [2,1], [2,2], [1,2]])
     
    870866        vertices = [[1,0,2], [1,2,4], [4,2,5], [3,1,4]]
    871867
    872         domain = Domain(points, vertices)
     868        domain = anuga.Domain(points, vertices)
    873869
    874870        # Flat surface with 1m of water
     
    877873        domain.set_quantity('friction', 0)
    878874
    879         Br = Reflective_boundary(domain)
     875        Br = anuga.Reflective_boundary(domain)
    880876        domain.set_boundary({'exterior': Br})
    881877
     
    883879        # restricted to a polygon enclosing triangle #1 (bce)
    884880        domain.forcing_terms = []
    885         R = Rainfall(domain,
     881        R = anuga.Rainfall(domain,
    886882                     rate=lambda t: 3*t + 7,
    887883                     polygon=rainfall_poly)                     
     
    943939        domain.set_quantity('friction', 0)
    944940
    945         Br = Reflective_boundary(domain)
     941        Br = anuga.Reflective_boundary(domain)
    946942        domain.set_boundary({'exterior': Br})
    947943
     
    949945        # restricted to a polygon enclosing triangle #1 (bce)
    950946        domain.forcing_terms = []
    951         R = Rainfall(domain,
     947        R = anuga.Rainfall(domain,
    952948                     rate=lambda t: 3*t + 7,
    953949                     polygon=rainfall_poly)
     
    1000996        domain.set_quantity('friction', 0)
    1001997
    1002         Br = Reflective_boundary(domain)
     998        Br = anuga.Reflective_boundary(domain)
    1003999        domain.set_boundary({'exterior': Br})
    10041000
     
    10151011
    10161012        domain.forcing_terms = []
    1017         R = Rainfall(domain,
     1013        R = anuga.Rainfall(domain,
    10181014                     rate=main_rate,
    10191015                     polygon = [[1,1], [2,1], [2,2], [1,2]],
     
    10681064        domain.set_quantity('friction', 0)
    10691065
    1070         Br = Reflective_boundary(domain)
     1066        Br = anuga.Reflective_boundary(domain)
    10711067        domain.set_boundary({'exterior': Br})
    10721068
     
    10831079
    10841080        domain.forcing_terms = []
    1085         R = Rainfall(domain,
     1081        R = anuga.Rainfall(domain,
    10861082                     rate=main_rate,
    10871083                     polygon=[[1,1], [2,1], [2,2], [1,2]],
     
    11201116        domain.set_quantity('friction', 0)
    11211117
    1122         Br = Reflective_boundary(domain)
     1118        Br = anuga.Reflective_boundary(domain)
    11231119        domain.set_boundary({'exterior': Br})
    11241120
     
    11271123        domain.forcing_terms = []
    11281124       
    1129         I = Inflow(domain, rate=2.0, center=(1,1), radius=1)
     1125        I = anuga.Inflow(domain, rate=2.0, center=(1,1), radius=1)
    11301126        domain.forcing_terms.append(I)       
    11311127        domain.compute_forcing_terms()
     
    11541150        vertices = [[1,0,2], [1,2,4], [4,2,5], [3,1,4]]
    11551151
    1156         domain = Domain(points, vertices)
     1152        domain = anuga.Domain(points, vertices)
    11571153
    11581154        # Flat surface with 1m of water
     
    11611157        domain.set_quantity('friction', 0)
    11621158
    1163         Br = Reflective_boundary(domain)
     1159        Br = anuga.Reflective_boundary(domain)
    11641160        domain.set_boundary({'exterior': Br})
    11651161
     
    12081204        domain.set_quantity('friction', 0)
    12091205
    1210         Br = Reflective_boundary(domain)
     1206        Br = anuga.Reflective_boundary(domain)
    12111207        domain.set_boundary({'exterior': Br})
    12121208
     
    13521348        verbose = False
    13531349       
    1354 
    1355         #----------------------------------------------------------------------
    1356         # Import necessary modules
    1357         #----------------------------------------------------------------------
    1358 
    1359         from anuga.abstract_2d_finite_volumes.mesh_factory \
    1360                 import rectangular_cross
    1361         from anuga.shallow_water import Domain
    1362         from anuga.shallow_water.shallow_water_domain import Reflective_boundary
    1363         from anuga.shallow_water.shallow_water_domain import Dirichlet_boundary
    1364         from anuga.shallow_water.forcing import Inflow
    1365         from anuga.shallow_water.data_manager \
    1366                 import get_flow_through_cross_section
    1367         from anuga.abstract_2d_finite_volumes.util \
    1368                 import sww2csv_gauges, csv2timeseries_graphs
    1369 
    13701350        #----------------------------------------------------------------------
    13711351        # Setup computational domain
     
    14141394
    14151395                # Fixed Flowrate onto Area
    1416                 fixed_inflow = Inflow(domain,
     1396                fixed_inflow = anuga.Inflow(domain,
    14171397                                      center=(10.0, 10.0),
    14181398                                      radius=5.00,
     
    14231403                    domain.forcing_terms.append(fixed_inflow)
    14241404               
    1425                 ref_flow = fixed_inflow.rate*number_of_inflows
     1405                ref_flow = fixed_inflow.rate*number_of_inflowsg
    14261406
    14271407                # Compute normal depth on plane using Mannings equation
  • trunk/anuga_core/source/anuga/shallow_water_balanced/test_swb_reporting.py

    r7573 r7866  
    66import tempfile
    77
     8import anuga
     9
    810from anuga.config import g, epsilon
    911from anuga.config import netcdf_mode_r, netcdf_mode_w, netcdf_mode_a
    1012from anuga.utilities.numerical_tools import mean
    11 from anuga.utilities.polygon import is_inside_polygon
     13from anuga.geometry.polygon import is_inside_polygon
    1214from anuga.coordinate_transforms.geo_reference import Geo_reference
    1315from anuga.abstract_2d_finite_volumes.quantity import Quantity
     
    7779        # Setup boundary conditions
    7880        #--------------------------------------------------------------
    79         Br = Reflective_boundary(domain)              # Reflective wall
     81        Br = anuga.Reflective_boundary(domain)       # Reflective wall
    8082        # Constant inflow
    81         Bd = Dirichlet_boundary([final_runup_height, 0, 0])
     83        Bd = anuga.Dirichlet_boundary([final_runup_height, 0, 0])
    8284
    8385        # All reflective to begin with (still water)
Note: See TracChangeset for help on using the changeset viewer.