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