Ticket #234 (closed defect: fixed)

Opened 9 years ago

Last modified 7 years ago

using holes when creating a mesh does not work with fitting

Reported by: duncan Owned by: hudson
Priority: normal Milestone:
Component: Architecture and API Version:
Severity: minor Keywords:

Description (last modified by hudson) (diff)


I have a problem using the function add_hole_from_polygon(). When I set up a mesh using add_region_from_polygon() for the outer model boundary, add_hole_from_polygon() to set up a hole inside this outer polygon and generate_mesh() + export_mesh_file() to create the mesh, I get an error message when trying to initialize the domain: ... File "C:\Python24\lib\site-packages\anuga\fit_interpolate\fit.py", line 301, in _build_matrix_AtA_Atz raise Exception(msg) Exception: ('Could not find triangle for point', array([ 650491.032685, 9894786.210949]))

Thats exactly one point that is inside the hole. I wonder how the program knows, that there should be a point inside... (erased .python cache before) The mesh is created in the correct way, I looked at it with graphical_mesh_generator. However, how can I get this working?

Best regards,

Arne Stahlmann

The problem is fitting does not know about holes and reckons all data points should be in a triangle.

The work-around is not to use add_hole_from_polygon(). Use add_region_from_polygon() and make the maximum triangle size huge.

Note, this error would be easier to avoid if fitting did not back track.

Change History

Changed 8 years ago by nariman

  • owner changed from Duncan to steve

Changed 7 years ago by hudson

  • owner changed from steve to hudson
  • description modified (diff)

Changed 7 years ago by hudson

I wrote a test for this problem, but need more information on the problem. What is the stack trace for the exception? Should fitting just ignore points which fall within holes, and leave them out of the calculation? The documentation for fit.py does not give enough context to understand the module on its own, or what effect discontinuities in the mesh should have.

Changed 7 years ago by steve

Replying to James, the fitting algorithm will work fine with domains with holes. The data matrix should be produced by iterating through each data point, and then finding a triangle which contains the point and then contributing to the data matrix, i.e. to the vertices associated with that triangle. If no triangle is found, then there is no need to contribute to the data matrix.

Changed 7 years ago by hudson

  • status changed from new to closed
  • resolution set to fixed

Points that fall within a hole are no longer used in fitting - they are simply ignored. Unit test written for regression. Fixed in rev:7801.

Note: See TracTickets for help on using tickets.