Skip to content
Snippets Groups Projects
Commit 0496e181 authored by mattijs's avatar mattijs
Browse files

Modified tolerances to take truncation error into account

parent 1e78a148
No related merge requests found
...@@ -199,13 +199,20 @@ Foam::scalarField Foam::coupledPolyPatch::calcFaceTol ...@@ -199,13 +199,20 @@ Foam::scalarField Foam::coupledPolyPatch::calcFaceTol
const face& f = faces[faceI]; const face& f = faces[faceI];
// 1. calculate a typical size of the face. Use maximum distance
// to face centre
scalar maxLenSqr = -GREAT; scalar maxLenSqr = -GREAT;
// 2. as measure of truncation error when comparing two coordinates
// use SMALL * maximum component
scalar maxCmpt = -GREAT;
forAll(f, fp) forAll(f, fp)
{ {
maxLenSqr = max(maxLenSqr, magSqr(points[f[fp]] - cc)); const point& pt = points[f[fp]];
maxLenSqr = max(maxLenSqr, magSqr(pt - cc));
maxCmpt = max(maxCmpt, cmptMax(cmptMag(pt)));
} }
tols[faceI] = matchTol * Foam::sqrt(maxLenSqr); tols[faceI] = max(SMALL*maxCmpt, matchTol*Foam::sqrt(maxLenSqr));
} }
return tols; return tols;
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment