source: inundation/ga/storm_surge/pyvolution/flatbed_compare.py @ 474

Last change on this file since 474 was 458, checked in by ole, 21 years ago

Fixed friction bug

File size: 1.5 KB
RevLine 
[453]1"""Example of shallow water wave equation.
2
3Comparison of flatbed between mark 2(Grohm) and mark 3
4
5"""
6
7######################
8# Module imports
9#
10from mesh_factory import rectangular
11from shallow_water import Domain, Reflective_boundary, Dirichlet_boundary,\
12     Transmissive_boundary, Constant_height
13from Numeric import array
14
15#Create basic mesh
[458]16N = 10
[453]17points, vertices, boundary = rectangular(N, N)
18
19#Create shallow water domain
20domain = Domain(points, vertices, boundary)
21
22if N < 20:
23    domain.visualise = True
24else:
25    domain.visualise = False
26    domain.store = True
27    domain.format = 'sww'
28    domain.filename = 'compare_py3'
29
[458]30#domain.visualise = False
[453]31domain.smooth = False
[458]32domain.default_order = 1
[453]33
34
35print 'Field values'
36domain.set_quantity('elevation', 0.0)
[458]37domain.set_quantity('friction', 1)
[453]38
39
40######################
41# Boundary conditions
42Br = Reflective_boundary(domain)
43Bd = Dirichlet_boundary([0.2,0.,0.])
44Bt = Transmissive_boundary(domain)
45
46domain.set_boundary({'left': Bd, 'right': Bt, 'top': Bt, 'bottom': Bt})
47domain.check_integrity()
48
[458]49print domain.quantities['elevation'].centroid_values[:4]
50print domain.quantities['friction'].centroid_values[:4]
[453]51
52######################
53#Evolution
[458]54for t in domain.evolve(yieldstep = 0.01, finaltime = 0.5):
[453]55    domain.write_time()
[458]56    #print
57
58#print domain.quantities['level'].centroid_values
59#print domain.quantities['xmomentum'].centroid_values
60#print domain.quantities['ymomentum'].centroid_values   
61
62#print 'R'
63#print domain.quantities['level'].edge_values
64
65
Note: See TracBrowser for help on using the repository browser.