anuga 1.3.5__zip
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/__config__.py +21 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/__config__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/__init__.py +363 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/__init__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/__metadata__.py +6 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/__metadata__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/__init__.py +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/__init__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/ermapper_grids.py +251 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/ermapper_grids.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/file_function.py +483 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/file_function.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/gauge.py +1080 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/gauge.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/general_mesh.py +865 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/general_mesh.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/generic_boundary_conditions.py +862 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/generic_boundary_conditions.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/generic_domain.py +2274 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/generic_domain.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/mesh_factory.py +1011 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/mesh_factory.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/mesh_factory_ext.pyd +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/neighbour_mesh.py +1488 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/neighbour_mesh.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/neighbour_mesh_ext.pyd +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/neighbour_table_ext.pyd +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/pmesh2domain.py +299 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/pmesh2domain.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/pmesh2domain_ext.pyd +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/quantity.py +2162 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/quantity.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/quantity_ext.pyd +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/region.py +321 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/region.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/setup.py +48 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/setup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/tag_region.py +167 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/tag_region.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/tests/__init__.py +8 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/tests/show_balanced_limiters.py +87 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/tests/test_ermapper.py +189 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/tests/test_gauge.py +539 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/tests/test_general_mesh.py +517 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/tests/test_generic_boundary_conditions.py +439 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/tests/test_generic_domain.py +907 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/tests/test_ghost.py +52 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/tests/test_neighbour_mesh.py +1854 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/tests/test_pmesh2domain.py +219 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/tests/test_quantity.py +2859 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/tests/test_region.py +99 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/tests/test_tag_region.py +258 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/tests/test_util.py +1632 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/util.py +928 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/abstract_2d_finite_volumes/util.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/advection/__init__.py +12 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/advection/__init__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/advection/advection.py +298 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/advection/advection.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/advection/advection_ext.pyd +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/advection/setup.py +27 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/advection/setup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/advection/tests/__init__.py +8 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/advection/tests/test_advection.py +183 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/alpha_shape/__init__.py +4 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/alpha_shape/__init__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/alpha_shape/alpha_shape.py +654 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/alpha_shape/alpha_shape.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/alpha_shape/setup.py +21 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/alpha_shape/setup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/alpha_shape/tests/__init__.py +8 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/alpha_shape/tests/test_alpha_shape.py +402 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/anuga_exceptions.py +46 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/anuga_exceptions.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/caching/__init__.py +18 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/caching/__init__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/caching/caching.py +2531 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/caching/caching.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/caching/dummy_classes_for_testing.py +20 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/caching/dummy_classes_for_testing.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/caching/setup.py +21 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/caching/setup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/caching/tests/__init__.py +8 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/caching/tests/test_caching.py +895 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/compile_all.py +82 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/compile_all.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/config.py +273 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/config.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/coordinate_transforms/__init__.py +6 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/coordinate_transforms/__init__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/coordinate_transforms/geo_reference.py +478 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/coordinate_transforms/geo_reference.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/coordinate_transforms/lat_long_UTM_conversion.py +250 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/coordinate_transforms/lat_long_UTM_conversion.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/coordinate_transforms/point.py +128 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/coordinate_transforms/point.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/coordinate_transforms/redfearn.py +233 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/coordinate_transforms/redfearn.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/coordinate_transforms/setup.py +21 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/coordinate_transforms/setup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/coordinate_transforms/tests/__init__.py +8 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/coordinate_transforms/tests/data/projection_test_points.csv +11 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/coordinate_transforms/tests/data/projection_test_points.lic +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/coordinate_transforms/tests/data/projection_test_points_z53.csv +11 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/coordinate_transforms/tests/data/projection_test_points_z53.lic +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/coordinate_transforms/tests/data/projection_test_points_z54.csv +11 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/coordinate_transforms/tests/data/projection_test_points_z54.lic +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/coordinate_transforms/tests/data/redfearn.lic +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/coordinate_transforms/tests/data/redfearn.xls +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/coordinate_transforms/tests/test_geo_reference.py +716 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/coordinate_transforms/tests/test_lat_long_UTM_conversion.py +126 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/coordinate_transforms/tests/test_point.py +125 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/coordinate_transforms/tests/test_redfearn.py +508 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/__init__.py +9 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/__init__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/culvert_class.py +1627 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/culvert_class.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/culvert_polygons.py +114 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/culvert_polygons.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/culvert_routines.py +362 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/culvert_routines.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/new_culvert_class.py +1630 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/new_culvert_class.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/setup.py +21 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/setup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/tests/__init__.py +8 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/tests/culvert_polygons_example.py +38 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/tests/data/example_rating_curve.csv +20 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/tests/data/example_rating_curve.lic +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/tests/data/example_rating_curve2.csv +20 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/tests/data/example_rating_curve2.lic +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/tests/data/unittests.lic +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/tests/data/unittests.xls +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/tests/run_culvert_flat_water_lev.py +173 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/tests/test_culvert_class.py +812 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/tests/test_culvert_polygons.py +84 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/tests/test_culvert_routines.py +586 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/tests/test_culvert_routines_box_10pct.py +342 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/tests/test_culvert_routines_box_1pct.py +342 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/tests/test_culvert_routines_pipe_10pct.py +338 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/tests/test_culvert_routines_pipe_1pct.py +338 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/culvert_flows/tests/test_new_culvert_class.py +810 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/damage_modelling/__init__.py +9 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/damage_modelling/__init__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/damage_modelling/exposure.py +223 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/damage_modelling/exposure.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/damage_modelling/inundation_damage.py +467 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/damage_modelling/inundation_damage.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/damage_modelling/setup.py +21 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/damage_modelling/setup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/damage_modelling/tests/__init__.py +8 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/damage_modelling/tests/test_exposure.py +325 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/damage_modelling/tests/test_inundation_damage.py +610 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/error_api.py +130 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/error_api.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/extras.py +193 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/extras.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/__init__.py +54 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/__init__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/csv_file.py +399 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/csv_file.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/mux.py +120 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/mux.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/netcdf.py +266 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/netcdf.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/pts.py +29 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/pts.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/setup.py +27 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/setup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/sts.py +293 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/sts.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/sww.py +1552 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/sww.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/tests/__init__.py +8 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/tests/test_csv.py +413 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/tests/test_mux.py +1539 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/tests/test_read_sww.py +350 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/tests/test_sww.py +560 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/tests/test_ungenerate.py +283 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/tests/test_urs.py +217 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/ungenerate.py +92 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/ungenerate.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/urs.py +323 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/urs.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file/urs_ext.pyd +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/__init__.py +20 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/__init__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/asc2dem.py +213 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/asc2dem.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/calc_grid_values_ext.pyd +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/csv2sts.py +165 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/csv2sts.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/dem2array.py +90 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/dem2array.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/dem2dem.py +145 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/dem2dem.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/dem2pts.py +357 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/dem2pts.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/esri2sww.py +327 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/esri2sww.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/ferret2sww.py +436 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/ferret2sww.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/file_conversion.py +367 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/file_conversion.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/grd2array.py +122 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/grd2array.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/sdf2pts.py +181 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/sdf2pts.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/setup.py +29 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/setup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/sts2sww_mesh.py +141 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/sts2sww_mesh.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/sww2array.py +321 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/sww2array.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/sww2dem.py +550 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/sww2dem.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/sww2dem_new.py +547 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/sww2dem_new.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/sww2pts.py +175 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/sww2pts.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/tests/__init__.py +8 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/tests/test_2pts.py +249 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/tests/test_csv2sts.py +118 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/tests/test_dem2array.py +121 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/tests/test_dem2dem.py +220 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/tests/test_dem2pts.py +411 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/tests/test_file_conversion.py +953 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/tests/test_grd2array.py +270 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/tests/test_sww2dem.py +1882 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/tests/test_urs2sts.py +2127 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/tests/test_urs2sww.py +628 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/urs2nc.py +202 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/urs2nc.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/urs2sts.py +316 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/urs2sts.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/urs2sww.py +306 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/urs2sww.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/urs2txt.py +71 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/urs2txt.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/xya2pts.py +39 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/file_conversion/xya2pts.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/fit_interpolate/__init__.py +12 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/fit_interpolate/__init__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/fit_interpolate/benchmark_least_squares.py +367 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/fit_interpolate/benchmark_least_squares.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/fit_interpolate/fit.py +611 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/fit_interpolate/fit.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/fit_interpolate/fitsmooth.pyd +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/fit_interpolate/general_fit_interpolate.py +127 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/fit_interpolate/general_fit_interpolate.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/fit_interpolate/interpolate.py +1144 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/fit_interpolate/interpolate.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/fit_interpolate/interpolate2d.py +305 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/fit_interpolate/interpolate2d.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/fit_interpolate/profile_long_benchmark.py +79 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/fit_interpolate/profile_long_benchmark.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/fit_interpolate/run_long_benchmark.py +131 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/fit_interpolate/run_long_benchmark.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/fit_interpolate/setup.py +37 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/fit_interpolate/setup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/fit_interpolate/tests/test_fit.py +1150 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/fit_interpolate/tests/test_interpolate.py +1952 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/fit_interpolate/tests/test_interpolate2d.py +469 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/fit_interpolate/tests/test_search_functions.py +236 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/fit_interpolate/ticket178_benchmark.py +66 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/fit_interpolate/ticket178_benchmark.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/geometry/__init__.py +11 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/geometry/__init__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/geometry/aabb.py +133 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/geometry/aabb.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/geometry/polygon.py +1138 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/geometry/polygon.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/geometry/polygon_ext.pyd +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/geometry/polygon_function.py +133 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/geometry/polygon_function.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/geometry/quad.py +190 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/geometry/quad.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/geometry/setup.py +27 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/geometry/setup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/geometry/tests/__init__.py +8 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/geometry/tests/test_geometry.py +110 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/geometry/tests/test_polygon.py +1994 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/geospatial_data/__init__.py +9 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/geospatial_data/__init__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/geospatial_data/geospatial_data.py +1698 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/geospatial_data/geospatial_data.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/geospatial_data/setup.py +21 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/geospatial_data/setup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/geospatial_data/tests/test_geospatial_data.py +1853 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/__init__.py +11 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/__init__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/add_csv_header.py +136 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/add_csv_header.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/file_length.py +14 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/file_length.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/maxasc.py +96 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/maxasc.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/order_boundary.py +109 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/order_boundary.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/setup.py +22 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/setup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/tests/__init__.py +8 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/tests/perthAll_stage_250m.lic +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/tests/perthAll_stage_250m_all.lic +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/tests/perthAll_stage_original.lic +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/tests/test1.asc +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/tests/test1.lic +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/tests/test1_bad_num_lines.asc +16 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/tests/test1_bad_num_lines.lic +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/tests/test1_header_differs.asc +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/tests/test1_header_differs.lic +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/tests/test1_wrong_num_columns.asc +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/tests/test1_wrong_num_columns.lic +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/tests/test2.asc +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/tests/test2.expected.asc +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/tests/test2.expected.lic +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/tests/test2.lic +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/tests/test3.asc +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/tests/test3.expected.asc +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/tests/test3.expected.lic +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/tests/test3.lic +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/tests/test_maxasc.py +150 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/lib/tests/test_order_boundary.py +397 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/load_mesh/__init__.py +4 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/load_mesh/__init__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/load_mesh/loadASCII.py +1073 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/load_mesh/loadASCII.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/load_mesh/setup.py +21 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/load_mesh/setup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/load_mesh/tests/test_loadASCII.py +544 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/mesh_engine/__init__.py +4 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/mesh_engine/__init__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/mesh_engine/compile.py +9 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/mesh_engine/compile.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/mesh_engine/mesh_engine.py +221 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/mesh_engine/mesh_engine.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/mesh_engine/mesh_engine_c_layer.pyd +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/mesh_engine/setup.py +29 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/mesh_engine/setup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/mesh_engine/tests/test_generate_mesh.py +470 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/__init__.py +11 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/__init__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/base_operator.py +125 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/base_operator.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/boundary_flux_integral_operator.py +79 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/boundary_flux_integral_operator.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/change_friction_operator.py +240 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/change_friction_operator.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/collect_max_quantities_operator.py +142 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/collect_max_quantities_operator.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/collect_max_stage_operator.py +85 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/collect_max_stage_operator.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/compile_all.py +16 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/compile_all.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/elliptic_operator.py +495 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/elliptic_operator.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/erosion_operators.py +859 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/erosion_operators.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/kinematic_viscosity_operator.py +563 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/kinematic_viscosity_operator.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/kinematic_viscosity_operator_ext.pyd +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/mannings_operator.py +87 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/mannings_operator.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/mannings_operator_ext.pyd +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/rate_operators.py +431 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/rate_operators.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/set_elevation.py +290 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/set_elevation.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/set_elevation_operator.py +148 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/set_elevation_operator.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/set_friction_operators.py +159 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/set_friction_operators.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/set_quantity.py +172 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/set_quantity.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/set_quantity_operator.py +158 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/set_quantity_operator.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/set_stage.py +131 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/set_stage.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/set_stage_operator.py +135 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/set_stage_operator.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/set_w_uh_vh_operator.py +170 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/set_w_uh_vh_operator.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/setup.py +33 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/setup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/tests/test_base_operator.py +51 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/tests/test_boundary_flux_integral_operator.py +98 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/tests/test_erosion_operators.py +344 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/tests/test_kinematic_viscosity_operator.py +1366 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/tests/test_rate_operators.py +888 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/tests/test_set_elevation_operator.py +1034 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/tests/test_set_quantity.py +511 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/tests/test_set_stage_operator.py +491 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/operators/tests/test_set_w_uh_vh_operators.py +211 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/__init__.py +31 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/__init__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/config.py +14 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/config.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/distribute_mesh.py +1682 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/distribute_mesh.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_advection.py +205 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_advection.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_api.py +467 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_api.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_boyd_box_operator.py +332 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_boyd_box_operator.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_boyd_pipe_operator.py +283 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_boyd_pipe_operator.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_generic_communications.py +207 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_generic_communications.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_inlet.py +605 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_inlet.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_inlet_enquiry.py +228 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_inlet_enquiry.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_inlet_operator.py +281 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_inlet_operator.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_internal_boundary_operator.py +230 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_internal_boundary_operator.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_meshes.py +445 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_meshes.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_operator_factory.py +959 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_operator_factory.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_shallow_water.py +282 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_shallow_water.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_structure_operator.py +1241 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_structure_operator.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_weir_orifice_trapezoid_operator.py +281 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/parallel_weir_orifice_trapezoid_operator.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/print_stats.py +205 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/print_stats.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/pypar_ext.py +528 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/pypar_ext.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/sequential_distribute.py +309 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/sequential_distribute.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/setup.py +100 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/parallel/setup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/AppShell.py +345 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/AppShell.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/Pmw.py +9253 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/Pmw.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/PmwBlt.py +671 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/PmwBlt.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/PmwColor.py +389 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/PmwColor.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/ProgressBar.py +80 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/ProgressBar.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/__init__.py +4 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/__init__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/compile.py +24 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/compile.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/cursornames.py +8 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/cursornames.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/exesetup.py +24 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/exesetup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/graphical_mesh_generator.py +1519 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/graphical_mesh_generator.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/addVertex.gif +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/addVertex.lic +16 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/autoSegGiveAlpha.gif +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/autoSegGiveAlpha.lic +16 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/default.gif +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/default.lic +16 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/edit.gif +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/edit.lic +16 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/hole.gif +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/hole.lic +16 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/joinVer.gif +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/joinVer.lic +16 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/meshGen.gif +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/meshGen.lic +16 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/no_see.gif +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/no_see.lic +16 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/pointer.gif +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/pointer.lic +16 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/region.gif +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/region.lic +16 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/see.gif +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/see.lic +16 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/segment.gif +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/segment.lic +16 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/sep.gif +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/sep.lic +16 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/vertex.gif +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/vertex.lic +16 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/zoom0.5.gif +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/zoom0.5.lic +16 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/zoom2.gif +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/zoom2.lic +16 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/zoomToMesh.gif +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/icons/zoomToMesh.lic +16 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/mesh.py +2416 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/mesh.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/mesh_interface.py +373 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/mesh_interface.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/mesh_quadtree.py +130 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/mesh_quadtree.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/run_setup.py +43 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/run_setup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/setup.py +22 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/setup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/tests/test_mesh.py +2129 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/tests/test_mesh_interface.py +988 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/tests/test_meshquad.py +189 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/timing.py +150 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/timing.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/toolbarbutton.py +80 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/toolbarbutton.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/ungen_example.py +69 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/ungen_example.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/view_tsh.py +47 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/view_tsh.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/visualmesh.py +302 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pmesh/visualmesh.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pymetis/__init__.py +6 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pymetis/__init__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pymetis/metis_ext.pyd +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pymetis/setup.py +54 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pymetis/setup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pymetis/tests/__init__.py +8 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/pymetis/tests/test_metis.py +141 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/setup.py +49 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/setup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/__init__.py +12 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/__init__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/boundaries.py +1028 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/boundaries.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/checkpoint.py +118 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/checkpoint.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/forcing.py +1339 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/forcing.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/most2nc.py +101 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/most2nc.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/setup.py +37 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/setup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/shallow_water_domain.py +3114 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/shallow_water_domain.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/shallow_water_ext.pyd +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/swDE1_domain_ext.pyd +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/swb2_domain.py +576 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/swb2_domain.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/swb2_domain_ext.pyd +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/sww_interrogate.py +652 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/sww_interrogate.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/__init__.py +8 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/data/polygon_values_example.csv +46 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/data/polygon_values_example.lic +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/data/test_points_large.csv +7855 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/data/test_points_large.lic +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/data/test_points_small.csv +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/data/test_points_small.lic +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/test_DE1_domain.py +111 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/test_data_manager.py +879 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/test_forcing.py +2271 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/test_loadsave.py +212 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/test_local_extrapolation_and_flux_updating.py +114 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/test_most2nc.py +52 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/test_shallow_water_domain.py +8670 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/test_swb2_domain.py +106 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/test_sww_interrogate.py +888 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/test_system.py +193 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/1-z.grd-e-mux2 +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/1-z.grd-n-mux2 +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/1-z.grd-z-mux2 +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/1-z.lic +55 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/2-z.grd-e-mux2 +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/2-z.grd-n-mux2 +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/2-z.grd-z-mux2 +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/2-z.lic +55 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/3-z.grd-e-mux2 +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/3-z.grd-n-mux2 +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/3-z.grd-z-mux2 +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/3-z.lic +55 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_1_0.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_1_0.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_1_1.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_1_1.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_1_2.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_1_2.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_1_3.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_1_3.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_1_4.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_1_4.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_2_0.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_2_0.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_2_1.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_2_1.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_2_2.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_2_2.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_2_3.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_2_3.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_2_4.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_2_4.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_3_0.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_3_0.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_3_1.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_3_1.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_3_2.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_3_2.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_3_3.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_3_3.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_3_4.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_3_4.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_combined_0.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_combined_0.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_combined_1.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_combined_1.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_combined_2.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_combined_2.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_combined_3.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_combined_3.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_combined_4.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/e_combined_4.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_1_0.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_1_0.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_1_1.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_1_1.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_1_2.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_1_2.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_1_3.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_1_3.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_1_4.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_1_4.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_2_0.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_2_0.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_2_1.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_2_1.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_2_2.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_2_2.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_2_3.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_2_3.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_2_4.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_2_4.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_3_0.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_3_0.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_3_1.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_3_1.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_3_2.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_3_2.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_3_3.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_3_3.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_3_4.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_3_4.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_combined_0.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_combined_0.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_combined_1.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_combined_1.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_combined_2.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_combined_2.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_combined_3.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_combined_3.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_combined_4.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/n_combined_4.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/thinned_bound_order_test.lic +18 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/thinned_bound_order_test.txt +6 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_1_0.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_1_0.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_1_1.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_1_1.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_1_2.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_1_2.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_1_3.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_1_3.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_1_4.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_1_4.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_2_0.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_2_0.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_2_1.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_2_1.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_2_2.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_2_2.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_2_3.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_2_3.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_2_4.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_2_4.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_3_0.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_3_0.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_3_1.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_3_1.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_3_2.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_3_2.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_3_3.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_3_3.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_3_4.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_3_4.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_combined_0.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_combined_0.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_combined_1.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_combined_1.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_combined_2.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_combined_2.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_combined_3.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_combined_3.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_combined_4.csv +252 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tests/urs_test_data/z_combined_4.lic +25 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tsh2sww.py +65 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/tsh2sww.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/__init__.py +5 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/__init__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/boyd_box_operator.py +380 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/boyd_box_operator.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/boyd_box_operator_Amended3.py +245 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/boyd_box_operator_Amended3.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/boyd_pipe_operator.py +305 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/boyd_pipe_operator.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/inlet.py +289 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/inlet.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/inlet_enquiry.py +146 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/inlet_enquiry.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/inlet_operator.py +229 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/inlet_operator.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/internal_boundary_functions.py +431 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/internal_boundary_functions.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/internal_boundary_operator.py +169 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/internal_boundary_operator.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/riverwall.py +738 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/riverwall.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/setup.py +24 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/setup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/structure_operator.py +757 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/structure_operator.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/tests/data/hecras_bridge_table.csv +105 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/tests/data/inlet_operator_test1.lic +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/tests/data/inlet_operator_test1.tms +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/tests/data/inlet_operator_test2.lic +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/tests/data/inlet_operator_test2.tms +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/tests/data/test_hydrograph.tms +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/tests/test_boyd_box_operator.py +2623 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/tests/test_boyd_pipe_operator.py +482 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/tests/test_inlet_operator.py +311 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/tests/test_internal_boundary_functions.py +96 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/tests/test_riverwall_structure.py +619 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/tests/test_weir_orifice_trapezoid_operator.py +650 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/weir_orifice_trapezoid_operator.py +387 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/structures/weir_orifice_trapezoid_operator.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/test_all.py +282 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/test_all.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/tsunami_source/__init__.py +13 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/tsunami_source/__init__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/tsunami_source/eqf.py +147 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/tsunami_source/eqf.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/tsunami_source/eqf_v2.py +559 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/tsunami_source/eqf_v2.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/tsunami_source/okada_tsunami.py +347 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/tsunami_source/okada_tsunami.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/tsunami_source/setup.py +27 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/tsunami_source/setup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/tsunami_source/smf.py +467 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/tsunami_source/smf.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/tsunami_source/tests/data/fullokada_MS.lic +23 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/tsunami_source/tests/data/fullokada_MS.txt +36 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/tsunami_source/tests/data/fullokada_SP.lic +23 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/tsunami_source/tests/data/fullokada_SP.txt +36 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/tsunami_source/tests/data/fullokada_SS.lic +23 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/tsunami_source/tests/data/fullokada_SS.txt +36 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/tsunami_source/tests/okada_tsunami_octave_95.txt +101 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/tsunami_source/tests/test_eq.py +67 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/tsunami_source/tests/test_okada_tsunami.py +439 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/tsunami_source/tests/test_smf.py +143 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/tsunami_source/tests/test_tsunami_okada.py +303 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/tsunami_source/tsunami_okada.py +1885 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/tsunami_source/tsunami_okada.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/__init__.py +11 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/__init__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/argparsing.py +76 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/argparsing.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/cg_ext.pyd +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/cg_solve.py +327 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/cg_solve.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/compile.py +497 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/compile.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/csv_tools.py +121 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/csv_tools.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/data_audit.py +404 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/data_audit.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/data_audit_wrapper.py +52 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/data_audit_wrapper.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/file_utils.py +308 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/file_utils.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/function_utils.py +117 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/function_utils.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/interp.py +318 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/interp.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/log.py +414 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/log.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/log_analyser.py +77 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/log_analyser.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/mem_time_equation.py +106 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/mem_time_equation.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/model_tools.py +457 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/model_tools.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/norms.py +16 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/norms.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/numerical_tools.py +397 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/numerical_tools.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/parallel_abstraction.py +67 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/parallel_abstraction.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/parse.py +26 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/parse.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/plot_utils.py +1237 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/plot_utils.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/quad_tree_ext.pyd +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/quantity_setting_functions.py +612 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/quantity_setting_functions.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/quickPlots.py +164 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/quickPlots.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/run_anuga_script.py +70 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/run_anuga_script.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/setup.py +39 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/setup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/sparse.py +398 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/sparse.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/sparse_ext.pyd +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/sparse_matrix_ext.pyd +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/spatialInputUtil.py +1394 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/spatialInputUtil.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/sww_merge.py +820 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/sww_merge.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/system_tools.py +646 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/system_tools.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/terminal_width.py +60 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/terminal_width.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/tests/data/complex_polygon.csv +4 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/tests/data/complex_polygon.lic +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/tests/data/crc_test_file.lic +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/tests/data/crc_test_file.png +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/tests/data/mainland_only.csv +669 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/tests/data/mainland_only.lic +33 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/tests/data/non_complex_polygon.csv +5 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/tests/data/non_complex_polygon.lic +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/tests/test_cg_solve.py +569 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/tests/test_csv_tools.py +435 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/tests/test_data_audit.py +393 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/tests/test_file_utils.py +157 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/tests/test_function_utils.py +65 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/tests/test_log_analyser.py +89 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/tests/test_mem_time_equation.py +47 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/tests/test_numerical_tools.py +616 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/tests/test_plot_utils.py +455 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/tests/test_quantity_setting_functions.py +369 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/tests/test_sparse.py +215 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/tests/test_spatialInputUtil.py +418 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/tests/test_system_tools.py +483 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/tests/test_xml_tools.py +316 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/util_ext.pyd +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/where_close.py +219 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/where_close.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/xml_tools.py +326 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/utilities/xml_tools.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/validation_utilities/__init__.py +15 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/validation_utilities/__init__.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/validation_utilities/fabricate.py +1429 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/validation_utilities/fabricate.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/validation_utilities/parameters.py +24 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/validation_utilities/parameters.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/validation_utilities/produce_report.py +38 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/validation_utilities/produce_report.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/validation_utilities/run_validation.py +51 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/validation_utilities/run_validation.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/validation_utilities/save_parameters_tex.py +17 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/validation_utilities/save_parameters_tex.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/validation_utilities/setup.py +22 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/validation_utilities/setup.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/validation_utilities/typeset_report.py +55 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/validation_utilities/typeset_report.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/version.py +11 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/version.pyc +0 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga-1.3.5-py2.7.egg-info/PKG-INFO +117 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga-1.3.5-py2.7.egg-info/SOURCES.txt +1329 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga-1.3.5-py2.7.egg-info/dependency_links.txt +1 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga-1.3.5-py2.7.egg-info/not-zip-safe +1 -0
- Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga-1.3.5-py2.7.egg-info/top_level.txt +1 -0
Users/steve/Miniconda/envs/anuga/Lib/site-packages/anuga/shallow_water/shallow_water_domain.py
ADDED
|
@@ -0,0 +1,3114 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Finite-volume computations of the shallow water wave equation.
|
|
3
|
+
|
|
4
|
+
Title: ANGUA shallow_water_domain - 2D triangular domains for finite-volume
|
|
5
|
+
computations of the shallow water wave equation.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Author: Ole Nielsen, Ole.Nielsen@ga.gov.au
|
|
9
|
+
Stephen Roberts, Stephen.Roberts@anu.edu.au
|
|
10
|
+
Duncan Gray, Duncan.Gray@ga.gov.au
|
|
11
|
+
|
|
12
|
+
CreationDate: 2004
|
|
13
|
+
|
|
14
|
+
Description:
|
|
15
|
+
This module contains a specialisation of class Generic_Domain from
|
|
16
|
+
module generic_domain.py consisting of methods specific to the
|
|
17
|
+
Shallow Water Wave Equation
|
|
18
|
+
|
|
19
|
+
U_t + E_x + G_y = S
|
|
20
|
+
|
|
21
|
+
where
|
|
22
|
+
|
|
23
|
+
U = [w, uh, vh]
|
|
24
|
+
E = [uh, u^2h + gh^2/2, uvh]
|
|
25
|
+
G = [vh, uvh, v^2h + gh^2/2]
|
|
26
|
+
S represents source terms forcing the system
|
|
27
|
+
(e.g. gravity, friction, wind stress, ...)
|
|
28
|
+
|
|
29
|
+
and _t, _x, _y denote the derivative with respect to t, x and y
|
|
30
|
+
respectively.
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
The quantities are
|
|
34
|
+
|
|
35
|
+
symbol variable name explanation
|
|
36
|
+
x x horizontal distance from origin [m]
|
|
37
|
+
y y vertical distance from origin [m]
|
|
38
|
+
z elevation elevation of bed on which flow is modelled [m]
|
|
39
|
+
h height water height above z [m]
|
|
40
|
+
w stage absolute water level, w = z+h [m]
|
|
41
|
+
u speed in the x direction [m/s]
|
|
42
|
+
v speed in the y direction [m/s]
|
|
43
|
+
uh xmomentum momentum in the x direction [m^2/s]
|
|
44
|
+
vh ymomentum momentum in the y direction [m^2/s]
|
|
45
|
+
|
|
46
|
+
eta mannings friction coefficient [to appear]
|
|
47
|
+
nu wind stress coefficient [to appear]
|
|
48
|
+
|
|
49
|
+
The conserved quantities are w, uh, vh
|
|
50
|
+
|
|
51
|
+
Reference:
|
|
52
|
+
Catastrophic Collapse of Water Supply Reservoirs in Urban Areas,
|
|
53
|
+
Christopher Zoppou and Stephen Roberts,
|
|
54
|
+
Journal of Hydraulic Engineering, vol. 127, No. 7 July 1999
|
|
55
|
+
|
|
56
|
+
Hydrodynamic modelling of coastal inundation.
|
|
57
|
+
Nielsen, O., S. Roberts, D. Gray, A. McPherson and A. Hitchman
|
|
58
|
+
In Zerger, A. and Argent, R.M. (eds) MODSIM 2005 International Congress on
|
|
59
|
+
Modelling and Simulation. Modelling and Simulation Society of Australia and
|
|
60
|
+
New Zealand, December 2005, pp. 518-523. ISBN: 0-9758400-2-9.
|
|
61
|
+
http://www.mssanz.org.au/modsim05/papers/nielsen.pdf
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
SeeAlso:
|
|
65
|
+
TRAC administration of ANUGA (User Manuals etc) at
|
|
66
|
+
https://anuga.anu.edu.au and Subversion repository at
|
|
67
|
+
$HeadURL: https://anuga.anu.edu.au/svn/anuga/trunk/anuga_core/source/
|
|
68
|
+
anuga/shallow_water/shallow_water_domain.py $
|
|
69
|
+
|
|
70
|
+
Constraints: See GPL license in the user guide
|
|
71
|
+
Version: 1.0 ($Revision: 9654 $)
|
|
72
|
+
ModifiedBy:
|
|
73
|
+
$Author: davies $
|
|
74
|
+
$Date: 2015-02-10 18:31:01 +1100 (Tue, 10 Feb 2015) $
|
|
75
|
+
"""
|
|
76
|
+
|
|
77
|
+
# Decorator added for profiling
|
|
78
|
+
#------------------------------
|
|
79
|
+
import cProfile#
|
|
80
|
+
|
|
81
|
+
def profileit(name):
|
|
82
|
+
def inner(func):
|
|
83
|
+
def wrapper(*args, **kwargs):
|
|
84
|
+
prof = cProfile.Profile()
|
|
85
|
+
retval = prof.runcall(func, *args, **kwargs)
|
|
86
|
+
# Note use of name from outer scope
|
|
87
|
+
print str(args[1])+"_"+name
|
|
88
|
+
prof.dump_stats(str(args[1])+"_"+name)
|
|
89
|
+
return retval
|
|
90
|
+
return wrapper
|
|
91
|
+
return inner
|
|
92
|
+
#-----------------------------
|
|
93
|
+
|
|
94
|
+
import numpy as num
|
|
95
|
+
import sys
|
|
96
|
+
import os
|
|
97
|
+
import time
|
|
98
|
+
import cPickle
|
|
99
|
+
|
|
100
|
+
from anuga.abstract_2d_finite_volumes.generic_domain \
|
|
101
|
+
import Generic_Domain
|
|
102
|
+
|
|
103
|
+
from anuga.shallow_water.forcing import Cross_section
|
|
104
|
+
from anuga.utilities.numerical_tools import mean
|
|
105
|
+
from anuga.file.sww import SWW_file
|
|
106
|
+
|
|
107
|
+
import anuga.utilities.log as log
|
|
108
|
+
|
|
109
|
+
from anuga.utilities.parallel_abstraction import size, rank, get_processor_name
|
|
110
|
+
from anuga.utilities.parallel_abstraction import finalize, send, receive
|
|
111
|
+
from anuga.utilities.parallel_abstraction import pypar_available, barrier
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
#from pypar import size, rank, send, receive, barrier
|
|
115
|
+
|
|
116
|
+
class Domain(Generic_Domain):
|
|
117
|
+
"""
|
|
118
|
+
This class is a specialization of class Generic_Domain from
|
|
119
|
+
module generic_domain.py consisting of methods specific to the
|
|
120
|
+
Shallow Water Wave Equation
|
|
121
|
+
|
|
122
|
+
U_t + E_x + G_y = S
|
|
123
|
+
|
|
124
|
+
where
|
|
125
|
+
|
|
126
|
+
U = [w, uh, vh]
|
|
127
|
+
E = [uh, u^2h + gh^2/2, uvh]
|
|
128
|
+
G = [vh, uvh, v^2h + gh^2/2]
|
|
129
|
+
|
|
130
|
+
S represents source terms forcing the system
|
|
131
|
+
(e.g. gravity, friction, wind stress, ...)
|
|
132
|
+
|
|
133
|
+
and _t, _x, _y denote the derivative with respect to t, x and y
|
|
134
|
+
respectively.
|
|
135
|
+
|
|
136
|
+
The quantities are
|
|
137
|
+
|
|
138
|
+
symbol variable name explanation
|
|
139
|
+
x x horizontal distance from origin [m]
|
|
140
|
+
y y vertical distance from origin [m]
|
|
141
|
+
z elevation elevation of bed on which flow is modelled [m]
|
|
142
|
+
h height water height above z [m]
|
|
143
|
+
w stage absolute water level, w = z+h [m]
|
|
144
|
+
u speed in the x direction [m/s]
|
|
145
|
+
v speed in the y direction [m/s]
|
|
146
|
+
uh xmomentum momentum in the x direction [m^2/s]
|
|
147
|
+
vh ymomentum momentum in the y direction [m^2/s]
|
|
148
|
+
|
|
149
|
+
eta mannings friction coefficient [to appear]
|
|
150
|
+
nu wind stress coefficient [to appear]
|
|
151
|
+
|
|
152
|
+
The conserved quantities are w, uh, vh
|
|
153
|
+
"""
|
|
154
|
+
|
|
155
|
+
def __init__(self,
|
|
156
|
+
coordinates=None,
|
|
157
|
+
vertices=None,
|
|
158
|
+
boundary=None,
|
|
159
|
+
tagged_elements=None,
|
|
160
|
+
geo_reference=None,
|
|
161
|
+
use_inscribed_circle=False,
|
|
162
|
+
mesh_filename=None,
|
|
163
|
+
use_cache=False,
|
|
164
|
+
verbose=False,
|
|
165
|
+
conserved_quantities = None,
|
|
166
|
+
evolved_quantities = None,
|
|
167
|
+
other_quantities = None,
|
|
168
|
+
full_send_dict=None,
|
|
169
|
+
ghost_recv_dict=None,
|
|
170
|
+
starttime=0,
|
|
171
|
+
processor=0,
|
|
172
|
+
numproc=1,
|
|
173
|
+
number_of_full_nodes=None,
|
|
174
|
+
number_of_full_triangles=None,
|
|
175
|
+
ghost_layer_width=2,
|
|
176
|
+
**kwargs):
|
|
177
|
+
|
|
178
|
+
"""
|
|
179
|
+
Instantiate a shallow water domain.
|
|
180
|
+
|
|
181
|
+
@param coordinates: vertex locations for the mesh
|
|
182
|
+
@param vertices: vertex indices for the mesh
|
|
183
|
+
@param boundary: boundaries of the mesh
|
|
184
|
+
"""
|
|
185
|
+
|
|
186
|
+
# Define quantities for the shallow_water domain
|
|
187
|
+
if conserved_quantities == None:
|
|
188
|
+
conserved_quantities = ['stage', 'xmomentum', 'ymomentum']
|
|
189
|
+
|
|
190
|
+
if evolved_quantities == None:
|
|
191
|
+
evolved_quantities = ['stage', 'xmomentum', 'ymomentum']
|
|
192
|
+
|
|
193
|
+
if other_quantities == None:
|
|
194
|
+
other_quantities = ['elevation', 'friction', 'height',
|
|
195
|
+
'xvelocity', 'yvelocity', 'x', 'y']
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
Generic_Domain.__init__(self,
|
|
202
|
+
coordinates,
|
|
203
|
+
vertices,
|
|
204
|
+
boundary,
|
|
205
|
+
conserved_quantities,
|
|
206
|
+
evolved_quantities,
|
|
207
|
+
other_quantities,
|
|
208
|
+
tagged_elements,
|
|
209
|
+
geo_reference,
|
|
210
|
+
use_inscribed_circle,
|
|
211
|
+
mesh_filename,
|
|
212
|
+
use_cache,
|
|
213
|
+
verbose,
|
|
214
|
+
full_send_dict,
|
|
215
|
+
ghost_recv_dict,
|
|
216
|
+
starttime,
|
|
217
|
+
processor,
|
|
218
|
+
numproc,
|
|
219
|
+
number_of_full_nodes=number_of_full_nodes,
|
|
220
|
+
number_of_full_triangles=number_of_full_triangles,
|
|
221
|
+
ghost_layer_width=ghost_layer_width)
|
|
222
|
+
|
|
223
|
+
self._set_defaults()
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
#-------------------------------
|
|
227
|
+
# Forcing Terms
|
|
228
|
+
#
|
|
229
|
+
# Gravity is now incorporated in
|
|
230
|
+
# compute_fluxes routine
|
|
231
|
+
#-------------------------------
|
|
232
|
+
self.forcing_terms.append(manning_friction_implicit)
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
#-------------------------------
|
|
236
|
+
# Operators
|
|
237
|
+
#-------------------------------
|
|
238
|
+
self.fractional_step_operators = []
|
|
239
|
+
self.kv_operator = None
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
#-------------------------------
|
|
244
|
+
# Stored output
|
|
245
|
+
#-------------------------------
|
|
246
|
+
self.set_store(True)
|
|
247
|
+
self.set_store_centroids(False)
|
|
248
|
+
self.set_store_vertices_uniquely(False)
|
|
249
|
+
self.quantities_to_be_stored = {'elevation': 1,
|
|
250
|
+
'friction':1,
|
|
251
|
+
'stage': 2,
|
|
252
|
+
'xmomentum': 2,
|
|
253
|
+
'ymomentum': 2}
|
|
254
|
+
|
|
255
|
+
#-------------------------------
|
|
256
|
+
# Set up check pointing every n
|
|
257
|
+
# yieldsteps
|
|
258
|
+
#-------------------------------
|
|
259
|
+
self.checkpoint = False
|
|
260
|
+
self.yieldstep_id = 1
|
|
261
|
+
self.checkpoint_step = 10
|
|
262
|
+
|
|
263
|
+
#-------------------------------
|
|
264
|
+
# Useful auxiliary quantity
|
|
265
|
+
#-------------------------------
|
|
266
|
+
n = self.number_of_elements
|
|
267
|
+
self.quantities['x'].set_values(self.vertex_coordinates[:,0].reshape(n,3))
|
|
268
|
+
self.quantities['x'].set_boundary_values_from_edges()
|
|
269
|
+
|
|
270
|
+
self.quantities['y'].set_values(self.vertex_coordinates[:,1].reshape(n,3))
|
|
271
|
+
self.quantities['y'].set_boundary_values_from_edges()
|
|
272
|
+
|
|
273
|
+
# For riverwalls, we need to know the 'edge_flux_type' for each edge
|
|
274
|
+
# Edge-flux-type of 0 == Normal edge, with shallow water flux
|
|
275
|
+
# 1 == riverwall
|
|
276
|
+
# 2 == ?
|
|
277
|
+
# etc
|
|
278
|
+
self.edge_flux_type=num.zeros(len(self.edge_coordinates[:,0])).astype(int)
|
|
279
|
+
|
|
280
|
+
# Riverwalls -- initialise with dummy values
|
|
281
|
+
# Presently only works with DE algorithms, will fail otherwise
|
|
282
|
+
import anuga.structures.riverwall
|
|
283
|
+
self.riverwallData=anuga.structures.riverwall.RiverWall(self)
|
|
284
|
+
|
|
285
|
+
## Keep track of the fluxes through the boundaries
|
|
286
|
+
## Only works for DE algorithms at present
|
|
287
|
+
max_time_substeps=3 # Maximum number of substeps supported by any timestepping method
|
|
288
|
+
# boundary_flux_sum holds boundary fluxes on each sub-step [unused substeps = 0.]
|
|
289
|
+
self.boundary_flux_sum=num.array([0.]*max_time_substeps)
|
|
290
|
+
from anuga.operators.boundary_flux_integral_operator import boundary_flux_integral_operator
|
|
291
|
+
self.boundary_flux_integral=boundary_flux_integral_operator(self)
|
|
292
|
+
# Make an integer counting how many times we call compute_fluxes_central -- so we know which substep we are on
|
|
293
|
+
#self.call=1
|
|
294
|
+
|
|
295
|
+
# List to store the volumes we computed before
|
|
296
|
+
self.volume_history=[]
|
|
297
|
+
|
|
298
|
+
# Work arrays [avoid allocate statements in compute_fluxes or extrapolate_second_order]
|
|
299
|
+
self.edge_flux_work=num.zeros(len(self.edge_coordinates[:,0])*3) # Advective fluxes
|
|
300
|
+
self.pressuregrad_work=num.zeros(len(self.edge_coordinates[:,0])) # Gravity related terms
|
|
301
|
+
self.x_centroid_work=num.zeros(len(self.edge_coordinates[:,0])/3)
|
|
302
|
+
self.y_centroid_work=num.zeros(len(self.edge_coordinates[:,0])/3)
|
|
303
|
+
|
|
304
|
+
############################################################################
|
|
305
|
+
## Local-timestepping information
|
|
306
|
+
#
|
|
307
|
+
# Fluxes can be updated every 1, 2, 4, 8, .. max_flux_update_frequency timesteps
|
|
308
|
+
# The global timestep is not allowed to increase except when
|
|
309
|
+
# number_of_timesteps%max_flux_update_frequency==0
|
|
310
|
+
self.max_flux_update_frequency=2**0 # Must be a power of 2.
|
|
311
|
+
|
|
312
|
+
# flux_update_frequency. The edge flux terms are re-computed only when
|
|
313
|
+
# number_of_timesteps%flux_update_frequency[myEdge]==0
|
|
314
|
+
self.flux_update_frequency=num.zeros(len(self.edge_coordinates[:,0])).astype(int)+1
|
|
315
|
+
# Flag: should we update the flux on the next compute fluxes call?
|
|
316
|
+
self.update_next_flux=num.zeros(len(self.edge_coordinates[:,0])).astype(int)+1
|
|
317
|
+
# Flag: should we update the extrapolation on the next extrapolation call?
|
|
318
|
+
# (Only do this if one or more of the fluxes on that triangle will be computed on
|
|
319
|
+
# the next timestep, assuming only the flux computation uses edge/vertex values)
|
|
320
|
+
self.update_extrapolation=num.zeros(len(self.edge_coordinates[:,0])/3).astype(int)+1
|
|
321
|
+
|
|
322
|
+
# edge_timestep [wavespeed/radius] -- not updated every timestep
|
|
323
|
+
self.edge_timestep=num.zeros(len(self.edge_coordinates[:,0]))+1.0e+100
|
|
324
|
+
|
|
325
|
+
# Do we allow the timestep to increase (not every time if local
|
|
326
|
+
# extrapolation/flux updating is used)
|
|
327
|
+
self.allow_timestep_increase=num.zeros(1).astype(int)+1
|
|
328
|
+
|
|
329
|
+
def _set_defaults(self):
|
|
330
|
+
"""Set the default values in this routine. That way we can inherit class
|
|
331
|
+
and just redefine the defaults for the new class
|
|
332
|
+
"""
|
|
333
|
+
|
|
334
|
+
from anuga.config import minimum_storable_height
|
|
335
|
+
from anuga.config import minimum_allowed_height, maximum_allowed_speed
|
|
336
|
+
from anuga.config import g
|
|
337
|
+
from anuga.config import tight_slope_limiters
|
|
338
|
+
from anuga.config import extrapolate_velocity_second_order
|
|
339
|
+
from anuga.config import alpha_balance
|
|
340
|
+
from anuga.config import optimise_dry_cells
|
|
341
|
+
from anuga.config import optimised_gradient_limiter
|
|
342
|
+
from anuga.config import use_edge_limiter
|
|
343
|
+
from anuga.config import use_centroid_velocities
|
|
344
|
+
from anuga.config import compute_fluxes_method
|
|
345
|
+
from anuga.config import distribute_to_vertices_and_edges_method
|
|
346
|
+
from anuga.config import sloped_mannings_function
|
|
347
|
+
from anuga.config import flow_algorithm
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
# Early algorithms need elevation to remain continuous
|
|
351
|
+
self.set_using_discontinuous_elevation(False)
|
|
352
|
+
|
|
353
|
+
self.set_minimum_allowed_height(minimum_allowed_height)
|
|
354
|
+
self.maximum_allowed_speed = maximum_allowed_speed
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
self.minimum_storable_height = minimum_storable_height
|
|
359
|
+
self.g = g
|
|
360
|
+
|
|
361
|
+
self.alpha_balance = alpha_balance
|
|
362
|
+
self.tight_slope_limiters = tight_slope_limiters
|
|
363
|
+
|
|
364
|
+
self.set_use_optimise_dry_cells(optimise_dry_cells)
|
|
365
|
+
self.set_extrapolate_velocity(extrapolate_velocity_second_order)
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
self.set_use_edge_limiter(use_edge_limiter)
|
|
369
|
+
self.optimised_gradient_limiter = optimised_gradient_limiter
|
|
370
|
+
self.use_centroid_velocities = use_centroid_velocities
|
|
371
|
+
|
|
372
|
+
self.set_sloped_mannings_function(sloped_mannings_function)
|
|
373
|
+
self.set_compute_fluxes_method(compute_fluxes_method)
|
|
374
|
+
self.set_flow_algorithm(flow_algorithm)
|
|
375
|
+
|
|
376
|
+
self.set_distribute_to_vertices_and_edges_method(distribute_to_vertices_and_edges_method)
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
def get_algorithm_parameters(self):
|
|
380
|
+
"""
|
|
381
|
+
Get the standard parameter that are currently set (as a dictionary)
|
|
382
|
+
"""
|
|
383
|
+
|
|
384
|
+
parameters = {}
|
|
385
|
+
|
|
386
|
+
parameters['minimum_allowed_height'] = self.minimum_allowed_height
|
|
387
|
+
parameters['maximum_allowed_speed'] = self.maximum_allowed_speed
|
|
388
|
+
parameters['minimum_storable_height'] = self.minimum_storable_height
|
|
389
|
+
parameters['g'] = self.g
|
|
390
|
+
parameters['alpha_balance'] = self.alpha_balance
|
|
391
|
+
parameters['tight_slope_limiters'] = self.tight_slope_limiters
|
|
392
|
+
parameters['optimise_dry_cells'] = self.optimise_dry_cells
|
|
393
|
+
parameters['use_edge_limiter'] = self.use_edge_limiter
|
|
394
|
+
parameters['use_centroid_velocities'] = self.use_centroid_velocities
|
|
395
|
+
parameters['use_sloped_mannings'] = self.use_sloped_mannings
|
|
396
|
+
parameters['compute_fluxes_method'] = self.get_compute_fluxes_method()
|
|
397
|
+
parameters['distribute_to_vertices_and_edges_method'] = \
|
|
398
|
+
self.get_distribute_to_vertices_and_edges_method()
|
|
399
|
+
parameters['flow_algorithm'] = self.get_flow_algorithm()
|
|
400
|
+
parameters['CFL'] = self.get_CFL()
|
|
401
|
+
parameters['timestepping_method'] = self.get_timestepping_method()
|
|
402
|
+
|
|
403
|
+
parameters['optimised_gradient_limiter'] = self.optimised_gradient_limiter
|
|
404
|
+
parameters['extrapolate_velocity_second_order'] = self.extrapolate_velocity_second_order
|
|
405
|
+
|
|
406
|
+
return parameters
|
|
407
|
+
|
|
408
|
+
def print_algorithm_parameters(self):
|
|
409
|
+
"""
|
|
410
|
+
Print the standard parameters that are curently set (as a dictionary)
|
|
411
|
+
"""
|
|
412
|
+
|
|
413
|
+
print '#============================'
|
|
414
|
+
print '# Domain Algorithm Parameters '
|
|
415
|
+
print '#============================'
|
|
416
|
+
from pprint import pprint
|
|
417
|
+
pprint(self.get_algorithm_parameters(),indent=4)
|
|
418
|
+
|
|
419
|
+
print '#----------------------------'
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
def _set_tsunami_defaults(self):
|
|
423
|
+
"""Set up the defaults for running the flow_algorithm "tsunami"
|
|
424
|
+
"""
|
|
425
|
+
|
|
426
|
+
self.set_CFL(1.0)
|
|
427
|
+
#self.set_use_kinematic_viscosity(False)
|
|
428
|
+
|
|
429
|
+
self.set_timestepping_method(2)
|
|
430
|
+
self.set_default_order(2)
|
|
431
|
+
self.set_compute_fluxes_method('tsunami')
|
|
432
|
+
self.set_extrapolate_velocity()
|
|
433
|
+
self.set_distribute_to_vertices_and_edges_method('tsunami')
|
|
434
|
+
self.use_edge_limiter=True
|
|
435
|
+
|
|
436
|
+
# The following allows storage of the negative depths associated with this method
|
|
437
|
+
self.minimum_storable_height=-99999999999.0
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
# Note that the extrapolation method used in quantity_ext.c (e.g.
|
|
441
|
+
# extrapolate_second_order_and_limit_by_edge) uses a constant value for
|
|
442
|
+
# all the betas.
|
|
443
|
+
self.beta_w=1.0
|
|
444
|
+
self.beta_w_dry=1.0
|
|
445
|
+
self.beta_uh=1.0
|
|
446
|
+
self.beta_uh_dry=1.0
|
|
447
|
+
self.beta_vh=1.0
|
|
448
|
+
self.beta_vh_dry=1.0
|
|
449
|
+
|
|
450
|
+
#self.optimise_dry_cells=True
|
|
451
|
+
# "self.optimise_dry_cells=False" presently ensures that the stage is
|
|
452
|
+
# always >= minimum_bed_edge value. Actually, we should only need to
|
|
453
|
+
# apply 'False' on the very first time step (to deal with stage values
|
|
454
|
+
# that were initialised below the bed by the user). After this, the
|
|
455
|
+
# algorithm should take care of itself, and 'True' should be okay.
|
|
456
|
+
self.optimise_dry_cells=False
|
|
457
|
+
|
|
458
|
+
# Because gravity is treated within the flux function,
|
|
459
|
+
# we remove it from the forcing terms.
|
|
460
|
+
#self.forcing_terms.remove(gravity)
|
|
461
|
+
|
|
462
|
+
# We need the edge_coordinates for the extrapolation
|
|
463
|
+
self.edge_coordinates=self.get_edge_midpoint_coordinates()
|
|
464
|
+
|
|
465
|
+
## (OLD) We demand that vertex values are stored uniquely
|
|
466
|
+
##self.set_store_vertices_smoothly(False)
|
|
467
|
+
# Now we can just store centroids directly
|
|
468
|
+
self.set_store_centroids(True)
|
|
469
|
+
|
|
470
|
+
self.maximum_allowed_speed=0.0
|
|
471
|
+
#self.minimum_allowed_height=0.01
|
|
472
|
+
|
|
473
|
+
#self.forcing_terms.append(manning_friction_explicit)
|
|
474
|
+
#self.forcing_terms.remove(manning_friction_implicit)
|
|
475
|
+
if self.processor == 0 and self.verbose:
|
|
476
|
+
print '##########################################################################'
|
|
477
|
+
print '#'
|
|
478
|
+
print "#"
|
|
479
|
+
print "# Here are some tips on using the 'tsunami' solver"
|
|
480
|
+
print "#"
|
|
481
|
+
print "# 1) When plotting outputs, I strongly suggest you examine centroid values, not vertex values"
|
|
482
|
+
print "# , as the latter can be completely misleading near strong gradients in the flow. "
|
|
483
|
+
print "# There is a plot_util.py script in anuga_core/utilities/ which might help you extract"
|
|
484
|
+
print "# quantities at centroid values from sww files."
|
|
485
|
+
print "# Note that to accuractely compute centroid values from sww files, the files need to store "
|
|
486
|
+
print "# vertices uniquely. This makes for large sww files (3x), but is the price to pay for the right answer"
|
|
487
|
+
print "# (unless we alter IO to allow centroids to be written to sww files, which would then affect"
|
|
488
|
+
print "# ANUGA viewer as well -- I expect this would be lots of work)"
|
|
489
|
+
print "#"
|
|
490
|
+
print "# 2) In field scale applications (where the depth is typically > 1m), I suggest you set"
|
|
491
|
+
print "# domain.minimum_allowed_height=0.01 (the default is 1.0e-3). "
|
|
492
|
+
print "#"
|
|
493
|
+
print "# 3) This solver is not expected to perform well in problems with very"
|
|
494
|
+
print "# shallow water flowing down steep slopes (such that the stage_centroid_value "
|
|
495
|
+
print "# is less than the maximum bed_edge_value on a given triangle). However, analytical tests"
|
|
496
|
+
print "# suggest it can do typical wetting/drying situations very well (parabolic oscillations test case) "
|
|
497
|
+
print "#"
|
|
498
|
+
print "# 4) This solver allows the stage_centroid_value to drop to slightly below the minimum bed_vertex_value"
|
|
499
|
+
print "# on it's triangle. In other ANUGA versions (e.g. 1.2.1), the limit would be the"
|
|
500
|
+
print "# bed_centroid_value. This means that triangles store slightly more water than they are"
|
|
501
|
+
print "# typically interpreted to store, which might have significance in some applications."
|
|
502
|
+
print "#"
|
|
503
|
+
print "# You will probably be able to tell this is causing you problems by convergence testing"
|
|
504
|
+
print "#"
|
|
505
|
+
print '# 5) Note that many options in config.py have been overridden by the solver -- we have '
|
|
506
|
+
print '# deliberately attempted to get the solver to perform well with consistent values of '
|
|
507
|
+
print '# these parameters -- so I advise against changing them unless you at least check that '
|
|
508
|
+
print '# it really does improve things'
|
|
509
|
+
print '#'
|
|
510
|
+
print '##########################################################################'
|
|
511
|
+
|
|
512
|
+
def _set_DE1_defaults(self):
|
|
513
|
+
"""Set up the defaults for running the flow_algorithm "DE1"
|
|
514
|
+
A 'discontinuous elevation' method
|
|
515
|
+
"""
|
|
516
|
+
self.set_CFL(1.0)
|
|
517
|
+
self.set_use_kinematic_viscosity(False)
|
|
518
|
+
#self.timestepping_method='rk2'#'rk3'#'euler'#'rk2'
|
|
519
|
+
self.set_timestepping_method(2)
|
|
520
|
+
|
|
521
|
+
self.set_using_discontinuous_elevation(True)
|
|
522
|
+
self.set_compute_fluxes_method('DE')
|
|
523
|
+
self.set_distribute_to_vertices_and_edges_method('DE')
|
|
524
|
+
|
|
525
|
+
# Don't place any restriction on the minimum storable height
|
|
526
|
+
self.minimum_storable_height=-99999999999.0
|
|
527
|
+
self.minimum_allowed_height=1.0e-5
|
|
528
|
+
|
|
529
|
+
self.use_edge_limiter=True
|
|
530
|
+
self.set_default_order(2)
|
|
531
|
+
self.set_extrapolate_velocity()
|
|
532
|
+
|
|
533
|
+
self.beta_w=1.0
|
|
534
|
+
self.beta_w_dry=0.0
|
|
535
|
+
self.beta_uh=1.0
|
|
536
|
+
self.beta_uh_dry=0.0
|
|
537
|
+
self.beta_vh=1.0
|
|
538
|
+
self.beta_vh_dry=0.0
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
#self.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2,
|
|
542
|
+
# 'ymomentum': 2, 'elevation': 2, 'height':2})
|
|
543
|
+
#self.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2,
|
|
544
|
+
# 'ymomentum': 2, 'elevation': 1})
|
|
545
|
+
self.set_store_centroids(True)
|
|
546
|
+
|
|
547
|
+
self.optimise_dry_cells=False
|
|
548
|
+
|
|
549
|
+
# We need the edge_coordinates for the extrapolation
|
|
550
|
+
self.edge_coordinates=self.get_edge_midpoint_coordinates()
|
|
551
|
+
|
|
552
|
+
# By default vertex values are NOT stored uniquely
|
|
553
|
+
# for storage efficiency. We may override this (but not so important since
|
|
554
|
+
# centroids are stored anyway
|
|
555
|
+
# self.set_store_vertices_smoothly(False)
|
|
556
|
+
|
|
557
|
+
self.maximum_allowed_speed=0.0
|
|
558
|
+
|
|
559
|
+
|
|
560
|
+
if self.processor == 0 and self.verbose:
|
|
561
|
+
print '##########################################################################'
|
|
562
|
+
print '#'
|
|
563
|
+
print '# Using discontinuous elevation solver DE1 '
|
|
564
|
+
print '#'
|
|
565
|
+
print '# Mostly designed for rk2 timestepping'
|
|
566
|
+
print '#'
|
|
567
|
+
print '# Make sure you use centroid values when reporting on important output quantities'
|
|
568
|
+
print '#'
|
|
569
|
+
print '##########################################################################'
|
|
570
|
+
|
|
571
|
+
def _set_DE0_defaults(self):
|
|
572
|
+
"""Set up the defaults for running the flow_algorithm "DE0"
|
|
573
|
+
A 'discontinuous elevation' method
|
|
574
|
+
"""
|
|
575
|
+
self.set_CFL(0.9)
|
|
576
|
+
self.set_use_kinematic_viscosity(False)
|
|
577
|
+
#self.timestepping_method='rk2'#'rk3'#'euler'#'rk2'
|
|
578
|
+
self.set_timestepping_method('euler')
|
|
579
|
+
|
|
580
|
+
self.set_using_discontinuous_elevation(True)
|
|
581
|
+
self.set_compute_fluxes_method('DE')
|
|
582
|
+
self.set_distribute_to_vertices_and_edges_method('DE')
|
|
583
|
+
|
|
584
|
+
# Don't place any restriction on the minimum storable height
|
|
585
|
+
self.minimum_storable_height=-99999999999.0
|
|
586
|
+
self.minimum_allowed_height=1.0e-12
|
|
587
|
+
|
|
588
|
+
self.use_edge_limiter=True
|
|
589
|
+
self.set_default_order(2)
|
|
590
|
+
self.set_extrapolate_velocity()
|
|
591
|
+
|
|
592
|
+
self.beta_w=0.5
|
|
593
|
+
self.beta_w_dry=0.0
|
|
594
|
+
self.beta_uh=0.5
|
|
595
|
+
self.beta_uh_dry=0.0
|
|
596
|
+
self.beta_vh=0.5
|
|
597
|
+
self.beta_vh_dry=0.0
|
|
598
|
+
|
|
599
|
+
|
|
600
|
+
#self.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2,
|
|
601
|
+
# 'ymomentum': 2, 'elevation': 2, 'height':2})
|
|
602
|
+
#self.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2,
|
|
603
|
+
# 'ymomentum': 2, 'elevation': 1})
|
|
604
|
+
self.set_store_centroids(True)
|
|
605
|
+
|
|
606
|
+
self.optimise_dry_cells=False
|
|
607
|
+
|
|
608
|
+
# We need the edge_coordinates for the extrapolation
|
|
609
|
+
self.edge_coordinates=self.get_edge_midpoint_coordinates()
|
|
610
|
+
|
|
611
|
+
# By default vertex values are NOT stored uniquely
|
|
612
|
+
# for storage efficiency. We may override this (but not so important since
|
|
613
|
+
# centroids are stored anyway
|
|
614
|
+
# self.set_store_vertices_smoothly(False)
|
|
615
|
+
|
|
616
|
+
self.maximum_allowed_speed=0.0
|
|
617
|
+
|
|
618
|
+
if self.processor == 0 and self.verbose:
|
|
619
|
+
print '##########################################################################'
|
|
620
|
+
print '#'
|
|
621
|
+
print '# Using discontinuous elevation solver DE0'
|
|
622
|
+
print '#'
|
|
623
|
+
print '# First order timestepping'
|
|
624
|
+
print '#'
|
|
625
|
+
print '# Make sure you use centroid values when reporting on important output quantities'
|
|
626
|
+
print '#'
|
|
627
|
+
print '##########################################################################'
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
def _set_DE2_defaults(self):
|
|
631
|
+
"""Set up the defaults for running the flow_algorithm "DE2"
|
|
632
|
+
A 'discontinuous elevation' method
|
|
633
|
+
"""
|
|
634
|
+
self.set_CFL(1.0)
|
|
635
|
+
self.set_use_kinematic_viscosity(False)
|
|
636
|
+
#self.timestepping_method='rk2'#'rk3'#'euler'#'rk2'
|
|
637
|
+
self.set_timestepping_method(2)
|
|
638
|
+
|
|
639
|
+
self.set_using_discontinuous_elevation(True)
|
|
640
|
+
self.set_compute_fluxes_method('DE')
|
|
641
|
+
self.set_distribute_to_vertices_and_edges_method('DE')
|
|
642
|
+
|
|
643
|
+
# Don't place any restriction on the minimum storable height
|
|
644
|
+
self.minimum_storable_height=-99999999999.0
|
|
645
|
+
self.minimum_allowed_height=1.0e-12
|
|
646
|
+
|
|
647
|
+
self.use_edge_limiter=True
|
|
648
|
+
self.set_default_order(2)
|
|
649
|
+
self.set_extrapolate_velocity()
|
|
650
|
+
|
|
651
|
+
self.beta_w=0.75
|
|
652
|
+
self.beta_w_dry=0.1
|
|
653
|
+
self.beta_uh=0.75
|
|
654
|
+
self.beta_uh_dry=0.1
|
|
655
|
+
self.beta_vh=0.75
|
|
656
|
+
self.beta_vh_dry=0.1
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
#self.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2,
|
|
660
|
+
# 'ymomentum': 2, 'elevation': 2, 'height':2})
|
|
661
|
+
#self.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2,
|
|
662
|
+
# 'ymomentum': 2, 'elevation': 1})
|
|
663
|
+
self.set_store_centroids(True)
|
|
664
|
+
|
|
665
|
+
self.optimise_dry_cells=False
|
|
666
|
+
|
|
667
|
+
# We need the edge_coordinates for the extrapolation
|
|
668
|
+
self.edge_coordinates=self.get_edge_midpoint_coordinates()
|
|
669
|
+
|
|
670
|
+
# By default vertex values are NOT stored uniquely
|
|
671
|
+
# for storage efficiency. We may override this (but not so important since
|
|
672
|
+
# centroids are stored anyway
|
|
673
|
+
# self.set_store_vertices_smoothly(False)
|
|
674
|
+
|
|
675
|
+
self.maximum_allowed_speed=0.0
|
|
676
|
+
|
|
677
|
+
if self.processor == 0 and self.verbose:
|
|
678
|
+
print '##########################################################################'
|
|
679
|
+
print '#'
|
|
680
|
+
print '# Using discontinuous elevation solver DE2 '
|
|
681
|
+
print '#'
|
|
682
|
+
print '# A slightly more diffusive version of DE1, does use rk2 timestepping'
|
|
683
|
+
print '#'
|
|
684
|
+
print '# Make sure you use centroid values when reporting on important output quantities'
|
|
685
|
+
print '#'
|
|
686
|
+
print '##########################################################################'
|
|
687
|
+
|
|
688
|
+
|
|
689
|
+
def _set_DE3_defaults(self):
|
|
690
|
+
"""Set up the defaults for running the flow_algorithm "DE3"
|
|
691
|
+
A 'discontinuous elevation' method
|
|
692
|
+
"""
|
|
693
|
+
|
|
694
|
+
self.set_CFL(0.9)
|
|
695
|
+
self.set_use_kinematic_viscosity(False)
|
|
696
|
+
#self.timestepping_method='rk2'#'rk3'#'euler'#'rk2'
|
|
697
|
+
self.set_timestepping_method(1)
|
|
698
|
+
|
|
699
|
+
self.set_using_discontinuous_elevation(True)
|
|
700
|
+
self.set_compute_fluxes_method('DE')
|
|
701
|
+
self.set_distribute_to_vertices_and_edges_method('DE')
|
|
702
|
+
|
|
703
|
+
# Don't place any restriction on the minimum storable height
|
|
704
|
+
self.minimum_storable_height=-99999999999.0
|
|
705
|
+
self.minimum_allowed_height=1.0e-12
|
|
706
|
+
|
|
707
|
+
self.use_edge_limiter=True
|
|
708
|
+
self.set_default_order(2)
|
|
709
|
+
self.set_extrapolate_velocity()
|
|
710
|
+
|
|
711
|
+
self.beta_w=0.7
|
|
712
|
+
self.beta_w_dry=0.1
|
|
713
|
+
self.beta_uh=0.7
|
|
714
|
+
self.beta_uh_dry=0.1
|
|
715
|
+
self.beta_vh=0.7
|
|
716
|
+
self.beta_vh_dry=0.1
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
#self.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2,
|
|
720
|
+
# 'ymomentum': 2, 'elevation': 2, 'height':2})
|
|
721
|
+
#self.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2,
|
|
722
|
+
# 'ymomentum': 2, 'elevation': 1})
|
|
723
|
+
self.set_store_centroids(True)
|
|
724
|
+
|
|
725
|
+
self.optimise_dry_cells=False
|
|
726
|
+
|
|
727
|
+
# We need the edge_coordinates for the extrapolation
|
|
728
|
+
self.edge_coordinates=self.get_edge_midpoint_coordinates()
|
|
729
|
+
|
|
730
|
+
# By default vertex values are NOT stored uniquely
|
|
731
|
+
# for storage efficiency. We may override this (but not so important since
|
|
732
|
+
# centroids are stored anyway
|
|
733
|
+
# self.set_store_vertices_smoothly(False)
|
|
734
|
+
|
|
735
|
+
self.maximum_allowed_speed=0.0
|
|
736
|
+
|
|
737
|
+
if self.processor == 0 and self.verbose:
|
|
738
|
+
print '##########################################################################'
|
|
739
|
+
print '#'
|
|
740
|
+
print '# Using discontinuous elevation solver DE3'
|
|
741
|
+
print '#'
|
|
742
|
+
print '# A slightly less diffusive version than DE0, uses euler timestepping'
|
|
743
|
+
print '#'
|
|
744
|
+
print '# Make sure you use centroid values when reporting on important output quantities'
|
|
745
|
+
print '#'
|
|
746
|
+
print '##########################################################################'
|
|
747
|
+
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
def update_special_conditions(self):
|
|
751
|
+
|
|
752
|
+
my_update_special_conditions(self)
|
|
753
|
+
|
|
754
|
+
# Note Padarn 06/12/12: The following line decorates
|
|
755
|
+
# the set_quantity function to be profiled individually.
|
|
756
|
+
# Need to uncomment the decorator at top of file.
|
|
757
|
+
#@profileit("set_quantity.profile")
|
|
758
|
+
def set_quantity(self, name, *args, **kwargs):
|
|
759
|
+
"""Set values for named quantity
|
|
760
|
+
|
|
761
|
+
We have to do something special for 'elevation'
|
|
762
|
+
otherwise pass through to generic set_quantity
|
|
763
|
+
"""
|
|
764
|
+
|
|
765
|
+
# if name == 'elevation':
|
|
766
|
+
# stage_c = self.get_quantity('stage').centroid_values
|
|
767
|
+
# elev_c = self.get_quantity('elevation').centroid_values
|
|
768
|
+
# height_c = stage_c - elev_c
|
|
769
|
+
# Generic_Domain.set_quantity(self, name, *args, **kwargs)
|
|
770
|
+
# stage_c[:] = elev_c + height_c
|
|
771
|
+
# else:
|
|
772
|
+
# Generic_Domain.set_quantity(self, name, *args, **kwargs)
|
|
773
|
+
|
|
774
|
+
Generic_Domain.set_quantity(self, name, *args, **kwargs)
|
|
775
|
+
|
|
776
|
+
|
|
777
|
+
def set_store(self, flag=True):
|
|
778
|
+
"""Set whether data saved to sww file.
|
|
779
|
+
"""
|
|
780
|
+
|
|
781
|
+
self.store = flag
|
|
782
|
+
|
|
783
|
+
def get_store(self):
|
|
784
|
+
"""Get whether data saved to sww file.
|
|
785
|
+
"""
|
|
786
|
+
|
|
787
|
+
return self.store
|
|
788
|
+
|
|
789
|
+
|
|
790
|
+
def set_store_centroids(self, flag=True):
|
|
791
|
+
"""Set whether centroid data is saved to sww file.
|
|
792
|
+
"""
|
|
793
|
+
|
|
794
|
+
self.store_centroids = flag
|
|
795
|
+
|
|
796
|
+
def get_store_centroids(self):
|
|
797
|
+
"""Get whether data saved to sww file.
|
|
798
|
+
"""
|
|
799
|
+
|
|
800
|
+
return self.store_centroids
|
|
801
|
+
|
|
802
|
+
def set_checkpointing(self, checkpoint= True, checkpoint_dir = 'CHECKPOINTS', checkpoint_step=10, checkpoint_time = None):
|
|
803
|
+
"""
|
|
804
|
+
Set up checkpointing.
|
|
805
|
+
|
|
806
|
+
@param checkpoint: Default = True. Set to False will tur off checkpointing
|
|
807
|
+
@param checkpoint_dir: Where to store checkpointing files
|
|
808
|
+
@param checkpoint_step: Save checkpoint files after this many yieldsteps
|
|
809
|
+
@param checkpoint_time: If set, over-rides checkpoint_step. save checkpoint files
|
|
810
|
+
after this amount of walltime
|
|
811
|
+
"""
|
|
812
|
+
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
if checkpoint:
|
|
816
|
+
# create checkpoint directory if necessary
|
|
817
|
+
if not os.path.exists(checkpoint_dir):
|
|
818
|
+
os.mkdir(checkpoint_dir)
|
|
819
|
+
|
|
820
|
+
assert os.path.exists(checkpoint_dir)
|
|
821
|
+
self.checkpoint_dir = checkpoint_dir
|
|
822
|
+
if checkpoint_time is not None:
|
|
823
|
+
#import time
|
|
824
|
+
self.walltime_prev = time.time()
|
|
825
|
+
self.checkpoint_time = checkpoint_time
|
|
826
|
+
self.checkpoint_step = 0
|
|
827
|
+
else:
|
|
828
|
+
self.checkpoint_step = checkpoint_step
|
|
829
|
+
self.checkpoint = True
|
|
830
|
+
#print self.checkpoint_dir, self.checkpoint_step
|
|
831
|
+
else:
|
|
832
|
+
self.checkpoint = False
|
|
833
|
+
|
|
834
|
+
def set_sloped_mannings_function(self, flag=True):
|
|
835
|
+
"""Set mannings friction function to use the sloped
|
|
836
|
+
wetted area.
|
|
837
|
+
|
|
838
|
+
The flag is tested in the python wrapper
|
|
839
|
+
mannings_friction_implicit
|
|
840
|
+
"""
|
|
841
|
+
if flag:
|
|
842
|
+
self.use_sloped_mannings = True
|
|
843
|
+
else:
|
|
844
|
+
self.use_sloped_mannings = False
|
|
845
|
+
|
|
846
|
+
|
|
847
|
+
def set_compute_fluxes_method(self, flag='original'):
|
|
848
|
+
"""Set method for computing fluxes.
|
|
849
|
+
|
|
850
|
+
Currently
|
|
851
|
+
original
|
|
852
|
+
wb_1
|
|
853
|
+
wb_2
|
|
854
|
+
wb_3
|
|
855
|
+
tsunami
|
|
856
|
+
DE
|
|
857
|
+
"""
|
|
858
|
+
compute_fluxes_methods = ['original', 'wb_1', 'wb_2', 'wb_3', 'tsunami', 'DE']
|
|
859
|
+
|
|
860
|
+
if flag in compute_fluxes_methods:
|
|
861
|
+
self.compute_fluxes_method = flag
|
|
862
|
+
else:
|
|
863
|
+
msg = 'Unknown compute_fluxes_method. \nPossible choices are:\n'+ \
|
|
864
|
+
', '.join(compute_fluxes_methods)+'.'
|
|
865
|
+
raise Exception(msg)
|
|
866
|
+
|
|
867
|
+
|
|
868
|
+
def set_local_extrapolation_and_flux_updating(self,nlevels=8):
|
|
869
|
+
"""
|
|
870
|
+
Use local flux and extrapolation updating
|
|
871
|
+
|
|
872
|
+
nlevels == number of flux_update_frequency levels > 1
|
|
873
|
+
|
|
874
|
+
For example, to allow flux updating every 1,2,4,8
|
|
875
|
+
timesteps, do:
|
|
876
|
+
|
|
877
|
+
domain.set_local_extrapolation_and_flux_updating(nlevels=3)
|
|
878
|
+
|
|
879
|
+
(since 2**3==8)
|
|
880
|
+
"""
|
|
881
|
+
|
|
882
|
+
self.max_flux_update_frequency=2**nlevels
|
|
883
|
+
|
|
884
|
+
if(self.max_flux_update_frequency is not 1):
|
|
885
|
+
if self.timestepping_method is not 'euler':
|
|
886
|
+
raise Exception, 'Local extrapolation and flux updating only supported with euler timestepping'
|
|
887
|
+
if self.compute_fluxes_method is not 'DE':
|
|
888
|
+
raise Exception, 'Local extrapolation and flux updating only supported for discontinuous flow algorithms'
|
|
889
|
+
|
|
890
|
+
|
|
891
|
+
def get_compute_fluxes_method(self):
|
|
892
|
+
"""Get method for computing fluxes.
|
|
893
|
+
|
|
894
|
+
See set_compute_fluxes_method for possible choices.
|
|
895
|
+
"""
|
|
896
|
+
|
|
897
|
+
return self.compute_fluxes_method
|
|
898
|
+
|
|
899
|
+
|
|
900
|
+
|
|
901
|
+
def set_distribute_to_vertices_and_edges_method(self, flag='original'):
|
|
902
|
+
"""Set method for computing fluxes.
|
|
903
|
+
|
|
904
|
+
Currently
|
|
905
|
+
original
|
|
906
|
+
tsunami
|
|
907
|
+
"""
|
|
908
|
+
distribute_to_vertices_and_edges_methods = ['original', 'tsunami', 'DE']
|
|
909
|
+
|
|
910
|
+
if flag in distribute_to_vertices_and_edges_methods:
|
|
911
|
+
self.distribute_to_vertices_and_edges_method = flag
|
|
912
|
+
else:
|
|
913
|
+
msg = 'Unknown distribute_to_vertices_and_edges_method. \nPossible choices are:\n'+ \
|
|
914
|
+
', '.join(distribute_to_vertices_and_edges_methods)+'.'
|
|
915
|
+
raise Exception(msg)
|
|
916
|
+
|
|
917
|
+
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
|
|
921
|
+
def get_distribute_to_vertices_and_edges_method(self):
|
|
922
|
+
"""Get method for distribute_to_vertices_and_edges.
|
|
923
|
+
|
|
924
|
+
See set_distribute_to_vertices_and_edges_method for possible choices.
|
|
925
|
+
"""
|
|
926
|
+
|
|
927
|
+
return self.distribute_to_vertices_and_edges_method
|
|
928
|
+
|
|
929
|
+
|
|
930
|
+
|
|
931
|
+
def set_using_discontinuous_elevation(self, flag=False):
|
|
932
|
+
"""Set flag to show whether compute flux algorithm
|
|
933
|
+
is allowing discontinuous elevation.
|
|
934
|
+
|
|
935
|
+
default is False
|
|
936
|
+
"""
|
|
937
|
+
|
|
938
|
+
self.using_discontinuous_elevation = flag
|
|
939
|
+
|
|
940
|
+
def get_using_discontinuous_elevation(self):
|
|
941
|
+
"""
|
|
942
|
+
Return boolean indicating whether algorithm is using dicontinuous elevation
|
|
943
|
+
"""
|
|
944
|
+
|
|
945
|
+
return self.using_discontinuous_elevation
|
|
946
|
+
|
|
947
|
+
def set_flow_algorithm(self, flag=1.5):
|
|
948
|
+
"""Set combination of slope limiting and time stepping
|
|
949
|
+
|
|
950
|
+
Currently
|
|
951
|
+
1
|
|
952
|
+
1.5
|
|
953
|
+
2
|
|
954
|
+
2.5
|
|
955
|
+
tsunami
|
|
956
|
+
DE0
|
|
957
|
+
DE1
|
|
958
|
+
DE2
|
|
959
|
+
DE3
|
|
960
|
+
"""
|
|
961
|
+
|
|
962
|
+
if isinstance(flag, str) :
|
|
963
|
+
flag = flag.replace(".","_")
|
|
964
|
+
else:
|
|
965
|
+
flag = str(float(str(flag))).replace(".","_")
|
|
966
|
+
|
|
967
|
+
flow_algorithms = ['1_0', '1_5', '1_75', '2_0', '2_0_limited', '2_5', \
|
|
968
|
+
'tsunami', 'yusuke', 'DE0', 'DE1', 'DE2', 'DE3']
|
|
969
|
+
|
|
970
|
+
if flag in flow_algorithms:
|
|
971
|
+
self.flow_algorithm = flag
|
|
972
|
+
else:
|
|
973
|
+
msg = 'Unknown flow_algorithm. \nPossible choices are:\n'+ \
|
|
974
|
+
', '.join(flow_algorithms)+'.'
|
|
975
|
+
raise Exception(msg)
|
|
976
|
+
|
|
977
|
+
|
|
978
|
+
|
|
979
|
+
|
|
980
|
+
if self.flow_algorithm == '1_0':
|
|
981
|
+
self.set_timestepping_method(1)
|
|
982
|
+
self.set_default_order(1)
|
|
983
|
+
self.set_CFL(1.0)
|
|
984
|
+
|
|
985
|
+
if self.flow_algorithm == '1_5':
|
|
986
|
+
self.set_timestepping_method(1)
|
|
987
|
+
self.set_default_order(2)
|
|
988
|
+
beta_w = 1.0
|
|
989
|
+
beta_w_dry = 0.2
|
|
990
|
+
beta_uh = 1.0
|
|
991
|
+
beta_uh_dry = 0.2
|
|
992
|
+
beta_vh = 1.0
|
|
993
|
+
beta_vh_dry = 0.2
|
|
994
|
+
self.set_betas(beta_w, beta_w_dry, beta_uh, beta_uh_dry, beta_vh, beta_vh_dry)
|
|
995
|
+
self.set_CFL(1.0)
|
|
996
|
+
self.set_compute_fluxes_method('wb_2')
|
|
997
|
+
self.set_extrapolate_velocity()
|
|
998
|
+
|
|
999
|
+
|
|
1000
|
+
|
|
1001
|
+
if self.flow_algorithm == '1_75':
|
|
1002
|
+
self.set_timestepping_method(1)
|
|
1003
|
+
self.set_default_order(2)
|
|
1004
|
+
beta_w = 1.5
|
|
1005
|
+
beta_w_dry = 0.2
|
|
1006
|
+
beta_uh = 1.5
|
|
1007
|
+
beta_uh_dry = 0.2
|
|
1008
|
+
beta_vh = 1.5
|
|
1009
|
+
beta_vh_dry = 0.2
|
|
1010
|
+
self.set_betas(beta_w, beta_w_dry, beta_uh, beta_uh_dry, beta_vh, beta_vh_dry)
|
|
1011
|
+
self.set_CFL(0.75)
|
|
1012
|
+
self.set_compute_fluxes_method('wb_2')
|
|
1013
|
+
self.set_extrapolate_velocity()
|
|
1014
|
+
|
|
1015
|
+
|
|
1016
|
+
if self.flow_algorithm == '2_0_limited':
|
|
1017
|
+
self.set_timestepping_method(2)
|
|
1018
|
+
self.set_default_order(2)
|
|
1019
|
+
beta_w = 1.5
|
|
1020
|
+
beta_w_dry = 0.2
|
|
1021
|
+
beta_uh = 1.5
|
|
1022
|
+
beta_uh_dry = 0.2
|
|
1023
|
+
beta_vh = 1.5
|
|
1024
|
+
beta_vh_dry = 0.2
|
|
1025
|
+
self.set_betas(beta_w, beta_w_dry, beta_uh, beta_uh_dry, beta_vh, beta_vh_dry)
|
|
1026
|
+
self.set_CFL(1.0)
|
|
1027
|
+
self.set_compute_fluxes_method('wb_2')
|
|
1028
|
+
self.set_extrapolate_velocity()
|
|
1029
|
+
|
|
1030
|
+
|
|
1031
|
+
|
|
1032
|
+
|
|
1033
|
+
if self.flow_algorithm == '2_0':
|
|
1034
|
+
self.set_timestepping_method(2)
|
|
1035
|
+
self.set_default_order(2)
|
|
1036
|
+
beta_w = 1.9
|
|
1037
|
+
beta_w_dry = 0.2
|
|
1038
|
+
beta_uh = 1.9
|
|
1039
|
+
beta_uh_dry = 0.2
|
|
1040
|
+
beta_vh = 1.9
|
|
1041
|
+
beta_vh_dry = 0.2
|
|
1042
|
+
self.set_betas(beta_w, beta_w_dry, beta_uh, beta_uh_dry, beta_vh, beta_vh_dry)
|
|
1043
|
+
self.set_CFL(1.0)
|
|
1044
|
+
self.set_compute_fluxes_method('wb_2')
|
|
1045
|
+
self.set_extrapolate_velocity()
|
|
1046
|
+
|
|
1047
|
+
|
|
1048
|
+
if self.flow_algorithm == 'tsunami':
|
|
1049
|
+
self._set_tsunami_defaults()
|
|
1050
|
+
|
|
1051
|
+
|
|
1052
|
+
if self.flow_algorithm == 'yusuke':
|
|
1053
|
+
# To speed up calculation we also turn off
|
|
1054
|
+
# the update of other quantities
|
|
1055
|
+
|
|
1056
|
+
self._set_tsunami_defaults()
|
|
1057
|
+
|
|
1058
|
+
|
|
1059
|
+
|
|
1060
|
+
|
|
1061
|
+
if self.flow_algorithm == '2_5':
|
|
1062
|
+
self.set_timestepping_method(3)
|
|
1063
|
+
self.set_default_order(2)
|
|
1064
|
+
beta_w = 1.9
|
|
1065
|
+
beta_w_dry = 0.2
|
|
1066
|
+
beta_uh = 1.9
|
|
1067
|
+
beta_uh_dry = 0.2
|
|
1068
|
+
beta_vh = 1.9
|
|
1069
|
+
beta_vh_dry = 0.2
|
|
1070
|
+
self.set_betas(beta_w, beta_w_dry, beta_uh, beta_uh_dry, beta_vh, beta_vh_dry)
|
|
1071
|
+
self.set_CFL(1.0)
|
|
1072
|
+
self.set_compute_fluxes_method('wb_2')
|
|
1073
|
+
self.set_extrapolate_velocity()
|
|
1074
|
+
|
|
1075
|
+
|
|
1076
|
+
if self.flow_algorithm == 'DE0':
|
|
1077
|
+
self._set_DE0_defaults()
|
|
1078
|
+
|
|
1079
|
+
if self.flow_algorithm == 'DE1':
|
|
1080
|
+
self._set_DE1_defaults()
|
|
1081
|
+
|
|
1082
|
+
if self.flow_algorithm == 'DE2':
|
|
1083
|
+
self._set_DE2_defaults()
|
|
1084
|
+
|
|
1085
|
+
if self.flow_algorithm == 'DE3':
|
|
1086
|
+
self._set_DE3_defaults()
|
|
1087
|
+
|
|
1088
|
+
def get_flow_algorithm(self):
|
|
1089
|
+
"""
|
|
1090
|
+
Get method used for timestepping and spatial discretisation
|
|
1091
|
+
|
|
1092
|
+
Currently 1_0, 1_5, 1_75 2_0, 2_5, tsunami, DE0, DE1, DE2, DE3
|
|
1093
|
+
"""
|
|
1094
|
+
|
|
1095
|
+
return self.flow_algorithm
|
|
1096
|
+
|
|
1097
|
+
|
|
1098
|
+
def set_gravity_method(self):
|
|
1099
|
+
"""Gravity method is determined by the compute_fluxes_method
|
|
1100
|
+
This is now not used, as gravity is combine in the compute_fluxes method
|
|
1101
|
+
"""
|
|
1102
|
+
|
|
1103
|
+
if self.get_compute_fluxes_method() == 'original':
|
|
1104
|
+
self.forcing_terms[0] = gravity
|
|
1105
|
+
|
|
1106
|
+
elif self.get_compute_fluxes_method() == 'wb_1':
|
|
1107
|
+
self.forcing_terms[0] = gravity_wb
|
|
1108
|
+
|
|
1109
|
+
elif self.get_compute_fluxes_method() == 'wb_2':
|
|
1110
|
+
self.forcing_terms[0] = gravity
|
|
1111
|
+
|
|
1112
|
+
else:
|
|
1113
|
+
raise Exception('undefined compute_fluxes method')
|
|
1114
|
+
|
|
1115
|
+
def set_extrapolate_velocity(self, flag=True):
|
|
1116
|
+
""" Extrapolation routine uses momentum by default,
|
|
1117
|
+
can change to velocity extrapolation which
|
|
1118
|
+
seems to work better.
|
|
1119
|
+
"""
|
|
1120
|
+
|
|
1121
|
+
if flag is True:
|
|
1122
|
+
self.extrapolate_velocity_second_order = True
|
|
1123
|
+
elif flag is False:
|
|
1124
|
+
self.extrapolate_velocity_second_order = False
|
|
1125
|
+
|
|
1126
|
+
def set_use_edge_limiter(self, flag=True):
|
|
1127
|
+
""" Extrapolation routine uses vertex values by default,
|
|
1128
|
+
for limiting, can change to edge limiting which
|
|
1129
|
+
seems to work better in some cases.
|
|
1130
|
+
"""
|
|
1131
|
+
|
|
1132
|
+
if flag is True:
|
|
1133
|
+
self.use_edge_limiter = True
|
|
1134
|
+
elif flag is False:
|
|
1135
|
+
self.use_edge_limiter = False
|
|
1136
|
+
|
|
1137
|
+
def set_use_optimise_dry_cells(self, flag=True):
|
|
1138
|
+
""" Try to optimize calculations where region is dry
|
|
1139
|
+
"""
|
|
1140
|
+
|
|
1141
|
+
if flag is True:
|
|
1142
|
+
self.optimise_dry_cells = int(True)
|
|
1143
|
+
elif flag is False:
|
|
1144
|
+
self.optimise_dry_cells = int(False)
|
|
1145
|
+
|
|
1146
|
+
|
|
1147
|
+
|
|
1148
|
+
|
|
1149
|
+
def set_use_kinematic_viscosity(self, flag=True):
|
|
1150
|
+
|
|
1151
|
+
from anuga.operators.kinematic_viscosity_operator import Kinematic_viscosity_operator
|
|
1152
|
+
|
|
1153
|
+
if flag :
|
|
1154
|
+
# Create Operator if necessary
|
|
1155
|
+
if self.kv_operator is None:
|
|
1156
|
+
self.kv_operator = Kinematic_viscosity_operator(self)
|
|
1157
|
+
else:
|
|
1158
|
+
if self.kv_operator is None:
|
|
1159
|
+
return
|
|
1160
|
+
else:
|
|
1161
|
+
# Remove operator from fractional_step_operators
|
|
1162
|
+
self.fractional_step_operators.remove(self.kv_operator)
|
|
1163
|
+
self.kv_operator = None
|
|
1164
|
+
|
|
1165
|
+
|
|
1166
|
+
|
|
1167
|
+
|
|
1168
|
+
|
|
1169
|
+
def set_beta(self, beta):
|
|
1170
|
+
"""Shorthand to assign one constant value [0,2] to all limiters.
|
|
1171
|
+
0 Corresponds to first order, where as larger values make use of
|
|
1172
|
+
the second order scheme.
|
|
1173
|
+
"""
|
|
1174
|
+
|
|
1175
|
+
self.beta_w = beta
|
|
1176
|
+
self.beta_w_dry = beta
|
|
1177
|
+
self.quantities['stage'].beta = beta
|
|
1178
|
+
|
|
1179
|
+
self.beta_uh = beta
|
|
1180
|
+
self.beta_uh_dry = beta
|
|
1181
|
+
self.quantities['xmomentum'].beta = beta
|
|
1182
|
+
|
|
1183
|
+
self.beta_vh = beta
|
|
1184
|
+
self.beta_vh_dry = beta
|
|
1185
|
+
self.quantities['ymomentum'].beta = beta
|
|
1186
|
+
|
|
1187
|
+
|
|
1188
|
+
def set_betas(self, beta_w, beta_w_dry, beta_uh, beta_uh_dry, beta_vh, beta_vh_dry):
|
|
1189
|
+
"""Assign beta values in the range [0,2] to all limiters.
|
|
1190
|
+
0 Corresponds to first order, where as larger values make use of
|
|
1191
|
+
the second order scheme.
|
|
1192
|
+
"""
|
|
1193
|
+
|
|
1194
|
+
self.beta_w = beta_w
|
|
1195
|
+
self.beta_w_dry = beta_w_dry
|
|
1196
|
+
self.quantities['stage'].beta = beta_w
|
|
1197
|
+
|
|
1198
|
+
self.beta_uh = beta_uh
|
|
1199
|
+
self.beta_uh_dry = beta_uh_dry
|
|
1200
|
+
self.quantities['xmomentum'].beta = beta_uh
|
|
1201
|
+
|
|
1202
|
+
self.beta_vh = beta_vh
|
|
1203
|
+
self.beta_vh_dry = beta_vh_dry
|
|
1204
|
+
self.quantities['ymomentum'].beta = beta_vh
|
|
1205
|
+
|
|
1206
|
+
|
|
1207
|
+
|
|
1208
|
+
|
|
1209
|
+
def set_store_vertices_uniquely(self, flag=True, reduction=None):
|
|
1210
|
+
"""Decide whether vertex values should be stored uniquely as
|
|
1211
|
+
computed in the model (True) or whether they should be reduced to one
|
|
1212
|
+
value per vertex using self.reduction (False).
|
|
1213
|
+
"""
|
|
1214
|
+
|
|
1215
|
+
# FIXME (Ole): how about using the word "continuous vertex values" or
|
|
1216
|
+
# "continuous stage surface"
|
|
1217
|
+
self.smooth = not flag
|
|
1218
|
+
|
|
1219
|
+
# Reduction operation for get_vertex_values
|
|
1220
|
+
if reduction is None:
|
|
1221
|
+
self.reduction = mean
|
|
1222
|
+
#self.reduction = min #Looks better near steep slopes
|
|
1223
|
+
|
|
1224
|
+
def set_store_vertices_smoothly(self, flag=True, reduction=None):
|
|
1225
|
+
"""Decide whether vertex values should be stored smoothly (one value per vertex)
|
|
1226
|
+
or uniquely as
|
|
1227
|
+
computed in the model (False).
|
|
1228
|
+
"""
|
|
1229
|
+
|
|
1230
|
+
# FIXME (Ole): how about using the word "continuous vertex values" or
|
|
1231
|
+
# "continuous stage surface"
|
|
1232
|
+
self.smooth = flag
|
|
1233
|
+
|
|
1234
|
+
# Reduction operation for get_vertex_values
|
|
1235
|
+
if reduction is None:
|
|
1236
|
+
self.reduction = mean
|
|
1237
|
+
#self.reduction = min #Looks better near steep slopes
|
|
1238
|
+
|
|
1239
|
+
def set_minimum_storable_height(self, minimum_storable_height):
|
|
1240
|
+
"""Set the minimum depth that will be written to an SWW file.
|
|
1241
|
+
|
|
1242
|
+
minimum_storable_height minimum allowed SWW depth is in meters
|
|
1243
|
+
|
|
1244
|
+
This is useful for removing thin water layers that seems to be caused
|
|
1245
|
+
by friction creep.
|
|
1246
|
+
"""
|
|
1247
|
+
|
|
1248
|
+
self.minimum_storable_height = minimum_storable_height
|
|
1249
|
+
|
|
1250
|
+
|
|
1251
|
+
def get_minimum_storable_height(self):
|
|
1252
|
+
|
|
1253
|
+
return self.minimum_storable_height
|
|
1254
|
+
|
|
1255
|
+
|
|
1256
|
+
def set_minimum_allowed_height(self, minimum_allowed_height):
|
|
1257
|
+
"""Set minimum depth that will be recognised in the numerical scheme.
|
|
1258
|
+
|
|
1259
|
+
minimum_allowed_height minimum allowed depth in meters
|
|
1260
|
+
|
|
1261
|
+
The parameter H0 (Minimal height for flux computation) is also set by
|
|
1262
|
+
this function.
|
|
1263
|
+
"""
|
|
1264
|
+
|
|
1265
|
+
#FIXME (Ole): rename H0 to minimum_allowed_height_in_flux_computation
|
|
1266
|
+
|
|
1267
|
+
#FIXME (Ole): Maybe use histogram to identify isolated extreme speeds
|
|
1268
|
+
#and deal with them adaptively similarly to how we used to use 1 order
|
|
1269
|
+
#steps to recover.
|
|
1270
|
+
|
|
1271
|
+
self.minimum_allowed_height = minimum_allowed_height
|
|
1272
|
+
self.H0 = minimum_allowed_height
|
|
1273
|
+
|
|
1274
|
+
|
|
1275
|
+
|
|
1276
|
+
def get_minimum_allowed_height(self):
|
|
1277
|
+
|
|
1278
|
+
return self.minimum_allowed_height
|
|
1279
|
+
|
|
1280
|
+
def set_maximum_allowed_speed(self, maximum_allowed_speed):
|
|
1281
|
+
"""Set the maximum particle speed that is allowed in water shallower
|
|
1282
|
+
than minimum_allowed_height.
|
|
1283
|
+
|
|
1284
|
+
maximum_allowed_speed
|
|
1285
|
+
|
|
1286
|
+
This is useful for controlling speeds in very thin layers of water and
|
|
1287
|
+
at the same time allow some movement avoiding pooling of water.
|
|
1288
|
+
"""
|
|
1289
|
+
|
|
1290
|
+
self.maximum_allowed_speed = maximum_allowed_speed
|
|
1291
|
+
|
|
1292
|
+
def set_points_file_block_line_size(self, points_file_block_line_size):
|
|
1293
|
+
"""
|
|
1294
|
+
"""
|
|
1295
|
+
|
|
1296
|
+
self.points_file_block_line_size = points_file_block_line_size
|
|
1297
|
+
|
|
1298
|
+
|
|
1299
|
+
# FIXME: Probably obsolete in its curren form
|
|
1300
|
+
def set_quantities_to_be_stored(self, q):
|
|
1301
|
+
"""Specify which quantities will be stored in the SWW file.
|
|
1302
|
+
|
|
1303
|
+
q must be either:
|
|
1304
|
+
- a dictionary with quantity names
|
|
1305
|
+
- a list of quantity names (for backwards compatibility)
|
|
1306
|
+
- None
|
|
1307
|
+
|
|
1308
|
+
The format of the dictionary is as follows
|
|
1309
|
+
|
|
1310
|
+
quantity_name: flag where flag must be either 1 or 2.
|
|
1311
|
+
If flag is 1, the quantity is considered static and will be
|
|
1312
|
+
stored once at the beginning of the simulation in a 1D array.
|
|
1313
|
+
|
|
1314
|
+
If flag is 2, the quantity is considered time dependent and
|
|
1315
|
+
it will be stored at each yieldstep by appending it to the
|
|
1316
|
+
appropriate 2D array in the sww file.
|
|
1317
|
+
|
|
1318
|
+
If q is None, storage will be switched off altogether.
|
|
1319
|
+
|
|
1320
|
+
Once the simulation has started and thw sww file opened,
|
|
1321
|
+
this function will have no effect.
|
|
1322
|
+
|
|
1323
|
+
The format, where q is a list of names is for backwards compatibility
|
|
1324
|
+
only.
|
|
1325
|
+
It will take the specified quantities to be time dependent and assume
|
|
1326
|
+
'elevation' to be static regardless.
|
|
1327
|
+
"""
|
|
1328
|
+
|
|
1329
|
+
if q is None:
|
|
1330
|
+
self.quantities_to_be_stored = {}
|
|
1331
|
+
self.store = False
|
|
1332
|
+
return
|
|
1333
|
+
|
|
1334
|
+
# Check correctness
|
|
1335
|
+
for quantity_name in q:
|
|
1336
|
+
msg = ('Quantity %s is not a valid conserved quantity'
|
|
1337
|
+
% quantity_name)
|
|
1338
|
+
assert quantity_name in self.quantities, msg
|
|
1339
|
+
|
|
1340
|
+
assert isinstance(q, dict)
|
|
1341
|
+
self.quantities_to_be_stored = q
|
|
1342
|
+
|
|
1343
|
+
def get_wet_elements(self, indices=None, minimum_height=None):
|
|
1344
|
+
"""Return indices for elements where h > minimum_allowed_height
|
|
1345
|
+
|
|
1346
|
+
Optional argument:
|
|
1347
|
+
indices is the set of element ids that the operation applies to.
|
|
1348
|
+
|
|
1349
|
+
Usage:
|
|
1350
|
+
indices = get_wet_elements()
|
|
1351
|
+
|
|
1352
|
+
Note, centroid values are used for this operation
|
|
1353
|
+
"""
|
|
1354
|
+
|
|
1355
|
+
# Water depth below which it is considered to be 0 in the model
|
|
1356
|
+
# FIXME (Ole): Allow this to be specified as a keyword argument as well
|
|
1357
|
+
from anuga.config import minimum_allowed_height
|
|
1358
|
+
|
|
1359
|
+
if minimum_height is None:
|
|
1360
|
+
minimum_height = minimum_allowed_height
|
|
1361
|
+
|
|
1362
|
+
elevation = self.get_quantity('elevation').\
|
|
1363
|
+
get_values(location='centroids', indices=indices)
|
|
1364
|
+
stage = self.get_quantity('stage').\
|
|
1365
|
+
get_values(location='centroids', indices=indices)
|
|
1366
|
+
depth = stage - elevation
|
|
1367
|
+
|
|
1368
|
+
# Select indices for which depth > 0
|
|
1369
|
+
wet_indices = num.compress(depth > minimum_height,
|
|
1370
|
+
num.arange(len(depth)))
|
|
1371
|
+
return wet_indices
|
|
1372
|
+
|
|
1373
|
+
def get_maximum_inundation_elevation(self, indices=None, minimum_height=None):
|
|
1374
|
+
"""Return highest elevation where h > 0
|
|
1375
|
+
|
|
1376
|
+
Optional argument:
|
|
1377
|
+
indices is the set of element ids that the operation applies to.
|
|
1378
|
+
minimum_height for testing h > minimum_height
|
|
1379
|
+
Usage:
|
|
1380
|
+
q = get_maximum_inundation_elevation()
|
|
1381
|
+
|
|
1382
|
+
Note, centroid values are used for this operation
|
|
1383
|
+
"""
|
|
1384
|
+
|
|
1385
|
+
wet_elements = self.get_wet_elements(indices, minimum_height)
|
|
1386
|
+
return self.get_quantity('elevation').\
|
|
1387
|
+
get_maximum_value(indices=wet_elements)
|
|
1388
|
+
|
|
1389
|
+
def get_maximum_inundation_location(self, indices=None):
|
|
1390
|
+
"""Return location of highest elevation where h > 0
|
|
1391
|
+
|
|
1392
|
+
Optional argument:
|
|
1393
|
+
indices is the set of element ids that the operation applies to.
|
|
1394
|
+
|
|
1395
|
+
Usage:
|
|
1396
|
+
q = get_maximum_inundation_location()
|
|
1397
|
+
|
|
1398
|
+
Note, centroid values are used for this operation
|
|
1399
|
+
"""
|
|
1400
|
+
|
|
1401
|
+
wet_elements = self.get_wet_elements(indices)
|
|
1402
|
+
return self.get_quantity('elevation').\
|
|
1403
|
+
get_maximum_location(indices=wet_elements)
|
|
1404
|
+
|
|
1405
|
+
|
|
1406
|
+
def get_water_volume(self):
|
|
1407
|
+
|
|
1408
|
+
from anuga import numprocs
|
|
1409
|
+
|
|
1410
|
+
#print self.evolved_called
|
|
1411
|
+
|
|
1412
|
+
if not self.evolved_called:
|
|
1413
|
+
Stage = self.quantities['stage']
|
|
1414
|
+
Elev = self.quantities['elevation']
|
|
1415
|
+
h_c = Stage.centroid_values - Elev.centroid_values
|
|
1416
|
+
#print h_c
|
|
1417
|
+
from anuga import Quantity
|
|
1418
|
+
Height = Quantity(self)
|
|
1419
|
+
Height.set_values(h_c, location='centroids')
|
|
1420
|
+
#print Height.centroid_values
|
|
1421
|
+
volume = Height.get_integral()
|
|
1422
|
+
elif self.get_using_discontinuous_elevation():
|
|
1423
|
+
Height = self.quantities['height']
|
|
1424
|
+
volume = Height.get_integral()
|
|
1425
|
+
else:
|
|
1426
|
+
Stage = self.quantities['stage']
|
|
1427
|
+
Elev = self.quantities['elevation']
|
|
1428
|
+
Height = Stage-Elev
|
|
1429
|
+
volume = Height.get_integral()
|
|
1430
|
+
|
|
1431
|
+
if numprocs == 1:
|
|
1432
|
+
self.volume_history.append(volume)
|
|
1433
|
+
return volume
|
|
1434
|
+
|
|
1435
|
+
# isolated parallel code
|
|
1436
|
+
from anuga import myid, send, receive, barrier
|
|
1437
|
+
|
|
1438
|
+
if myid == 0:
|
|
1439
|
+
water_volume = volume
|
|
1440
|
+
for i in range(1,numprocs):
|
|
1441
|
+
remote_volume = receive(i)
|
|
1442
|
+
water_volume = water_volume + remote_volume
|
|
1443
|
+
else:
|
|
1444
|
+
send(volume,0)
|
|
1445
|
+
|
|
1446
|
+
barrier()
|
|
1447
|
+
|
|
1448
|
+
if myid == 0:
|
|
1449
|
+
for i in range(1,numprocs):
|
|
1450
|
+
send(water_volume,i)
|
|
1451
|
+
else:
|
|
1452
|
+
water_volume = receive(0)
|
|
1453
|
+
|
|
1454
|
+
self.volume_history.append(water_volume)
|
|
1455
|
+
return water_volume
|
|
1456
|
+
|
|
1457
|
+
def get_boundary_flux_integral(self):
|
|
1458
|
+
"""
|
|
1459
|
+
Compute the boundary flux integral.
|
|
1460
|
+
Should work in parallel
|
|
1461
|
+
"""
|
|
1462
|
+
|
|
1463
|
+
from anuga import numprocs
|
|
1464
|
+
|
|
1465
|
+
if not self.compute_fluxes_method=='DE':
|
|
1466
|
+
msg='Boundary flux integral only supported for DE fluxes '+\
|
|
1467
|
+
'(because computation of boundary_flux_sum is only implemented there)'
|
|
1468
|
+
raise Exception, msg
|
|
1469
|
+
|
|
1470
|
+
flux_integral = self.boundary_flux_integral.boundary_flux_integral
|
|
1471
|
+
|
|
1472
|
+
if numprocs == 1:
|
|
1473
|
+
return flux_integral
|
|
1474
|
+
|
|
1475
|
+
# isolate parallel code
|
|
1476
|
+
from anuga import myid, send, receive, barrier
|
|
1477
|
+
|
|
1478
|
+
if myid == 0:
|
|
1479
|
+
for i in range(1,numprocs):
|
|
1480
|
+
remote_flux_integral = receive(i)
|
|
1481
|
+
flux_integral = flux_integral + remote_flux_integral
|
|
1482
|
+
else:
|
|
1483
|
+
send(flux_integral,0)
|
|
1484
|
+
|
|
1485
|
+
barrier()
|
|
1486
|
+
|
|
1487
|
+
if myid == 0:
|
|
1488
|
+
for i in range(1,numprocs):
|
|
1489
|
+
send(flux_integral,i)
|
|
1490
|
+
else:
|
|
1491
|
+
flux_integral = receive(0)
|
|
1492
|
+
|
|
1493
|
+
return flux_integral
|
|
1494
|
+
|
|
1495
|
+
def get_fractional_step_volume_integral(self):
|
|
1496
|
+
"""
|
|
1497
|
+
Compute the integrated flows from fractional steps
|
|
1498
|
+
This requires that the fractional step operators
|
|
1499
|
+
update the fractional_step_volume_integral
|
|
1500
|
+
Should work in parallel
|
|
1501
|
+
"""
|
|
1502
|
+
|
|
1503
|
+
from anuga import numprocs
|
|
1504
|
+
|
|
1505
|
+
flux_integral = self.fractional_step_volume_integral
|
|
1506
|
+
|
|
1507
|
+
if numprocs == 1:
|
|
1508
|
+
return flux_integral
|
|
1509
|
+
|
|
1510
|
+
# isolate parallel code
|
|
1511
|
+
from anuga import myid, send, receive, barrier
|
|
1512
|
+
|
|
1513
|
+
if myid == 0:
|
|
1514
|
+
for i in range(1,numprocs):
|
|
1515
|
+
remote_flux_integral = receive(i)
|
|
1516
|
+
flux_integral = flux_integral + remote_flux_integral
|
|
1517
|
+
else:
|
|
1518
|
+
send(flux_integral,0)
|
|
1519
|
+
|
|
1520
|
+
barrier()
|
|
1521
|
+
|
|
1522
|
+
if myid == 0:
|
|
1523
|
+
for i in range(1,numprocs):
|
|
1524
|
+
send(flux_integral,i)
|
|
1525
|
+
else:
|
|
1526
|
+
flux_integral = receive(0)
|
|
1527
|
+
|
|
1528
|
+
return flux_integral
|
|
1529
|
+
|
|
1530
|
+
def get_flow_through_cross_section(self, polyline, verbose=False):
|
|
1531
|
+
"""Get the total flow through an arbitrary poly line.
|
|
1532
|
+
|
|
1533
|
+
This is a run-time equivalent of the function with same name
|
|
1534
|
+
in sww_interrogate.py
|
|
1535
|
+
|
|
1536
|
+
Input:
|
|
1537
|
+
polyline: Representation of desired cross section - it may contain
|
|
1538
|
+
multiple sections allowing for complex shapes. Assume
|
|
1539
|
+
absolute UTM coordinates.
|
|
1540
|
+
Format [[x0, y0], [x1, y1], ...]
|
|
1541
|
+
|
|
1542
|
+
Output:
|
|
1543
|
+
Q: Total flow [m^3/s] across given segments.
|
|
1544
|
+
"""
|
|
1545
|
+
|
|
1546
|
+
|
|
1547
|
+
cross_section = Cross_section(self, polyline, verbose)
|
|
1548
|
+
|
|
1549
|
+
return cross_section.get_flow_through_cross_section()
|
|
1550
|
+
|
|
1551
|
+
|
|
1552
|
+
def get_energy_through_cross_section(self, polyline,
|
|
1553
|
+
kind='total',
|
|
1554
|
+
verbose=False):
|
|
1555
|
+
"""Obtain average energy head [m] across specified cross section.
|
|
1556
|
+
|
|
1557
|
+
Inputs:
|
|
1558
|
+
polyline: Representation of desired cross section - it may contain
|
|
1559
|
+
multiple sections allowing for complex shapes. Assume
|
|
1560
|
+
absolute UTM coordinates.
|
|
1561
|
+
Format [[x0, y0], [x1, y1], ...]
|
|
1562
|
+
kind: Select which energy to compute.
|
|
1563
|
+
Options are 'specific' and 'total' (default)
|
|
1564
|
+
|
|
1565
|
+
Output:
|
|
1566
|
+
E: Average energy [m] across given segments for all stored times.
|
|
1567
|
+
|
|
1568
|
+
The average velocity is computed for each triangle intersected by
|
|
1569
|
+
the polyline and averaged weighted by segment lengths.
|
|
1570
|
+
|
|
1571
|
+
The typical usage of this function would be to get average energy of
|
|
1572
|
+
flow in a channel, and the polyline would then be a cross section
|
|
1573
|
+
perpendicular to the flow.
|
|
1574
|
+
|
|
1575
|
+
#FIXME (Ole) - need name for this energy reflecting that its dimension
|
|
1576
|
+
is [m].
|
|
1577
|
+
"""
|
|
1578
|
+
|
|
1579
|
+
|
|
1580
|
+
|
|
1581
|
+
cross_section = Cross_section(self, polyline, verbose)
|
|
1582
|
+
|
|
1583
|
+
return cross_section.get_energy_through_cross_section(kind)
|
|
1584
|
+
|
|
1585
|
+
|
|
1586
|
+
def check_integrity(self):
|
|
1587
|
+
""" Run integrity checks on shallow water domain. """
|
|
1588
|
+
Generic_Domain.check_integrity(self)
|
|
1589
|
+
|
|
1590
|
+
#Check that we are solving the shallow water wave equation
|
|
1591
|
+
msg = 'First conserved quantity must be "stage"'
|
|
1592
|
+
assert self.conserved_quantities[0] == 'stage', msg
|
|
1593
|
+
msg = 'Second conserved quantity must be "xmomentum"'
|
|
1594
|
+
assert self.conserved_quantities[1] == 'xmomentum', msg
|
|
1595
|
+
msg = 'Third conserved quantity must be "ymomentum"'
|
|
1596
|
+
assert self.conserved_quantities[2] == 'ymomentum', msg
|
|
1597
|
+
|
|
1598
|
+
|
|
1599
|
+
#@profile
|
|
1600
|
+
def extrapolate_second_order_sw(self):
|
|
1601
|
+
"""Fast version of extrapolation from centroids to edges"""
|
|
1602
|
+
|
|
1603
|
+
from shallow_water_ext import extrapolate_second_order_sw as extrapol2
|
|
1604
|
+
extrapol2(self)
|
|
1605
|
+
|
|
1606
|
+
#@profile
|
|
1607
|
+
def compute_fluxes(self):
|
|
1608
|
+
"""Compute fluxes and timestep suitable for all volumes in domain.
|
|
1609
|
+
|
|
1610
|
+
Compute total flux for each conserved quantity using "flux_function"
|
|
1611
|
+
|
|
1612
|
+
Fluxes across each edge are scaled by edgelengths and summed up
|
|
1613
|
+
Resulting flux is then scaled by area and stored in
|
|
1614
|
+
explicit_update for each of the three conserved quantities
|
|
1615
|
+
stage, xmomentum and ymomentum
|
|
1616
|
+
|
|
1617
|
+
The maximal allowable speed computed by the flux_function for each volume
|
|
1618
|
+
is converted to a timestep that must not be exceeded. The minimum of
|
|
1619
|
+
those is computed as the next overall timestep.
|
|
1620
|
+
|
|
1621
|
+
Post conditions:
|
|
1622
|
+
domain.explicit_update is reset to computed flux values
|
|
1623
|
+
domain.flux_timestep is set to the largest step satisfying all volumes.
|
|
1624
|
+
|
|
1625
|
+
This wrapper calls the underlying C version of compute fluxes
|
|
1626
|
+
"""
|
|
1627
|
+
|
|
1628
|
+
if self.compute_fluxes_method == 'original':
|
|
1629
|
+
from shallow_water_ext import compute_fluxes_ext_central_structure
|
|
1630
|
+
from shallow_water_ext import gravity as gravity_c
|
|
1631
|
+
|
|
1632
|
+
self.flux_timestep = compute_fluxes_ext_central_structure(self)
|
|
1633
|
+
gravity_c(self)
|
|
1634
|
+
|
|
1635
|
+
elif self.compute_fluxes_method == 'wb_1':
|
|
1636
|
+
# Calc pressure terms using Simpson rule in flux
|
|
1637
|
+
# computations. Then they match up exactly with
|
|
1638
|
+
# standard gravity term - g h grad(z)
|
|
1639
|
+
from shallow_water_ext import compute_fluxes_ext_wb
|
|
1640
|
+
from shallow_water_ext import gravity as gravity_c
|
|
1641
|
+
|
|
1642
|
+
self.flux_timestep = compute_fluxes_ext_wb(self)
|
|
1643
|
+
gravity_c(self)
|
|
1644
|
+
|
|
1645
|
+
elif self.compute_fluxes_method == 'wb_2':
|
|
1646
|
+
# Use standard flux calculation, but calc gravity
|
|
1647
|
+
# as -g h grad(w) - sum midpoint edge pressure terms
|
|
1648
|
+
|
|
1649
|
+
from shallow_water_ext import compute_fluxes_ext_central_structure
|
|
1650
|
+
from shallow_water_ext import gravity_wb as gravity_wb_c
|
|
1651
|
+
|
|
1652
|
+
self.flux_timestep = compute_fluxes_ext_central_structure(self)
|
|
1653
|
+
gravity_wb_c(self)
|
|
1654
|
+
|
|
1655
|
+
|
|
1656
|
+
elif self.compute_fluxes_method == 'wb_3':
|
|
1657
|
+
# Calculate pure flux terms with simpsons rule, and
|
|
1658
|
+
# gravity flux and gravity forcing via
|
|
1659
|
+
# as -g h grad(w) - sum midpoint edge pressure terms
|
|
1660
|
+
from shallow_water_ext import compute_fluxes_ext_wb_3
|
|
1661
|
+
from shallow_water_ext import gravity_wb as gravity_wb_c
|
|
1662
|
+
|
|
1663
|
+
self.flux_timestep = compute_fluxes_ext_wb_3(self)
|
|
1664
|
+
gravity_wb_c(self)
|
|
1665
|
+
|
|
1666
|
+
elif self.compute_fluxes_method == 'tsunami':
|
|
1667
|
+
# Using Gareth Davies well balanced scheme
|
|
1668
|
+
# Flux calculation and gravity incorporated in same
|
|
1669
|
+
# procedure
|
|
1670
|
+
#
|
|
1671
|
+
# FIXME SR: This needs cleaning up, should just be passing through
|
|
1672
|
+
# the domain as in other compute flux calls
|
|
1673
|
+
|
|
1674
|
+
from swb2_domain_ext import compute_fluxes_ext_central \
|
|
1675
|
+
as compute_fluxes_ext
|
|
1676
|
+
|
|
1677
|
+
# Shortcuts
|
|
1678
|
+
Stage = self.quantities['stage']
|
|
1679
|
+
Xmom = self.quantities['xmomentum']
|
|
1680
|
+
Ymom = self.quantities['ymomentum']
|
|
1681
|
+
Bed = self.quantities['elevation']
|
|
1682
|
+
|
|
1683
|
+
timestep = self.evolve_max_timestep
|
|
1684
|
+
|
|
1685
|
+
self.flux_timestep = compute_fluxes_ext(timestep,
|
|
1686
|
+
self.epsilon,
|
|
1687
|
+
self.H0,
|
|
1688
|
+
self.g,
|
|
1689
|
+
self.neighbours,
|
|
1690
|
+
self.neighbour_edges,
|
|
1691
|
+
self.normals,
|
|
1692
|
+
self.edgelengths,
|
|
1693
|
+
self.radii,
|
|
1694
|
+
self.areas,
|
|
1695
|
+
self.tri_full_flag,
|
|
1696
|
+
Stage.edge_values,
|
|
1697
|
+
Xmom.edge_values,
|
|
1698
|
+
Ymom.edge_values,
|
|
1699
|
+
Bed.edge_values,
|
|
1700
|
+
Stage.boundary_values,
|
|
1701
|
+
Xmom.boundary_values,
|
|
1702
|
+
Ymom.boundary_values,
|
|
1703
|
+
self.boundary_flux_type,
|
|
1704
|
+
Stage.explicit_update,
|
|
1705
|
+
Xmom.explicit_update,
|
|
1706
|
+
Ymom.explicit_update,
|
|
1707
|
+
self.already_computed_flux,
|
|
1708
|
+
self.max_speed,
|
|
1709
|
+
int(self.optimise_dry_cells),
|
|
1710
|
+
Stage.centroid_values,
|
|
1711
|
+
Bed.centroid_values,
|
|
1712
|
+
Bed.vertex_values)
|
|
1713
|
+
|
|
1714
|
+
elif self.compute_fluxes_method == 'DE':
|
|
1715
|
+
# Using Gareth Davies discontinuous elevation scheme
|
|
1716
|
+
# Flux calculation and gravity incorporated in same
|
|
1717
|
+
# procedure
|
|
1718
|
+
|
|
1719
|
+
from swDE1_domain_ext import compute_fluxes_ext_central \
|
|
1720
|
+
as compute_fluxes_ext
|
|
1721
|
+
|
|
1722
|
+
timestep = self.evolve_max_timestep
|
|
1723
|
+
|
|
1724
|
+
flux_timestep = compute_fluxes_ext(self, timestep)
|
|
1725
|
+
|
|
1726
|
+
self.flux_timestep = flux_timestep
|
|
1727
|
+
|
|
1728
|
+
else:
|
|
1729
|
+
raise Exception('unknown compute_fluxes_method')
|
|
1730
|
+
|
|
1731
|
+
# TODO (SR)
|
|
1732
|
+
# Should implement wb_4 as simpsons rule on both pure
|
|
1733
|
+
# flux and pressure flux terms, ie a combination of wb_1
|
|
1734
|
+
# and wb_3
|
|
1735
|
+
# Mabe should come up with better names!
|
|
1736
|
+
|
|
1737
|
+
|
|
1738
|
+
|
|
1739
|
+
|
|
1740
|
+
def distribute_to_vertices_and_edges(self):
|
|
1741
|
+
""" Call correct module function """
|
|
1742
|
+
|
|
1743
|
+
|
|
1744
|
+
if self.compute_fluxes_method == 'tsunami':
|
|
1745
|
+
|
|
1746
|
+
|
|
1747
|
+
# FIXME SR: Clean up code to just take self (domain) as
|
|
1748
|
+
# input argument
|
|
1749
|
+
from swb2_domain_ext import protect
|
|
1750
|
+
|
|
1751
|
+
# shortcuts
|
|
1752
|
+
wc = self.quantities['stage'].centroid_values
|
|
1753
|
+
wv = self.quantities['stage'].vertex_values
|
|
1754
|
+
zc = self.quantities['elevation'].centroid_values
|
|
1755
|
+
zv = self.quantities['elevation'].vertex_values
|
|
1756
|
+
xmomc = self.quantities['xmomentum'].centroid_values
|
|
1757
|
+
ymomc = self.quantities['ymomentum'].centroid_values
|
|
1758
|
+
areas = self.areas
|
|
1759
|
+
|
|
1760
|
+
mass_error = protect(self.minimum_allowed_height, self.maximum_allowed_speed,
|
|
1761
|
+
self.epsilon, wc, wv, zc,zv, xmomc, ymomc, areas)
|
|
1762
|
+
|
|
1763
|
+
if mass_error > 0.0 and self.verbose :
|
|
1764
|
+
print 'Cumulative mass protection: %g m^3 '% mass_error
|
|
1765
|
+
|
|
1766
|
+
|
|
1767
|
+
from swb2_domain_ext import extrapolate_second_order_edge_sw as extrapol2_ext
|
|
1768
|
+
|
|
1769
|
+
# Shortcuts
|
|
1770
|
+
Stage = self.quantities['stage']
|
|
1771
|
+
Xmom = self.quantities['xmomentum']
|
|
1772
|
+
Ymom = self.quantities['ymomentum']
|
|
1773
|
+
Elevation = self.quantities['elevation']
|
|
1774
|
+
|
|
1775
|
+
extrapol2_ext(self,
|
|
1776
|
+
self.surrogate_neighbours,
|
|
1777
|
+
self.number_of_boundaries,
|
|
1778
|
+
self.centroid_coordinates,
|
|
1779
|
+
Stage.centroid_values,
|
|
1780
|
+
Xmom.centroid_values,
|
|
1781
|
+
Ymom.centroid_values,
|
|
1782
|
+
Elevation.centroid_values,
|
|
1783
|
+
self.edge_coordinates,
|
|
1784
|
+
Stage.edge_values,
|
|
1785
|
+
Xmom.edge_values,
|
|
1786
|
+
Ymom.edge_values,
|
|
1787
|
+
Elevation.edge_values,
|
|
1788
|
+
Stage.vertex_values,
|
|
1789
|
+
Xmom.vertex_values,
|
|
1790
|
+
Ymom.vertex_values,
|
|
1791
|
+
Elevation.vertex_values,
|
|
1792
|
+
int(self.optimise_dry_cells),
|
|
1793
|
+
int(self.extrapolate_velocity_second_order))
|
|
1794
|
+
|
|
1795
|
+
elif self.compute_fluxes_method=='DE':
|
|
1796
|
+
|
|
1797
|
+
# Do protection step
|
|
1798
|
+
self.protect_against_infinitesimal_and_negative_heights()
|
|
1799
|
+
# Do extrapolation step
|
|
1800
|
+
from swDE1_domain_ext import extrapolate_second_order_edge_sw as extrapol2
|
|
1801
|
+
extrapol2(self)
|
|
1802
|
+
|
|
1803
|
+
else:
|
|
1804
|
+
# Code for original method
|
|
1805
|
+
if self.use_edge_limiter:
|
|
1806
|
+
self.distribute_using_edge_limiter()
|
|
1807
|
+
else:
|
|
1808
|
+
self.distribute_using_vertex_limiter()
|
|
1809
|
+
|
|
1810
|
+
|
|
1811
|
+
|
|
1812
|
+
def distribute_using_edge_limiter(self):
|
|
1813
|
+
"""Distribution from centroids to edges specific to the SWW eqn.
|
|
1814
|
+
|
|
1815
|
+
It will ensure that h (w-z) is always non-negative even in the
|
|
1816
|
+
presence of steep bed-slopes by taking a weighted average between shallow
|
|
1817
|
+
and deep cases.
|
|
1818
|
+
|
|
1819
|
+
In addition, all conserved quantities get distributed as per either a
|
|
1820
|
+
constant (order==1) or a piecewise linear function (order==2).
|
|
1821
|
+
|
|
1822
|
+
|
|
1823
|
+
Precondition:
|
|
1824
|
+
All quantities defined at centroids and bed elevation defined at
|
|
1825
|
+
vertices.
|
|
1826
|
+
|
|
1827
|
+
Postcondition
|
|
1828
|
+
Conserved quantities defined at vertices
|
|
1829
|
+
"""
|
|
1830
|
+
|
|
1831
|
+
# Remove very thin layers of water
|
|
1832
|
+
self.protect_against_infinitesimal_and_negative_heights()
|
|
1833
|
+
|
|
1834
|
+
for name in self.conserved_quantities:
|
|
1835
|
+
Q = self.quantities[name]
|
|
1836
|
+
if self._order_ == 1:
|
|
1837
|
+
Q.extrapolate_first_order()
|
|
1838
|
+
elif self._order_ == 2:
|
|
1839
|
+
Q.extrapolate_second_order_and_limit_by_edge()
|
|
1840
|
+
else:
|
|
1841
|
+
raise Exception('Unknown order')
|
|
1842
|
+
|
|
1843
|
+
self.balance_deep_and_shallow()
|
|
1844
|
+
|
|
1845
|
+
# Compute edge values by interpolation
|
|
1846
|
+
for name in self.conserved_quantities:
|
|
1847
|
+
Q = domain.quantities[name]
|
|
1848
|
+
Q.interpolate_from_vertices_to_edges()
|
|
1849
|
+
|
|
1850
|
+
def distribute_using_vertex_limiter(self):
|
|
1851
|
+
"""Distribution from centroids to vertices specific to the SWW equation.
|
|
1852
|
+
|
|
1853
|
+
It will ensure that h (w-z) is always non-negative even in the
|
|
1854
|
+
presence of steep bed-slopes by taking a weighted average between shallow
|
|
1855
|
+
and deep cases.
|
|
1856
|
+
|
|
1857
|
+
In addition, all conserved quantities get distributed as per either a
|
|
1858
|
+
constant (order==1) or a piecewise linear function (order==2).
|
|
1859
|
+
|
|
1860
|
+
FIXME: more explanation about removal of artificial variability etc
|
|
1861
|
+
|
|
1862
|
+
Precondition:
|
|
1863
|
+
All quantities defined at centroids and bed elevation defined at
|
|
1864
|
+
vertices.
|
|
1865
|
+
|
|
1866
|
+
Postcondition
|
|
1867
|
+
Conserved quantities defined at vertices
|
|
1868
|
+
"""
|
|
1869
|
+
|
|
1870
|
+
# Remove very thin layers of water
|
|
1871
|
+
self.protect_against_infinitesimal_and_negative_heights()
|
|
1872
|
+
|
|
1873
|
+
# Extrapolate all conserved quantities
|
|
1874
|
+
if self.optimised_gradient_limiter:
|
|
1875
|
+
# MH090605 if second order,
|
|
1876
|
+
# perform the extrapolation and limiting on
|
|
1877
|
+
# all of the conserved quantities
|
|
1878
|
+
|
|
1879
|
+
if (self._order_ == 1):
|
|
1880
|
+
for name in self.conserved_quantities:
|
|
1881
|
+
Q = self.quantities[name]
|
|
1882
|
+
Q.extrapolate_first_order()
|
|
1883
|
+
elif self._order_ == 2:
|
|
1884
|
+
self.extrapolate_second_order_sw()
|
|
1885
|
+
else:
|
|
1886
|
+
raise Exception('Unknown order')
|
|
1887
|
+
else:
|
|
1888
|
+
# Old code:
|
|
1889
|
+
for name in domain.conserved_quantities:
|
|
1890
|
+
Q = self.quantities[name]
|
|
1891
|
+
|
|
1892
|
+
if self._order_ == 1:
|
|
1893
|
+
Q.extrapolate_first_order()
|
|
1894
|
+
elif self._order_ == 2:
|
|
1895
|
+
Q.extrapolate_second_order_and_limit_by_vertex()
|
|
1896
|
+
else:
|
|
1897
|
+
raise Exception('Unknown order')
|
|
1898
|
+
|
|
1899
|
+
# Take bed elevation into account when water heights are small
|
|
1900
|
+
self.balance_deep_and_shallow()
|
|
1901
|
+
|
|
1902
|
+
# Compute edge values by interpolation
|
|
1903
|
+
for name in self.conserved_quantities:
|
|
1904
|
+
Q = self.quantities[name]
|
|
1905
|
+
Q.interpolate_from_vertices_to_edges()
|
|
1906
|
+
|
|
1907
|
+
|
|
1908
|
+
def protect_against_infinitesimal_and_negative_heights(self):
|
|
1909
|
+
""" Clean up the stage and momentum values to ensure non-negative heights
|
|
1910
|
+
"""
|
|
1911
|
+
|
|
1912
|
+
if self.flow_algorithm == 'tsunami':
|
|
1913
|
+
|
|
1914
|
+
from swb2_domain_ext import protect
|
|
1915
|
+
|
|
1916
|
+
# shortcuts
|
|
1917
|
+
wc = self.quantities['stage'].centroid_values
|
|
1918
|
+
wv = self.quantities['stage'].vertex_values
|
|
1919
|
+
zc = self.quantities['elevation'].centroid_values
|
|
1920
|
+
zv = self.quantities['elevation'].vertex_values
|
|
1921
|
+
xmomc = self.quantities['xmomentum'].centroid_values
|
|
1922
|
+
ymomc = self.quantities['ymomentum'].centroid_values
|
|
1923
|
+
areas = self.areas
|
|
1924
|
+
|
|
1925
|
+
mass_error = protect(self.minimum_allowed_height, self.maximum_allowed_speed,
|
|
1926
|
+
self.epsilon, wc, wv, zc,zv, xmomc, ymomc, areas)
|
|
1927
|
+
|
|
1928
|
+
if mass_error > 0.0 and self.verbose :
|
|
1929
|
+
print 'Cumulative mass protection: '+str(mass_error)+' m^3 '
|
|
1930
|
+
|
|
1931
|
+
elif self.flow_algorithm.startswith('DE'):
|
|
1932
|
+
|
|
1933
|
+
from swDE1_domain_ext import protect
|
|
1934
|
+
|
|
1935
|
+
# shortcuts
|
|
1936
|
+
wc = self.quantities['stage'].centroid_values
|
|
1937
|
+
wv = self.quantities['stage'].vertex_values
|
|
1938
|
+
zc = self.quantities['elevation'].centroid_values
|
|
1939
|
+
zv = self.quantities['elevation'].vertex_values
|
|
1940
|
+
xmomc = self.quantities['xmomentum'].centroid_values
|
|
1941
|
+
ymomc = self.quantities['ymomentum'].centroid_values
|
|
1942
|
+
areas = self.areas
|
|
1943
|
+
xc = self.centroid_coordinates[:,0]
|
|
1944
|
+
yc = self.centroid_coordinates[:,1]
|
|
1945
|
+
|
|
1946
|
+
mass_error = protect(self.minimum_allowed_height, self.maximum_allowed_speed,
|
|
1947
|
+
self.epsilon, wc, wv, zc,zv, xmomc, ymomc, areas, xc, yc)
|
|
1948
|
+
|
|
1949
|
+
if mass_error > 0.0 and self.verbose :
|
|
1950
|
+
print 'Cumulative mass protection: '+str(mass_error)+' m^3 '
|
|
1951
|
+
|
|
1952
|
+
else:
|
|
1953
|
+
from shallow_water_ext import protect
|
|
1954
|
+
|
|
1955
|
+
# Shortcuts
|
|
1956
|
+
wc = self.quantities['stage'].centroid_values
|
|
1957
|
+
zc = self.quantities['elevation'].centroid_values
|
|
1958
|
+
xmomc = self.quantities['xmomentum'].centroid_values
|
|
1959
|
+
ymomc = self.quantities['ymomentum'].centroid_values
|
|
1960
|
+
|
|
1961
|
+
protect(self.minimum_allowed_height, self.maximum_allowed_speed,
|
|
1962
|
+
self.epsilon, wc, zc, xmomc, ymomc)
|
|
1963
|
+
|
|
1964
|
+
|
|
1965
|
+
def balance_deep_and_shallow(self):
|
|
1966
|
+
"""Compute linear combination between stage as computed by
|
|
1967
|
+
gradient-limiters limiting using w, and stage computed by
|
|
1968
|
+
gradient-limiters limiting using h (h-limiter).
|
|
1969
|
+
|
|
1970
|
+
The former takes precedence when heights are large compared to the
|
|
1971
|
+
bed slope while the latter takes precedence when heights are
|
|
1972
|
+
relatively small. Anything in between is computed as a balanced
|
|
1973
|
+
linear combination in order to avoid numerical disturbances which
|
|
1974
|
+
would otherwise appear as a result of hard switching between
|
|
1975
|
+
modes.
|
|
1976
|
+
|
|
1977
|
+
Wrapper for C implementation
|
|
1978
|
+
"""
|
|
1979
|
+
|
|
1980
|
+
from shallow_water_ext import balance_deep_and_shallow \
|
|
1981
|
+
as balance_deep_and_shallow_ext
|
|
1982
|
+
|
|
1983
|
+
# Shortcuts
|
|
1984
|
+
wc = self.quantities['stage'].centroid_values
|
|
1985
|
+
zc = self.quantities['elevation'].centroid_values
|
|
1986
|
+
wv = self.quantities['stage'].vertex_values
|
|
1987
|
+
zv = self.quantities['elevation'].vertex_values
|
|
1988
|
+
|
|
1989
|
+
# Momentums at centroids
|
|
1990
|
+
xmomc = self.quantities['xmomentum'].centroid_values
|
|
1991
|
+
ymomc = self.quantities['ymomentum'].centroid_values
|
|
1992
|
+
|
|
1993
|
+
# Momentums at vertices
|
|
1994
|
+
xmomv = self.quantities['xmomentum'].vertex_values
|
|
1995
|
+
ymomv = self.quantities['ymomentum'].vertex_values
|
|
1996
|
+
|
|
1997
|
+
balance_deep_and_shallow_ext(self,
|
|
1998
|
+
wc, zc, wv, zv, wc,
|
|
1999
|
+
xmomc, ymomc, xmomv, ymomv)
|
|
2000
|
+
|
|
2001
|
+
|
|
2002
|
+
def update_conserved_quantities(self):
|
|
2003
|
+
"""Update vectors of conserved quantities using previously
|
|
2004
|
+
computed fluxes and specified forcing functions.
|
|
2005
|
+
"""
|
|
2006
|
+
|
|
2007
|
+
|
|
2008
|
+
timestep = self.timestep
|
|
2009
|
+
|
|
2010
|
+
|
|
2011
|
+
# Update conserved_quantities
|
|
2012
|
+
#for name in self.conserved_quantities:
|
|
2013
|
+
# Q = self.quantities[name]
|
|
2014
|
+
# Q.update(timestep)
|
|
2015
|
+
|
|
2016
|
+
#print 'shallow water update conserved quantties'
|
|
2017
|
+
|
|
2018
|
+
Elev = self.quantities['elevation']
|
|
2019
|
+
Stage = self.quantities['stage']
|
|
2020
|
+
Xmom = self.quantities['xmomentum']
|
|
2021
|
+
Ymom = self.quantities['ymomentum']
|
|
2022
|
+
|
|
2023
|
+
Stage.update(timestep)
|
|
2024
|
+
Xmom.update(timestep)
|
|
2025
|
+
Ymom.update(timestep)
|
|
2026
|
+
|
|
2027
|
+
if self.get_using_discontinuous_elevation():
|
|
2028
|
+
|
|
2029
|
+
tff = self.tri_full_flag
|
|
2030
|
+
|
|
2031
|
+
negative_ids = num.where( num.logical_and((Stage.centroid_values - Elev.centroid_values) < 0.0 , tff > 0) )[0]
|
|
2032
|
+
|
|
2033
|
+
if len(negative_ids)>0:
|
|
2034
|
+
import warnings
|
|
2035
|
+
warnings.warn('Negative cells being set to zero depth, possible loss of conservation')
|
|
2036
|
+
Stage.centroid_values[negative_ids] = Elev.centroid_values[negative_ids]
|
|
2037
|
+
Xmom.centroid_values[negative_ids] = 0.0
|
|
2038
|
+
Ymom.centroid_values[negative_ids] = 0.0
|
|
2039
|
+
|
|
2040
|
+
|
|
2041
|
+
|
|
2042
|
+
|
|
2043
|
+
def update_other_quantities(self):
|
|
2044
|
+
""" There may be a need to calculates some of the other quantities
|
|
2045
|
+
based on the new values of conserved quantities
|
|
2046
|
+
"""
|
|
2047
|
+
|
|
2048
|
+
return
|
|
2049
|
+
|
|
2050
|
+
"""
|
|
2051
|
+
if self.flow_algorithm == 'yusuke':
|
|
2052
|
+
return
|
|
2053
|
+
|
|
2054
|
+
|
|
2055
|
+
# The centroid values of height and x and y velocity
|
|
2056
|
+
# might not have been setup
|
|
2057
|
+
|
|
2058
|
+
self.update_centroids_of_velocities_and_height()
|
|
2059
|
+
|
|
2060
|
+
|
|
2061
|
+
# At present just use piecewise constants for these "other' quantities
|
|
2062
|
+
for name in ['height', 'xvelocity', 'yvelocity']:
|
|
2063
|
+
Q = self.quantities[name]
|
|
2064
|
+
Q.extrapolate_first_order()
|
|
2065
|
+
|
|
2066
|
+
# for name in ['height', 'xvelocity', 'yvelocity']:
|
|
2067
|
+
# Q = self.quantities[name]
|
|
2068
|
+
# if self._order_ == 1:
|
|
2069
|
+
# Q.extrapolate_first_order()
|
|
2070
|
+
# elif self._order_ == 2:
|
|
2071
|
+
# if self.use_edge_limiter:
|
|
2072
|
+
# Q.extrapolate_second_order_and_limit_by_edge()
|
|
2073
|
+
# else:
|
|
2074
|
+
# Q.extrapolate_second_order_and_limit_by_vertex()
|
|
2075
|
+
# else:
|
|
2076
|
+
# raise Exception('Unknown order')
|
|
2077
|
+
|
|
2078
|
+
"""
|
|
2079
|
+
|
|
2080
|
+
def update_centroids_of_velocities_and_height(self):
|
|
2081
|
+
"""Calculate the centroid values of velocities and height based
|
|
2082
|
+
on the values of the quantities stage and x and y momentum
|
|
2083
|
+
|
|
2084
|
+
Assumes that stage and momentum are up to date
|
|
2085
|
+
|
|
2086
|
+
Useful for kinematic viscosity calculations
|
|
2087
|
+
"""
|
|
2088
|
+
|
|
2089
|
+
# For shallow water we need to update height xvelocity and yvelocity
|
|
2090
|
+
|
|
2091
|
+
#Shortcuts
|
|
2092
|
+
W = self.quantities['stage']
|
|
2093
|
+
UH = self.quantities['xmomentum']
|
|
2094
|
+
VH = self.quantities['ymomentum']
|
|
2095
|
+
H = self.quantities['height']
|
|
2096
|
+
Z = self.quantities['elevation']
|
|
2097
|
+
U = self.quantities['xvelocity']
|
|
2098
|
+
V = self.quantities['yvelocity']
|
|
2099
|
+
|
|
2100
|
+
#print num.min(W.centroid_values)
|
|
2101
|
+
|
|
2102
|
+
# Make sure boundary values of conserved quantites
|
|
2103
|
+
# are consistent with value of functions at centroids
|
|
2104
|
+
#self.distribute_to_vertices_and_edges()
|
|
2105
|
+
Z.set_boundary_values_from_edges()
|
|
2106
|
+
|
|
2107
|
+
#W.set_boundary_values_from_edges()
|
|
2108
|
+
#UH.set_boundary_values_from_edges()
|
|
2109
|
+
#VH.set_boundary_values_from_edges()
|
|
2110
|
+
|
|
2111
|
+
|
|
2112
|
+
#Aliases
|
|
2113
|
+
w_C = W.centroid_values
|
|
2114
|
+
z_C = Z.centroid_values
|
|
2115
|
+
uh_C = UH.centroid_values
|
|
2116
|
+
vh_C = VH.centroid_values
|
|
2117
|
+
u_C = U.centroid_values
|
|
2118
|
+
v_C = V.centroid_values
|
|
2119
|
+
h_C = H.centroid_values
|
|
2120
|
+
|
|
2121
|
+
w_B = W.boundary_values
|
|
2122
|
+
z_B = Z.boundary_values
|
|
2123
|
+
uh_B = UH.boundary_values
|
|
2124
|
+
vh_B = VH.boundary_values
|
|
2125
|
+
u_B = U.boundary_values
|
|
2126
|
+
v_B = V.boundary_values
|
|
2127
|
+
h_B = H.boundary_values
|
|
2128
|
+
|
|
2129
|
+
h_C[:] = w_C-z_C
|
|
2130
|
+
h_C[:] = num.where(h_C >= 0, h_C , 0.0)
|
|
2131
|
+
|
|
2132
|
+
h_B[:] = w_B-z_B
|
|
2133
|
+
h_B[:] = num.where(h_B >=0, h_B, 0.0)
|
|
2134
|
+
|
|
2135
|
+
# Update height values
|
|
2136
|
+
#H.set_values( num.where(W.centroid_values-Z.centroid_values>=0,
|
|
2137
|
+
# W.centroid_values-Z.centroid_values, 0.0), location='centroids')
|
|
2138
|
+
#H.set_boundary_values( num.where(W.boundary_values-Z.boundary_values>=0,
|
|
2139
|
+
# W.boundary_values-Z.boundary_values, 0.0))
|
|
2140
|
+
|
|
2141
|
+
|
|
2142
|
+
|
|
2143
|
+
#assert num.min(h_C) >= 0
|
|
2144
|
+
#assert num.min(h_B) >= 0
|
|
2145
|
+
|
|
2146
|
+
|
|
2147
|
+
H0 = 1.0e-8
|
|
2148
|
+
|
|
2149
|
+
#U.set_values(uh_C/(h_C + H0/h_C), location='centroids')
|
|
2150
|
+
#V.set_values(vh_C/(h_C + H0/h_C), location='centroids')
|
|
2151
|
+
|
|
2152
|
+
factor = h_C/(h_C*h_C + H0)
|
|
2153
|
+
u_C[:] = uh_C*factor
|
|
2154
|
+
v_C[:] = vh_C*factor
|
|
2155
|
+
|
|
2156
|
+
#U.set_boundary_values(uh_B/(h_B + H0/h_B))
|
|
2157
|
+
#V.set_boundary_values(vh_B/(h_B + H0/h_B))
|
|
2158
|
+
|
|
2159
|
+
factor = h_B/(h_B*h_B + H0)
|
|
2160
|
+
u_B[:] = uh_B*factor
|
|
2161
|
+
v_B[:] = vh_B*factor
|
|
2162
|
+
|
|
2163
|
+
|
|
2164
|
+
|
|
2165
|
+
def update_centroids_of_momentum_from_velocity(self):
|
|
2166
|
+
"""Calculate the centroid value of x and y momentum from height and velocities
|
|
2167
|
+
|
|
2168
|
+
Assumes centroids of height and velocities are up to date
|
|
2169
|
+
|
|
2170
|
+
Useful for kinematic viscosity calculations
|
|
2171
|
+
"""
|
|
2172
|
+
|
|
2173
|
+
# For shallow water we need to update height xvelocity and yvelocity
|
|
2174
|
+
|
|
2175
|
+
#Shortcuts
|
|
2176
|
+
UH = self.quantities['xmomentum']
|
|
2177
|
+
VH = self.quantities['ymomentum']
|
|
2178
|
+
H = self.quantities['height']
|
|
2179
|
+
Z = self.quantities['elevation']
|
|
2180
|
+
U = self.quantities['xvelocity']
|
|
2181
|
+
V = self.quantities['yvelocity']
|
|
2182
|
+
|
|
2183
|
+
|
|
2184
|
+
#Arrays
|
|
2185
|
+
u_C = U.centroid_values
|
|
2186
|
+
v_C = V.centroid_values
|
|
2187
|
+
uh_C = UH.centroid_values
|
|
2188
|
+
vh_C = VH.centroid_values
|
|
2189
|
+
h_C = H.centroid_values
|
|
2190
|
+
|
|
2191
|
+
u_B = U.boundary_values
|
|
2192
|
+
v_B = V.boundary_values
|
|
2193
|
+
uh_B = UH.boundary_values
|
|
2194
|
+
vh_B = VH.boundary_values
|
|
2195
|
+
h_B = H.boundary_values
|
|
2196
|
+
|
|
2197
|
+
uh_C[:] = u_C*h_C
|
|
2198
|
+
vh_C[:] = v_C*h_C
|
|
2199
|
+
#UH.set_values(u_C*h_C , location='centroids')
|
|
2200
|
+
#VH.set_values(v_C*h_C , location='centroids')
|
|
2201
|
+
|
|
2202
|
+
self.distribute_to_vertices_and_edges()
|
|
2203
|
+
|
|
2204
|
+
|
|
2205
|
+
|
|
2206
|
+
def evolve(self,
|
|
2207
|
+
yieldstep=None,
|
|
2208
|
+
finaltime=None,
|
|
2209
|
+
duration=None,
|
|
2210
|
+
skip_initial_step=False):
|
|
2211
|
+
"""Specialisation of basic evolve method from parent class.
|
|
2212
|
+
|
|
2213
|
+
Evolve the model by 1 step.
|
|
2214
|
+
"""
|
|
2215
|
+
|
|
2216
|
+
# Call check integrity here rather than from user scripts
|
|
2217
|
+
# self.check_integrity()
|
|
2218
|
+
|
|
2219
|
+
msg = 'Attribute self.beta_w must be in the interval [0, 2]'
|
|
2220
|
+
assert 0 <= self.beta_w <= 2.0, msg
|
|
2221
|
+
|
|
2222
|
+
# Initial update of vertex and edge values before any STORAGE
|
|
2223
|
+
# and or visualisation.
|
|
2224
|
+
# This is done again in the initialisation of the Generic_Domain
|
|
2225
|
+
# evolve loop but we do it here to ensure the values are ok for storage.
|
|
2226
|
+
self.distribute_to_vertices_and_edges()
|
|
2227
|
+
|
|
2228
|
+
if self.store is True and self.get_time() == self.get_starttime():
|
|
2229
|
+
self.initialise_storage()
|
|
2230
|
+
|
|
2231
|
+
if self.get_time() >= finaltime: yield
|
|
2232
|
+
|
|
2233
|
+
# Call basic machinery from parent class
|
|
2234
|
+
for t in Generic_Domain.evolve(self, yieldstep=yieldstep,
|
|
2235
|
+
finaltime=finaltime, duration=duration,
|
|
2236
|
+
skip_initial_step=skip_initial_step):
|
|
2237
|
+
|
|
2238
|
+
self.yieldstep_id += 1
|
|
2239
|
+
walltime = time.time()
|
|
2240
|
+
|
|
2241
|
+
#print t , self.get_time()
|
|
2242
|
+
# Store model data, e.g. for subsequent visualisation
|
|
2243
|
+
if self.store is True:
|
|
2244
|
+
self.store_timestep()
|
|
2245
|
+
|
|
2246
|
+
if self.checkpoint:
|
|
2247
|
+
|
|
2248
|
+
|
|
2249
|
+
save_checkpoint=False
|
|
2250
|
+
if self.checkpoint_step == 0:
|
|
2251
|
+
if rank() == 0:
|
|
2252
|
+
if walltime - self.walltime_prev > self.checkpoint_time:
|
|
2253
|
+
|
|
2254
|
+
save_checkpoint = True
|
|
2255
|
+
for cpu in range(size()):
|
|
2256
|
+
if cpu != rank():
|
|
2257
|
+
send(save_checkpoint, cpu)
|
|
2258
|
+
else:
|
|
2259
|
+
save_checkpoint = receive(0)
|
|
2260
|
+
|
|
2261
|
+
elif self.yieldstep_id%self.checkpoint_step == 0:
|
|
2262
|
+
save_checkpoint = True
|
|
2263
|
+
|
|
2264
|
+
if save_checkpoint:
|
|
2265
|
+
pickle_name = os.path.join(self.checkpoint_dir,self.get_name())+'_'+str(self.get_time())+'.pickle'
|
|
2266
|
+
cPickle.dump(self, open(pickle_name, 'wb'))
|
|
2267
|
+
|
|
2268
|
+
barrier()
|
|
2269
|
+
self.walltime_prev = time.time()
|
|
2270
|
+
|
|
2271
|
+
#print 'Stored Checkpoint File '+pickle_name
|
|
2272
|
+
|
|
2273
|
+
# Pass control on to outer loop for more specific actions
|
|
2274
|
+
yield(t)
|
|
2275
|
+
|
|
2276
|
+
|
|
2277
|
+
def initialise_storage(self):
|
|
2278
|
+
"""Create and initialise self.writer object for storing data.
|
|
2279
|
+
Also, save x,y and bed elevation
|
|
2280
|
+
"""
|
|
2281
|
+
|
|
2282
|
+
# Initialise writer
|
|
2283
|
+
self.writer = SWW_file(self)
|
|
2284
|
+
|
|
2285
|
+
# Store vertices and connectivity
|
|
2286
|
+
self.writer.store_connectivity()
|
|
2287
|
+
|
|
2288
|
+
|
|
2289
|
+
def store_timestep(self):
|
|
2290
|
+
"""Store time dependent quantities and time.
|
|
2291
|
+
|
|
2292
|
+
Precondition:
|
|
2293
|
+
self.writer has been initialised
|
|
2294
|
+
"""
|
|
2295
|
+
|
|
2296
|
+
self.writer.store_timestep()
|
|
2297
|
+
|
|
2298
|
+
|
|
2299
|
+
def sww_merge(self, *args, **kwargs):
|
|
2300
|
+
|
|
2301
|
+
pass
|
|
2302
|
+
|
|
2303
|
+
def timestepping_statistics(self,
|
|
2304
|
+
track_speeds=False,
|
|
2305
|
+
triangle_id=None):
|
|
2306
|
+
"""Return string with time stepping statistics for printing or logging
|
|
2307
|
+
|
|
2308
|
+
Optional boolean keyword track_speeds decides whether to report
|
|
2309
|
+
location of smallest timestep as well as a histogram and percentile
|
|
2310
|
+
report.
|
|
2311
|
+
"""
|
|
2312
|
+
|
|
2313
|
+
from anuga.config import epsilon, g
|
|
2314
|
+
|
|
2315
|
+
# Call basic machinery from parent class
|
|
2316
|
+
msg = Generic_Domain.timestepping_statistics(self, track_speeds,
|
|
2317
|
+
triangle_id)
|
|
2318
|
+
|
|
2319
|
+
if track_speeds is True:
|
|
2320
|
+
# qwidth determines the text field used for quantities
|
|
2321
|
+
qwidth = self.qwidth
|
|
2322
|
+
|
|
2323
|
+
# Selected triangle
|
|
2324
|
+
k = self.k
|
|
2325
|
+
|
|
2326
|
+
# Report some derived quantities at vertices, edges and centroid
|
|
2327
|
+
# specific to the shallow water wave equation
|
|
2328
|
+
z = self.quantities['elevation']
|
|
2329
|
+
w = self.quantities['stage']
|
|
2330
|
+
|
|
2331
|
+
Vw = w.get_values(location='vertices', indices=[k])[0]
|
|
2332
|
+
Ew = w.get_values(location='edges', indices=[k])[0]
|
|
2333
|
+
Cw = w.get_values(location='centroids', indices=[k])
|
|
2334
|
+
|
|
2335
|
+
Vz = z.get_values(location='vertices', indices=[k])[0]
|
|
2336
|
+
Ez = z.get_values(location='edges', indices=[k])[0]
|
|
2337
|
+
Cz = z.get_values(location='centroids', indices=[k])
|
|
2338
|
+
|
|
2339
|
+
name = 'depth'
|
|
2340
|
+
Vh = Vw-Vz
|
|
2341
|
+
Eh = Ew-Ez
|
|
2342
|
+
Ch = Cw-Cz
|
|
2343
|
+
|
|
2344
|
+
message = ' %s: vertex_values = %.4f,\t %.4f,\t %.4f\n'\
|
|
2345
|
+
% (name.ljust(qwidth), Vh[0], Vh[1], Vh[2])
|
|
2346
|
+
|
|
2347
|
+
message += ' %s: edge_values = %.4f,\t %.4f,\t %.4f\n'\
|
|
2348
|
+
% (name.ljust(qwidth), Eh[0], Eh[1], Eh[2])
|
|
2349
|
+
|
|
2350
|
+
message += ' %s: centroid_value = %.4f\n'\
|
|
2351
|
+
% (name.ljust(qwidth), Ch[0])
|
|
2352
|
+
|
|
2353
|
+
msg += message
|
|
2354
|
+
|
|
2355
|
+
uh = self.quantities['xmomentum']
|
|
2356
|
+
vh = self.quantities['ymomentum']
|
|
2357
|
+
|
|
2358
|
+
Vuh = uh.get_values(location='vertices', indices=[k])[0]
|
|
2359
|
+
Euh = uh.get_values(location='edges', indices=[k])[0]
|
|
2360
|
+
Cuh = uh.get_values(location='centroids', indices=[k])
|
|
2361
|
+
|
|
2362
|
+
Vvh = vh.get_values(location='vertices', indices=[k])[0]
|
|
2363
|
+
Evh = vh.get_values(location='edges', indices=[k])[0]
|
|
2364
|
+
Cvh = vh.get_values(location='centroids', indices=[k])
|
|
2365
|
+
|
|
2366
|
+
# Speeds in each direction
|
|
2367
|
+
Vu = Vuh/(Vh + epsilon)
|
|
2368
|
+
Eu = Euh/(Eh + epsilon)
|
|
2369
|
+
Cu = Cuh/(Ch + epsilon)
|
|
2370
|
+
name = 'U'
|
|
2371
|
+
message = ' %s: vertex_values = %.4f,\t %.4f,\t %.4f\n' \
|
|
2372
|
+
% (name.ljust(qwidth), Vu[0], Vu[1], Vu[2])
|
|
2373
|
+
|
|
2374
|
+
message += ' %s: edge_values = %.4f,\t %.4f,\t %.4f\n' \
|
|
2375
|
+
% (name.ljust(qwidth), Eu[0], Eu[1], Eu[2])
|
|
2376
|
+
|
|
2377
|
+
message += ' %s: centroid_value = %.4f\n' \
|
|
2378
|
+
% (name.ljust(qwidth), Cu[0])
|
|
2379
|
+
|
|
2380
|
+
msg += message
|
|
2381
|
+
|
|
2382
|
+
Vv = Vvh/(Vh + epsilon)
|
|
2383
|
+
Ev = Evh/(Eh + epsilon)
|
|
2384
|
+
Cv = Cvh/(Ch + epsilon)
|
|
2385
|
+
name = 'V'
|
|
2386
|
+
message = ' %s: vertex_values = %.4f,\t %.4f,\t %.4f\n' \
|
|
2387
|
+
% (name.ljust(qwidth), Vv[0], Vv[1], Vv[2])
|
|
2388
|
+
|
|
2389
|
+
message += ' %s: edge_values = %.4f,\t %.4f,\t %.4f\n' \
|
|
2390
|
+
% (name.ljust(qwidth), Ev[0], Ev[1], Ev[2])
|
|
2391
|
+
|
|
2392
|
+
message += ' %s: centroid_value = %.4f\n'\
|
|
2393
|
+
%(name.ljust(qwidth), Cv[0])
|
|
2394
|
+
|
|
2395
|
+
msg += message
|
|
2396
|
+
|
|
2397
|
+
# Froude number in each direction
|
|
2398
|
+
name = 'Froude (x)'
|
|
2399
|
+
Vfx = Vu/(num.sqrt(g*Vh) + epsilon)
|
|
2400
|
+
Efx = Eu/(num.sqrt(g*Eh) + epsilon)
|
|
2401
|
+
Cfx = Cu/(num.sqrt(g*Ch) + epsilon)
|
|
2402
|
+
|
|
2403
|
+
message = ' %s: vertex_values = %.4f,\t %.4f,\t %.4f\n'\
|
|
2404
|
+
% (name.ljust(qwidth), Vfx[0], Vfx[1], Vfx[2])
|
|
2405
|
+
|
|
2406
|
+
message += ' %s: edge_values = %.4f,\t %.4f,\t %.4f\n'\
|
|
2407
|
+
% (name.ljust(qwidth), Efx[0], Efx[1], Efx[2])
|
|
2408
|
+
|
|
2409
|
+
message += ' %s: centroid_value = %.4f\n'\
|
|
2410
|
+
% (name.ljust(qwidth), Cfx[0])
|
|
2411
|
+
|
|
2412
|
+
msg += message
|
|
2413
|
+
|
|
2414
|
+
name = 'Froude (y)'
|
|
2415
|
+
Vfy = Vv/(num.sqrt(g*Vh) + epsilon)
|
|
2416
|
+
Efy = Ev/(num.sqrt(g*Eh) + epsilon)
|
|
2417
|
+
Cfy = Cv/(num.sqrt(g*Ch) + epsilon)
|
|
2418
|
+
|
|
2419
|
+
message = ' %s: vertex_values = %.4f,\t %.4f,\t %.4f\n'\
|
|
2420
|
+
% (name.ljust(qwidth), Vfy[0], Vfy[1], Vfy[2])
|
|
2421
|
+
|
|
2422
|
+
message += ' %s: edge_values = %.4f,\t %.4f,\t %.4f\n'\
|
|
2423
|
+
% (name.ljust(qwidth), Efy[0], Efy[1], Efy[2])
|
|
2424
|
+
|
|
2425
|
+
message += ' %s: centroid_value = %.4f\n'\
|
|
2426
|
+
% (name.ljust(qwidth), Cfy[0])
|
|
2427
|
+
|
|
2428
|
+
msg += message
|
|
2429
|
+
|
|
2430
|
+
return msg
|
|
2431
|
+
|
|
2432
|
+
def print_timestepping_statistics(self, *args, **kwargs):
|
|
2433
|
+
|
|
2434
|
+
msg = self.timestepping_statistics(*args, **kwargs)
|
|
2435
|
+
|
|
2436
|
+
print msg
|
|
2437
|
+
|
|
2438
|
+
|
|
2439
|
+
def compute_boundary_flows(self):
|
|
2440
|
+
"""Compute boundary flows at current timestep.
|
|
2441
|
+
|
|
2442
|
+
Quantities computed are:
|
|
2443
|
+
Total inflow across boundary
|
|
2444
|
+
Total outflow across boundary
|
|
2445
|
+
Flow across each tagged boundary segment
|
|
2446
|
+
|
|
2447
|
+
These calculations are only approximate since they don't use the
|
|
2448
|
+
flux calculation used in evolve
|
|
2449
|
+
|
|
2450
|
+
See get_boundary_flux_integral for an exact computation
|
|
2451
|
+
"""
|
|
2452
|
+
|
|
2453
|
+
# Run through boundary array and compute for each segment
|
|
2454
|
+
# the normal momentum ((uh, vh) dot normal) times segment length.
|
|
2455
|
+
# Based on sign accumulate this into boundary_inflow and
|
|
2456
|
+
# boundary_outflow.
|
|
2457
|
+
|
|
2458
|
+
# Compute flows along boundary
|
|
2459
|
+
|
|
2460
|
+
uh = self.get_quantity('xmomentum').get_values(location='edges')
|
|
2461
|
+
vh = self.get_quantity('ymomentum').get_values(location='edges')
|
|
2462
|
+
|
|
2463
|
+
# Loop through edges that lie on the boundary and calculate
|
|
2464
|
+
# flows
|
|
2465
|
+
boundary_flows = {}
|
|
2466
|
+
total_boundary_inflow = 0.0
|
|
2467
|
+
total_boundary_outflow = 0.0
|
|
2468
|
+
for vol_id, edge_id in self.boundary:
|
|
2469
|
+
# Compute normal flow across edge. Since normal vector points
|
|
2470
|
+
# away from triangle, a positive sign means that water
|
|
2471
|
+
# flows *out* from this triangle.
|
|
2472
|
+
|
|
2473
|
+
momentum = [uh[vol_id, edge_id], vh[vol_id, edge_id]]
|
|
2474
|
+
normal = self.mesh.get_normal(vol_id, edge_id)
|
|
2475
|
+
length = self.mesh.get_edgelength(vol_id, edge_id)
|
|
2476
|
+
normal_flow = num.dot(momentum, normal)*length
|
|
2477
|
+
|
|
2478
|
+
# Reverse sign so that + is taken to mean inflow
|
|
2479
|
+
# and - means outflow. This is more intuitive.
|
|
2480
|
+
edge_flow = -normal_flow
|
|
2481
|
+
|
|
2482
|
+
# Tally up inflows and outflows separately
|
|
2483
|
+
if edge_flow > 0:
|
|
2484
|
+
# Flow is inflow
|
|
2485
|
+
total_boundary_inflow += edge_flow
|
|
2486
|
+
else:
|
|
2487
|
+
# Flow is outflow
|
|
2488
|
+
total_boundary_outflow += edge_flow
|
|
2489
|
+
|
|
2490
|
+
# Tally up flows by boundary tag
|
|
2491
|
+
tag = self.boundary[(vol_id, edge_id)]
|
|
2492
|
+
|
|
2493
|
+
if tag not in boundary_flows:
|
|
2494
|
+
boundary_flows[tag] = 0.0
|
|
2495
|
+
boundary_flows[tag] += edge_flow
|
|
2496
|
+
|
|
2497
|
+
|
|
2498
|
+
return boundary_flows, total_boundary_inflow, total_boundary_outflow
|
|
2499
|
+
|
|
2500
|
+
|
|
2501
|
+
def compute_forcing_flows(self):
|
|
2502
|
+
"""
|
|
2503
|
+
Compute flows in and out of domain due to forcing terms.
|
|
2504
|
+
|
|
2505
|
+
Quantities computed are:
|
|
2506
|
+
|
|
2507
|
+
Total inflow through forcing terms
|
|
2508
|
+
Total outflow through forcing terms
|
|
2509
|
+
Current total volume in domain
|
|
2510
|
+
|
|
2511
|
+
"""
|
|
2512
|
+
|
|
2513
|
+
#FIXME(Ole): We need to separate what part of explicit_update was
|
|
2514
|
+
# due to the normal flux calculations and what is due to forcing terms.
|
|
2515
|
+
|
|
2516
|
+
pass
|
|
2517
|
+
|
|
2518
|
+
|
|
2519
|
+
def compute_total_volume(self):
|
|
2520
|
+
"""
|
|
2521
|
+
Compute total volume (m^3) of water in entire domain
|
|
2522
|
+
|
|
2523
|
+
"""
|
|
2524
|
+
|
|
2525
|
+
return self.get_water_volume()
|
|
2526
|
+
|
|
2527
|
+
|
|
2528
|
+
def volumetric_balance_statistics(self):
|
|
2529
|
+
"""Create volumetric balance report suitable for printing or logging.
|
|
2530
|
+
"""
|
|
2531
|
+
|
|
2532
|
+
(boundary_flows, total_boundary_inflow,
|
|
2533
|
+
total_boundary_outflow) = self.compute_boundary_flows()
|
|
2534
|
+
|
|
2535
|
+
message = '---------------------------\n'
|
|
2536
|
+
message += 'Volumetric balance report:\n'
|
|
2537
|
+
message += 'Note: Boundary fluxes are not exact\n'
|
|
2538
|
+
message += 'See get_boundary_flux_integral for exact computation\n'
|
|
2539
|
+
message += '--------------------------\n'
|
|
2540
|
+
message += 'Total boundary inflow [m^3/s]: %.2f\n' % total_boundary_inflow
|
|
2541
|
+
message += 'Total boundary outflow [m^3/s]: %.2f\n' % total_boundary_outflow
|
|
2542
|
+
message += 'Net boundary flow by tags [m^3/s]\n'
|
|
2543
|
+
for tag in boundary_flows:
|
|
2544
|
+
message += ' %s [m^3/s]: %.2f\n' % (tag, boundary_flows[tag])
|
|
2545
|
+
|
|
2546
|
+
message += 'Total net boundary flow [m^3/s]: %.2f\n' % \
|
|
2547
|
+
(total_boundary_inflow + total_boundary_outflow)
|
|
2548
|
+
message += 'Total volume in domain [m^3]: %.2f\n' % \
|
|
2549
|
+
self.compute_total_volume()
|
|
2550
|
+
|
|
2551
|
+
# The go through explicit forcing update and record the rate of change
|
|
2552
|
+
# for stage and
|
|
2553
|
+
# record into forcing_inflow and forcing_outflow. Finally compute
|
|
2554
|
+
# integral of depth to obtain total volume of domain.
|
|
2555
|
+
|
|
2556
|
+
# FIXME(Ole): This part is not yet done.
|
|
2557
|
+
|
|
2558
|
+
return message
|
|
2559
|
+
|
|
2560
|
+
def compute_flux_update_frequency(self):
|
|
2561
|
+
"""
|
|
2562
|
+
Update the 'flux_update_frequency' and 'update_extrapolate' variables
|
|
2563
|
+
Used to control updating of fluxes / extrapolation for 'local-time-stepping'
|
|
2564
|
+
"""
|
|
2565
|
+
from swDE1_domain_ext import compute_flux_update_frequency \
|
|
2566
|
+
as compute_flux_update_frequency_ext
|
|
2567
|
+
|
|
2568
|
+
compute_flux_update_frequency_ext(self, self.timestep)
|
|
2569
|
+
|
|
2570
|
+
def report_water_volume_statistics(self, verbose=True, returnStats=False):
|
|
2571
|
+
"""
|
|
2572
|
+
Compute the volume, boundary flux integral, fractional step volume integral, and their difference
|
|
2573
|
+
|
|
2574
|
+
If verbose, print a summary
|
|
2575
|
+
If returnStats, return a list with the volume statistics
|
|
2576
|
+
"""
|
|
2577
|
+
from anuga import myid
|
|
2578
|
+
|
|
2579
|
+
if(self.compute_fluxes_method is not 'DE'):
|
|
2580
|
+
if(myid==0):
|
|
2581
|
+
print 'Water_volume_statistics only supported for DE algorithm '
|
|
2582
|
+
return
|
|
2583
|
+
|
|
2584
|
+
# Compute the volume
|
|
2585
|
+
Vol=self.get_water_volume()
|
|
2586
|
+
# Compute the boundary flux integral
|
|
2587
|
+
fluxIntegral=self.get_boundary_flux_integral()
|
|
2588
|
+
fracIntegral=self.get_fractional_step_volume_integral()
|
|
2589
|
+
|
|
2590
|
+
if(verbose and myid==0):
|
|
2591
|
+
print ' '
|
|
2592
|
+
print ' Volume V is:', Vol
|
|
2593
|
+
print ' Boundary Flux integral BF: ', fluxIntegral
|
|
2594
|
+
print ' (rate + inlet) Fractional Step volume integral FS: ', fracIntegral
|
|
2595
|
+
print ' V - BF - FS - InitialVolume :', Vol- fluxIntegral -fracIntegral - self.volume_history[0]
|
|
2596
|
+
print ' '
|
|
2597
|
+
|
|
2598
|
+
if(returnStats):
|
|
2599
|
+
return [Vol, fluxIntegral, fracIntegral]
|
|
2600
|
+
else:
|
|
2601
|
+
return
|
|
2602
|
+
|
|
2603
|
+
def report_cells_with_small_local_timestep(self, threshold_depth=None):
|
|
2604
|
+
"""
|
|
2605
|
+
Convenience function to print the locations of cells
|
|
2606
|
+
with a small local timestep.
|
|
2607
|
+
|
|
2608
|
+
Computations are at cell centroids
|
|
2609
|
+
|
|
2610
|
+
Useful in models
|
|
2611
|
+
with complex meshes, to find ways to speed up the model
|
|
2612
|
+
"""
|
|
2613
|
+
from anuga.parallel import myid, numprocs
|
|
2614
|
+
from anuga.config import g, epsilon
|
|
2615
|
+
|
|
2616
|
+
if(threshold_depth is None):
|
|
2617
|
+
threshold_depth=self.minimum_allowed_height
|
|
2618
|
+
|
|
2619
|
+
uh = self.quantities['xmomentum'].centroid_values
|
|
2620
|
+
vh = self.quantities['ymomentum'].centroid_values
|
|
2621
|
+
d = self.quantities['stage'].centroid_values - self.quantities['elevation'].centroid_values
|
|
2622
|
+
d = num.maximum(d, threshold_depth)
|
|
2623
|
+
v = ( (uh)**2 + (vh)**2)**0.5/d
|
|
2624
|
+
v = v*(d>threshold_depth)
|
|
2625
|
+
|
|
2626
|
+
for i in range(numprocs):
|
|
2627
|
+
if(myid==i):
|
|
2628
|
+
print ' Processor ', myid
|
|
2629
|
+
gravSpeed=(g*d)**0.5
|
|
2630
|
+
waveSpeed = abs(v)+gravSpeed
|
|
2631
|
+
localTS=self.radii/num.maximum(waveSpeed, epsilon)
|
|
2632
|
+
controlling_pt_ind=localTS.argmin()
|
|
2633
|
+
print ' * Smallest LocalTS is: ', localTS[controlling_pt_ind]
|
|
2634
|
+
print ' -- Location: ', round(self.centroid_coordinates[controlling_pt_ind,0]+self.geo_reference.xllcorner,2),\
|
|
2635
|
+
round(self.centroid_coordinates[controlling_pt_ind,1]+self.geo_reference.yllcorner,2)
|
|
2636
|
+
print ' -+ Speed: ', v[controlling_pt_ind]
|
|
2637
|
+
print ' -* Gravity_wave_speed', gravSpeed[controlling_pt_ind]
|
|
2638
|
+
print ' '
|
|
2639
|
+
|
|
2640
|
+
barrier()
|
|
2641
|
+
return
|
|
2642
|
+
|
|
2643
|
+
################################################################################
|
|
2644
|
+
# End of class Shallow Water Domain
|
|
2645
|
+
################################################################################
|
|
2646
|
+
|
|
2647
|
+
#-----------------
|
|
2648
|
+
# Flux computation
|
|
2649
|
+
#-----------------
|
|
2650
|
+
|
|
2651
|
+
#def compute_fluxes(domain):
|
|
2652
|
+
# """Compute fluxes and timestep suitable for all volumes in domain.
|
|
2653
|
+
#
|
|
2654
|
+
# Compute total flux for each conserved quantity using "flux_function"
|
|
2655
|
+
#
|
|
2656
|
+
# Fluxes across each edge are scaled by edgelengths and summed up
|
|
2657
|
+
# Resulting flux is then scaled by area and stored in
|
|
2658
|
+
# explicit_update for each of the three conserved quantities
|
|
2659
|
+
# stage, xmomentum and ymomentum
|
|
2660
|
+
#
|
|
2661
|
+
# The maximal allowable speed computed by the flux_function for each volume
|
|
2662
|
+
# is converted to a timestep that must not be exceeded. The minimum of
|
|
2663
|
+
# those is computed as the next overall timestep.
|
|
2664
|
+
#
|
|
2665
|
+
# Post conditions:
|
|
2666
|
+
# domain.explicit_update is reset to computed flux values
|
|
2667
|
+
# domain.timestep is set to the largest step satisfying all volumes.
|
|
2668
|
+
#
|
|
2669
|
+
# This wrapper calls the underlying C version of compute fluxes
|
|
2670
|
+
# """
|
|
2671
|
+
#
|
|
2672
|
+
# import sys
|
|
2673
|
+
# from shallow_water_ext import compute_fluxes_ext_central \
|
|
2674
|
+
# as compute_fluxes_ext
|
|
2675
|
+
#
|
|
2676
|
+
# # Shortcuts
|
|
2677
|
+
# Stage = domain.quantities['stage']
|
|
2678
|
+
# Xmom = domain.quantities['xmomentum']
|
|
2679
|
+
# Ymom = domain.quantities['ymomentum']
|
|
2680
|
+
# Bed = domain.quantities['elevation']
|
|
2681
|
+
#
|
|
2682
|
+
#
|
|
2683
|
+
#
|
|
2684
|
+
# timestep = float(sys.maxint)
|
|
2685
|
+
#
|
|
2686
|
+
# flux_timestep = compute_fluxes_ext(timestep,
|
|
2687
|
+
# domain.epsilon,
|
|
2688
|
+
# domain.H0,
|
|
2689
|
+
# domain.g,
|
|
2690
|
+
# domain.neighbours,
|
|
2691
|
+
# domain.neighbour_edges,
|
|
2692
|
+
# domain.normals,
|
|
2693
|
+
# domain.edgelengths,
|
|
2694
|
+
# domain.radii,
|
|
2695
|
+
# domain.areas,
|
|
2696
|
+
# domain.tri_full_flag,
|
|
2697
|
+
# Stage.edge_values,
|
|
2698
|
+
# Xmom.edge_values,
|
|
2699
|
+
# Ymom.edge_values,
|
|
2700
|
+
# Bed.edge_values,
|
|
2701
|
+
# Stage.boundary_values,
|
|
2702
|
+
# Xmom.boundary_values,
|
|
2703
|
+
# Ymom.boundary_values,
|
|
2704
|
+
# Stage.explicit_update,
|
|
2705
|
+
# Xmom.explicit_update,
|
|
2706
|
+
# Ymom.explicit_update,
|
|
2707
|
+
# domain.already_computed_flux,
|
|
2708
|
+
# domain.max_speed,
|
|
2709
|
+
# domain.optimise_dry_cells)
|
|
2710
|
+
#
|
|
2711
|
+
# domain.flux_timestep = flux_timestep
|
|
2712
|
+
#
|
|
2713
|
+
#
|
|
2714
|
+
#
|
|
2715
|
+
#def compute_fluxes_structure(domain):
|
|
2716
|
+
# """Compute fluxes and timestep suitable for all volumes in domain.
|
|
2717
|
+
#
|
|
2718
|
+
# Compute total flux for each conserved quantity using "flux_function"
|
|
2719
|
+
#
|
|
2720
|
+
# Fluxes across each edge are scaled by edgelengths and summed up
|
|
2721
|
+
# Resulting flux is then scaled by area and stored in
|
|
2722
|
+
# explicit_update for each of the three conserved quantities
|
|
2723
|
+
# stage, xmomentum and ymomentum
|
|
2724
|
+
#
|
|
2725
|
+
# The maximal allowable speed computed by the flux_function for each volume
|
|
2726
|
+
# is converted to a timestep that must not be exceeded. The minimum of
|
|
2727
|
+
# those is computed as the next overall timestep.
|
|
2728
|
+
#
|
|
2729
|
+
# Post conditions:
|
|
2730
|
+
# domain.explicit_update is reset to computed flux values
|
|
2731
|
+
# domain.flux_timestep is set to the largest step satisfying all volumes.
|
|
2732
|
+
#
|
|
2733
|
+
# This wrapper calls the underlying C version of compute fluxes
|
|
2734
|
+
# """
|
|
2735
|
+
#
|
|
2736
|
+
#
|
|
2737
|
+
# from shallow_water_ext import compute_fluxes_ext_central_structure
|
|
2738
|
+
#
|
|
2739
|
+
#
|
|
2740
|
+
# domain.flux_timestep = compute_fluxes_ext_central_structure(domain)
|
|
2741
|
+
#
|
|
2742
|
+
|
|
2743
|
+
|
|
2744
|
+
################################################################################
|
|
2745
|
+
# Module functions for gradient limiting
|
|
2746
|
+
################################################################################
|
|
2747
|
+
|
|
2748
|
+
def extrapolate_second_order_sw_old(domain):
|
|
2749
|
+
"""Wrapper calling C version of extrapolate_second_order_sw.
|
|
2750
|
+
|
|
2751
|
+
domain the domain to operate on
|
|
2752
|
+
|
|
2753
|
+
Note MH090605: The following method belongs to the shallow_water domain
|
|
2754
|
+
class, see comments in the corresponding method in shallow_water_ext.c
|
|
2755
|
+
"""
|
|
2756
|
+
|
|
2757
|
+
from shallow_water_ext import extrapolate_second_order_sw_old as extrapol2
|
|
2758
|
+
|
|
2759
|
+
# Shortcuts
|
|
2760
|
+
Stage = domain.quantities['stage']
|
|
2761
|
+
Xmom = domain.quantities['xmomentum']
|
|
2762
|
+
Ymom = domain.quantities['ymomentum']
|
|
2763
|
+
Elevation = domain.quantities['elevation']
|
|
2764
|
+
|
|
2765
|
+
extrapol2(domain,
|
|
2766
|
+
domain.surrogate_neighbours,
|
|
2767
|
+
domain.number_of_boundaries,
|
|
2768
|
+
domain.centroid_coordinates,
|
|
2769
|
+
Stage.centroid_values,
|
|
2770
|
+
Xmom.centroid_values,
|
|
2771
|
+
Ymom.centroid_values,
|
|
2772
|
+
Elevation.centroid_values,
|
|
2773
|
+
domain.vertex_coordinates,
|
|
2774
|
+
Stage.vertex_values,
|
|
2775
|
+
Xmom.vertex_values,
|
|
2776
|
+
Ymom.vertex_values,
|
|
2777
|
+
Elevation.vertex_values,
|
|
2778
|
+
int(domain.optimise_dry_cells),
|
|
2779
|
+
int(domain.extrapolate_velocity_second_order))
|
|
2780
|
+
|
|
2781
|
+
|
|
2782
|
+
#def extrapolate_second_order_sw(domain):
|
|
2783
|
+
# """Wrapper calling C version of extrapolate_second_order_sw.
|
|
2784
|
+
#
|
|
2785
|
+
# domain the domain to operate on
|
|
2786
|
+
#
|
|
2787
|
+
# Note MH090605: The following method belongs to the shallow_water domain
|
|
2788
|
+
# class, see comments in the corresponding method in shallow_water_ext.c
|
|
2789
|
+
# """
|
|
2790
|
+
#
|
|
2791
|
+
# from shallow_water_ext import extrapolate_second_order_sw as extrapol2
|
|
2792
|
+
# extrapol2(domain)
|
|
2793
|
+
|
|
2794
|
+
|
|
2795
|
+
def distribute_using_vertex_limiter(domain):
|
|
2796
|
+
"""Distribution from centroids to vertices specific to the SWW equation.
|
|
2797
|
+
|
|
2798
|
+
It will ensure that h (w-z) is always non-negative even in the
|
|
2799
|
+
presence of steep bed-slopes by taking a weighted average between shallow
|
|
2800
|
+
and deep cases.
|
|
2801
|
+
|
|
2802
|
+
In addition, all conserved quantities get distributed as per either a
|
|
2803
|
+
constant (order==1) or a piecewise linear function (order==2).
|
|
2804
|
+
|
|
2805
|
+
FIXME: more explanation about removal of artificial variability etc
|
|
2806
|
+
|
|
2807
|
+
Precondition:
|
|
2808
|
+
All quantities defined at centroids and bed elevation defined at
|
|
2809
|
+
vertices.
|
|
2810
|
+
|
|
2811
|
+
Postcondition
|
|
2812
|
+
Conserved quantities defined at vertices
|
|
2813
|
+
"""
|
|
2814
|
+
|
|
2815
|
+
# Remove very thin layers of water
|
|
2816
|
+
domain.protect_against_infinitesimal_and_negative_heights()
|
|
2817
|
+
|
|
2818
|
+
# Extrapolate all conserved quantities
|
|
2819
|
+
if domain.optimised_gradient_limiter:
|
|
2820
|
+
# MH090605 if second order,
|
|
2821
|
+
# perform the extrapolation and limiting on
|
|
2822
|
+
# all of the conserved quantities
|
|
2823
|
+
|
|
2824
|
+
if (domain._order_ == 1):
|
|
2825
|
+
for name in domain.conserved_quantities:
|
|
2826
|
+
Q = domain.quantities[name]
|
|
2827
|
+
Q.extrapolate_first_order()
|
|
2828
|
+
elif domain._order_ == 2:
|
|
2829
|
+
domain.extrapolate_second_order_sw()
|
|
2830
|
+
else:
|
|
2831
|
+
raise Exception('Unknown order')
|
|
2832
|
+
else:
|
|
2833
|
+
# Old code:
|
|
2834
|
+
for name in domain.conserved_quantities:
|
|
2835
|
+
Q = domain.quantities[name]
|
|
2836
|
+
|
|
2837
|
+
if domain._order_ == 1:
|
|
2838
|
+
Q.extrapolate_first_order()
|
|
2839
|
+
elif domain._order_ == 2:
|
|
2840
|
+
Q.extrapolate_second_order_and_limit_by_vertex()
|
|
2841
|
+
else:
|
|
2842
|
+
raise Exception('Unknown order')
|
|
2843
|
+
|
|
2844
|
+
# Take bed elevation into account when water heights are small
|
|
2845
|
+
balance_deep_and_shallow(domain)
|
|
2846
|
+
|
|
2847
|
+
# Compute edge values by interpolation
|
|
2848
|
+
for name in domain.conserved_quantities:
|
|
2849
|
+
Q = domain.quantities[name]
|
|
2850
|
+
Q.interpolate_from_vertices_to_edges()
|
|
2851
|
+
|
|
2852
|
+
#def distribute_using_edge_limiter(domain):
|
|
2853
|
+
# """Distribution from centroids to edges specific to the SWW eqn.
|
|
2854
|
+
#
|
|
2855
|
+
# It will ensure that h (w-z) is always non-negative even in the
|
|
2856
|
+
# presence of steep bed-slopes by taking a weighted average between shallow
|
|
2857
|
+
# and deep cases.
|
|
2858
|
+
#
|
|
2859
|
+
# In addition, all conserved quantities get distributed as per either a
|
|
2860
|
+
# constant (order==1) or a piecewise linear function (order==2).
|
|
2861
|
+
#
|
|
2862
|
+
#
|
|
2863
|
+
# Precondition:
|
|
2864
|
+
# All quantities defined at centroids and bed elevation defined at
|
|
2865
|
+
# vertices.
|
|
2866
|
+
#
|
|
2867
|
+
# Postcondition
|
|
2868
|
+
# Conserved quantities defined at vertices
|
|
2869
|
+
# """
|
|
2870
|
+
#
|
|
2871
|
+
# # Remove very thin layers of water
|
|
2872
|
+
# domain.protect_against_infinitesimal_and_negative_heights()
|
|
2873
|
+
#
|
|
2874
|
+
# for name in domain.conserved_quantities:
|
|
2875
|
+
# Q = domain.quantities[name]
|
|
2876
|
+
# if domain._order_ == 1:
|
|
2877
|
+
# Q.extrapolate_first_order()
|
|
2878
|
+
# elif domain._order_ == 2:
|
|
2879
|
+
# Q.extrapolate_second_order_and_limit_by_edge()
|
|
2880
|
+
# else:
|
|
2881
|
+
# raise Exception('Unknown order')
|
|
2882
|
+
#
|
|
2883
|
+
# balance_deep_and_shallow(domain)
|
|
2884
|
+
#
|
|
2885
|
+
# # Compute edge values by interpolation
|
|
2886
|
+
# for name in domain.conserved_quantities:
|
|
2887
|
+
# Q = domain.quantities[name]
|
|
2888
|
+
# Q.interpolate_from_vertices_to_edges()
|
|
2889
|
+
#
|
|
2890
|
+
##def protect_against_infinitesimal_and_negative_heights(domain):
|
|
2891
|
+
## """Protect against infinitesimal heights and associated high velocities"""
|
|
2892
|
+
##
|
|
2893
|
+
## from shallow_water_ext import protect
|
|
2894
|
+
##
|
|
2895
|
+
## # Shortcuts
|
|
2896
|
+
## wc = domain.quantities['stage'].centroid_values
|
|
2897
|
+
## zc = domain.quantities['elevation'].centroid_values
|
|
2898
|
+
## xmomc = domain.quantities['xmomentum'].centroid_values
|
|
2899
|
+
## ymomc = domain.quantities['ymomentum'].centroid_values
|
|
2900
|
+
##
|
|
2901
|
+
## protect(domain.minimum_allowed_height, domain.maximum_allowed_speed,
|
|
2902
|
+
## domain.epsilon, wc, zc, xmomc, ymomc)
|
|
2903
|
+
|
|
2904
|
+
|
|
2905
|
+
|
|
2906
|
+
|
|
2907
|
+
|
|
2908
|
+
################################################################################
|
|
2909
|
+
# Standard forcing terms
|
|
2910
|
+
################################################################################
|
|
2911
|
+
|
|
2912
|
+
|
|
2913
|
+
def manning_friction_implicit(domain):
|
|
2914
|
+
"""Apply (Manning) friction to water momentum
|
|
2915
|
+
Wrapper for c version
|
|
2916
|
+
"""
|
|
2917
|
+
|
|
2918
|
+
from shallow_water_ext import manning_friction_flat
|
|
2919
|
+
from shallow_water_ext import manning_friction_sloped
|
|
2920
|
+
|
|
2921
|
+
xmom = domain.quantities['xmomentum']
|
|
2922
|
+
ymom = domain.quantities['ymomentum']
|
|
2923
|
+
|
|
2924
|
+
x = domain.get_vertex_coordinates()
|
|
2925
|
+
|
|
2926
|
+
w = domain.quantities['stage'].centroid_values
|
|
2927
|
+
z = domain.quantities['elevation'].vertex_values
|
|
2928
|
+
|
|
2929
|
+
uh = xmom.centroid_values
|
|
2930
|
+
vh = ymom.centroid_values
|
|
2931
|
+
eta = domain.quantities['friction'].centroid_values
|
|
2932
|
+
|
|
2933
|
+
xmom_update = xmom.semi_implicit_update
|
|
2934
|
+
ymom_update = ymom.semi_implicit_update
|
|
2935
|
+
|
|
2936
|
+
eps = domain.minimum_allowed_height
|
|
2937
|
+
g = domain.g
|
|
2938
|
+
|
|
2939
|
+
if domain.use_sloped_mannings:
|
|
2940
|
+
manning_friction_sloped(g, eps, x, w, uh, vh, z, eta, xmom_update, \
|
|
2941
|
+
ymom_update)
|
|
2942
|
+
else:
|
|
2943
|
+
manning_friction_flat(g, eps, w, uh, vh, z, eta, xmom_update, \
|
|
2944
|
+
ymom_update)
|
|
2945
|
+
|
|
2946
|
+
|
|
2947
|
+
def manning_friction_explicit(domain):
|
|
2948
|
+
"""Apply (Manning) friction to water momentum
|
|
2949
|
+
Wrapper for c version
|
|
2950
|
+
"""
|
|
2951
|
+
|
|
2952
|
+
from shallow_water_ext import manning_friction_flat
|
|
2953
|
+
from shallow_water_ext import manning_friction_sloped
|
|
2954
|
+
|
|
2955
|
+
xmom = domain.quantities['xmomentum']
|
|
2956
|
+
ymom = domain.quantities['ymomentum']
|
|
2957
|
+
|
|
2958
|
+
x = domain.get_vertex_coordinates()
|
|
2959
|
+
|
|
2960
|
+
w = domain.quantities['stage'].centroid_values
|
|
2961
|
+
z = domain.quantities['elevation'].vertex_values
|
|
2962
|
+
|
|
2963
|
+
uh = xmom.centroid_values
|
|
2964
|
+
vh = ymom.centroid_values
|
|
2965
|
+
eta = domain.quantities['friction'].centroid_values
|
|
2966
|
+
|
|
2967
|
+
xmom_update = xmom.explicit_update
|
|
2968
|
+
ymom_update = ymom.explicit_update
|
|
2969
|
+
|
|
2970
|
+
eps = domain.minimum_allowed_height
|
|
2971
|
+
|
|
2972
|
+
if domain.use_sloped_mannings:
|
|
2973
|
+
manning_friction_sloped(domain.g, eps, x, w, uh, vh, z, eta, xmom_update, \
|
|
2974
|
+
ymom_update)
|
|
2975
|
+
else:
|
|
2976
|
+
manning_friction_flat(domain.g, eps, w, uh, vh, z, eta, xmom_update, \
|
|
2977
|
+
ymom_update)
|
|
2978
|
+
|
|
2979
|
+
|
|
2980
|
+
|
|
2981
|
+
# FIXME (Ole): This was implemented for use with one of the analytical solutions
|
|
2982
|
+
def linear_friction(domain):
|
|
2983
|
+
"""Apply linear friction to water momentum
|
|
2984
|
+
|
|
2985
|
+
Assumes quantity: 'linear_friction' to be present
|
|
2986
|
+
"""
|
|
2987
|
+
|
|
2988
|
+
w = domain.quantities['stage'].centroid_values
|
|
2989
|
+
z = domain.quantities['elevation'].centroid_values
|
|
2990
|
+
h = w-z
|
|
2991
|
+
|
|
2992
|
+
uh = domain.quantities['xmomentum'].centroid_values
|
|
2993
|
+
vh = domain.quantities['ymomentum'].centroid_values
|
|
2994
|
+
tau = domain.quantities['linear_friction'].centroid_values
|
|
2995
|
+
|
|
2996
|
+
xmom_update = domain.quantities['xmomentum'].semi_implicit_update
|
|
2997
|
+
ymom_update = domain.quantities['ymomentum'].semi_implicit_update
|
|
2998
|
+
|
|
2999
|
+
num_tris = len(domain)
|
|
3000
|
+
eps = domain.minimum_allowed_height
|
|
3001
|
+
|
|
3002
|
+
for k in range(num_tris):
|
|
3003
|
+
if tau[k] >= eps:
|
|
3004
|
+
if h[k] >= eps:
|
|
3005
|
+
S = -tau[k]/h[k]
|
|
3006
|
+
|
|
3007
|
+
#Update momentum
|
|
3008
|
+
xmom_update[k] += S*uh[k]
|
|
3009
|
+
ymom_update[k] += S*vh[k]
|
|
3010
|
+
|
|
3011
|
+
def depth_dependent_friction(domain, default_friction,
|
|
3012
|
+
surface_roughness_data,
|
|
3013
|
+
verbose=False):
|
|
3014
|
+
"""Returns an array of friction values for each wet element adjusted for
|
|
3015
|
+
depth.
|
|
3016
|
+
|
|
3017
|
+
Inputs:
|
|
3018
|
+
domain - computational domain object
|
|
3019
|
+
default_friction - depth independent bottom friction
|
|
3020
|
+
surface_roughness_data - N x 5 array of n0, d1, n1, d2, n2 values
|
|
3021
|
+
for each friction region.
|
|
3022
|
+
|
|
3023
|
+
Outputs:
|
|
3024
|
+
wet_friction - Array that can be used directly to update friction as
|
|
3025
|
+
follows:
|
|
3026
|
+
domain.set_quantity('friction', wet_friction)
|
|
3027
|
+
|
|
3028
|
+
|
|
3029
|
+
|
|
3030
|
+
"""
|
|
3031
|
+
|
|
3032
|
+
default_n0 = 0 # James - this was missing, don't know what it should be
|
|
3033
|
+
|
|
3034
|
+
# Create a temp array to store updated depth dependent
|
|
3035
|
+
# friction for wet elements
|
|
3036
|
+
# EHR this is outwardly inneficient but not obvious how to avoid
|
|
3037
|
+
# recreating each call??????
|
|
3038
|
+
|
|
3039
|
+
wet_friction = num.zeros(len(domain), num.float)
|
|
3040
|
+
wet_friction[:] = default_n0 # Initially assign default_n0 to all array so
|
|
3041
|
+
# sure have no zeros values
|
|
3042
|
+
|
|
3043
|
+
# create depth instance for this timestep
|
|
3044
|
+
depth = domain.create_quantity_from_expression('stage - elevation')
|
|
3045
|
+
# Recompute depth as vector
|
|
3046
|
+
d_vals = depth.get_values(location='centroids')
|
|
3047
|
+
|
|
3048
|
+
# rebuild the 'friction' values adjusted for depth at this instant
|
|
3049
|
+
# loop for each wet element in domain
|
|
3050
|
+
|
|
3051
|
+
for i in domain.get_wet_elements():
|
|
3052
|
+
# Get roughness data for each element
|
|
3053
|
+
d1 = float(surface_roughness_data[i, 1])
|
|
3054
|
+
n1 = float(surface_roughness_data[i, 2])
|
|
3055
|
+
d2 = float(surface_roughness_data[i, 3])
|
|
3056
|
+
n2 = float(surface_roughness_data[i, 4])
|
|
3057
|
+
|
|
3058
|
+
|
|
3059
|
+
# Recompute friction values from depth for this element
|
|
3060
|
+
|
|
3061
|
+
if d_vals[i] <= d1:
|
|
3062
|
+
ddf = n1
|
|
3063
|
+
elif d_vals[i] >= d2:
|
|
3064
|
+
ddf = n2
|
|
3065
|
+
else:
|
|
3066
|
+
ddf = n1 + ((n2-n1)/(d2-d1))*(d_vals[i]-d1)
|
|
3067
|
+
|
|
3068
|
+
# check sanity of result
|
|
3069
|
+
if (ddf < 0.010 or \
|
|
3070
|
+
ddf > 9999.0) :
|
|
3071
|
+
log.critical('>>>> WARNING: computed depth_dependent friction '
|
|
3072
|
+
'out of range, ddf%f, n1=%f, n2=%f'
|
|
3073
|
+
% (ddf, n1, n2))
|
|
3074
|
+
|
|
3075
|
+
# update depth dependent friction for that wet element
|
|
3076
|
+
wet_friction[i] = ddf
|
|
3077
|
+
|
|
3078
|
+
# EHR add code to show range of 'friction across domain at this instant as
|
|
3079
|
+
# sanity check?????????
|
|
3080
|
+
|
|
3081
|
+
if verbose :
|
|
3082
|
+
# return array of domain nvals
|
|
3083
|
+
nvals = domain.get_quantity('friction').get_values(location='centroids')
|
|
3084
|
+
n_min = min(nvals)
|
|
3085
|
+
n_max = max(nvals)
|
|
3086
|
+
|
|
3087
|
+
log.critical(' ++++ calculate_depth_dependent_friction - '
|
|
3088
|
+
'Updated friction - range %7.3f to %7.3f'
|
|
3089
|
+
% (n_min, n_max))
|
|
3090
|
+
|
|
3091
|
+
return wet_friction
|
|
3092
|
+
|
|
3093
|
+
def my_update_special_conditions(domain):
|
|
3094
|
+
|
|
3095
|
+
pass
|
|
3096
|
+
|
|
3097
|
+
|
|
3098
|
+
################################################################################
|
|
3099
|
+
# Initialise module
|
|
3100
|
+
################################################################################
|
|
3101
|
+
|
|
3102
|
+
#def _raise_compile_exception():
|
|
3103
|
+
# """ Raise exception if compiler not available. """
|
|
3104
|
+
# msg = 'C implementations could not be accessed by %s.\n ' % __file__
|
|
3105
|
+
# msg += 'Make sure compile_all.py has been run as described in '
|
|
3106
|
+
# msg += 'the ANUGA installation guide.'
|
|
3107
|
+
# raise Exception(msg)
|
|
3108
|
+
#
|
|
3109
|
+
#from anuga.utilities import compile
|
|
3110
|
+
#if not compile.can_use_C_extension('shallow_water_ext.c'):
|
|
3111
|
+
# _raise_compile_exception()
|
|
3112
|
+
|
|
3113
|
+
if __name__ == "__main__":
|
|
3114
|
+
pass
|