Changeset 8068 for trunk/anuga_core/source/anuga/shallow_water
- Timestamp:
- Nov 11, 2010, 11:55:52 AM (14 years ago)
- Location:
- trunk/anuga_core/source/anuga/shallow_water
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/shallow_water/shallow_water_domain.py
r8047 r8068 106 106 full_send_dict=None, 107 107 ghost_recv_dict=None, 108 starttime=0, 108 109 processor=0, 109 110 numproc=1, … … 140 141 other_quantities = ['elevation', 'friction'] 141 142 143 142 144 Generic_Domain.__init__(self, 143 145 coordinates, … … 155 157 full_send_dict, 156 158 ghost_recv_dict, 159 starttime, 157 160 processor, 158 161 numproc, … … 563 566 self.distribute_to_vertices_and_edges() 564 567 565 if self.store is True and self. time == 0.0:568 if self.store is True and self.get_time() == self.get_starttime(): 566 569 self.initialise_storage() 567 570 -
trunk/anuga_core/source/anuga/shallow_water/test_data_manager.py
r7872 r8068 783 783 784 784 temp_time=num.zeros(int(finaltime/yieldstep)+1,num.float) 785 786 domain_time.set_starttime(domain_fbound.get_starttime()) 787 785 788 for i, t in enumerate(domain_time.evolve(yieldstep=yieldstep, 786 789 finaltime=finaltime, … … 831 834 if __name__ == "__main__": 832 835 #suite = unittest.makeSuite(Test_Data_Manager, 'test_sww2domain2') 833 suite = unittest.makeSuite(Test_Data_Manager, 'test _sww')836 suite = unittest.makeSuite(Test_Data_Manager, 'test') 834 837 835 838 -
trunk/anuga_core/source/anuga/shallow_water/test_forcing.py
r7844 r8068 591 591 domain.forcing_terms.append(R) 592 592 593 # This will test that time used in the forcing function takes 594 # startime into account. 595 domain.starttime = 5.0 596 597 domain.time = 7. 593 # This will test that time is set to starttime in set_starttime 594 domain.set_starttime(5.0) 598 595 599 596 domain.compute_forcing_terms() … … 602 599 (3*domain.get_time() + 7)/1000) 603 600 assert num.allclose(domain.quantities['stage'].explicit_update[1], 604 (3*(domain.time + domain.starttime) + 7)/1000) 605 606 # Using internal time her should fail 607 assert not num.allclose(domain.quantities['stage'].explicit_update[1], 608 (3*domain.time + 7)/1000) 601 (3*domain.get_starttime() + 7)/1000) 609 602 610 603 assert num.allclose(domain.quantities['stage'].explicit_update[0], 0) … … 657 650 domain.forcing_terms.append(R) 658 651 659 # This will test that time used in the forcing function takes 660 # startime into account. 661 domain.starttime = 5.0 662 663 domain.time = 7. 652 # This will test that time is set to starttime in set_starttime 653 domain.set_starttime(5.0) 664 654 665 655 domain.compute_forcing_terms() … … 668 658 (3*domain.get_time() + 7)/1000) 669 659 assert num.allclose(domain.quantities['stage'].explicit_update[1], 670 (3*(domain.time + domain.starttime) + 7)/1000) 671 672 # Using internal time her should fail 673 assert not num.allclose(domain.quantities['stage'].explicit_update[1], 674 (3*domain.time + 7)/1000) 660 (3*domain.get_starttime() + 7)/1000) 675 661 676 662 assert num.allclose(domain.quantities['stage'].explicit_update[0], 0) -
trunk/anuga_core/source/anuga/shallow_water/test_forcing_terms.py
r7814 r8068 887 887 domain.forcing_terms.append(R) 888 888 889 # This will test that time used in the forcing function takes 890 # startime into account. 891 domain.starttime = 5.0 892 893 domain.time = 7. 889 # This will test that time is set to starttime in set_starttime 890 domain.set_starttime(5.0) 894 891 895 892 domain.compute_forcing_terms() … … 898 895 (3*domain.get_time() + 7)/1000) 899 896 assert num.allclose(domain.quantities['stage'].explicit_update[1], 900 (3*(domain.time + domain.starttime) + 7)/1000) 901 902 # Using internal time her should fail 903 assert not num.allclose(domain.quantities['stage'].explicit_update[1], 904 (3*domain.time + 7)/1000) 897 (3*domain.get_starttime() + 7)/1000) 905 898 906 899 assert num.allclose(domain.quantities['stage'].explicit_update[0], 0) … … 953 946 domain.forcing_terms.append(R) 954 947 955 # This will test that time used in the forcing function takes 956 # startime into account. 957 domain.starttime = 5.0 958 959 domain.time = 7. 948 # This will test that time is set to starttime in set_starttime 949 domain.set_starttime(5.0) 960 950 961 951 domain.compute_forcing_terms() … … 964 954 (3*domain.get_time() + 7)/1000) 965 955 assert num.allclose(domain.quantities['stage'].explicit_update[1], 966 (3*(domain.time + domain.starttime) + 7)/1000) 967 968 # Using internal time her should fail 969 assert not num.allclose(domain.quantities['stage'].explicit_update[1], 970 (3*domain.time + 7)/1000) 956 (3*domain.get_starttime() + 7)/1000) 957 971 958 972 959 assert num.allclose(domain.quantities['stage'].explicit_update[0], 0) -
trunk/anuga_core/source/anuga/shallow_water/test_system.py
r7778 r8068 83 83 """ 84 84 85 boundary_starttime = 50085 boundary_starttime = 0 86 86 boundary_filename = self.create_sww_boundary(boundary_starttime) 87 87 filename = tempfile.mktemp(".sww") … … 131 131 """ 132 132 133 boundary_starttime = 500133 boundary_starttime = 0 134 134 boundary_filename = self.create_sww_boundary(boundary_starttime) 135 135 #print "boundary_filename",boundary_filename … … 147 147 domain.set_name(senario_name) 148 148 domain.set_datadir(dir) 149 new_starttime = 510.149 new_starttime = 0. 150 150 domain.set_starttime(new_starttime) 151 151 … … 178 178 msg += "Not logic. " 179 179 msg += "It's testing that starttime is working" 180 assert num.allclose(stage[2,0], 11.9867153168),msg180 assert num.allclose(stage[2,0], 4.7981238),msg 181 181 182 182
Note: See TracChangeset
for help on using the changeset viewer.