Changeset 6651
- Timestamp:
- Mar 28, 2009, 11:03:51 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/test_shallow_water_domain.py
r6643 r6651 2567 2567 polygon = [[1,1], [2,1], [2,2], [1,2]]) 2568 2568 2569 assert num.allclose(R.exchange_area, 1)2569 assert num.allclose(R.exchange_area, 2) 2570 2570 2571 2571 domain.forcing_terms.append(R) … … 2734 2734 polygon=rainfall_poly) 2735 2735 2736 assert num.allclose(R.exchange_area, 1)2736 assert num.allclose(R.exchange_area, 2) 2737 2737 2738 2738 domain.forcing_terms.append(R) … … 2807 2807 default_rate=5.0) 2808 2808 2809 assert num.allclose(R.exchange_area, 1)2809 assert num.allclose(R.exchange_area, 2) 2810 2810 2811 2811 domain.forcing_terms.append(R) … … 2882 2882 default_rate=5.0) 2883 2883 2884 assert num.allclose(R.exchange_area, 1)2884 assert num.allclose(R.exchange_area, 2) 2885 2885 2886 2886 domain.forcing_terms.append(R) … … 2924 2924 # Setup only one forcing term, constant inflow of 2 m^3/s on a circle affecting triangles #0 and #1 (bac and bce) 2925 2925 domain.forcing_terms = [] 2926 domain.forcing_terms.append( Inflow(domain, rate=2.0, center=(1,1), radius=1) ) 2927 2926 2927 I = Inflow(domain, rate=2.0, center=(1,1), radius=1) 2928 domain.forcing_terms.append(I) 2928 2929 domain.compute_forcing_terms() 2929 #print domain.quantities['stage'].explicit_update 2930 2931 assert num.allclose(domain.quantities['stage'].explicit_update[1], 2.0/pi) 2932 assert num.allclose(domain.quantities['stage'].explicit_update[0], 2.0/pi) 2930 2931 A = I.exchange_area 2932 assert num.allclose(A, 4) # Two triangles 2933 2934 assert num.allclose(domain.quantities['stage'].explicit_update[1], 2.0/A) 2935 assert num.allclose(domain.quantities['stage'].explicit_update[0], 2.0/A) 2933 2936 assert num.allclose(domain.quantities['stage'].explicit_update[2:], 0) 2934 2937 … … 2961 2964 # Setup only one forcing term, time dependent inflow of 2 m^3/s on a circle affecting triangles #0 and #1 (bac and bce) 2962 2965 domain.forcing_terms = [] 2963 domain.forcing_terms.append( Inflow(domain, rate=lambda t: 2., center=(1,1), radius=1) ) 2964 2965 domain.compute_forcing_terms() 2966 2967 assert num.allclose(domain.quantities['stage'].explicit_update[1], 2.0/pi) 2968 assert num.allclose(domain.quantities['stage'].explicit_update[0], 2.0/pi) 2966 I = Inflow(domain, rate=lambda t: 2., center=(1,1), radius=1) 2967 domain.forcing_terms.append(I) 2968 2969 domain.compute_forcing_terms() 2970 2971 A = I.exchange_area 2972 assert num.allclose(A, 4) # Two triangles 2973 2974 assert num.allclose(domain.quantities['stage'].explicit_update[1], 2.0/A) 2975 assert num.allclose(domain.quantities['stage'].explicit_update[0], 2.0/A) 2969 2976 assert num.allclose(domain.quantities['stage'].explicit_update[2:], 0) 2970 2977 … … 6876 6883 6877 6884 if __name__ == "__main__": 6878 suite = unittest.makeSuite(Test_Shallow_Water, 'test_inflow_using_flowline') 6885 #suite = unittest.makeSuite(Test_Shallow_Water, 'test_inflow_using_flowline') 6886 suite = unittest.makeSuite(Test_Shallow_Water, 'test') 6879 6887 runner = unittest.TextTestRunner(verbosity=1) 6880 6888 runner.run(suite)
Note: See TracChangeset
for help on using the changeset viewer.