- Timestamp:
- Aug 27, 2004, 1:35:01 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/test_shallow_water.py
r229 r232 1771 1771 1772 1772 1773 1773 def test_complex_bed(self): 1774 #No friction is tested here 1775 1776 from shallow_water import Domain, Reflective_boundary, Dirichlet_boundary,\ 1777 Transmissive_boundary, Time_boundary,\ 1778 Weir_simple as Weir, Constant_height 1779 1780 from mesh_factory import rectangular 1781 from Numeric import array 1782 1783 N = 12 1784 points, vertices, boundary = rectangular(N, N/2, len1=1.2,len2=0.6, 1785 origin=(-0.07, 0)) 1786 1787 1788 domain = Domain(points, vertices, boundary) 1789 domain.smooth = False 1790 domain.visualise = False 1791 domain.default_order=2 1792 1793 1794 inflow_stage = 0.1 1795 Z = Weir(inflow_stage) 1796 domain.set_quantity('elevation', Z) 1797 1798 Br = Reflective_boundary(domain) 1799 Bd = Dirichlet_boundary([inflow_stage, 0.0, 0.0]) 1800 domain.set_boundary({'left': Bd, 'right': Br, 'bottom': Br, 'top': Br}) 1801 1802 domain.set_quantity('level', Constant_height(Z, 0.)) 1803 1804 for t in domain.evolve(yieldstep = 0.02, finaltime = 0.2): 1805 pass 1806 1807 assert allclose(domain.quantities['level'].centroid_values, 1808 [3.96042007e-002, 5.61081828e-002, 4.66578380e-002, 5.73165329e-002, 1809 4.72542001e-002, 5.74770060e-002, 4.74459150e-002, 5.77550805e-002, 1810 4.80791695e-002, 5.85754074e-002, 4.90681598e-002, 6.02682664e-002, 1811 1.16686827e-002, 1.75422685e-002, 1.17014731e-002, 2.15810992e-002, 1812 1.30549421e-002, 2.14416681e-002, 1.31212934e-002, 2.15486277e-002, 1813 1.34996488e-002, 2.24053139e-002, 1.50195194e-002, 2.22306851e-002, 1814 -7.26762170e-003, -1.35071582e-003, -7.88143638e-003, 1815 -2.18165245e-003, -7.81749271e-003, -1.06732807e-003, 1816 -7.76399231e-003, -1.00580353e-003, -7.81877765e-003, 1817 -9.81086203e-004, -7.42500800e-003, -2.41412070e-004, 1.86244453e-001, 1818 8.79324341e-002, 1.86232625e-001, 8.78313615e-002, 6.12537452e-002, 1819 -3.73125664e-002, -6.37550753e-002, -3.73269705e-002, 6.12145063e-002, 1820 8.77700677e-002, 1.86257693e-001, 8.79121535e-002, -4.83328632e-002, 1821 1.18336527e-001, -4.83328400e-002, 1.18337005e-001, -4.83328850e-002, 1822 -6.65776472e-003, -1.73331646e-001, -1.31654218e-001, 1823 -1.73332232e-001, -6.66097985e-003, -4.83323869e-002, 1.18339536e-001, 1824 -2.48333331e-001, -2.31666623e-001, -2.48333332e-001, 1825 -2.31666628e-001, -2.48333332e-001, -2.31666627e-001, 1826 -2.48333330e-001, -2.31666575e-001, -2.48333330e-001, 1827 -2.31666597e-001, -2.48333329e-001, -2.31666584e-001, 1828 -4.65000000e-001, -3.65000000e-001, -4.65000000e-001, 1829 -3.65000000e-001, -4.65000000e-001, -3.65000000e-001, 1830 -4.65000000e-001, -3.65000000e-001, -4.65000000e-001, 1831 -3.65000000e-001, -4.65000000e-001, -3.65000000e-001, 1832 -5.98333333e-001, -5.81666667e-001, -5.98333333e-001, 1833 -5.81666667e-001, -5.98333333e-001, -5.81666667e-001, 1834 -5.98333333e-001, -5.81666667e-001, -5.98333333e-001, 1835 -5.81666667e-001, -5.98333333e-001, -5.81666667e-001, 1836 -6.48333333e-001, -6.31666667e-001, -6.48333333e-001, 1837 -6.31666667e-001, -6.48333333e-001, -6.31666667e-001, 1838 -6.48333333e-001, -6.31666667e-001, -6.48333333e-001, 1839 -6.31666667e-001, -6.48333333e-001, -6.31666667e-001, 1840 -5.31666667e-001, -5.98333333e-001, -5.31666667e-001, 1841 -5.98333333e-001, -5.31666667e-001, -5.98333333e-001, 1842 -5.31666667e-001, -5.98333333e-001, -5.31666667e-001, 1843 -5.98333333e-001, -5.31666667e-001, -5.98333333e-001, 1844 -4.98333333e-001, -4.81666667e-001, -4.98333333e-001, 1845 -4.81666667e-001, -4.98333333e-001, -4.81666667e-001, 1846 -4.98333333e-001, -4.81666667e-001, -4.98333333e-001, 1847 -4.81666667e-001, -4.98333333e-001, -4.81666667e-001, 1848 -5.48333333e-001, -5.31666667e-001, -5.48333333e-001, 1849 -5.31666667e-001, -5.48333333e-001, -5.31666667e-001, 1850 -5.48333333e-001, -5.31666667e-001, -5.48333333e-001, 1851 -5.31666667e-001, -5.48333333e-001, -5.31666667e-001]) 1852 1853 1774 1854 1775 1855
Note: See TracChangeset
for help on using the changeset viewer.