Ignore:
Timestamp:
Jul 22, 2005, 5:59:19 PM (20 years ago)
Author:
ole
Message:

Interpolation work and some refactoring

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/validation/LWRU1/lwru1.py

    r1627 r1632  
    3232#(only about 200m is expected, though)
    3333
    34 #points, vertices, boundary = rectangular(400, 40,
     34points, vertices, boundary = rectangular(400, 40,
     35                                         len1=55000, len2=5000,
     36                                         origin = (-5000, 0.0))
     37
     38#points, vertices, boundary = rectangular(100, 10,
    3539#                                         len1=55000, len2=5000,
    3640#                                         origin = (-5000, 0.0))
    37 
    38 points, vertices, boundary = rectangular(100, 10,
    39                                          len1=55000, len2=5000,
    40                                          origin = (-5000, 0.0))
    4141
    4242
     
    9090        #plot(self.x, self.w)
    9191        #show()
    92 
     92        #import sys; sys.exit()
    9393
    9494    def __call__(self, x, y):
     
    154154
    155155#Set boundary conditions
    156 domain.set_boundary({'left': Bd, 'right': Bd, 'bottom': Bd, 'top': Bd})
     156domain.set_boundary({'left': Br, 'right': Bt, 'bottom': Bt, 'top': Bt})
    157157
    158158
     
    167167xes = []
    168168y = 2500
    169 x0 = -5000
     169x0 = -100
    170170step = 50
    171171for i in range(1000):
     
    176176from pylab import *
    177177from pyvolution.least_squares import Interpolation
    178 I = Interpolation(domain.coordinates,
    179                   domain.triangles,
     178
     179 
     180V = domain.get_vertex_coordinates(obj=True)
     181T = domain.get_triangles(obj=True)
     182
     183I = Interpolation(V,
     184                  T,
    180185                  point_coordinates = pt,
    181186                  verbose = True)
    182187
    183188
     189f = domain.quantities['elevation'].vertex_values.flat
     190z = I.interpolate( f )
     191
    184192print 'xxxxx'
    185193
     194ion()
    186195hold(False)
    187 for t in domain.evolve(yieldstep = 1, finaltime = 220.0):
    188 
    189     f = domain.quantities['stage'].get_vertex_values(smooth = True)
     196f = domain.quantities['stage'].vertex_values.flat
     197y = I.interpolate( f )
     198plot(xes, y, '-b', xes, z, '-k')
     199set( gca(), Ylim=(-10,10) )
     200
     201raw_input('go')
     202for t in domain.evolve(yieldstep = 1, finaltime = 300.0):
     203
     204    f = domain.quantities['stage'].vertex_values.flat
    190205    y = I.interpolate( f )
    191 
     206    ioff()
     207    plot(xes, y, '-b', xes, z, '-k')
    192208    ion()
    193     plot(xes, y)   
     209    set( gca(), Ylim=(-10,10) )
     210   
     211   
     212    #print y[:], y.shape
     213
     214
    194215    domain.write_time()
    195216
Note: See TracChangeset for help on using the changeset viewer.