Last change
on this file since 1452 was
1231,
checked in by steve, 20 years ago
|
Added advection example for parallel testing
|
File size:
783 bytes
|
Line | |
---|
1 | from config import g, epsilon |
---|
2 | from Numeric import allclose, array, zeros, ones, Float |
---|
3 | from advection import * |
---|
4 | from Numeric import array |
---|
5 | |
---|
6 | from mesh_factory import rectangular |
---|
7 | |
---|
8 | points, vertices, boundary = rectangular(20, 20) |
---|
9 | |
---|
10 | #Create advection domain with direction (1,-1) |
---|
11 | domain = Domain(points, vertices, boundary, velocity=[1.0, 0.0]) |
---|
12 | |
---|
13 | # Initial condition is zero by default |
---|
14 | |
---|
15 | domain.visualise = True |
---|
16 | |
---|
17 | #Boundaries |
---|
18 | T = Transmissive_boundary(domain) |
---|
19 | D = Dirichlet_boundary(array([0.5])) |
---|
20 | |
---|
21 | domain.default_order = 2 |
---|
22 | |
---|
23 | domain.set_boundary( {'left': D, 'right': T, 'bottom': T, 'top': T} ) |
---|
24 | domain.check_integrity() |
---|
25 | |
---|
26 | #Check that the boundary value gets propagated to all elements |
---|
27 | for t in domain.evolve(yieldstep = 0.01, finaltime = 1.5): |
---|
28 | domain.write_time() |
---|
Note: See
TracBrowser
for help on using the repository browser.