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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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')
Note: See TracChangeset for help on using the changeset viewer.