Changeset 4711


Ignore:
Timestamp:
Sep 6, 2007, 4:23:42 PM (17 years ago)
Author:
ole
Message:

Added tolerance for extremum computations

Files:
2 edited

Legend:

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

    r4704 r4711  
    860860        """
    861861
     862        # Define a tolerance for extremum computations
     863        epsilon = 1.0e-6 # Import 'single_precision' from config
     864       
    862865        if self.quantities_to_be_monitored is None:
    863866            return
     
    868871               self.time > self.monitor_time_interval[1]):
    869872            return
    870            
    871        
     873
    872874        # Update extrema for each specified quantity subject to
    873875        # polygon restriction (via monitor_indices).
     
    881883            info_block = self.quantities_to_be_monitored[quantity_name]
    882884
    883             # Update maximum (n > None is always True)
     885            # Update maximum
     886            # (n > None is always True, but we check explicitly because of the epsilon)
    884887            maxval = Q.get_maximum_value(self.monitor_indices)
    885             if maxval > info_block['max']:
     888            if info_block['max'] is None or\
     889                   maxval > info_block['max'] + epsilon:
    886890                info_block['max'] = maxval
    887891                maxloc = Q.get_maximum_location()
     
    890894
    891895
    892             # Update minimum (n < None is always False)
     896            # Update minimum
    893897            minval = Q.get_minimum_value(self.monitor_indices)
    894898            if info_block['min'] is None or\
    895                    minval < info_block['min']:
     899                   minval < info_block['min'] - epsilon:
    896900                info_block['min'] = minval               
    897901                minloc = Q.get_minimum_location()
  • anuga_validation/automated_validation_tests/okushiri_tank_validation/run_okushiri.py

    r4631 r4711  
    5656domain.set_all_limiters(0.9)              # Max second order scheme (old lim)
    5757domain.set_minimum_storable_height(0.001) # Don't store w < 0.001m
    58 domain.set_maximum_allowed_speed(0.1)     # Allow a little runoff (0.1 is OK)
     58# domain.set_maximum_allowed_speed(0.1)     # Allow a little runoff (0.1 is OK)
     59domain.set_quantities_to_be_monitored('stage')
    5960
    6061# New slope limiter and first order h-limiter
     
    8586for t in domain.evolve(yieldstep = 0.05, finaltime = 22.5):
    8687    domain.write_time()
     88    print domain.quantity_statistics(precision='%.12f')
    8789
    8890print 'That took %.2f seconds' %(time.time()-t0)
Note: See TracChangeset for help on using the changeset viewer.