ENH: Add a diff function to triad and a tolerance to edgeDirections

This commit is contained in:
laurence
2013-03-21 10:06:49 +00:00
parent 6243c90ac5
commit 10b2f07825
4 changed files with 6 additions and 4 deletions

View File

@ -136,7 +136,7 @@ Foam::pointField Foam::coupledPolyPatch::getAnchorPoints
{ {
pointField anchors(faces.size()); pointField anchors(faces.size());
if (transform == COINCIDENTFULLMATCH) if (transform != COINCIDENTFULLMATCH)
{ {
// Return the first point // Return the first point
forAll(faces, faceI) forAll(faces, faceI)

View File

@ -393,7 +393,8 @@ Foam::scalar Foam::diff(const triad& A, const triad& B)
} }
scalar cosPhi = scalar cosPhi =
(tmpA[dir] & tmpB[dir])/(mag(tmpA[dir])*mag(tmpA[dir]) + SMALL); (tmpA[dir] & tmpB[dir])
/(mag(tmpA[dir])*mag(tmpA[dir]) + SMALL);
cosPhi = min(max(cosPhi, -1), 1); cosPhi = min(max(cosPhi, -1), 1);

View File

@ -165,7 +165,7 @@ Foam::extendedFeatureEdgeMesh::extendedFeatureEdgeMesh(const IOobject& io)
edgeDirections_[eI] = eds[eI].vec(pts); edgeDirections_[eI] = eds[eI].vec(pts);
} }
edgeDirections_ /= mag(edgeDirections_); edgeDirections_ /= (mag(edgeDirections_) + SMALL);
} }
} }

View File

@ -116,7 +116,8 @@ bool Foam::treeDataPrimitivePatch<PatchType>::findIntersection
dir, dir,
faceCentres[index], faceCentres[index],
points, points,
intersection::HALF_RAY intersection::HALF_RAY,
shape.planarTol_
); );
} }