Changeset 7804 for anuga_work


Ignore:
Timestamp:
Jun 7, 2010, 4:19:31 PM (14 years ago)
Author:
hudson
Message:

Fixed up failing tests, updated user guide with new API (first few chapters only).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/development/classroom/ripcurrent.py

    r7589 r7804  
    1616# Import necessary modules
    1717#------------------------------------------------------------------------------
    18 from anuga.interface import create_domain_from_regions
    19 from anuga.shallow_water.shallow_water_domain import Dirichlet_boundary
    20 from anuga.shallow_water.shallow_water_domain import Reflective_boundary
    21 from anuga.shallow_water.shallow_water_domain import Time_boundary
    22 from anuga.shallow_water.data_manager import get_mesh_and_quantities_from_file
     18import anuga
    2319from pylab import figure, plot, axis, quiver, quiverkey, show, title, axhline
    2420from pylab import cos, sin, pi
     
    4137halfchannelwidth = 5
    4238bank_slope = 0.1
    43 simulation_length = 1
     39simulation_length = 60
    4440timestep = 1
    4541
     
    5046length = 120
    5147width = 170
    52 seafloor_resolution = 60.0 # Resolution: Max area of triangles in the mesh
     48seafloor_resolution = 20.0 # Resolution: Max area of triangles in the mesh
    5349feature_resolution = 1.0
    5450beach_resolution = 10.0
    5551
    5652sea_boundary_polygon = [[0,0],[length,0],[length,width],[0,width]]
    57 feature_boundary_polygon = [[0,100],[length,100],[length,150],[0,150]]
     53feature_boundary_polygon = [[19,99],[length/2+1,99],[length/2+1,151],[0,151]]
     54hole_boundary_polygon = [[20,100],[length/2,100],[length/2,150],[20,150]]
    5855beach_interior_polygon = [[0,150],[length,150],[length,width],[0,width]]
    5956
     
    6461                   [beach_interior_polygon, beach_resolution]]
    6562
    66 domain = create_domain_from_regions(sea_boundary_polygon,
     63domain = anuga.create_domain_from_regions(sea_boundary_polygon,
    6764                                    boundary_tags={'bottom': [0],
    6865                                                   'right' : [1],
     
    7269                                    mesh_filename=meshname,
    7370                                    interior_regions=feature_regions,
     71                                    interior_holes=[hole_boundary_polygon],
    7472                                    use_cache=True,
    7573                                    verbose=True)
     
    149147# Setup boundary conditions
    150148#------------------------------------------------------------------------------
    151 Bi = Dirichlet_boundary([0.4, 0, 0])          # Inflow
    152 Br = Reflective_boundary(domain)              # Solid reflective wall
    153 Bo = Dirichlet_boundary([-5, 0, 0])           # Outflow
     149Bi = anuga.Dirichlet_boundary([0.4, 0, 0])          # Inflow
     150Br = anuga.Reflective_boundary(domain)              # Solid reflective wall
     151Bo = anuga.Dirichlet_boundary([-5, 0, 0])           # Outflow
    154152
    155153def wave(t):
     
    158156   
    159157    A = 0.4  # Amplitude of wave [m] (wave height)
    160     T = 5    # Wave period [s]
     158    T = 1    # Wave period [s]
    161159
    162160    if t < 30000000000:
     
    165163        return [0.0, 0, 0]
    166164
    167 Bt = Time_boundary(domain, f=wave)
    168 
    169 
    170 domain.set_boundary({'left': Br, 'right': Br, 'top': Bo, 'bottom': Bt})
     165Bt = anuga.Time_boundary(domain, f=wave)
     166
     167
     168domain.set_boundary({'left': Br, 'right': Br, 'top': Bo, 'bottom': Bt, 'exterior': Br})
    171169
    172170
Note: See TracChangeset for help on using the changeset viewer.