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
|
\\ / 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-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -36,6 +36,8 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
defineTypeNameAndDebug(faceOnlySet, 0);
|
defineTypeNameAndDebug(faceOnlySet, 0);
|
||||||
addToRunTimeSelectionTable(sampledSet, faceOnlySet, word);
|
addToRunTimeSelectionTable(sampledSet, faceOnlySet, word);
|
||||||
|
|
||||||
|
const scalar faceOnlySet::tol = 1e-6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -146,10 +148,10 @@ void Foam::faceOnlySet::calcSamples
|
|||||||
|
|
||||||
getTrackingPoint
|
getTrackingPoint
|
||||||
(
|
(
|
||||||
offset,
|
|
||||||
start_,
|
start_,
|
||||||
bPoint,
|
bPoint,
|
||||||
bFaceI,
|
bFaceI,
|
||||||
|
smallDist,
|
||||||
|
|
||||||
trackPt,
|
trackPt,
|
||||||
trackCellI,
|
trackCellI,
|
||||||
|
|||||||
@ -2,7 +2,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-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -96,6 +96,14 @@ public:
|
|||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("face");
|
TypeName("face");
|
||||||
|
|
||||||
|
|
||||||
|
// Static data
|
||||||
|
|
||||||
|
//- Tolerance when comparing points relative to difference between
|
||||||
|
// start_ and end_
|
||||||
|
static const scalar tol;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
|
|||||||
@ -2,7 +2,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-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -36,6 +36,8 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
defineTypeNameAndDebug(polyLineSet, 0);
|
defineTypeNameAndDebug(polyLineSet, 0);
|
||||||
addToRunTimeSelectionTable(sampledSet, polyLineSet, word);
|
addToRunTimeSelectionTable(sampledSet, polyLineSet, word);
|
||||||
|
|
||||||
|
const scalar polyLineSet::tol = 1e-6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -205,10 +207,10 @@ void Foam::polyLineSet::calcSamples
|
|||||||
bool isSample =
|
bool isSample =
|
||||||
getTrackingPoint
|
getTrackingPoint
|
||||||
(
|
(
|
||||||
sampleCoords_[sampleI+1] - sampleCoords_[sampleI],
|
|
||||||
sampleCoords_[sampleI],
|
sampleCoords_[sampleI],
|
||||||
bPoint,
|
bPoint,
|
||||||
bFaceI,
|
bFaceI,
|
||||||
|
smallDist,
|
||||||
|
|
||||||
trackPt,
|
trackPt,
|
||||||
trackCellI,
|
trackCellI,
|
||||||
|
|||||||
@ -2,7 +2,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-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -95,6 +95,13 @@ public:
|
|||||||
TypeName("polyLine");
|
TypeName("polyLine");
|
||||||
|
|
||||||
|
|
||||||
|
// Static data
|
||||||
|
|
||||||
|
//- Tolerance when comparing points relative to difference between
|
||||||
|
// start_ and end_
|
||||||
|
static const scalar tol;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
|
|||||||
@ -34,8 +34,6 @@ License
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
const scalar sampledSet::tol = 1e-3;
|
|
||||||
|
|
||||||
defineTypeNameAndDebug(sampledSet, 0);
|
defineTypeNameAndDebug(sampledSet, 0);
|
||||||
defineRunTimeSelectionTable(sampledSet, word);
|
defineRunTimeSelectionTable(sampledSet, word);
|
||||||
}
|
}
|
||||||
@ -227,18 +225,16 @@ Foam::point Foam::sampledSet::pushIn
|
|||||||
|
|
||||||
bool Foam::sampledSet::getTrackingPoint
|
bool Foam::sampledSet::getTrackingPoint
|
||||||
(
|
(
|
||||||
const vector& offset,
|
|
||||||
const point& samplePt,
|
const point& samplePt,
|
||||||
const point& bPoint,
|
const point& bPoint,
|
||||||
const label bFaceI,
|
const label bFaceI,
|
||||||
|
const scalar smallDist,
|
||||||
|
|
||||||
point& trackPt,
|
point& trackPt,
|
||||||
label& trackCellI,
|
label& trackCellI,
|
||||||
label& trackFaceI
|
label& trackFaceI
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const scalar smallDist = mag(tol*offset);
|
|
||||||
|
|
||||||
bool isGoodSample = false;
|
bool isGoodSample = false;
|
||||||
|
|
||||||
if (bFaceI == -1)
|
if (bFaceI == -1)
|
||||||
@ -311,7 +307,6 @@ bool Foam::sampledSet::getTrackingPoint
|
|||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
InfoInFunction
|
InfoInFunction
|
||||||
<< " offset:" << offset
|
|
||||||
<< " samplePt:" << samplePt
|
<< " samplePt:" << samplePt
|
||||||
<< " bPoint:" << bPoint
|
<< " bPoint:" << bPoint
|
||||||
<< " bFaceI:" << bFaceI
|
<< " bFaceI:" << bFaceI
|
||||||
|
|||||||
@ -2,7 +2,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-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -125,10 +125,10 @@ protected:
|
|||||||
// trackFaceI, trackCellI (-1 if no tracking point found)
|
// trackFaceI, trackCellI (-1 if no tracking point found)
|
||||||
bool getTrackingPoint
|
bool getTrackingPoint
|
||||||
(
|
(
|
||||||
const vector& offset,
|
|
||||||
const point& samplePt,
|
const point& samplePt,
|
||||||
const point& bPoint,
|
const point& bPoint,
|
||||||
const label bFaceI,
|
const label bFaceI,
|
||||||
|
const scalar smallDist,
|
||||||
|
|
||||||
point& trackPt,
|
point& trackPt,
|
||||||
label& trackCellI,
|
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
|
// Constructors
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
|
|||||||
@ -2,7 +2,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-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -36,6 +36,8 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
defineTypeNameAndDebug(uniformSet, 0);
|
defineTypeNameAndDebug(uniformSet, 0);
|
||||||
addToRunTimeSelectionTable(sampledSet, uniformSet, word);
|
addToRunTimeSelectionTable(sampledSet, uniformSet, word);
|
||||||
|
|
||||||
|
const scalar uniformSet::tol = 1e-3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -260,10 +262,10 @@ void Foam::uniformSet::calcSamples
|
|||||||
bool isSample =
|
bool isSample =
|
||||||
getTrackingPoint
|
getTrackingPoint
|
||||||
(
|
(
|
||||||
offset,
|
|
||||||
start_,
|
start_,
|
||||||
bPoint,
|
bPoint,
|
||||||
bFaceI,
|
bFaceI,
|
||||||
|
smallDist,
|
||||||
|
|
||||||
trackPt,
|
trackPt,
|
||||||
trackCellI,
|
trackCellI,
|
||||||
|
|||||||
@ -2,7 +2,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-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -112,6 +112,14 @@ public:
|
|||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("uniform");
|
TypeName("uniform");
|
||||||
|
|
||||||
|
|
||||||
|
// Static data
|
||||||
|
|
||||||
|
//- Tolerance when comparing points relative to difference between
|
||||||
|
// start_ and end_
|
||||||
|
static const scalar tol;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
|
|||||||
Reference in New Issue
Block a user