Changeset 5549
- Timestamp:
- Jul 22, 2008, 1:31:50 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/test_data_manager.py
r5548 r5549 7096 7096 interior_regions=None 7097 7097 boundary_tags={'ocean': [0,1], 'otherocean': [2,3,4]} 7098 create_mesh_from_regions(bounding_polygon,boundary_tags=boundary_tags, 7099 maximum_triangle_area=extent_res,filename=meshname, 7100 interior_regions=interior_regions,verbose=False) 7098 create_mesh_from_regions(bounding_polygon, 7099 boundary_tags=boundary_tags, 7100 maximum_triangle_area=extent_res, 7101 filename=meshname, 7102 interior_regions=interior_regions, 7103 verbose=False) 7101 7104 7102 7105 domain_fbound = Domain(meshname) 7103 7106 domain_fbound.set_quantity('stage', tide) 7104 Bf = File_boundary(sts_file+'.sts', domain_fbound, boundary_polygon=bounding_polygon) 7107 Bf = File_boundary(sts_file+'.sts', 7108 domain_fbound, 7109 boundary_polygon=bounding_polygon) 7105 7110 Br = Reflective_boundary(domain_fbound) 7111 Bd = Dirichlet_boundary([w+tide, u*(w+h+tide), v*(w+h+tide)]) 7106 7112 7107 7113 domain_fbound.set_boundary({'ocean': Bf,'otherocean': Br}) 7114 7115 # Check boundary object evaluates as it should 7116 for i, ((vol_id, edge_id), B) in enumerate(domain_fbound.boundary_objects): 7117 if B is Bf: 7118 7119 qf = B.evaluate(vol_id, edge_id) # File boundary 7120 qd = Bd.evaluate(vol_id, edge_id) # Dirichlet boundary 7121 7122 assert allclose(qf, qd) 7123 7124 7125 # Evolve 7108 7126 finaltime=time_step*(time_step_count-1) 7109 7127 yieldstep=time_step 7110 7128 temp_fbound=zeros(int(finaltime/yieldstep)+1,Float) 7111 7129 7112 for i, t in enumerate(domain_fbound.evolve(yieldstep=yieldstep,finaltime=finaltime, 7113 skip_initial_step = False)): 7114 temp_fbound[i]=domain_fbound.quantities['stage'].centroid_values[2] 7130 for i, t in enumerate(domain_fbound.evolve(yieldstep=yieldstep, 7131 finaltime=finaltime, 7132 skip_initial_step=False)): 7133 7134 D = domain_fbound 7135 temp_fbound[i]=D.quantities['stage'].centroid_values[2] 7136 7137 # Check that file boundary object has populated 7138 # boundary array correctly 7139 # FIXME (Ole): Do this for the other tests too! 7140 for j, val in enumerate(D.get_quantity('stage').boundary_values): 7141 7142 (vol_id, edge_id), B = D.boundary_objects[j] 7143 if isinstance(B, File_boundary): 7144 #print j, val 7145 assert allclose(val, w + tide) 7146 7147 7148 7149 7150 7151 7152 7115 7153 7116 7154 … … 7118 7156 domain_drchlt.set_quantity('stage', tide) 7119 7157 Br = Reflective_boundary(domain_drchlt) 7120 Bd = Dirichlet_boundary([w+tide, u*(w+h+tide), v*(w+h+tide)]) 7158 7121 7159 domain_drchlt.set_boundary({'ocean': Bd,'otherocean': Br}) 7122 7160 temp_drchlt=zeros(int(finaltime/yieldstep)+1,Float) 7123 7161 7124 for i, t in enumerate(domain_drchlt.evolve(yieldstep=yieldstep,finaltime=finaltime, 7125 skip_initial_step = False)): 7162 for i, t in enumerate(domain_drchlt.evolve(yieldstep=yieldstep, 7163 finaltime=finaltime, 7164 skip_initial_step=False)): 7126 7165 temp_drchlt[i]=domain_drchlt.quantities['stage'].centroid_values[2] 7127 7166 … … 9454 9493 9455 9494 suite = unittest.makeSuite(Test_Data_Manager,'test') 9456 #suite = unittest.makeSuite(Test_Data_Manager,'test_file_boundary_sts ')9495 #suite = unittest.makeSuite(Test_Data_Manager,'test_file_boundary_stsI') 9457 9496 #suite = unittest.makeSuite(Test_Data_Manager,'test_urs2sts_ordering_different_sources') 9458 9497 #suite = unittest.makeSuite(Test_Data_Manager,'test_get_flow_through_cross_section_with_geo')
Note: See TracChangeset
for help on using the changeset viewer.