diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C index 545ce686b8ded2b0342f2409c10b3ab6d85fc8bd..706ab83cf5273688b51c30b10348ffe28ecc8c77 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C @@ -145,7 +145,6 @@ Foam::pointField Foam::coupledPolyPatch::getAnchorPoints Foam::scalarField Foam::coupledPolyPatch::calcFaceTol ( - const scalar matchTol, const UList<face>& faces, const pointField& points, const pointField& faceCentres @@ -173,7 +172,7 @@ Foam::scalarField Foam::coupledPolyPatch::calcFaceTol maxLenSqr = max(maxLenSqr, magSqr(pt - cc)); maxCmpt = max(maxCmpt, cmptMax(cmptMag(pt))); } - tols[faceI] = max(SMALL*maxCmpt, matchTol*Foam::sqrt(maxLenSqr)); + tols[faceI] = max(SMALL*maxCmpt, Foam::sqrt(maxLenSqr)); } return tols; } diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.H index 58cb8e66fa2b6c58c1146131d3d07363592edfad..86ad34976863702e34901d1aeaff8bb7677ed02a 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.H @@ -160,7 +160,6 @@ protected: // from face centre to any of the face vertices. static scalarField calcFaceTol ( - const scalar matchTol, const UList<face>& faces, const pointField& points, const pointField& faceCentres diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C index 51f0887b5ecda076c6ee316ec298858b367d85fd..868a9f8b6868cf792bc2ba8bb3145404c47e9d56 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C @@ -304,9 +304,9 @@ void Foam::cyclicPolyPatch::calcTransforms { scalarField half0Tols ( - calcFaceTol + matchTolerance() + *calcFaceTol ( - matchTolerance(), half0, half0.points(), static_cast<const pointField&>(half0Ctrs) @@ -562,7 +562,7 @@ void Foam::cyclicPolyPatch::getCentresAndAnchors // Calculate typical distance per face - tols = calcFaceTol(matchTolerance(), pp1, pp1.points(), half1Ctrs); + tols = matchTolerance()*calcFaceTol(pp1, pp1.points(), half1Ctrs); } diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/oldCyclic/oldCyclicPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/oldCyclic/oldCyclicPolyPatch.C index 7081ca79889407eed4bac208f572327863eb0f55..e10ae88a07e98cd73df13d8c3a3282d5b1c7835a 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/oldCyclic/oldCyclicPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/oldCyclic/oldCyclicPolyPatch.C @@ -444,7 +444,7 @@ void Foam::oldCyclicPolyPatch::getCentresAndAnchors // Calculate typical distance per face - tols = calcFaceTol(matchTolerance(), half1Faces, pp.points(), half1Ctrs); + tols = matchTolerance()*calcFaceTol(half1Faces, pp.points(), half1Ctrs); } diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C index d1da5a64460c170195271e94f058b50360209d8b..6ea10d25df1e988617c2c38491f3102e55830ede 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C @@ -179,6 +179,10 @@ void Foam::processorPolyPatch::calcGeometry(PstreamBuffers& pBufs) // Neighbour normals vectorField nbrFaceNormals(neighbFaceAreas_.size()); + // Face match tolerances + scalarField tols = + calcFaceTol(*this, points(), faceCentres()); + // Calculate normals from areas and check forAll(faceNormals, facei) { @@ -194,7 +198,7 @@ void Foam::processorPolyPatch::calcGeometry(PstreamBuffers& pBufs) faceNormals[facei] = point(1, 0, 0); nbrFaceNormals[facei] = faceNormals[facei]; } - else if (mag(magSf - nbrMagSf)/avSf > matchTolerance()) + else if (mag(magSf - nbrMagSf) > matchTolerance()*sqr(tols[facei])) { fileName nm ( @@ -238,7 +242,7 @@ void Foam::processorPolyPatch::calcGeometry(PstreamBuffers& pBufs) << "patch:" << name() << " my area:" << magSf << " neighbour area:" << nbrMagSf - << " matching tolerance:" << matchTolerance() + << " matching tolerance:" << matchTolerance()*sqr(tols[facei]) << endl << "Mesh face:" << start()+facei << " vertices:" @@ -264,7 +268,7 @@ void Foam::processorPolyPatch::calcGeometry(PstreamBuffers& pBufs) neighbFaceCentres_, faceNormals, nbrFaceNormals, - calcFaceTol(matchTolerance(), *this, points(), faceCentres()), + matchTolerance()*tols, matchTolerance() ); } @@ -569,7 +573,7 @@ bool Foam::processorPolyPatch::order // Calculate typical distance from face centre scalarField tols ( - calcFaceTol(matchTolerance(), pp, pp.points(), pp.faceCentres()) + matchTolerance()*calcFaceTol(pp, pp.points(), pp.faceCentres()) ); if (debug || masterCtrs.size() != pp.size())