Changeset 1587
- Timestamp:
- Jul 7, 2005, 3:47:06 PM (19 years ago)
- Location:
- inundation/ga/storm_surge
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/Hobart/Landslide_1D.for
r1491 r1587 39 39 c 40 40 nx = 101 41 dtmax = 1.0d041 dtmax = 0.5d0 42 42 Tout = 1.0d0 43 tf = 200.0d043 tf = 1500.0d0 44 44 length = 1000.0d0 45 45 … … 49 49 50 50 limith = 1 51 dx = 10.d0 51 52 dx = 10000.d0/dble(nx-1) 52 53 K = 0.0d0 53 54 54 55 if (nx.gt.nxmax) write(*,*)'nx too large' 55 56 toll = 1.0d-10 56 cfl = 0. 01d057 cfl = 0.2d0 57 58 theta = 1.2d0 58 59 version = 10 … … 310 311 w1 = h1 + z(i) 311 312 w2 = h2 + z(i+1) 312 313 314 d1h = h1 - h0 315 d2h = h2 - h1 313 316 d1w = w1 - w0 314 317 d2w = w2 - w1 … … 316 319 317 320 c ------- W = H+Z 318 h_x = xmin( d1w, d2w) - dz 321 c h_x = xmin( d1w, d2w) - dz 322 h_x = xmic(theta, d1h, d2h) 319 323 320 324 c ------- Return the left and right values of h in an interval … … 323 327 324 328 c ------- Test for h_l or h_r negative 325 hmin = dmin1(h0,h1,h2)326 if ( h_l(i) .le. hmin ) then327 h_l(i) = hmin328 h_r(i) = h(i) + (h(i) - h_l(i))329 elseif ( h_r(i) .le. hmin ) then330 h_r(i) = hmin331 h_l(i) = h(i) + (h(i) - h_r(i))332 endif329 c$$$ hmin = dmin1(h0,h1,h2) 330 c$$$ if ( h_l(i) .le. hmin ) then 331 c$$$ h_l(i) = hmin 332 c$$$ h_r(i) = h(i) + (h(i) - h_l(i)) 333 c$$$ elseif ( h_r(i) .le. hmin ) then 334 c$$$ h_r(i) = hmin 335 c$$$ h_l(i) = h(i) + (h(i) - h_r(i)) 336 c$$$ endif 333 337 enddo 334 338 c 335 339 c ---- Enforce a minimum height 336 340 c 337 do i=md,nx+md+2338 hmax = dmax1(h_l(i),h_r(i))339 if (hmax .lt. 1.0d-3 ) then340 h_r(i) = 0.0d0341 uh_r(i) = 0.0d0342 h_l(i) = 0.0d0343 uh_l(i) = 0.0d0344 h(i) = 0.0d0345 uh(i) = 0.0d0346 endif347 enddo341 c$$$ do i=md,nx+md+2 342 c$$$ hmax = dmax1(h_l(i),h_r(i)) 343 c$$$ if (hmax .lt. 1.0d-3 ) then 344 c$$$c h_r(i) = 0.0d0 345 c$$$ uh_r(i) = 0.0d0 346 c$$$c h_l(i) = 0.0d0 347 c$$$ uh_l(i) = 0.0d0 348 c$$$c h(i) = 0.0d0 349 c$$$ uh(i) = 0.0d0 350 c$$$ endif 351 c$$$ enddo 348 352 c 349 353 c ---- Try for a flat subinterval … … 410 414 d2 = u(i+1) - u(i) 411 415 u_x = xmic( theta, d1, d2 ) 416 c u_x = xmin( d1, d2 ) 412 417 u_l(i) = u(i) - 0.5d0*u_x 413 418 u_r(i) = u(i) + 0.5d0*u_x -
inundation/ga/storm_surge/Hobart/Landslide_Tadmor.for
r1491 r1587 37 37 theta = 1.0d0 38 38 g = 9.81d0 39 hl= 10.0d039 hl= 5.0d0 40 40 hr = 0.d0 41 41 dx = 10000.d0/dble(nx-1) -
inundation/ga/storm_surge/pyvolution/general_mesh.py
r1565 r1587 85 85 self.number_of_elements = N = self.triangles.shape[0] 86 86 87 self.xy_extent = [ min(self.coordinates[:,0]), min(self.coordinates[:,1]) , 88 max(self.coordinates[:,0]), max(self.coordinates[:,1]) ] 87 xy_extent = [ min(self.coordinates[:,0]), min(self.coordinates[:,1]) , 88 max(self.coordinates[:,0]), max(self.coordinates[:,1]) ] 89 90 self.xy_extent = array(xy_extent, Float) 89 91 90 92 -
inundation/ga/storm_surge/pyvolution/mesh_factory.py
r1558 r1587 517 517 518 518 return points, elements, boundary 519 520 521 def contracting_channel_cross(m, n, W_upstream = 1., W_downstream = 0.75, 522 L_1 = 5.0, L_2 = 2.0, L_3 = 10, origin = (0.0, 0.0)): 523 """Setup a contracting channel grid of triangles 524 with m segments in the x-direction and n segments in the y-direction 525 526 """ 527 528 from Numeric import array 529 import math 530 531 from config import epsilon 532 533 534 lenx = L_1 + L_2 + L_3 535 leny = W_upstream 536 deltax = lenx/float(m) 537 deltay = leny/float(n) 538 539 x1 = 0 540 y1 = 0 541 x2 = L_1 542 y2 = 0 543 x3 = L_1 + L_2 544 y3 = (W_upstream - W_downstream)/2 545 x4 = L_1 + L_2 + L_3 546 y4 = y3 547 x5 = x4 548 y5 = y4 + W_downstream 549 x6 = L_1 + L_2 550 y6 = y5 551 x7 = L_1 552 y7 = W_upstream 553 x8 = 0 554 y8 = W_upstream 555 a1 = 0 556 a2 = (W_upstream - W_downstream)/(2*L_2) 557 a3 = 1 558 a4 = (W_downstream - W_upstream)/(L_2*W_upstream) 559 560 # Dictionary of vertex objects 561 vertices = {} 562 points = [] 563 564 for i in range(m+1): 565 x = deltax*i 566 for j in range(n+1): 567 y = deltay*j 568 if x > L_1 and x <= (L_1 + L_2): 569 y = a1 + a2*(x - L_1) + a3*y + a4*(x - L_1)*y 570 elif x > L_1 + L_2: 571 y = (W_upstream - W_downstream)/2 + deltay*j*W_downstream/W_upstream 572 573 vertices[i,j] = len(points) 574 points.append([x + origin[0], y + origin[1]]) 575 576 # Construct 4 triangles per element 577 elements = [] 578 boundary = {} 579 for i in range(m): 580 for j in range(n): 581 v1 = vertices[i,j+1] 582 v2 = vertices[i,j] 583 v3 = vertices[i+1,j+1] 584 v4 = vertices[i+1,j] 585 x = (points[v1][0]+points[v2][0]+points[v3][0]+points[v4][0])*0.25 586 y = (points[v1][1]+points[v2][1]+points[v3][1]+points[v4][1])*0.25 587 v5 = len(points) 588 points.append([x + origin[0], y + origin[1]]) 589 590 #Create left triangle 591 if i == 0: 592 boundary[(len(elements), 1)] = 'left' 593 elements.append([v2,v5,v1]) 594 595 #Create bottom triangle 596 if j == 0: 597 boundary[(len(elements), 1)] = 'bottom' 598 elements.append([v4,v5,v2]) 599 600 #Create right triangle 601 if i == m-1: 602 boundary[(len(elements), 1)] = 'right' 603 elements.append([v3,v5,v4]) 604 605 #Create top triangle 606 if j == n-1: 607 boundary[(len(elements), 1)] = 'top' 608 elements.append([v1,v5,v3]) 609 610 611 return points, elements, boundary
Note: See TracChangeset
for help on using the changeset viewer.