BUG: procesorPolyPatch: fixed check on oppositeness, correct tolerance

This commit is contained in:
mattijs
2015-11-11 12:54:08 +00:00
parent 3457f567e5
commit c48a203267
2 changed files with 13 additions and 8 deletions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -187,9 +187,11 @@ bool Foam::matchPoints
// Go through range of equal mag and find nearest vector.
scalar minDistSqr = VGREAT;
scalar minDistNorm = 0;
label minFaceI = -1;
// Valid candidate points should have opposite normal
const scalar minDistNorm = 0;
for
(
label j = startI;
@ -220,7 +222,6 @@ bool Foam::matchPoints
// Check that the normals point in equal and opposite directions
if (distNorm < minDistNorm)
{
minDistNorm = distNorm;
minDistSqr = distSqr;
minFaceI = faceI;
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -913,7 +913,7 @@ bool Foam::processorPolyPatch::order
faceMap
);
// Try using face point average for matching
// Fallback: try using face point average for matching
if (!matchedAll)
{
const pointField& ppPoints = pp.points();
@ -933,16 +933,20 @@ bool Foam::processorPolyPatch::order
scalarField tols2
(
calcFaceTol(pp, pp.points(), facePointAverages)
matchTolerance()
*calcFaceTol(pp, pp.points(), facePointAverages)
);
// Note that we do not use the faceNormals anymore for
// comparison. Since we're
// having problems with the face centres (e.g. due to extreme
// aspect ratios) we will probably also have problems with
// reliable normals calculation
labelList faceMap2(faceMap.size(), -1);
matchedAll = matchPoints
(
facePointAverages,
masterFacePointAverages,
pp.faceNormals(),
masterNormals,
tols2,
true,
faceMap2