[MOAB-dev] Bug in kdtree?

Andrew Davis davisa at engr.wisc.edu
Wed Jul 24 09:32:00 CDT 2013


I think I may have found a bug in kdtree.

My test problem consists of a tet mesh that is composed of some 4000 
tets. The mesh looks like that in mesh.png, a ray starts at position 
(1,0,0) and fires along (1,0,0) and we get the following results back 
from my test program swp.cpp

Compile the minimum working example as

g++ swp.cpp -I/<moab include dir> -L<moab lib dir> -lMOAB


This is as expected,

# of intersections : 20
intersection distances are on 8.5 8.74072 9.25928 9.5 18.5 18.7407 
19.2593 19.5 28.5 28.7407 29.2593 29.5 38.5 38.7407 39.2593 39.5 48.5 
48.7407 49.2593 49.5 of ray length 900

8.5 9.5 18.5 19.5 etc are the boundaries of the faces of the mesh.

However, if we recompile and change the starting position to (1,4,0) we get

# of intersections : 17
intersection distances are on 8.5 8.63513 9.06064 9.5 18.5 18.6351 
19.0606 19.5 28.5 28.6351 29.0606 29.5 38.5 38.6351 39.0606 39.5 48.5 of 
ray length 900

As far this ray is concerned there is no mesh in the 5th slab.

What have I done wrong?

Thanks

Andy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mesh.png
Type: image/png
Size: 218733 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/moab-dev/attachments/20130724/ef925667/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: swp.cpp
Type: text/x-c++src
Size: 3181 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/moab-dev/attachments/20130724/ef925667/attachment-0001.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test2_mesh.h5m
Type: application/octet-stream
Size: 408152 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/moab-dev/attachments/20130724/ef925667/attachment-0001.obj>


More information about the moab-dev mailing list