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

Last change on this file since 4026 was 4026, checked in by jack, 17 years ago

Moved the vpython visualiser to obsolete_code and cleared out things that call it from other code.

File size: 984 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.