-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unit test for find_exit_face function #128
base: master
Are you sure you want to change the base?
Conversation
@Fuad-HH Thanks for the PR. I haven't looked at the code yet, but could you explain the difference between the arrow and the line segment in the figure? |
To test if the function provides the correct intersected face, I have simulated these two rays in the picture that share the same destination point. The function gives the correct exit face for the left ray and the wrong exit face for the right. We discovered this by looking at the algorithm used to find the exit face here. It uses the destination's barycentric coordinate to find the exit/intersected face. In this test case, these two rays share the same destination but they intersect two different edges. But as expected, the More specifics are provided in the header section of the test case. |
test passing
added more tests to test_find_exit_face. without bcc passsing, with bcc failing
test passing with two rays starting in element 0 and ending out of the domain. It intersects the correct faces at the correct location. The results are varified on the python notebook
it uses the same rays and mesh as moller trumbore line test. Status: it passes without bcc and fails with bcc as expected(same destination)
the new tests varifies different behaviours of the function
breaking if requireIntersection flag off
We discovered that the
find_exit_face
function inpumipic_adjacency.tpp
should not work when theuseBcc
flag istrue
. A test case is added here to demonstrate the failed scenario.Briefly, the function here decides which edge the ray crosses by the index of the minimum of the barycentric coordinates of the ray's destination; this is incorrect. The following picture demonstrates this. Although it has the same destination and the origin is in the same triangle, they will intersect different edges.
I have added the failing test case to fix it in the future.
Note: It uses a mesh called
square2d4elem.msh
and it's added to the pumipic_data repository. It's in this pull request