Changeset 2619
- Timestamp:
- Mar 28, 2006, 1:08:47 PM (19 years ago)
- Location:
- inundation
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/examples/bedslope.py
r2582 r2619 7 7 ###################### 8 8 # Module imports 9 #10 9 from pyvolution.mesh_factory import rectangular 11 10 from pyvolution.shallow_water import Domain, Reflective_boundary,\ -
inundation/examples/island.py
r2618 r2619 1 1 """Example of shallow water wave equation. 2 2 3 Island surrounded by water 3 Island surrounded by water. 4 This example investigates onshore 'creep' 4 5 5 6 """ 6 7 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 16 14 from math import exp 17 15 16 # Application specific imports 17 from pyvolution.mesh_factory import rectangular 18 from pyvolution.shallow_water import Domain, Reflective_boundary 19 from utilities.polygon import Polygon_function, read_polygon 20 21 22 #------------------------------------------------------------------------------- 23 # Setup computational domain 24 #------------------------------------------------------------------------------- 18 25 19 26 #Create basic mesh … … 23 30 #Create shallow water domain 24 31 domain = Domain(points, vertices, boundary) 25 domain.store = True26 32 domain.smooth = False 27 domain.visualise = False28 33 domain.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 34 domain.set_default_order(2) 34 35 35 36 … … 44 45 45 46 46 #Initial conditions 47 #------------------------------------------------------------------------------- 48 # Setup initial conditions 49 #------------------------------------------------------------------------------- 47 50 48 51 def island(x, y): … … 57 60 58 61 62 #------------------------------------------------------------------------------- 63 # Setup boundary conditions (all reflective) 64 #------------------------------------------------------------------------------- 59 65 60 ######################61 # Boundary conditions62 66 Br = Reflective_boundary(domain) 63 67 … … 66 70 67 71 68 ###################### 69 #Evolution 72 #------------------------------------------------------------------------------- 73 # Evolve system through time 74 #------------------------------------------------------------------------------- 75 70 76 import time 71 77 for t in domain.evolve(yieldstep = 1, finaltime = 100):
Note: See TracChangeset
for help on using the changeset viewer.