Changeset 7806


Ignore:
Timestamp:
Jun 8, 2010, 8:33:06 AM (14 years ago)
Author:
hudson
Message:

Channel examples run with new API.

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  
    77# Import necessary modules
    88#------------------------------------------------------------------------------
    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
     9import anuga
    1410
    1511#------------------------------------------------------------------------------
     
    2016dx = dy = 1           # Resolution: Length of subdivisions on both axes
    2117
    22 points, vertices, boundary = rectangular_cross(int(length/dx), int(width/dy),
    23                                                len1=length, len2=width)
    24 domain = Domain(points, vertices, boundary)   
     18points, vertices, boundary = anuga.rectangular_cross(int(length/dx),
     19                                        int(width/dy), len1=length, len2=width)
     20                                       
     21domain = anuga.Domain(points, vertices, boundary)   
    2522domain.set_name('channel2')                 # Output name
    2623
     
    3936# Setup boundary conditions
    4037#------------------------------------------------------------------------------
    41 Bi = Dirichlet_boundary([0.4, 0, 0])         # Inflow
    42 Br = Reflective_boundary(domain)             # Solid reflective wall
    43 Bo = Dirichlet_boundary([-5, 0, 0])          # Outflow
     38Bi = anuga.Dirichlet_boundary([0.4, 0, 0])   # Inflow
     39Br = anuga.Reflective_boundary(domain)       # Solid reflective wall
     40Bo = anuga.Dirichlet_boundary([-5, 0, 0])    # Outflow
    4441
    4542domain.set_boundary({'left': Bi, 'right': Br, 'top': Br, 'bottom': Br})
     
    5552        print 'Stage > 0: Changing to outflow boundary'
    5653        domain.set_boundary({'right': Bo})
     54       
  • trunk/anuga_core/documentation/user_manual/demos/channel3.py

    r7064 r7806  
    77# Import necessary modules
    88#------------------------------------------------------------------------------
    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
     9import anuga
    1410
    1511#------------------------------------------------------------------------------
     
    2016dx = dy = .1           # Resolution: Length of subdivisions on both axes
    2117
    22 points, vertices, boundary = rectangular_cross(int(length/dx), int(width/dy),
    23                                                len1=length, len2=width)
    24 domain = Domain(points, vertices, boundary)
     18points, vertices, boundary = anuga.rectangular_cross(int(length/dx),
     19                                         int(width/dy), len1=length, len2=width)
     20domain = anuga.Domain(points, vertices, boundary)
    2521domain.set_name('channel3')                  # Output name
    2622print domain.statistics()
     
    5753# Setup boundary conditions
    5854#------------------------------------------------------------------------------
    59 Bi = Dirichlet_boundary([0.4, 0, 0])          # Inflow
    60 Br = Reflective_boundary(domain)              # Solid reflective wall
    61 Bo = Dirichlet_boundary([-5, 0, 0])           # Outflow
     55Bi = anuga.Dirichlet_boundary([0.4, 0, 0])          # Inflow
     56Br = anuga.Reflective_boundary(domain)              # Solid reflective wall
     57Bo = anuga.Dirichlet_boundary([-5, 0, 0])           # Outflow
    6258
    6359domain.set_boundary({'left': Bi, 'right': Bo, 'top': Br, 'bottom': Br})
     
    7369        print 'Stage > 0: Changing to outflow boundary'
    7470        domain.set_boundary({'right': Bo})
     71       
Note: See TracChangeset for help on using the changeset viewer.