Changeset 6713


Ignore:
Timestamp:
Apr 3, 2009, 12:34:47 PM (16 years ago)
Author:
steve
Message:

Fixed pylab so that it would work on bogong, by flattening the arrays for plotting

Location:
anuga_work/development/anuga_1d
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/development/anuga_1d/discontinuous_z.py

    r6694 r6713  
    1919domain.set_timestepping_method('rk2')
    2020domain.cfl = 1.0
    21 domain.limiter = "minmod"
     21domain.limiter = "vanleer"
    2222
    2323def stage_flat(x):
     
    8585domain.set_quantity('elevation',elevation_arbitrary)
    8686domain.set_boundary({'exterior':Reflective_boundary(domain)})
    87 X=domain.vertices
    88 C=domain.centroids
     87X=domain.vertices.flat
     88C=domain.centroids.flat
    8989
    9090t0=time.time()
     
    9595        print "t=",t
    9696        print "integral", domain.quantities['height'].get_integral()
    97         StageQ=domain.quantities['stage'].vertex_values
    98         MomentumQ=domain.quantities['xmomentum'].vertex_values
    99         ElevationQ=domain.quantities['elevation'].vertex_values
    100         VelocityQ=domain.quantities['velocity'].vertex_values
     97        StageQ=domain.quantities['stage'].vertex_values.flat
     98        MomentumQ=domain.quantities['xmomentum'].vertex_values.flat
     99        ElevationQ=domain.quantities['elevation'].vertex_values.flat
     100        VelocityQ=domain.quantities['velocity'].vertex_values.flat
    101101
    102102        hold(False)
  • anuga_work/development/anuga_1d/test_discontinuous_z.py

    r6698 r6713  
    8585domain.set_quantity('elevation',elevation_arbitrary2)
    8686domain.set_boundary({'exterior':Reflective_boundary(domain)})
    87 X=domain.vertices
    88 C=domain.centroids
     87X=domain.vertices.flat
     88C=domain.centroids.flat
    8989
    9090yieldstep = 1.0
     
    148148domain.write_time()
    149149print "integral", domain.quantities['height'].get_integral()
    150 StageQ=domain.quantities['stage'].vertex_values
     150StageQ=domain.quantities['stage'].vertex_values.flat
    151151StageUp=domain.quantities['stage'].explicit_update
    152 MomentumQ=domain.quantities['xmomentum'].vertex_values
     152MomentumQ=domain.quantities['xmomentum'].vertex_values.flat
    153153MomentumUp=domain.quantities['xmomentum'].explicit_update
    154154
    155 ElevationQ=domain.quantities['elevation'].vertex_values
    156 VelocityQ=domain.quantities['velocity'].vertex_values
     155ElevationQ=domain.quantities['elevation'].vertex_values.flat
     156VelocityQ=domain.quantities['velocity'].vertex_values.flat
    157157
    158158print "momentum", MomentumQ
     
    161161#StageUp=domain.quantities['stage'].explicit_update
    162162print "MomUpdates", MomentumUp
     163
    163164hold(False)
    164165plot1 = subplot(311)
     166#plot(X,StageQ)
    165167plot(X,StageQ, X,ElevationQ)
    166168plot1.set_ylim([-1.0,8.0])
     
    178180plot3 = subplot(313)
    179181plot(X,VelocityQ)
    180 #plot2.set_ylim([-5.0,30.0])
     182#plot3.set_ylim([-5.0,30.0])
    181183legend( ('Numerical Solution', 'for velocity'), 'upper right', shadow=False)
    182184xlabel('Position')
  • anuga_work/development/anuga_1d/var_depth_only.py

    r6453 r6713  
    6363
    6464# Define random array for width
    65 
     65
    6666randomarray=zeros(len(points),Float)
    6767for j in range(N+1):
Note: See TracChangeset for help on using the changeset viewer.