source: anuga_work/development/demos/advection_dirichlet.py @ 5236

Last change on this file since 5236 was 4713, checked in by steve, 18 years ago

Implemented 2nd and 3rd order timestepping via the domain.set_timestepping_method method

File size: 948 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
22
23#Boundaries
24T = Transmissive_boundary(domain)
25D = Dirichlet_boundary(array([0.1]))
26
27domain.set_boundary( {'left': D, 'right': T, 'bottom': T, 'top': T} )
28domain.check_integrity()
29
30###################
31# Evolution
32for t in domain.evolve(yieldstep = 0.02, finaltime = 2):
33    domain.write_time()
34
35
36
Note: See TracBrowser for help on using the repository browser.