diff --git a/src/sampling/sampledSet/face/faceOnlySet.C b/src/sampling/sampledSet/face/faceOnlySet.C index d8aedfee9aac3a57f3e9b3f8a9310e157e6f9771..0225658febd45914091d9c15cf06ba39773d2243 100644 --- a/src/sampling/sampledSet/face/faceOnlySet.C +++ b/src/sampling/sampledSet/face/faceOnlySet.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,6 +36,8 @@ namespace Foam { defineTypeNameAndDebug(faceOnlySet, 0); addToRunTimeSelectionTable(sampledSet, faceOnlySet, word); + + const scalar faceOnlySet::tol = 1e-6; } @@ -146,10 +148,10 @@ void Foam::faceOnlySet::calcSamples getTrackingPoint ( - offset, start_, bPoint, bFaceI, + smallDist, trackPt, trackCellI, diff --git a/src/sampling/sampledSet/face/faceOnlySet.H b/src/sampling/sampledSet/face/faceOnlySet.H index fdb47d4d435d3d7cc138a1e0cdc638a1a35ffe64..61f20c7ce79b48e59a484650a50a86bc97d126e8 100644 --- a/src/sampling/sampledSet/face/faceOnlySet.H +++ b/src/sampling/sampledSet/face/faceOnlySet.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -96,6 +96,14 @@ public: //- Runtime type information TypeName("face"); + + // Static data + + //- Tolerance when comparing points relative to difference between + // start_ and end_ + static const scalar tol; + + // Constructors //- Construct from components diff --git a/src/sampling/sampledSet/polyLine/polyLineSet.C b/src/sampling/sampledSet/polyLine/polyLineSet.C index 7ce2e3fdc23e162ef4709e458b9b2e8ddfeb2cfe..f5ff5b461bbc5c5d0a5df6512a6b45a65758e020 100644 --- a/src/sampling/sampledSet/polyLine/polyLineSet.C +++ b/src/sampling/sampledSet/polyLine/polyLineSet.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,6 +36,8 @@ namespace Foam { defineTypeNameAndDebug(polyLineSet, 0); addToRunTimeSelectionTable(sampledSet, polyLineSet, word); + + const scalar polyLineSet::tol = 1e-6; } @@ -205,10 +207,10 @@ void Foam::polyLineSet::calcSamples bool isSample = getTrackingPoint ( - sampleCoords_[sampleI+1] - sampleCoords_[sampleI], sampleCoords_[sampleI], bPoint, bFaceI, + smallDist, trackPt, trackCellI, diff --git a/src/sampling/sampledSet/polyLine/polyLineSet.H b/src/sampling/sampledSet/polyLine/polyLineSet.H index 3dc880246a84f8289619fa2304d9811b3a2bea9e..c97ff9fc7d0de9742920d2421dcf0743dbf67480 100644 --- a/src/sampling/sampledSet/polyLine/polyLineSet.H +++ b/src/sampling/sampledSet/polyLine/polyLineSet.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -95,6 +95,13 @@ public: TypeName("polyLine"); + // Static data + + //- Tolerance when comparing points relative to difference between + // start_ and end_ + static const scalar tol; + + // Constructors //- Construct from components diff --git a/src/sampling/sampledSet/sampledSet/sampledSet.C b/src/sampling/sampledSet/sampledSet/sampledSet.C index 00f843d570520b673105165fb76573f7b6e8f3d5..ff58cef6bf06149489ecb24111edc1aeab2dd3ed 100644 --- a/src/sampling/sampledSet/sampledSet/sampledSet.C +++ b/src/sampling/sampledSet/sampledSet/sampledSet.C @@ -34,8 +34,6 @@ License namespace Foam { - const scalar sampledSet::tol = 1e-3; - defineTypeNameAndDebug(sampledSet, 0); defineRunTimeSelectionTable(sampledSet, word); } @@ -227,18 +225,16 @@ Foam::point Foam::sampledSet::pushIn bool Foam::sampledSet::getTrackingPoint ( - const vector& offset, const point& samplePt, const point& bPoint, const label bFaceI, + const scalar smallDist, point& trackPt, label& trackCellI, label& trackFaceI ) const { - const scalar smallDist = mag(tol*offset); - bool isGoodSample = false; if (bFaceI == -1) @@ -311,7 +307,6 @@ bool Foam::sampledSet::getTrackingPoint if (debug) { InfoInFunction - << " offset:" << offset << " samplePt:" << samplePt << " bPoint:" << bPoint << " bFaceI:" << bFaceI diff --git a/src/sampling/sampledSet/sampledSet/sampledSet.H b/src/sampling/sampledSet/sampledSet/sampledSet.H index 810d4565edca9c66a54e1629b4e937a20f971b62..005ef61c1cbf9795b28d28e40cfb74fafd1f3d5f 100644 --- a/src/sampling/sampledSet/sampledSet/sampledSet.H +++ b/src/sampling/sampledSet/sampledSet/sampledSet.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -125,10 +125,10 @@ protected: // trackFaceI, trackCellI (-1 if no tracking point found) bool getTrackingPoint ( - const vector& offset, const point& samplePt, const point& bPoint, const label bFaceI, + const scalar smallDist, point& trackPt, label& trackCellI, @@ -193,13 +193,6 @@ public: }; - // Static data - - //- Tolerance when comparing points. Usually relative to difference - // between start_ and end_ - static const scalar tol; - - // Constructors //- Construct from components diff --git a/src/sampling/sampledSet/uniform/uniformSet.C b/src/sampling/sampledSet/uniform/uniformSet.C index 295a3e79e369db62cf5b653cfcad72752f79caa8..75376d277871f67d916a16e6592d98dcfda19db2 100644 --- a/src/sampling/sampledSet/uniform/uniformSet.C +++ b/src/sampling/sampledSet/uniform/uniformSet.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,6 +36,8 @@ namespace Foam { defineTypeNameAndDebug(uniformSet, 0); addToRunTimeSelectionTable(sampledSet, uniformSet, word); + + const scalar uniformSet::tol = 1e-3; } @@ -260,10 +262,10 @@ void Foam::uniformSet::calcSamples bool isSample = getTrackingPoint ( - offset, start_, bPoint, bFaceI, + smallDist, trackPt, trackCellI, diff --git a/src/sampling/sampledSet/uniform/uniformSet.H b/src/sampling/sampledSet/uniform/uniformSet.H index edd5212e51772f3e80cf9db20adb266d9bf8dad7..a9f29ed2b9a97911b218f8a933d0c4d29f9bb372 100644 --- a/src/sampling/sampledSet/uniform/uniformSet.H +++ b/src/sampling/sampledSet/uniform/uniformSet.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -112,6 +112,14 @@ public: //- Runtime type information TypeName("uniform"); + + // Static data + + //- Tolerance when comparing points relative to difference between + // start_ and end_ + static const scalar tol; + + // Constructors //- Construct from components