Changeset 2619


Ignore:
Timestamp:
Mar 28, 2006, 1:08:47 PM (19 years ago)
Author:
ole
Message:

Cleaned up island example

Location:
inundation
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • inundation/examples/bedslope.py

    r2582 r2619  
    77######################
    88# Module imports
    9 #
    109from pyvolution.mesh_factory import rectangular
    1110from pyvolution.shallow_water import Domain, Reflective_boundary,\
  • inundation/examples/island.py

    r2618 r2619  
    11"""Example of shallow water wave equation.
    22
    3 Island surrounded by water
     3Island surrounded by water.
     4This example investigates onshore 'creep'
    45
    56"""
    67
    7 ######################
    8 # Module imports
    9 #
    10 from os import sep, path
    11 from mesh_factory import rectangular
    12 from shallow_water import Domain, Reflective_boundary, Dirichlet_boundary,\
    13      Constant_height
    14 from Numeric import array
    15 from utilities.polygon import Polygon_function, read_polygon
     8
     9#-------------------------------------------------------------------------------
     10# Import necessary modules
     11#-------------------------------------------------------------------------------
     12
     13# Standard modules
    1614from math import exp
    1715
     16# Application specific imports
     17from pyvolution.mesh_factory import rectangular
     18from pyvolution.shallow_water import Domain, Reflective_boundary
     19from utilities.polygon import Polygon_function, read_polygon
     20
     21
     22#-------------------------------------------------------------------------------   
     23# Setup computational domain
     24#-------------------------------------------------------------------------------
    1825
    1926#Create basic mesh
     
    2330#Create shallow water domain
    2431domain = Domain(points, vertices, boundary)
    25 domain.store = True
    2632domain.smooth = False
    27 domain.visualise = False
    2833domain.set_name('island')
    29 print 'Output being written to ' + domain.get_datadir() + sep + \
    30               domain.get_name() + '.' + domain.format
    31 
    32 
    33 domain.default_order=2
     34domain.set_default_order(2)
    3435
    3536
     
    4445
    4546
    46 #Initial conditions
     47#-------------------------------------------------------------------------------
     48# Setup initial conditions
     49#-------------------------------------------------------------------------------
    4750
    4851def island(x, y):
     
    5760
    5861
     62#-------------------------------------------------------------------------------
     63# Setup boundary conditions (all reflective)
     64#-------------------------------------------------------------------------------
    5965
    60 ######################
    61 # Boundary conditions
    6266Br = Reflective_boundary(domain)
    6367
     
    6670
    6771
    68 ######################
    69 #Evolution
     72#-------------------------------------------------------------------------------
     73# Evolve system through time
     74#-------------------------------------------------------------------------------
     75
    7076import time
    7177for t in domain.evolve(yieldstep = 1, finaltime = 100):
Note: See TracChangeset for help on using the changeset viewer.