Changeset 326


Ignore:
Timestamp:
Sep 20, 2004, 6:13:57 PM (20 years ago)
Author:
ole
Message:
 
Location:
inundation/ga/storm_surge/pyvolution
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/pyvolution/bed_w_eden_boundary.py

    r324 r326  
    1414
    1515#Create basic mesh  (1km x 1km)
    16 points, vertices, boundary = rectangular(10, 10, 100, 100)
     16points, vertices, boundary = rectangular(50, 50, 100, 100)
    1717
    1818#Create shallow water domain
    1919domain = Domain(points, vertices, boundary)
    2020domain.smooth = False
    21 domain.visualise = True
     21domain.visualise = False
    2222domain.default_order=2
    2323domain.store = True    #Store for visualisation purposes
     
    2828#######################
    2929#Bed-slope and friction
    30 #domain.set_quantity('elevation', lambda x,y: -20*ones(x.shape))
     30domain.set_quantity('elevation', lambda x,y: 0.*ones(x.shape))
    3131
    32 domain.set_quantity('elevation', lambda x,y: -(x+y)/3)
     32#domain.set_quantity('elevation', lambda x,y: -(x+y)/3)
    3333domain.set_quantity('friction', 0.1)
    3434
     
    4646
    4747Br = Reflective_boundary(domain)
    48 Bd = Dirichlet_boundary([0. ,0.,0.])
     48Bd = Dirichlet_boundary([1. ,0.,0.])
    4949Bw = Time_boundary(domain=domain,
    50                    f=lambda t: [(1*sin(t*pi)), 0.0, 0.0])
     50                   f=lambda t: [(1*sin(t*pi/20)), 0.0, 0.0])
    5151
    5252Bf = File_boundary(domain, filename)
    5353
    54 domain.set_boundary({'left': Bd, 'right': Br, 'top': Br, 'bottom': Br})
    55 #domain.set_boundary({'left': Bf, 'right': Br, 'top': Br, 'bottom': Br})
     54#domain.set_boundary({'left': Bw, 'right': Br, 'top': Br, 'bottom': Br})
     55domain.set_boundary({'left': Bf, 'right': Br, 'top': Br, 'bottom': Br})
    5656
    5757
     
    6565######################
    6666#Evolution
    67 for t in domain.evolve(yieldstep = 6, finaltime = 385*15*60):
     67for t in domain.evolve(yieldstep = 60, finaltime = 385*15*60):
    6868    domain.write_time()
    6969
  • inundation/ga/storm_surge/pyvolution/generic_boundary_conditions.py

    r324 r326  
    222222        if t > self.T[-1]: raise msg       
    223223
     224        oldindex = self.index
     225
    224226        #Find slot
    225227        while t > self.T[self.index]: self.index += 1
    226228        while t < self.T[self.index]: self.index -= 1
    227229
    228 
     230        if oldindex != self.index:
     231            print 'Changing from %d to %d' %(oldindex, self.index)
     232       
     233       
    229234        #t is now between index and index+1
    230235        ratio = (t - self.T[self.index])/(self.T[self.index+1] - self.T[self.index])
Note: See TracChangeset for help on using the changeset viewer.