blockMesh: Stabilised arc-cosine argument for 180 degree arcs

This commit is contained in:
Will Bainbridge
2018-05-01 11:26:29 +01:00
parent 87e32ab499
commit 06ade28f93

View File

@ -72,7 +72,8 @@ Foam::cylindricalCS Foam::blockEdges::arcEdge::calcAngle()
vector r3(p3_ - centre);
// find angles
angle_ = radToDeg(acos((r3 & r1)/(mag(r3) * mag(r1))));
const scalar cosAngle = (r3 & r1)/(mag(r3) * mag(r1));
angle_ = radToDeg(acos(max(-1, min(cosAngle, 1))));
// check if the vectors define an exterior or an interior arcEdge
if (((r1 ^ r2) & (r1 ^ r3)) < 0.0)