[1280] | 1 | import sys |
---|
| 2 | from os import sep |
---|
| 3 | sys.path.append('..'+sep+'pyvolution') |
---|
| 4 | |
---|
| 5 | #======================================================================== |
---|
| 6 | from config import g, epsilon |
---|
| 7 | from Numeric import allclose, array, zeros, ones, Float |
---|
| 8 | from advection import * |
---|
| 9 | from Numeric import array |
---|
| 10 | |
---|
| 11 | from mesh_factory import rectangular |
---|
| 12 | |
---|
| 13 | points, vertices, boundary = rectangular(60, 60) |
---|
| 14 | |
---|
| 15 | #Create advection domain with direction (1,-1) |
---|
| 16 | domain = Domain(points, vertices, boundary, velocity=[1.0, 0.0]) |
---|
| 17 | |
---|
| 18 | # Initial condition is zero by default |
---|
| 19 | |
---|
| 20 | domain.visualise = True |
---|
[1387] | 21 | domain.visualise_range_z = 0.5 |
---|
| 22 | #domain.visualise_color_stage = True |
---|
[1280] | 23 | |
---|
[1363] | 24 | |
---|
[1280] | 25 | #Boundaries |
---|
| 26 | T = Transmissive_boundary(domain) |
---|
[1363] | 27 | D = Dirichlet_boundary(array([1.0])) |
---|
[1280] | 28 | |
---|
| 29 | domain.default_order = 2 |
---|
| 30 | |
---|
| 31 | print domain.quantities.keys() |
---|
| 32 | |
---|
| 33 | domain.set_boundary( {'left': D, 'right': T, 'bottom': T, 'top': T} ) |
---|
| 34 | domain.check_integrity() |
---|
| 35 | |
---|
| 36 | #Check that the boundary value gets propagated to all elements |
---|
| 37 | for t in domain.evolve(yieldstep = 0.01, finaltime = 1.5): |
---|
| 38 | domain.write_time() |
---|