source: inundation/parallel/run_advection.py @ 2225

Last change on this file since 2225 was 2152, checked in by linda, 19 years ago

Added caching to the sw_merimbula files. Also updated some of the comments

File size: 1.3 KB
RevLine 
[1575]1#import pdb
2#pdb.set_trace()
[1520]3
[1280]4import sys
5from os import sep
6sys.path.append('..'+sep+'pyvolution')
7
8#========================================================================
9from config import g, epsilon
10from Numeric import allclose, array, zeros, ones, Float
[1639]11from advection import Domain, Transmissive_boundary, Dirichlet_boundary
[1280]12from Numeric import array
13
[1520]14
[1280]15from mesh_factory import rectangular
16
[2152]17#points, vertices, boundary = rectangular(60, 60)
18points, vertices, boundary = rectangular(10, 10)
[1280]19
20#Create advection domain with direction (1,-1)
21domain = 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
31T = Transmissive_boundary(domain)
[1363]32D = Dirichlet_boundary(array([1.0]))
[1280]33
[1520]34#turn on the visualisation
35rect = [0.0, 0.0, 1.0, 1.0]
[1639]36#domain.initialise_visualiser(rect=rect)
37domain.visualise = True
[1520]38
39
[1280]40domain.default_order = 2
41
42print domain.quantities.keys()
43
44domain.set_boundary( {'left': D, 'right': T, 'bottom': T, 'top': T} )
45domain.check_integrity()
46
47#Check that the boundary value gets propagated to all elements
[1472]48for t in domain.evolve(yieldstep = 0.1, finaltime = 1.5):
[1280]49    domain.write_time()
[1575]50    #pdb.set_trace()
Note: See TracBrowser for help on using the repository browser.