Changeset 7806
 Timestamp:
 Jun 8, 2010, 8:33:06 AM (13 years ago)
 Location:
 trunk/anuga_core/documentation/user_manual/demos
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/anuga_core/documentation/user_manual/demos/channel2.py
r7064 r7806 7 7 # Import necessary modules 8 8 # 9 from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular_cross 10 from anuga.shallow_water import Domain 11 from anuga.shallow_water import Reflective_boundary 12 from anuga.shallow_water import Dirichlet_boundary 13 from anuga.shallow_water import Time_boundary 9 import anuga 14 10 15 11 # … … 20 16 dx = dy = 1 # Resolution: Length of subdivisions on both axes 21 17 22 points, vertices, boundary = rectangular_cross(int(length/dx), int(width/dy), 23 len1=length, len2=width) 24 domain = Domain(points, vertices, boundary) 18 points, vertices, boundary = anuga.rectangular_cross(int(length/dx), 19 int(width/dy), len1=length, len2=width) 20 21 domain = anuga.Domain(points, vertices, boundary) 25 22 domain.set_name('channel2') # Output name 26 23 … … 39 36 # Setup boundary conditions 40 37 # 41 Bi = Dirichlet_boundary([0.4, 0, 0])# Inflow42 Br = Reflective_boundary(domain)# Solid reflective wall43 Bo = Dirichlet_boundary([5, 0, 0])# Outflow38 Bi = anuga.Dirichlet_boundary([0.4, 0, 0]) # Inflow 39 Br = anuga.Reflective_boundary(domain) # Solid reflective wall 40 Bo = anuga.Dirichlet_boundary([5, 0, 0]) # Outflow 44 41 45 42 domain.set_boundary({'left': Bi, 'right': Br, 'top': Br, 'bottom': Br}) … … 55 52 print 'Stage > 0: Changing to outflow boundary' 56 53 domain.set_boundary({'right': Bo}) 54 
trunk/anuga_core/documentation/user_manual/demos/channel3.py
r7064 r7806 7 7 # Import necessary modules 8 8 # 9 from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular_cross 10 from anuga.shallow_water import Domain 11 from anuga.shallow_water import Reflective_boundary 12 from anuga.shallow_water import Dirichlet_boundary 13 from anuga.shallow_water import Time_boundary 9 import anuga 14 10 15 11 # … … 20 16 dx = dy = .1 # Resolution: Length of subdivisions on both axes 21 17 22 points, vertices, boundary = rectangular_cross(int(length/dx), int(width/dy),23 24 domain = Domain(points, vertices, boundary)18 points, vertices, boundary = anuga.rectangular_cross(int(length/dx), 19 int(width/dy), len1=length, len2=width) 20 domain = anuga.Domain(points, vertices, boundary) 25 21 domain.set_name('channel3') # Output name 26 22 print domain.statistics() … … 57 53 # Setup boundary conditions 58 54 # 59 Bi = Dirichlet_boundary([0.4, 0, 0]) # Inflow60 Br = Reflective_boundary(domain) # Solid reflective wall61 Bo = Dirichlet_boundary([5, 0, 0]) # Outflow55 Bi = anuga.Dirichlet_boundary([0.4, 0, 0]) # Inflow 56 Br = anuga.Reflective_boundary(domain) # Solid reflective wall 57 Bo = anuga.Dirichlet_boundary([5, 0, 0]) # Outflow 62 58 63 59 domain.set_boundary({'left': Bi, 'right': Bo, 'top': Br, 'bottom': Br}) … … 73 69 print 'Stage > 0: Changing to outflow boundary' 74 70 domain.set_boundary({'right': Bo}) 71
Note: See TracChangeset
for help on using the changeset viewer.