Changeset 3963


Ignore:
Timestamp:
Nov 10, 2006, 12:35:03 PM (18 years ago)
Author:
jack
Message:

Added new method get_quantity_names to domain.py for use by the visualiser.
Made commandline_viewer.py correctly start and stop the thread.
Made realtime.py only use public interfaces rather than dealing with the internals of the domain and quantity data structures

Location:
anuga_core/source/anuga
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/abstract_2d_finite_volumes/domain.py

    r3946 r3963  
    330330        self.quantities[name].set_values(*args, **kwargs)
    331331
     332
     333    def get_quantity_names(self):
     334        """Get a list of all the quantity names that this domain is aware of.
     335        Any value in the result should be a valid input to get_quantity.
     336        """
     337        return self.quantities.keys()
    332338
    333339    def get_quantity(self, name, location='vertices', indices = None):
  • anuga_core/source/anuga/visualiser/commandline_viewer.py

    r3823 r3963  
    5757
    5858        # Start the visualiser (in its own thread).
    59         o.run()
     59        o.start()
     60        # Wait for the visualiser to terminate before shutdown
     61        o.join()
     62       
  • anuga_core/source/anuga/visualiser/realtime.py

    r3960 r3963  
    6161        qty_index = zeros(N_vert, Float)
    6262        triangles = self.source.get_triangles()
     63        vertex_values, _ = self.source.get_quantity(quantityName).get_vertex_values(xy=False, smooth=False)
    6364
    6465        for n in range(len(triangles)):
    6566            for v in range(3):
    66                 qty_index[triangles[n][v]] = self.source.get_quantity(quantityName).vertex_values[n][v]
     67                #qty_index[triangles[n][v]] = self.source.get_quantity(quantityName).vertex_values[n][v]
     68                qty_index[triangles[n][v]] = vertex_values[n * 3 + v]
    6769
    6870        points = vtkPoints()
     
    9597        triangles = self.source.get_triangles()
    9698        quantities = {}
    97         for q in self.source.quantities.keys():
     99        for q in self.source.get_quantity_names():
    98100            quantities[q], _ = self.source.get_quantity(q).get_vertex_values(xy=False)
    99101        return quantities
Note: See TracChangeset for help on using the changeset viewer.