-
Notifications
You must be signed in to change notification settings - Fork 189
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
Oif corrections #3385
Oif corrections #3385
Conversation
@icimrak could you please re-check this. There were some merge conflicts I had to resolve. |
Codecov Report
@@ Coverage Diff @@
## python #3385 +/- ##
======================================
- Coverage 87% 87% -1%
======================================
Files 536 534 -2
Lines 24403 24356 -47
======================================
- Hits 21252 21202 -50
- Misses 3151 3154 +3
Continue to review full report at Codecov.
|
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.
These changes are ok....
@jngrad, I chrrey-picked your suggestion. I also reverted the randomization of the test, since it is not easy to guarantee that this doesn't flip some of the normal vectors of the triangles making up the surface. there is a deterministic anisotropic deformation now, instead. As for the corner cases: It is not clear to me how to construct triangles such that the dot product of the normal vectors is >1 or <-1. Formally, that never happens. One would have to construct triangles with normal vectors triggering a rounding error after normalization. @icimrak, could you suggest a docstring explaining the convention for the resulting angles, and supply two sets of two triangles with angles in the two half-spaces? Please avoid zeros and ones in the coordinates. |
@RudolfWeeber the dot product is (exactly) +/- 1 if both triangles have the same points, in which case the normals are either parallel or anti-parallel and hence their inner product is +/- 1. |
@fweik, my understanding of
https://en.cppreference.com/w/cpp/numeric/math/acos
is that +,- 1.0 are permissible. Due to floating point rounding, ocassionally 1 + epsilon occurs, which is not permissible and has to be capped.
So, if we want to test the corner cases, that would be them.
|
You were saying that +/-1 are formally impossible, which is not correct. Rather, this corresponds to the very common case where both triangles are in the same plane. |
LGTM, would be perfect if there was a test for the revised |
Hi Rudolf, Do we get in touch via skype? We can then discuss issues listed on github, as well as the article…. Here are the times we are available: 9.1. only between 10am till 12pm Please let us know when are you available, Thanks, |
Here is the suggestion for a docstring for function call: Returns the angle between two triangles in 3D space given by points P1P2P3 and P2P3P4. Note, that the common edge is given as the second and the third argument. Here, the angle can have values from 0 to 2 * PI, depending on the orientation of the two triangles. So the angle can be convex or concave. For each triangle, an inward direction has been defined as the direction of one of the two normal vectors. Particularly, for triangle P1P2P3 it is the vector N1 = P2P1 x P2P3 and for triangle P2P3P4 it is N2 = P2P3 x P2P4. The method first computes the angle between N1 and N2, which gives always value between 0 and PI and then it checks whether this value must be corrected to a value between PI and 2 * PI. As an example, consider 4 points A,B,C,D in space given by coordinates A = [1,1,1], B = [2,1,1], C = [1,2,1], D = [1,1,2]. We want to determine the angle between triangles ABC and ACD. In case that the orientations of the triangle ABC is [0,0,1] and orientation of ACD is [1,0,0], then the resulting angle must be PI/2.0. To get correct result, note that the common edge is AC, and one must call the method as Alternatively, if the orientations of the two triangles were the oppisite, the correct call would be angle_btw_triangles(B,C,A,D) |
…sso into oif_corrections
Can be merged if
is fixed. |
bc0755e
to
323b125
Compare
These features were removed in espressomd#3385.
These features were removed in espressomd#3385.
This ports back fixes from the object in fluid development branch. In particular, the bending force between two triangeles becomes torque-free with this.
The test in this PR fails without the correctiosn in oif_local_force.hpp