From 10b2f078255718d9c5b007bedd36374170ef43df Mon Sep 17 00:00:00 2001 From: laurence Date: Thu, 21 Mar 2013 10:06:49 +0000 Subject: [PATCH] ENH: Add a diff function to triad and a tolerance to edgeDirections --- .../polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C | 2 +- src/OpenFOAM/primitives/triad/triad.C | 3 ++- src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.C | 2 +- src/meshTools/indexedOctree/treeDataPrimitivePatch.C | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C index ef6625e0d3..7e056675b5 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C @@ -136,7 +136,7 @@ Foam::pointField Foam::coupledPolyPatch::getAnchorPoints { pointField anchors(faces.size()); - if (transform == COINCIDENTFULLMATCH) + if (transform != COINCIDENTFULLMATCH) { // Return the first point forAll(faces, faceI) diff --git a/src/OpenFOAM/primitives/triad/triad.C b/src/OpenFOAM/primitives/triad/triad.C index a5c0d38b42..46ed89b7e2 100644 --- a/src/OpenFOAM/primitives/triad/triad.C +++ b/src/OpenFOAM/primitives/triad/triad.C @@ -393,7 +393,8 @@ Foam::scalar Foam::diff(const triad& A, const triad& B) } 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); diff --git a/src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.C b/src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.C index 3e8b153b38..8358d62aec 100644 --- a/src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.C +++ b/src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.C @@ -165,7 +165,7 @@ Foam::extendedFeatureEdgeMesh::extendedFeatureEdgeMesh(const IOobject& io) edgeDirections_[eI] = eds[eI].vec(pts); } - edgeDirections_ /= mag(edgeDirections_); + edgeDirections_ /= (mag(edgeDirections_) + SMALL); } } diff --git a/src/meshTools/indexedOctree/treeDataPrimitivePatch.C b/src/meshTools/indexedOctree/treeDataPrimitivePatch.C index 2664849ab1..a2e6ff07dd 100644 --- a/src/meshTools/indexedOctree/treeDataPrimitivePatch.C +++ b/src/meshTools/indexedOctree/treeDataPrimitivePatch.C @@ -116,7 +116,8 @@ bool Foam::treeDataPrimitivePatch::findIntersection dir, faceCentres[index], points, - intersection::HALF_RAY + intersection::HALF_RAY, + shape.planarTol_ ); }