Changeset 4623 for anuga_core/source/anuga/pmesh/mesh_interface.py
- Timestamp:
- Jul 12, 2007, 3:31:51 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/pmesh/mesh_interface.py
r4285 r4623 29 29 mesh_geo_reference=None, 30 30 minimum_triangle_angle=28.0, 31 fail_if_polygons_outside=True, 31 32 use_cache=False, 32 33 verbose=True): … … 68 69 Note, interior regions should be fully nested, as overlaps may cause 69 70 unintended resolutions. 71 72 fail_if_polygons_outside: If True (the default) Exception in thrown 73 where interior polygons fall outside bounding polygon. If False, these 74 will be ignored and execution continued. 75 70 76 71 77 """ … … 82 88 'mesh_geo_reference': mesh_geo_reference, 83 89 'minimum_triangle_angle': minimum_triangle_angle, 90 'fail_if_polygons_outside': fail_if_polygons_outside, 84 91 'verbose': verbose} # FIXME (Ole): Should be bypassed one day 85 92 # What should be bypassed? Verbose? … … 118 125 mesh_geo_reference=None, 119 126 minimum_triangle_angle=28.0, 127 fail_if_polygons_outside=True, 120 128 verbose=True): 121 129 """_create_mesh_from_regions - internal function. … … 145 153 if interior_regions is not None: 146 154 # Test that all the interior polygons are inside the bounding_poly 155 # and throw out those that aren't fully included. 156 157 polygons_inside_boundary = [] 147 158 for interior_polygon, res in interior_regions: 148 159 indices = inside_polygon(interior_polygon, bounding_polygon, … … 150 161 151 162 if len(indices) <> len(interior_polygon): 152 msg = 'Interior polygon %s is outside bounding polygon: %s'\ 153 %(str(interior_polygon), str(bounding_polygon)) 154 raise PolygonError, msg 163 msg = 'Interior polygon %s is not fully inside'\ 164 %(str(interior_polygon)) 165 msg += ' bounding polygon: %s.' %(str(bounding_polygon)) 166 167 if fail_if_polygons_outside is True: 168 raise PolygonError, msg 169 else: 170 msg += ' I will ignore it.' 171 print msg 172 173 else: 174 polygons_inside_boundary.append([interior_polygon, res]) 175 176 # Record only those that were fully contained 177 interior_regions = polygons_inside_boundary 178 179 155 180 156 181 # the following segment of code could be used to Test that all the
Note: See TracChangeset
for help on using the changeset viewer.