diff --git a/src/sampling/sampledSet/uniform/uniformSet.C b/src/sampling/sampledSet/uniform/uniformSet.C index 0bc3d319cb..397ee24b01 100644 --- a/src/sampling/sampledSet/uniform/uniformSet.C +++ b/src/sampling/sampledSet/uniform/uniformSet.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -40,8 +41,6 @@ namespace Foam addToRunTimeSelectionTable(sampledSet, uniformSet, word); } -const Foam::scalar Foam::uniformSet::tol = 1e-3; - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -93,7 +92,7 @@ bool Foam::uniformSet::trackToBoundary { // distance vector between sampling points const vector offset = (end_ - start_)/(nPoints_ - 1); - const vector smallVec = tol*offset; + const vector smallVec(tol_*offset); const scalar smallDist = mag(smallVec); point trackPt = singleParticle.position(); @@ -207,7 +206,7 @@ void Foam::uniformSet::calcSamples const vector offset = (end_ - start_)/(nPoints_ - 1); const vector normOffset = offset/mag(offset); - const vector smallVec = tol*offset; + const vector smallVec(tol_*offset); const scalar smallDist = mag(smallVec); // Force calculation of cloud addressing on all processors @@ -429,6 +428,7 @@ Foam::uniformSet::uniformSet sampledSet(name, mesh, searchEngine, axis), start_(start), end_(end), + tol_(1e-3), nPoints_(nPoints) { genSamples(); @@ -446,6 +446,7 @@ Foam::uniformSet::uniformSet sampledSet(name, mesh, searchEngine, dict), start_(dict.get("start")), end_(dict.get("end")), + tol_(dict.getCheckOrDefault("tol", 1e-3, scalarMinMax::ge(0))), nPoints_(dict.get