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

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -913,7 +913,7 @@ bool Foam::processorPolyPatch::order
faceMap faceMap
); );
// Try using face point average for matching // Fallback: try using face point average for matching
if (!matchedAll) if (!matchedAll)
{ {
const pointField& ppPoints = pp.points(); const pointField& ppPoints = pp.points();
@ -933,16 +933,20 @@ bool Foam::processorPolyPatch::order
scalarField tols2 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); labelList faceMap2(faceMap.size(), -1);
matchedAll = matchPoints matchedAll = matchPoints
( (
facePointAverages, facePointAverages,
masterFacePointAverages, masterFacePointAverages,
pp.faceNormals(),
masterNormals,
tols2, tols2,
true, true,
faceMap2 faceMap2