Ignore:
Timestamp:
Nov 26, 2012, 8:57:18 PM (12 years ago)
Author:
steve
Message:

Testing visualising height quantity

Location:
trunk/anuga_core/source/anuga/visualiser
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/visualiser/commandline_viewer.py

    r7276 r8649  
    3939        # the stage height:
    4040        # 0 and 10 are the minimum and maximum values of the stage.
    41         o.colour_height_quantity('stage', (lambda q: q['stage'], 0, 10))
     41        o.colour_height_quantity('stage', (lambda q: q['stage'], 1.0, 5.0))
    4242        # Or with the magnitude of the momentum at that point:
    4343        # Needs the sqrt function from numeric. Again, 0 and 10
    4444        # define the colour range.
    45         # o.colour_height_quantity('stage',
     45        from numpy import sqrt
     46        #o.colour_height_quantity('stage',
    4647        #                          (lambda q:sqrt((q['xmomentum'] ** 2) +
    4748        #                                         (q['ymomentum'] ** 2)),
    4849        #                                          0, 10))
     50        o.colour_height_quantity('stage',
     51                                  (lambda q: q['xmomentum']/
     52                                             (q['stage'] - q['elevation']),
     53                                              0, 5))
     54
     55
     56        # Draw some axes on the visualiser so we can see how big the wave is
     57
    4958
    5059        # Draw some axes on the visualiser so we can see how big the wave is
  • trunk/anuga_core/source/anuga/visualiser/numerical_dam_break_dry.py

    r8641 r8649  
    9393    from anuga.visualiser import RealtimeVisualiser
    9494    vis = RealtimeVisualiser(domain)
    95     vis.render_quantity_height("stage", zScale =1.0, dynamic=True)
     95    vis.render_quantity_height("height",dynamic=True)
     96    #vis.render_quantity_height("stage", zScale =1.0, dynamic=True)
    9697    vis.colour_height_quantity('stage', (0.0, 0.0, 1.0))
    9798    vis.start()
     
    110111        fileName = 'stage_%03d' % i + '.vtk'
    111112        i = i+1
    112         vis.store_height_quantity('stage',fileName)
    113 
     113        vis.store_height_quantity('height',fileName)
    114114
    115115#test against know data
  • trunk/anuga_core/source/anuga/visualiser/visualiser.py

    r8641 r8649  
    195195                    map(scalars.InsertNextValue, colour[0](self.build_quantity_dict()))
    196196                    self.vtk_polyData[quantityName].GetPointData().SetScalars(scalars)
    197                     #mapper.SetScalarRange(colour[1:])
     197                    mapper.SetScalarRange(colour[1:])
    198198                    mapper.Update()
    199199                else:
Note: See TracChangeset for help on using the changeset viewer.