Changeset 7866 for trunk/anuga_core/source/anuga/shallow_water_balanced
- Timestamp:
- Jun 22, 2010, 12:04:32 PM (15 years ago)
- 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 6 6 import tempfile 7 7 8 import anuga 9 8 10 from anuga.config import g, epsilon 9 11 from anuga.config import netcdf_mode_r, netcdf_mode_w, netcdf_mode_a 10 12 from anuga.utilities.numerical_tools import mean 11 from anuga. utilities.polygon import is_inside_polygon13 from anuga.geometry.polygon import is_inside_polygon 12 14 from anuga.coordinate_transforms.geo_reference import Geo_reference 13 15 from anuga.abstract_2d_finite_volumes.quantity import Quantity … … 2085 2087 can be controlled this way. 2086 2088 """ 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 2097 2090 #--------------------------------------------------------------------- 2098 2091 # Setup computational domain … … 2108 2101 len1=length, 2109 2102 len2=width) 2110 domain = Domain(points, vertices, boundary)2103 domain = anuga.Domain(points, vertices, boundary) 2111 2104 domain.set_name('channel_variable_test') # Output name 2112 2105 domain.set_quantities_to_be_stored({'elevation': 2, -
trunk/anuga_core/source/anuga/shallow_water_balanced/test_swb_boundary_condition.py
r7616 r7866 9 9 from anuga.config import netcdf_mode_r, netcdf_mode_w, netcdf_mode_a 10 10 from anuga.utilities.numerical_tools import mean 11 from anuga. utilities.polygon import is_inside_polygon11 from anuga.geometry.polygon import is_inside_polygon 12 12 from anuga.coordinate_transforms.geo_reference import Geo_reference 13 13 from anuga.abstract_2d_finite_volumes.quantity import Quantity -
trunk/anuga_core/source/anuga/shallow_water_balanced/test_swb_conservation.py
r7733 r7866 6 6 import tempfile 7 7 8 import anuga 9 8 10 from anuga.config import g, epsilon 9 11 from anuga.config import netcdf_mode_r, netcdf_mode_w, netcdf_mode_a 10 12 from anuga.utilities.numerical_tools import mean 11 from anuga. utilities.polygon import is_inside_polygon13 from anuga.geometry.polygon import is_inside_polygon 12 14 from anuga.coordinate_transforms.geo_reference import Geo_reference 13 15 from anuga.abstract_2d_finite_volumes.quantity import Quantity … … 60 62 61 63 # Boundary conditions (reflective everywhere) 62 Br = Reflective_boundary(domain)64 Br = anuga.Reflective_boundary(domain) 63 65 domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br}) 64 66 … … 88 90 """ 89 91 90 from mesh_factory import rectangular91 92 92 # Create basic mesh 93 points, vertices, boundary = rectangular(6, 6)93 points, vertices, boundary = anuga.rectangular(6, 6) 94 94 95 95 # Create shallow water domain 96 domain = Domain(points, vertices, boundary)96 domain = anuga.Domain(points, vertices, boundary) 97 97 domain.smooth = False 98 98 domain.default_order = 2 … … 107 107 108 108 # Boundary conditions (reflective everywhere) 109 Br = Reflective_boundary(domain)109 Br = anuga.Reflective_boundary(domain) 110 110 domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br}) 111 111 … … 140 140 141 141 # Create shallow water domain 142 domain = Domain(points, vertices, boundary)142 domain = anuga.Domain(points, vertices, boundary) 143 143 domain.smooth = False 144 144 … … 163 163 164 164 # Boundary conditions (reflective everywhere) 165 Br = Reflective_boundary(domain)165 Br = anuga.Reflective_boundary(domain) 166 166 domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br}) 167 167 … … 200 200 """ 201 201 202 from mesh_factory import rectangular203 204 202 # Create basic mesh 205 points, vertices, boundary = rectangular(6, 6)203 points, vertices, boundary = anuga.rectangular(6, 6) 206 204 207 205 # Create shallow water domain 208 domain = Domain(points, vertices, boundary)206 domain = anuga.Domain(points, vertices, boundary) 209 207 domain.smooth = False 210 208 domain.default_order = 2 … … 232 230 233 231 # Boundary conditions (reflective everywhere) 234 Br = Reflective_boundary(domain)232 Br = anuga.Reflective_boundary(domain) 235 233 domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br}) 236 234 … … 271 269 """ 272 270 273 from mesh_factory import rectangular274 275 271 # Create basic mesh 276 points, vertices, boundary = rectangular(6, 6)272 points, vertices, boundary = anuga.rectangular(6, 6) 277 273 278 274 # Create shallow water domain 279 domain = Domain(points, vertices, boundary)275 domain = anuga.Domain(points, vertices, boundary) 280 276 domain.smooth = False 281 277 domain.default_order = 2 … … 290 286 291 287 # 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]) 295 291 domain.set_boundary({'left': Bleft, 'right': Bright, 296 292 'top': Br, 'bottom': Br}) … … 362 358 363 359 # Boundaries 364 R = Reflective_boundary(domain)360 R = anuga.Reflective_boundary(domain) 365 361 domain.set_boundary({'left': R, 'right': R, 'top':R, 'bottom': R}) 366 362 … … 384 380 Test that total volume can be computed correctly 385 381 """ 386 387 #----------------------------------------------------------------------388 # Import necessary modules389 #----------------------------------------------------------------------390 from anuga.abstract_2d_finite_volumes.mesh_factory \391 import rectangular_cross392 from anuga.shallow_water import Domain393 382 394 383 #---------------------------------------------------------------------- … … 449 438 verbose = False 450 439 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 463 441 464 442 #---------------------------------------------------------------------- … … 500 478 #---------------------------------------------------------------------- 501 479 502 Br = Reflective_boundary(domain) # Solid reflective wall480 Br = anuga.Reflective_boundary(domain) # Solid reflective wall 503 481 504 482 # Constant flow in and out of domain 505 483 # 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]) 508 486 509 487 domain.set_boundary({'left': Bi, 'right': Bo, 'top': Br, 'bottom': Br}) … … 544 522 545 523 546 #---------------------------------------------------------------------547 # Import necessary modules548 #---------------------------------------------------------------------549 from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular_cross550 from anuga.shallow_water import Domain551 from anuga.shallow_water.shallow_water_domain import Reflective_boundary552 from anuga.shallow_water.shallow_water_domain import Dirichlet_boundary553 from anuga.shallow_water.forcing import Inflow554 from anuga.shallow_water.data_manager import get_flow_through_cross_section555 556 524 #---------------------------------------------------------------------- 557 525 # Setup computational domain … … 569 537 570 538 571 domain = Domain(points, vertices, boundary)539 domain = anuga.Domain(points, vertices, boundary) 572 540 domain.set_name('Inflow_volume_test') # Output name 573 541 … … 593 561 594 562 # Fixed Flowrate onto Area 595 fixed_inflow = Inflow(domain,563 fixed_inflow = anuga.Inflow(domain, 596 564 center=(10.0, 10.0), 597 565 radius=5.00, … … 604 572 #---------------------------------------------------------------------- 605 573 606 Br = Reflective_boundary(domain) # Solid reflective wall574 Br = anuga.Reflective_boundary(domain) # Solid reflective wall 607 575 domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br}) 608 576 … … 646 614 647 615 648 #---------------------------------------------------------------------649 # Import necessary modules650 #---------------------------------------------------------------------651 from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular_cross652 from anuga.shallow_water import Domain653 from anuga.shallow_water.shallow_water_domain import Reflective_boundary654 from anuga.shallow_water.shallow_water_domain import Dirichlet_boundary655 from anuga.shallow_water.shallow_water_domain import Rainfall656 from anuga.shallow_water.data_manager import get_flow_through_cross_section657 658 616 #---------------------------------------------------------------------- 659 617 # Setup computational domain … … 666 624 667 625 668 points, vertices, boundary = rectangular_cross(int(length/dx),626 points, vertices, boundary = anuga.rectangular_cross(int(length/dx), 669 627 int(width/dy), 670 628 len1=length, len2=width) 671 629 672 630 673 domain = Domain(points, vertices, boundary)631 domain = anuga.Domain(points, vertices, boundary) 674 632 domain.set_name('Rain_volume_test') # Output name 675 633 … … 695 653 696 654 # Fixed rain onto small circular area 697 fixed_rain = Rainfall(domain,655 fixed_rain = anuga.Rainfall(domain, 698 656 center=(10.0, 10.0), 699 657 radius=5.00, … … 706 664 #---------------------------------------------------------------------- 707 665 708 Br = Reflective_boundary(domain) # Solid reflective wall666 Br = anuga.Reflective_boundary(domain) # Solid reflective wall 709 667 domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br}) 710 668 … … 755 713 756 714 757 #---------------------------------------------------------------------758 # Import necessary modules759 #---------------------------------------------------------------------760 from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular_cross761 from anuga.shallow_water import Domain762 from anuga.shallow_water.shallow_water_domain import Reflective_boundary763 from anuga.shallow_water.shallow_water_domain import Dirichlet_boundary764 from anuga.shallow_water.shallow_water_domain import Rainfall765 from anuga.shallow_water.data_manager import get_flow_through_cross_section766 767 715 #---------------------------------------------------------------------- 768 716 # Setup computational domain … … 815 763 #---------------------------------------------------------------------- 816 764 817 Br = Reflective_boundary(domain) # Solid reflective wall818 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]) 820 768 domain.set_boundary({'left': Bt, 'right': Bd, 'top': Bt, 'bottom': Bt}) 821 769 -
trunk/anuga_core/source/anuga/shallow_water_balanced/test_swb_cross_sections.py
r7559 r7866 6 6 import tempfile 7 7 8 import anuga 9 8 10 from anuga.config import g, epsilon 9 11 from anuga.config import netcdf_mode_r, netcdf_mode_w, netcdf_mode_a 10 12 from anuga.utilities.numerical_tools import mean 11 from anuga. utilities.polygon import is_inside_polygon13 from anuga.geometry.polygon import is_inside_polygon 12 14 from anuga.coordinate_transforms.geo_reference import Geo_reference 13 from anuga.abstract_2d_finite_volumes.quantity import Quantity14 from anuga.geospatial_data.geospatial_data import Geospatial_data15 from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular_cross16 15 17 16 from anuga.utilities.system_tools import get_pathname_from_package … … 76 75 uh = u*h 77 76 78 Br = Reflective_boundary(domain) # Side walls79 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: 80 79 81 80 … … 161 160 uh = u*h 162 161 163 Br = Reflective_boundary(domain)# Side walls164 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: 165 164 166 165 # Initial conditions … … 252 251 uh = u*h 253 252 254 Br = Reflective_boundary(domain)# Side walls255 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: 256 255 257 256 # Initial conditions -
trunk/anuga_core/source/anuga/shallow_water_balanced/test_swb_distribute.py
r7573 r7866 9 9 from anuga.config import netcdf_mode_r, netcdf_mode_w, netcdf_mode_a 10 10 from anuga.utilities.numerical_tools import mean 11 from anuga. utilities.polygon import is_inside_polygon11 from anuga.geometry.polygon import is_inside_polygon 12 12 from anuga.coordinate_transforms.geo_reference import Geo_reference 13 13 from anuga.abstract_2d_finite_volumes.quantity import Quantity -
trunk/anuga_core/source/anuga/shallow_water_balanced/test_swb_forcing_terms.py
r7733 r7866 5 5 from math import pi, sqrt 6 6 import tempfile 7 import anuga 7 8 8 9 from anuga.config import g, epsilon 9 10 from anuga.config import netcdf_mode_r, netcdf_mode_w, netcdf_mode_a 10 11 from anuga.utilities.numerical_tools import mean 11 from anuga. utilities.polygon import is_inside_polygon12 from anuga.geometry.polygon import is_inside_polygon 12 13 from anuga.coordinate_transforms.geo_reference import Geo_reference 13 14 from anuga.abstract_2d_finite_volumes.quantity import Quantity … … 394 395 vertices = [[1,0,2], [1,2,4], [4,2,5], [3,1,4]] 395 396 396 domain = Domain(points, vertices)397 domain = anuga.Domain(points, vertices) 397 398 398 399 #Flat surface with 1m of water … … 401 402 domain.set_quantity('friction', 0) 402 403 403 Br = Reflective_boundary(domain)404 Br = anuga.Reflective_boundary(domain) 404 405 domain.set_boundary({'exterior': Br}) 405 406 … … 408 409 phi = 135 409 410 domain.forcing_terms = [] 410 domain.forcing_terms.append( Wind_stress(s, phi))411 domain.forcing_terms.append(anuga.Wind_stress(s, phi)) 411 412 412 413 domain.compute_forcing_terms() … … 450 451 domain.set_quantity('friction', 0) 451 452 452 Br = Reflective_boundary(domain)453 Br = anuga.Reflective_boundary(domain) 453 454 domain.set_boundary({'exterior': Br}) 454 455 … … 459 460 phi = 135 460 461 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)) 462 463 463 464 domain.compute_forcing_terms() … … 522 523 domain.set_quantity('friction', 0) 523 524 524 Br = Reflective_boundary(domain)525 Br = anuga.Reflective_boundary(domain) 525 526 domain.set_boundary({'exterior': Br}) 526 527 … … 543 544 fid.close() 544 545 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') 549 547 os.remove(filename + '.txt') 550 548 … … 616 614 domain.set_quantity('friction', 0) 617 615 618 Br = Reflective_boundary(domain)616 Br = anuga.Reflective_boundary(domain) 619 617 domain.set_boundary({'exterior': Br}) 620 618 … … 623 621 # Write wind stress file (ensure that domain.time is covered) 624 622 # 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' 626 625 start = time.mktime(time.strptime('2000', '%Y')) 627 fid = open(filename + '.txt', 'w')626 fid = open(filename, 'w') 628 627 dt = 0.5 # Half second interval 629 628 t = 0.0 … … 635 634 fid.close() 636 635 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) 642 638 643 639 # Setup wind stress 644 F = file_function(file name + '.tms',640 F = file_function(file_out, 645 641 quantities=['Attribute0', 'Attribute1']) 646 os.remove(file name + '.tms')647 648 W = Wind_stress(F)642 os.remove(file_out) 643 644 W = anuga.Wind_stress(F) 649 645 650 646 domain.forcing_terms = [] … … 709 705 domain.set_quantity('friction', 0) 710 706 711 Br = Reflective_boundary(domain)707 Br = anuga.Reflective_boundary(domain) 712 708 domain.set_boundary({'exterior': Br}) 713 709 … … 718 714 719 715 try: 720 domain.forcing_terms.append( Wind_stress(s=scalar_func_list,716 domain.forcing_terms.append(anuga.Wind_stress(s=scalar_func_list, 721 717 phi=angle)) 722 718 except AssertionError: … … 763 759 domain.set_quantity('friction', 0) 764 760 765 Br = Reflective_boundary(domain)761 Br = anuga.Reflective_boundary(domain) 766 762 domain.set_boundary({'exterior': Br}) 767 763 768 764 # Setup only one forcing term, constant rainfall 769 765 domain.forcing_terms = [] 770 domain.forcing_terms.append( Rainfall(domain, rate=2.0))766 domain.forcing_terms.append(anuga.Rainfall(domain, rate=2.0)) 771 767 772 768 domain.compute_forcing_terms() … … 795 791 domain.set_quantity('friction', 0) 796 792 797 Br = Reflective_boundary(domain)793 Br = anuga.Reflective_boundary(domain) 798 794 domain.set_boundary({'exterior': Br}) 799 795 … … 801 797 # restricted to a polygon enclosing triangle #1 (bce) 802 798 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]]) 804 800 805 801 assert num.allclose(R.exchange_area, 2) … … 826 822 vertices = [[1,0,2], [1,2,4], [4,2,5], [3,1,4]] 827 823 828 domain = Domain(points, vertices)824 domain = anuga.Domain(points, vertices) 829 825 830 826 # Flat surface with 1m of water … … 833 829 domain.set_quantity('friction', 0) 834 830 835 Br = Reflective_boundary(domain)831 Br = anuga.Reflective_boundary(domain) 836 832 domain.set_boundary({'exterior': Br}) 837 833 … … 839 835 # restricted to a polygon enclosing triangle #1 (bce) 840 836 domain.forcing_terms = [] 841 R = Rainfall(domain,837 R = anuga.Rainfall(domain, 842 838 rate=lambda t: 3*t + 7, 843 839 polygon = [[1,1], [2,1], [2,2], [1,2]]) … … 870 866 vertices = [[1,0,2], [1,2,4], [4,2,5], [3,1,4]] 871 867 872 domain = Domain(points, vertices)868 domain = anuga.Domain(points, vertices) 873 869 874 870 # Flat surface with 1m of water … … 877 873 domain.set_quantity('friction', 0) 878 874 879 Br = Reflective_boundary(domain)875 Br = anuga.Reflective_boundary(domain) 880 876 domain.set_boundary({'exterior': Br}) 881 877 … … 883 879 # restricted to a polygon enclosing triangle #1 (bce) 884 880 domain.forcing_terms = [] 885 R = Rainfall(domain,881 R = anuga.Rainfall(domain, 886 882 rate=lambda t: 3*t + 7, 887 883 polygon=rainfall_poly) … … 943 939 domain.set_quantity('friction', 0) 944 940 945 Br = Reflective_boundary(domain)941 Br = anuga.Reflective_boundary(domain) 946 942 domain.set_boundary({'exterior': Br}) 947 943 … … 949 945 # restricted to a polygon enclosing triangle #1 (bce) 950 946 domain.forcing_terms = [] 951 R = Rainfall(domain,947 R = anuga.Rainfall(domain, 952 948 rate=lambda t: 3*t + 7, 953 949 polygon=rainfall_poly) … … 1000 996 domain.set_quantity('friction', 0) 1001 997 1002 Br = Reflective_boundary(domain)998 Br = anuga.Reflective_boundary(domain) 1003 999 domain.set_boundary({'exterior': Br}) 1004 1000 … … 1015 1011 1016 1012 domain.forcing_terms = [] 1017 R = Rainfall(domain,1013 R = anuga.Rainfall(domain, 1018 1014 rate=main_rate, 1019 1015 polygon = [[1,1], [2,1], [2,2], [1,2]], … … 1068 1064 domain.set_quantity('friction', 0) 1069 1065 1070 Br = Reflective_boundary(domain)1066 Br = anuga.Reflective_boundary(domain) 1071 1067 domain.set_boundary({'exterior': Br}) 1072 1068 … … 1083 1079 1084 1080 domain.forcing_terms = [] 1085 R = Rainfall(domain,1081 R = anuga.Rainfall(domain, 1086 1082 rate=main_rate, 1087 1083 polygon=[[1,1], [2,1], [2,2], [1,2]], … … 1120 1116 domain.set_quantity('friction', 0) 1121 1117 1122 Br = Reflective_boundary(domain)1118 Br = anuga.Reflective_boundary(domain) 1123 1119 domain.set_boundary({'exterior': Br}) 1124 1120 … … 1127 1123 domain.forcing_terms = [] 1128 1124 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) 1130 1126 domain.forcing_terms.append(I) 1131 1127 domain.compute_forcing_terms() … … 1154 1150 vertices = [[1,0,2], [1,2,4], [4,2,5], [3,1,4]] 1155 1151 1156 domain = Domain(points, vertices)1152 domain = anuga.Domain(points, vertices) 1157 1153 1158 1154 # Flat surface with 1m of water … … 1161 1157 domain.set_quantity('friction', 0) 1162 1158 1163 Br = Reflective_boundary(domain)1159 Br = anuga.Reflective_boundary(domain) 1164 1160 domain.set_boundary({'exterior': Br}) 1165 1161 … … 1208 1204 domain.set_quantity('friction', 0) 1209 1205 1210 Br = Reflective_boundary(domain)1206 Br = anuga.Reflective_boundary(domain) 1211 1207 domain.set_boundary({'exterior': Br}) 1212 1208 … … 1352 1348 verbose = False 1353 1349 1354 1355 #----------------------------------------------------------------------1356 # Import necessary modules1357 #----------------------------------------------------------------------1358 1359 from anuga.abstract_2d_finite_volumes.mesh_factory \1360 import rectangular_cross1361 from anuga.shallow_water import Domain1362 from anuga.shallow_water.shallow_water_domain import Reflective_boundary1363 from anuga.shallow_water.shallow_water_domain import Dirichlet_boundary1364 from anuga.shallow_water.forcing import Inflow1365 from anuga.shallow_water.data_manager \1366 import get_flow_through_cross_section1367 from anuga.abstract_2d_finite_volumes.util \1368 import sww2csv_gauges, csv2timeseries_graphs1369 1370 1350 #---------------------------------------------------------------------- 1371 1351 # Setup computational domain … … 1414 1394 1415 1395 # Fixed Flowrate onto Area 1416 fixed_inflow = Inflow(domain,1396 fixed_inflow = anuga.Inflow(domain, 1417 1397 center=(10.0, 10.0), 1418 1398 radius=5.00, … … 1423 1403 domain.forcing_terms.append(fixed_inflow) 1424 1404 1425 ref_flow = fixed_inflow.rate*number_of_inflows 1405 ref_flow = fixed_inflow.rate*number_of_inflowsg 1426 1406 1427 1407 # Compute normal depth on plane using Mannings equation -
trunk/anuga_core/source/anuga/shallow_water_balanced/test_swb_reporting.py
r7573 r7866 6 6 import tempfile 7 7 8 import anuga 9 8 10 from anuga.config import g, epsilon 9 11 from anuga.config import netcdf_mode_r, netcdf_mode_w, netcdf_mode_a 10 12 from anuga.utilities.numerical_tools import mean 11 from anuga. utilities.polygon import is_inside_polygon13 from anuga.geometry.polygon import is_inside_polygon 12 14 from anuga.coordinate_transforms.geo_reference import Geo_reference 13 15 from anuga.abstract_2d_finite_volumes.quantity import Quantity … … 77 79 # Setup boundary conditions 78 80 #-------------------------------------------------------------- 79 Br = Reflective_boundary(domain)# Reflective wall81 Br = anuga.Reflective_boundary(domain) # Reflective wall 80 82 # Constant inflow 81 Bd = Dirichlet_boundary([final_runup_height, 0, 0])83 Bd = anuga.Dirichlet_boundary([final_runup_height, 0, 0]) 82 84 83 85 # All reflective to begin with (still water)
Note: See TracChangeset
for help on using the changeset viewer.