mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: procesorPolyPatch: fixed check on oppositeness, correct tolerance
This commit is contained in:
@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user