Ignore:
Timestamp:
May 22, 2009, 4:40:11 PM (11 years ago)
Author:
rwilson
Message:

Fiddling with layout of user guide.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/documentation/user_manual/demos/cairns/runcairns.py

    r6889 r7064  
    1515# Import necessary modules
    1616#------------------------------------------------------------------------------
    17 
    1817# Standard modules
    1918import os
     
    3736import project                 # Definition of file names and polygons
    3837
    39 
    4038#------------------------------------------------------------------------------
    4139# Preparation of topographic data
    4240# Convert ASC 2 DEM 2 PTS using source data and store result in source data
    4341#------------------------------------------------------------------------------
    44 
    4542# Create DEM from asc data
    4643convert_dem_from_ascii2netcdf(project.demname, use_cache=True, verbose=True)
     
    4946dem2pts(project.demname, use_cache=True, verbose=True)
    5047
    51 
    5248#------------------------------------------------------------------------------
    5349# Create the triangular mesh and domain based on
     
    5551# boundary and interior regions as defined in project.py
    5652#------------------------------------------------------------------------------
    57 
    5853domain = create_domain_from_regions(project.bounding_polygon,
    5954                                    boundary_tags={'top': [0],
     
    6762                                    verbose=True)
    6863
    69 
    7064# Print some stats about mesh and domain
    7165print 'Number of triangles = ', len(domain)
     
    7670# Setup parameters of computational domain
    7771#------------------------------------------------------------------------------
    78 
    79 
    8072domain.set_name('cairns_' + project.scenario) # Name of sww file
    8173domain.set_datadir('.')                       # Store sww output here
    8274domain.set_minimum_storable_height(0.01)      # Store only depth > 1cm
    8375
    84 
    8576#------------------------------------------------------------------------------
    8677# Setup initial conditions
    8778#------------------------------------------------------------------------------
    88 
    8979tide = 0.0
    9080domain.set_quantity('stage', tide)
     
    9686                    alpha=0.1)
    9787
    98 
    9988#------------------------------------------------------------------------------
    10089# Setup information for slide scenario (to be applied 1 min into simulation
    10190#------------------------------------------------------------------------------
    102 
    10391if project.scenario == 'slide':
    10492    # Function for submarine slide
     
    113101                                   verbose=True)
    114102
    115 
    116103#------------------------------------------------------------------------------
    117104# Setup boundary conditions
    118105#------------------------------------------------------------------------------
    119 
    120106print 'Available boundary tags', domain.get_boundary_tags()
    121 
    122107
    123108Bd = Dirichlet_boundary([tide,0,0]) # Mean water level
    124109Bs = Transmissive_stage_zero_momentum_boundary(domain) # Neutral boundary
    125 
    126110
    127111if project.scenario == 'fixed_wave':
     
    129113    Bw = Time_boundary(domain=domain,
    130114                       function=lambda t: [(60<t<3660)*50, 0, 0])
    131                        
    132115    domain.set_boundary({'ocean_east': Bw,
    133116                         'bottom': Bs,
     
    141124                         'onshore': Bd,
    142125                         'top': Bd})
    143    
    144126
    145127#------------------------------------------------------------------------------
    146128# Evolve system through time
    147129#------------------------------------------------------------------------------
    148 
    149130import time
    150131t0 = time.time()
     
    154135
    155136if project.scenario == 'slide':
    156    
    157137    for t in domain.evolve(yieldstep=10, finaltime=60):
    158138        print domain.timestepping_statistics()
     
    171151        print domain.boundary_statistics(tags='ocean_east')   
    172152
    173        
    174153if project.scenario == 'fixed_wave':
    175 
    176154    # Save every two mins leading up to wave approaching land
    177155    for t in domain.evolve(yieldstep=120, finaltime=5000):
Note: See TracChangeset for help on using the changeset viewer.