Changeset 2636


Ignore:
Timestamp:
Mar 30, 2006, 5:45:12 PM (18 years ago)
Author:
ole
Message:

Work on friction creep example

Location:
inundation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inundation/examples/island.py

    r2635 r2636  
    2828
    2929#Create basic mesh
    30 N = 40
    31 points, vertices, boundary = rectangular(N, N, 100, 100)
    32 
    33 
    3430create_mesh_from_regions( [[0,0], [100,0], [100,100], [0,100]],
    3531                          boundary_tags = {'bottom': [0],
     
    3733                                           'top': [2],
    3834                                           'left': [3]},
    39                           maximum_triangle_area = 25,
     35                          maximum_triangle_area = 20,
    4036                          filename = 'island.msh'
    41                           , interior_regions=[ ([[50,25], [70,25], [70,75], [50,75]], 1)]
     37                          , interior_regions=[ ([[50,25], [70,25], [70,75], [50,75]], 3)]
    4238                          )
    4339                         
    4440                                                   
    4541                         
    46                            
    47 
    4842#Create shallow water domain
    49 #domain = Domain(points, vertices, boundary)
    5043domain = Domain(mesh_filename = 'island.msh')
    5144domain.smooth = False
     
    8477    return z
    8578
    86 domain.set_quantity('friction', 0.0)
     79#domain.set_quantity('friction', 0.1)  #Honky dory
     80domain.set_quantity('friction', 2)     #Creep
    8781domain.set_quantity('elevation', island)
    8882domain.set_quantity('stage', 1)
     
    9690Bd = Dirichlet_boundary([1, 0, 0])
    9791
    98 #domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br})
    9992domain.set_boundary({'left': Bd, 'right': Bd, 'top': Bd, 'bottom': Bd})
    10093domain.check_integrity()
     
    10699
    107100import time
    108 for t in domain.evolve(yieldstep = 1, finaltime = 500):
     101for t in domain.evolve(yieldstep = 1, finaltime = 100):
    109102    domain.write_time()
    110     if allclose(t, 100):
    111         Q = domain.get_quantity('stage')
    112         Q_s = Quantity(domain)
    113         Q_s.set_values(slump)
    114         domain.set_quantity('stage', Q + Q_s)
     103    #if allclose(t, 100):
     104    #    Q = domain.get_quantity('stage')
     105    #    Q_s = Quantity(domain)
     106    #    Q_s.set_values(slump)
     107    #    domain.set_quantity('stage', Q + Q_s)
    115108    #print '    Volume: ', domain.get_quantity('stage').get_integral()
    116109
  • inundation/pyvolution/shallow_water_ext.c

    r2635 r2636  
    381381      //New code: Adjust momentum to guarantee speeds are physical
    382382      //          ensure h is non negative     
    383      
    384      
     383      //FIXME (Ole): This is only implemented in this C extension and
     384      //             has no Python equivalent     
    385385      if (hc <= 0.0) {
    386386        wc[k] = zc[k];
Note: See TracChangeset for help on using the changeset viewer.