Ignore:
Timestamp:
Jun 8, 2010, 10:47:10 AM (13 years ago)
Author:
hudson
Message:

Examples work with new API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/documentation/user_manual/examples/runuptest.py

    r3563 r7808  
    1010#------------------------------------------------------------------------------
    1111
    12 from anuga.pmesh.mesh_interface import create_mesh_from_regions
    13 from anuga.shallow_water import Domain
    14 from anuga.shallow_water import Reflective_boundary
    15 from anuga.shallow_water import Dirichlet_boundary
    16 from anuga.shallow_water import Time_boundary
    17 from anuga.shallow_water import Transmissive_boundary
     12import anuga
    1813
    1914
     
    3227meshname = 'test.msh'
    3328
    34 create_mesh_from_regions(polygon,
     29anuga.create_mesh_from_regions(polygon,
    3530                         boundary_tags={'top': [0],
    3631                                        'left': [1],
     
    4136                         #interior_regions=interior_regions)
    4237
    43 domain = Domain(meshname,use_cache=True,verbose = True)
     38domain = anuga.Domain(meshname,use_cache=True,verbose = True)
    4439domain.set_name('test')                     # Output to test.sww
    4540domain.set_datadir('.')                     # Use current directory for output
     
    6762
    6863from math import sin, pi
    69 Br = Reflective_boundary(domain)      # Solid reflective wall
    70 Bt = Transmissive_boundary(domain)    # Continue all values on boundary
    71 Bd = Dirichlet_boundary([0.,0.,0.])   # Constant boundary values
    72 Bw = Time_boundary(domain=domain,     # Time dependent boundary 
     64Br = anuga.Reflective_boundary(domain)      # Solid reflective wall
     65Bt = anuga.Transmissive_boundary(domain)    # Continue all values on boundary
     66Bd = anuga.Dirichlet_boundary([0.,0.,0.])   # Constant boundary values
     67Bw = anuga.Time_boundary(domain=domain,     # Time dependent boundary 
    7368                   f=lambda t: [((10<t<20)*waveheight), 0.0, 0.0])
    7469
     
    9186# Gauge line
    9287def gauge_line(west,east,north,south):
    93     from Numeric import arange
     88    from numpy import arange
    9489    gaugex = arange(west,(west+east)/2.,1000.)
    9590    gauges = []
     
    10398gauges, gaugex, gaugey = gauge_line(west,east,north,south)
    10499
    105 from anuga.abstract_2d_finite_volumes.util import file_function
    106 
    107 f = file_function('test.sww',
     100f = anuga.file_function('test.sww',
    108101                  quantities = ['stage', 'elevation', 'xmomentum', 'ymomentum'],
    109102                  interpolation_points = gauges,
Note: See TracChangeset for help on using the changeset viewer.