Ignore:
Timestamp:
Sep 5, 2007, 10:06:48 AM (17 years ago)
Author:
ole
Message:

Work on ticket:192 (and untabify)

File:
1 edited

Legend:

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

    r4701 r4702  
    573573        # FIXME (Ole): This is under construction. See ticket:192
    574574
     575        from anuga.abstract_2d_finite_volumes.util import\
     576             apply_expression_to_dictionary       
     577
    575578        if q is None:
    576579            self.quantities_to_be_monitored = None
     
    582585            q = [q] # Turn argument into a list
    583586
    584         # Check correcness
     587        # Check correcness and initialise
     588        self.quantities_to_be_monitored = {}
    585589        for quantity_name in q:
    586590            msg = 'Quantity %s is not a valid conserved quantity'\
    587591                  %quantity_name
    588592           
    589             assert quantity_name in self.conserved_quantities, msg
     593
     594            if not quantity_name in self.quantities:
     595                # See if this expression is valid
     596                apply_expression_to_dictionary(quantity_name, self.quantities)
     597
     598            # Initialise extrema
     599            self.quantities_to_be_monitored[quantity_name] = [None, None]
     600           
    590601
    591602        if polygon is not None:
     
    598609
    599610
    600         self.quantities_to_be_monitored = q
     611       
    601612        self.monitor_polygon = polygon
    602613        self.monitor_time_interval = time_interval       
     
    694705
    695706            x, y = self.get_centroid_coordinates()[k]
    696             radius = self.get_radii()[k]
    697             area = self.get_areas()[k]     
    698             max_speed = self.max_speed[k]          
     707            radius = self.get_radii()[k]
     708            area = self.get_areas()[k]     
     709            max_speed = self.max_speed[k]          
    699710
    700711            msg += '  Triangle #%d with centroid (%.4f, %.4f), ' %(k, x, y)
    701             msg += 'area = %.4f and radius = %.4f ' %(area, radius)
     712            msg += 'area = %.4f and radius = %.4f ' %(area, radius)
    702713            msg += 'had the largest computed speed: %.6f m/s ' %(max_speed)
    703             if max_speed > 0.0:
     714            if max_speed > 0.0:
    704715                msg += '(timestep=%.6f)\n' %(radius/max_speed)
    705716            else:
    706                 msg += '(timestep=%.6f)\n' %(0)    
     717                msg += '(timestep=%.6f)\n' %(0)    
    707718           
    708719            # Report all quantity values at vertices
     
    10151026        """Go through list of boundary objects and update boundary values
    10161027        for all conserved quantities on boundary.
    1017         It is assumed that the ordering of conserved quantities is
    1018         consistent between the domain and the boundary object, i.e.
    1019         the jth element of vector q must correspond to the jth conserved
    1020         quantity in domain.
     1028        It is assumed that the ordering of conserved quantities is
     1029        consistent between the domain and the boundary object, i.e.
     1030        the jth element of vector q must correspond to the jth conserved
     1031        quantity in domain.
    10211032        """
    10221033
     
    10241035        #FIXME: Boundary objects should not include ghost nodes.
    10251036        for i, ((vol_id, edge_id), B) in enumerate(self.boundary_objects):
    1026             if B is None:
    1027                 print 'WARNING: Ignored boundary segment %d (None)'
    1028             else:
     1037            if B is None:
     1038                print 'WARNING: Ignored boundary segment %d (None)'
     1039            else:
    10291040                q = B.evaluate(vol_id, edge_id)
    10301041
Note: See TracChangeset for help on using the changeset viewer.