Changeset 4985
 Timestamp:
 Jan 30, 2008, 11:39:28 AM (16 years ago)
 Location:
 anuga_validation/conical_island
 Files:

 2 added
 1 edited
Legend:
 Unmodified
 Added
 Removed

anuga_validation/conical_island/run_circular.py
r4980 r4985 11 11 from anuga.shallow_water import Dirichlet_boundary, Time_boundary 12 12 from anuga.shallow_water.data_manager import get_maximum_inundation_data 13 from anuga.abstract_2d_finite_volumes.util import file_function, sww2csv_gauges ,square_root13 from anuga.abstract_2d_finite_volumes.util import file_function, sww2csv_gauges 14 14 from anuga.pmesh.mesh_interface import create_mesh_from_regions 15 15 from anuga.utilities.polygon import read_polygon, plot_polygons … … 19 19 from anuga.shallow_water.data_manager import csv2dict 20 20 21 #import project22 23 21 # 24 22 # Create Domain from mesh … … 99 97 d=0.75 100 98 res=.05 101 res=1.99 #res=1. 102 100 103 101 #create polygons (circles) to have higher resolution … … 166 164 domain.set_quantity('stage', water_height) 167 165 168 #def square_root(): 169 # fileName1 = "square_root_table.csv" 170 # file1 = open(fileName1,"w") 171 ## file1.write("number,square_root \n") 172 # for i in range (0,37): 173 # for j in range (0,10): 174 # number = i+(j/10.) 175 # print "%s,%s, %s, %s" %(i,j, number, sqrt(number)) 176 # 177 # file1.write("%s, %s\n" %(i, sqrt(number))) 178 # file1.close() 179 # 180 ## return sqrt(s) 181 # 182 #def test(): 183 # fileName = "test.csv" 184 # file = open(fileName,"w") 185 # file.write("easting,northing,elevation \n") 186 # 187 # # csv2dict() 188 # 189 # x = 12.96 190 # y = 13.80 191 # res=1 192 # for i in range(0,30*res): 193 # for j in range(0,25*res): 194 ## a = (xi)**2 195 ## b = (yj)**2 196 # 197 # # z = sqrt((x(i/res))**2+(y(j/res))**2) 198 # du = (x(i/res))**2+(y(j/res))**2 199 # z = sqrt(du)*.25+(0.8975) 200 # if z <0: 201 # z=0 202 # if z > .625: 203 # z=0.625 204 # 205 # #print 'x,y,f',du,i,j,z 206 # file.write("%s, %s, %s\n" %(i/res, j/res, z)) 207 # file.close() 208 # 209 ##square_root() 210 ##test() 211 # 212 #square_root_data=array([],typecode=Float) 213 # 214 #square_root_data=resize(square_root_data,(400,2)) 215 # 216 # 217 #for i in range (0,37): 218 # for j in range (0,10): 219 # number = i+(j/10.) 220 # print "%s,%s, %s, %s" %(i,j, number, sqrt(number)) 221 # 222 # square_root_data[i*10+j]= number, sqrt(number) 223 # 224 ## file1.write("%s, %s\n" %(i, sqrt(number))) 225 226 attribute_dic, title_index_dic = csv2dict('sqrt_table.csv') 166 167 #attribute_dic, title_index_dic = csv2dict('sqrt_table.csv') 168 attribute_dic, title_index_dic = csv2dict('sqrt_table_new.csv') 227 169 #print attribute_dic 228 170 print attribute_dic['number'][10] … … 243 185 z1=[] 244 186 for d in du: 245 n1a = round(d,0) 246 n1=int(n1a)*10 247 n2=int(round(d  int(round(d,0)),1)*10) 248 nn=n1+n2 249 #print d,n1a,n1,n2,nn 187 # n1=int(round(d,0))*10 188 # n2=int(round(d  int(round(d,0)),1)*10) 189 ## n3=int(round(d  int(round(d,1)),2)*100) 190 # nn=n1+n2#+n3 191 192 193 # n1=int(round(d,0))*100 194 # n2=int(round(d  n1,1)*10)*10 195 # n3=int(round(d  n2,2)*100) 196 # nn=n1+n2+n3 197 nn=int(round(d,2)*100) 198 # print d,n1,n2,n3,nn 250 199 # zz=square_root_data[nn] 251 200 zz=float(attribute_dic['sqrt'][nn]) 252 print nn,zz201 # print nn,zz 253 202 254 203 # z = square_root((center_xx)**2+(center_yy)**2) … … 259 208 if z > .625: 260 209 z=0.625 261 print 'hello',z 210 print 'hello',d,nn,zz,z 211 # print 'hello',d,n1,n2,n3,nn,zz,z 262 212 z1.append(z) 263 213 return z1 … … 265 215 #domain.set_quantity('elevation',filename = "test.csv", alpha=0.1) 266 216 #domain.set_quantity('elevation',filename = "test.csv", alpha=1.,verbose=True) 267 domain.set_quantity('elevation',test, verbose=True)217 domain.set_quantity('elevation',test, alpha=1., verbose=True) 268 218 269 219 … … 272 222 # 273 223 domain.set_name('test1') # Name of output sww file 274 domain.set_default_order(1) # Apply second order scheme 275 domain.set_all_limiters(0.9) # Max second order scheme (old lim) 276 domain.set_minimum_storable_height(0.01) # Don't store w < 0.001m 277 domain.set_maximum_allowed_speed(0.1) # Allow a little runoff (0.1 is OK) 224 #domain.set_default_order(1) # Apply second order scheme 225 #domain.set_all_limiters(0.9) # Max second order scheme (old lim) 226 #domain.set_minimum_storable_height(0.01) # Don't store w < 0.001m 227 #domain.set_maximum_allowed_speed(0.1) # Allow a little runoff (0.1 is OK) 228 domain.set_default_order(2) # Apply second order scheme 229 #domain.set_all_limiters(0.9) # Max second order scheme (old lim) 230 domain.set_minimum_storable_height(0.001) # Don't store w < 0.001m 231 domain.set_maximum_allowed_speed(1) # Allow a little runoff (0.1 is OK) 278 232 domain.tight_slope_limiters = 1 279 233 domain.beta_h = 0.0 … … 320 274 t0 = time.time() 321 275 322 for t in domain.evolve(yieldstep = 1, finaltime = 3 2):276 for t in domain.evolve(yieldstep = 1, finaltime = 30): 323 277 domain.write_time() 324 278 # domain.write_time(track_speeds=False) … … 329 283 domain.write_time() 330 284 331 for t in domain.evolve(yieldstep = 1, finaltime = 50285 for t in domain.evolve(yieldstep = 1, finaltime = 45 332 286 ,skip_initial_step = True): 333 287 domain.write_time()
Note: See TracChangeset
for help on using the changeset viewer.