 Timestamp:
 Jul 25, 2008, 1:35:45 PM (15 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

anuga_core/source/anuga/shallow_water/shallow_water_domain.py
r5506 r5570 108 108 109 109 110 from anuga.utilities.polygon import inside_polygon, polygon_area 110 from anuga.utilities.polygon import inside_polygon, polygon_area, is_inside_polygon 111 111 112 112 … … 1501 1501 1502 1502 1503 from math import pi 1503 from math import pi, cos, sin 1504 1504 1505 1505 self.domain = domain … … 1513 1513 # previous timestep in order to obtain rate 1514 1514 1515 1516 bounding_polygon = domain.get_boundary_polygon() 1517 1518 1515 1519 # Update area if applicable 1516 1520 self.exchange_area = None … … 1521 1525 1522 1526 self.exchange_area = radius**2*pi 1527 1528 # Check that circle center lies within the mesh. 1529 msg = 'Center %s specified for forcing term did not' %(str(center)) 1530 msg += 'fall within the domain boundary.' 1531 assert is_inside_polygon(center, bounding_polygon), msg 1532 1533 # Check that circle periphery lies within the mesh. 1534 N = 100 1535 periphery_points = [] 1536 for i in range(N): 1537 1538 theta = 2*pi*i/100 1539 1540 x = center[0] + radius*cos(theta) 1541 y = center[1] + radius*sin(theta) 1542 1543 periphery_points.append([x,y]) 1544 1545 1546 for point in periphery_points: 1547 msg = 'Point %s on periphery for forcing term did not' %(str(point)) 1548 msg += ' fall within the domain boundary.' 1549 assert is_inside_polygon(point, bounding_polygon), msg 1550 1523 1551 1524 1552 if polygon is not None: 1525 1553 self.exchange_area = polygon_area(self.polygon) 1554 1555 # Check that polygon lies within the mesh. 1556 for point in self.polygon: 1557 msg = 'Point %s in polygon for forcing term did not' %(str(point)) 1558 msg += 'fall within the domain boundary.' 1559 assert is_inside_polygon(point, bounding_polygon), msg 1560 1561 1562 1563 1526 1564 1527 1565
Note: See TracChangeset
for help on using the changeset viewer.