diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.H b/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.H index c4ab139ca3f99f4b8a9366e9ede3bc7444c76853..cbff3c405270f5a02e1c86612c38aab0c084ada6 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.H +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -755,16 +755,17 @@ public: // Useful derived info - //- Is the point in the cell bounding box, option relative - // tolerance to increase the effective size of the boundBox + //- Return true if the point in the cell bounding box. + // The bounding box may be isotropically inflated by the fraction + // inflationFraction bool pointInCellBB ( const point& p, label celli, - scalar tol = 0 + scalar inflationFraction = 0 ) const; - //- Is the point in the cell + //- Return true if the point is in the cell bool pointInCell(const point& p, label celli) const; //- Find the cell with the nearest cell centre to location diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshFindCell.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshFindCell.C index edb261c6010e4b1cbe7f17af6a7ad88a573a16d4..4b6b0dcd0d899c222f7a616fa03a22d37eea51d7 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshFindCell.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshFindCell.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,7 +33,7 @@ bool Foam::primitiveMesh::pointInCellBB ( const point& p, label celli, - scalar tol + scalar inflationFraction ) const { boundBox bb @@ -46,13 +46,10 @@ bool Foam::primitiveMesh::pointInCellBB false ); - if (tol > SMALL) + if (inflationFraction > SMALL) { - bb = boundBox - ( - bb.min() - tol*bb.span(), - bb.max() + tol*bb.span() - ); + vector inflation = inflationFraction*vector::one*mag(bb.span()); + bb = boundBox(bb.min() - inflation, bb.max() + inflation); } return bb.contains(p);