source: anuga_core/source/anuga/examples/advection_dirichlet.py @ 3740

Last change on this file since 3740 was 3560, checked in by ole, 18 years ago

Renamed pyvolution to abstract_2d_finite_volumes. This is
one step towards pulling pyvolution apart. More to follow.
All unit tests pass and most examples fixed up.




File size: 1009 bytes
Line 
1"""Simple example using the module for solving the advection equation
2
3Initial condition is zero, boudary conditions are dirichlet at the left edge
4and transmissive everywhere else
5"""
6import sys
7from os import sep
8sys.path.append('..'+sep+'abstract_2d_finite_volumes')
9
10from mesh_factory import rectangular
11from advection import Domain, Transmissive_boundary, Dirichlet_boundary
12
13from Numeric import array
14
15#Create basic mesh
16points, vertices, boundary = rectangular(8, 8)
17
18#Create advection domain with direction (1,-1)
19# - Initial condition is zero by default
20domain = Domain(points, vertices, boundary, velocity=[1.0, -1.0])
21domain.smooth = False
22domain.visualise = True
23
24#Boundaries
25T = Transmissive_boundary(domain)
26D = Dirichlet_boundary(array([0.1]))
27
28domain.set_boundary( {'left': D, 'right': T, 'bottom': T, 'top': T} )
29domain.check_integrity()
30
31###################
32# Evolution
33for t in domain.evolve(yieldstep = 0.02, finaltime = 2):
34    domain.write_time()
35
36
37
Note: See TracBrowser for help on using the repository browser.