source: anuga_core/source/anuga/examples/flatbed_compare.py @ 3846

Last change on this file since 3846 was 3565, checked in by ole, 18 years ago

Moved obsolete code and examples to their appropriate locations

File size: 1.3 KB
Line 
1"""Example of shallow water wave equation.
2
3Generate slope
4
5"""
6
7######################
8# Module imports
9#
10from mesh_factory import rectangular
11from shallow_water import Domain, Reflective_boundary, Dirichlet_boundary,\
12     Constant_height
13from Numeric import array
14
15#Create basic mesh
16N = 8
17points, vertices, boundary = rectangular(N, N)
18
19#Create shallow water domain
20domain = Domain(points, vertices, boundary)
21domain.smooth = False
22domain.visualise = True
23domain.default_order=2
24
25
26######################
27# Boundary conditions
28Br = Reflective_boundary(domain)
29Bd = Dirichlet_boundary([0.2,0.,0.])
30
31domain.set_boundary({'left': Bd, 'right': Br, 'top': Br, 'bottom': Br})
32
33
34domain.check_integrity()
35
36######################
37#Evolution
38#for t in domain.evolve(yieldstep = 0.05, finaltime = 1.):
39#    domain.write_time()
40
41
42#import sys; sys.exit()
43
44######################
45#Evolution
46for t in domain.evolve(yieldstep = 0.01, finaltime = 0.03):
47    domain.write_time()
48
49print domain.quantities['stage'].centroid_values[:4]
50print domain.quantities['xmomentum'].centroid_values[:4]
51print domain.quantities['ymomentum'].centroid_values[:4]
52domain.distribute_to_vertices_and_edges()
53print
54print domain.quantities['stage'].vertex_values[:4,0]
55print domain.quantities['xmomentum'].vertex_values[:4,0]
56print domain.quantities['ymomentum'].vertex_values[:4,0] 
Note: See TracBrowser for help on using the repository browser.