Changeset 9096


Ignore:
Timestamp:
Apr 26, 2014, 2:19:41 PM (11 years ago)
Author:
steve
Message:

Trouble with indents on windows, moving to linux

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/operators/run_set_elevation.py

    r8928 r9096  
    1515from anuga import Time_boundary
    1616
    17 #------------------------------------------------------------------------------
    18 # Setup computational domain
    19 #------------------------------------------------------------------------------
    20 length = 24.
    21 width = 5.
    22 dx = dy = 0.2 #.1           # Resolution: Length of subdivisions on both axes
    23 
    24 points, vertices, boundary = rectangular_cross(int(length/dx), int(width/dy),
    25                                                len1=length, len2=width)
    26 domain = Domain(points, vertices, boundary)
    27 domain.set_name('set_elevation') # Output name
    28 print domain.statistics()
    29 domain.set_quantities_to_be_stored({'elevation': 2,
    30                                     'stage': 2})
    3117
    3218#------------------------------------------------------------------------------
    33 # Setup initial conditions
     19# Stage and Elevation Functions
    3420#------------------------------------------------------------------------------
    3521def topography(x,y):
     
    8167
    8268
    83 def pole(t):
     69def pole(x,y,t):
     70       
     71        z = topography(x,y)
     72    if t<10:
     73        return z
     74    elif t>12:
     75        return z
     76    else:
     77        return z+1.0
    8478
    85     if t<10:
    86         return 0.0
    87     elif t>12:
    88         return 0.0
    89     else:
    90         return 1.0
    9179
     80
     81#------------------------------------------------------------------------------
     82# Setup computational domain
     83#------------------------------------------------------------------------------
     84length = 24.
     85width = 5.
     86dx = dy = 0.2 #.1           # Resolution: Length of subdivisions on both axes
     87
     88points, vertices, boundary = rectangular_cross(int(length/dx), int(width/dy),
     89                                               len1=length, len2=width)
     90domain = Domain(points, vertices, boundary)
     91domain.set_name() # Output name based on script name
     92print domain.statistics()
     93domain.set_quantities_to_be_stored({'elevation': 2,
     94                                    'stage': 2})
     95
     96#------------------------------------------------------------------------------
     97# Setup initial conditions
     98#------------------------------------------------------------------------------
    9299
    93100domain.set_quantity('elevation', topography)           # elevation is a function
     
    108115#------------------------------------------------------------------------------
    109116
    110 from anuga.operators.set_elevation_operators import Set_elevation_operator
     117from anuga import Set_elevation_operator
    111118op1 = Set_elevation_operator(domain, elevation=pole, radius=0.5, center = (12.0,3.0))
    112119
    113 from anuga.operators.set_elevation import Set_elevation
     120from anuga import Set_elevation
    114121op2 = Set_elevation(domain, elevation = topography)
    115122
Note: See TracChangeset for help on using the changeset viewer.