mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
sampledSets: use smallDist consistently between getTrackingPoint and other tracking functions
Use different hit-tolerances between sampling methods to account for the difference in the "offset" definition.
This commit is contained in:
@ -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,
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user