-
Notifications
You must be signed in to change notification settings - Fork 78
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
Refactor intersection index inside and document what it does #692
base: master
Are you sure you want to change the base?
Conversation
jenkins build this please |
0e363cb
to
7fa451e
Compare
We were using the same value incremented by 0 already, anyway. Reduces code.
Added another commit that reused indexInInside in boundaryId to reduce code. |
jenkins build this please |
Checks are green. Do you have more comments? |
Apart from those comments on documentation ("idx of the underlying Cartesian grid" -> "idx of the unit cube"), no further comments from my side |
jenkins build this please |
"Unhandled face tag: " + std::to_string(tag)); | ||
} | ||
else { | ||
return 2 * static_cast<int>(tag) + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this should work right now, it depends on the (not guaranteed to be stable) values of the face_tag enum, which actually has no defined values, but depends on the defaults. I therefore think the existing code is a bit safer.
/// the index of the face of the underlying cartesian grid assuming that | ||
/// all faces are perpendicular to the axis: | ||
/// For faces perpendicular to x-axis: 0 (normal points contrary to axis) 1 (else) | ||
/// For faces perpendicular to x-axis: 2 (normal points contrary to axis) 3 (else) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be y-axis (and z-axis below), similar for the next block.
Also: the return values are determined by topological orientation, not by the direction the normal points in.
Instead of switch-case we compute the index directly for Non-NNcs.