Ignore:
Timestamp:
Jun 30, 2008, 10:41:27 AM (16 years ago)
Author:
ole
Message:

Added exception is inlet_region for General flow does not contain any triangles.
An input check was also added.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/shallow_water/shallow_water_domain.py

    r5442 r5450  
    14911491                 verbose=False):
    14921492                     
    1493 
     1493        if center is None:
     1494            msg = 'I got radius but no center.'       
     1495            assert radius is None, msg
     1496           
     1497        if radius is None:
     1498            msg += 'I got center but no radius.'       
     1499            assert center is None, msg
     1500           
     1501           
     1502                     
    14941503        from math import pi
    14951504
     
    15291538            # Inlet is circular
    15301539           
     1540            inlet_region = 'center=%s, radius=%s' %(self.center, self.radius)
     1541           
    15311542            self.exchange_indices = []
    15321543            for k in range(N):
     
    15371548        if self.polygon is not None:                   
    15381549            # Inlet is polygon
     1550           
     1551            inlet_region = 'polygon=%s' %(self.polygon)
     1552                       
    15391553            self.exchange_indices = inside_polygon(points, self.polygon)
    15401554           
    1541 
    1542            
     1555           
     1556        if self.exchange_indices is not None:
     1557            #print inlet_region
     1558       
     1559            if len(self.exchange_indices) == 0:
     1560                msg = 'No triangles have been identified in specified region: %s' %inlet_region
     1561                raise Exception, msg
    15431562
    15441563
Note: See TracChangeset for help on using the changeset viewer.