- Timestamp:
- Nov 17, 2008, 9:58:04 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/test_data_manager.py
r5938 r5958 8769 8769 8770 8770 8771 def Xtest_file_boundary_stsIV_sinewave_ordering(self):8771 def test_file_boundary_stsIV_sinewave_ordering(self): 8772 8772 """test_file_boundary_stsIV_sinewave_ordering(self): 8773 8773 Read correct points from ordering file and apply sts to boundary … … 8782 8782 from anuga.pmesh.mesh_interface import create_mesh_from_regions 8783 8783 8784 from numpy import sin,cos 8785 8784 8786 lat_long_points=[[6.01,97.0],[6.02,97.0],[6.05,96.9],[6.0,97.0]] 8785 8787 bounding_polygon=[[6.0,97.0],[6.01,97.0],[6.02,97.0],[6.02,97.02],[6.00,97.02]] 8786 8788 tide = 0.35 8787 8789 time_step_count = 50 8788 time_step = 2 8790 time_step = 0.1 8791 times_ref = arange(0, time_step_count*time_step, time_step) 8789 8792 8790 8793 n=len(lat_long_points) … … 8793 8796 8794 8797 gauge_depth=20*ones(n,Float) 8795 ha1[1]=2*sin(times_ref - 3) 8796 ua=0.0*ones((n,time_step_count),Float) 8797 va=0.0*ones((n,time_step_count),Float) 8798 8799 ha1=ones((n,time_step_count),Float) 8800 ua1=3.*ones((n,time_step_count),Float) 8801 va1=2.*ones((n,time_step_count),Float) 8802 for i in range(n): 8803 ha1[i]=sin(times_ref) 8798 8804 8799 8805 … … 8802 8808 first_tstep, last_tstep, 8803 8809 depth=gauge_depth, 8804 ha=ha ,8805 ua=ua ,8806 va=va )8810 ha=ha1, 8811 ua=ua1, 8812 va=va1) 8807 8813 8808 8814 # Write order file … … 8916 8922 8917 8923 8918 domain_drchlt = Domain(meshname) 8919 domain_drchlt.set_quantity('stage', tide) 8920 Br = Reflective_boundary(domain_drchlt) 8921 w = 2.0+tide 8922 h = 20+w 8923 Bd = Dirichlet_boundary([w, 10*h,-10*h]) 8924 domain_drchlt.set_boundary({'ocean': Bd,'otherocean': Br}) 8925 8926 temp_drchlt=zeros(int(finaltime/yieldstep)+1,Float) 8927 8928 for i, t in enumerate(domain_drchlt.evolve(yieldstep=yieldstep,finaltime=finaltime, 8924 domain_time = Domain(meshname) 8925 domain_time.set_quantity('stage', tide) 8926 Br = Reflective_boundary(domain_time) 8927 Bw=Time_boundary(domain=domain_time, 8928 f=lambda t: [sin(t)+tide,3.*(20.+sin(t)+tide),2.*(20.+sin(t)+tide)]) 8929 domain_time.set_boundary({'ocean': Bw,'otherocean': Br}) 8930 8931 temp_time=zeros(int(finaltime/yieldstep)+1,Float) 8932 for i, t in enumerate(domain_time.evolve(yieldstep=yieldstep, 8933 finaltime=finaltime, 8929 8934 skip_initial_step=False)): 8930 temp_ drchlt[i]=domain_drchlt.quantities['stage'].centroid_values[2]8931 8932 8933 8934 print temp_fbound8935 print temp_drchlt8936 8937 print domain_fbound.quantities['stage'].vertex_values8938 print domain_drchlt.quantities['stage'].vertex_values8939 8940 assert allclose(temp_fbound, temp_ drchlt)8935 temp_time[i]=domain_time.quantities['stage'].centroid_values[2] 8936 8937 8938 8939 #print temp_fbound 8940 #print temp_time 8941 8942 #print domain_fbound.quantities['stage'].vertex_values 8943 #print domain_time.quantities['stage'].vertex_values 8944 8945 assert allclose(temp_fbound, temp_time) 8941 8946 assert allclose(domain_fbound.quantities['stage'].vertex_values, 8942 domain_ drchlt.quantities['stage'].vertex_values)8947 domain_time.quantities['stage'].vertex_values) 8943 8948 8944 8949 assert allclose(domain_fbound.quantities['xmomentum'].vertex_values, 8945 domain_ drchlt.quantities['xmomentum'].vertex_values)8950 domain_time.quantities['xmomentum'].vertex_values) 8946 8951 8947 8952 assert allclose(domain_fbound.quantities['ymomentum'].vertex_values, 8948 domain_ drchlt.quantities['ymomentum'].vertex_values)8953 domain_time.quantities['ymomentum'].vertex_values) 8949 8954 8950 8955 … … 10933 10938 if __name__ == "__main__": 10934 10939 10935 #suite = unittest.makeSuite(Test_Data_Manager,'test')10940 suite = unittest.makeSuite(Test_Data_Manager,'test') 10936 10941 #suite = unittest.makeSuite(Test_Data_Manager,'test_file_boundary_stsI_beyond_model_time') 10937 10942 #suite = unittest.makeSuite(Test_Data_Manager,'test_file_boundary_stsIV_sinewave_ordering') … … 10942 10947 10943 10948 # FIXME (Ole): This is the test that fails under Windows 10944 suite = unittest.makeSuite(Test_Data_Manager,'test_read_mux_platform_problem2') 10949 #suite = unittest.makeSuite(Test_Data_Manager,'test_read_mux_platform_problem2') 10950 #suite = unittest.makeSuite(Test_Data_Manager,'test_file_boundary_stsIV') 10945 10951 10946 10952
Note: See TracChangeset
for help on using the changeset viewer.