Opened 12 years ago

Closed 12 years ago

#363 closed defect (fixed)

error with interior_hole

Reported by: steve Owned by: steve
Priority: normal Milestone: Mesh generation maintenance
Component: Architecture and API Version:
Severity: normal Keywords:
Cc:

Description

Here is an error report from Marco

I am trying to simulate the presence of a building within my inundation area. I therefore tried to insert an internal hole, like this:

U = 686072,923091], [686072,923084], [686082,923084], [686082,923091? # building perimeter domain = anuga.create_domain_from_regions(project.bounding_polygon, boundary_tags={'nord': [0], 'est': [1], 'sud': [2], 'ovest': [3]}, maximum_triangle_area=project.default_res, mesh_filename=project.meshname, interior_holes=U, use_cache=True, verbose=True)

Unfortunately I get the following error message:

Traceback (most recent call last):

File "ammonite.py", line 47, in <module>

verbose=True)

File "/usr/lib/python2.6/dist-packages/anuga/init.py", line 254, in create_domain_from_regions

compression=False)

File "/usr/lib/python2.6/dist-packages/anuga/caching/caching.py", line 376, in cache

T = my_F(*args, kwargs) # Built-in 'apply' deprecated in Py3K

File "/usr/lib/python2.6/dist-packages/anuga/init.py", line 292, in _create_domain_from_regions

verbose=verbose)

File "/usr/lib/python2.6/dist-packages/anuga/pmesh/mesh_interface.py", line 121, in create_mesh_from_regions

args, kwargs)

File "/usr/lib/python2.6/dist-packages/anuga/pmesh/mesh_interface.py", line 241, in _create_mesh_from_regions

raise PolygonError?, msg

PolygonError?: Interior polygon [686072, 923091] is outside bounding polygon: [[ 686007.82 923006.11] [ 686145.11 923006.11] [ 686145.11 923145.11] [ 686003.91 923145.6 ]]

Marco's problem was fixed by changing the interior_holes argument assignment from

interior_holes=U

to

interior_holes=[U]

ie from a list of points to a list of (one) polygon(s).

But a bug still persists as the code produced an error saying that the first point in the list was nor inside the bounding polygon. Which is wrong. So it seems that the inside_polygon procedure works for polygons but not individual points.

Also the precedure create_mesh_from_regions should have thrown an exception when it got a list of points instead of a list of polygons. The same problem probably holds for interiour regions and breaklines.

Change History (1)

comment:1 Changed 12 years ago by steve

  • Resolution set to fixed
  • Status changed from new to closed

If a user passes just a polygon to the interior_holes argument in create_mesh(domain)_from regions then will get an error of the form

Interior hole polygon %s has too few (<3) points.
(Insure that you have specified a LIST of interior hole polygons)

The hint hopefully will alert the user to change the argument to a list of (one) polygons.

Note: See TracTickets for help on using tickets.