diff --git a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C index 6418c8c8c5..0ad7c431b5 100644 --- a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C +++ b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C @@ -35,6 +35,7 @@ License #include "polyMesh.H" #include "polyPatch.H" #include "Time.H" +#include "mapDistribute.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -64,34 +65,6 @@ namespace Foam const NamedEnum directMappedPatchBase::offsetModeNames_; - - - //- Private class for finding nearest - // - point+local index - // - sqr(distance) - // - processor - typedef Tuple2 > nearInfo; - - class nearestEqOp - { - - public: - - void operator()(nearInfo& x, const nearInfo& y) const - { - if (y.first().hit()) - { - if (!x.first().hit()) - { - x = y; - } - else if (y.second().first() < x.second().first()) - { - x = y; - } - } - } - }; } diff --git a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.H b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.H index 6b3513f374..0519836f07 100644 --- a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.H +++ b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.H @@ -70,8 +70,6 @@ SourceFiles #include "pointField.H" #include "Tuple2.H" #include "pointIndexHit.H" -#include "mapDistribute.H" - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -80,6 +78,7 @@ namespace Foam class polyPatch; class polyMesh; +class mapDistribute; /*---------------------------------------------------------------------------*\ Class directMappedPatchBase Declaration @@ -106,6 +105,34 @@ public: NORMAL // use face normal + distance }; + + //- Helper class for finding nearest + // - point+local index + // - sqr(distance) + // - processor + typedef Tuple2 > nearInfo; + + class nearestEqOp + { + + public: + + void operator()(nearInfo& x, const nearInfo& y) const + { + if (y.first().hit()) + { + if (!x.first().hit()) + { + x = y; + } + else if (y.second().first() < x.second().first()) + { + x = y; + } + } + } + }; + private: // Private data diff --git a/src/sampling/probes/patchProbes.C b/src/sampling/probes/patchProbes.C index 55ae5cd09d..7e545c9f96 100644 --- a/src/sampling/probes/patchProbes.C +++ b/src/sampling/probes/patchProbes.C @@ -25,10 +25,10 @@ License #include "patchProbes.H" #include "volFields.H" -#include "dictionary.H" -#include "Time.H" #include "IOmanip.H" -#include "directMappedPatchBase.C" +// For 'nearInfo' helper class only +#include "directMappedPatchBase.H" +#include "meshSearch.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -41,11 +41,10 @@ namespace Foam void Foam::patchProbes::findElements(const fvMesh& mesh) { - elementList_.clear(); elementList_.setSize(size()); // All the info for nearest. Construct to miss - List nearest(this->size()); + List nearest(this->size()); // Octree based search engine meshSearch meshSearchEngine(mesh, false); @@ -75,7 +74,7 @@ void Foam::patchProbes::findElements(const fvMesh& mesh) // Find nearest. - Pstream::listCombineGather(nearest, nearestEqOp()); + Pstream::listCombineGather(nearest, directMappedPatchBase::nearestEqOp()); Pstream::listCombineScatter(nearest); if (debug) @@ -118,7 +117,6 @@ void Foam::patchProbes::findElements(const fvMesh& mesh) } - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::patchProbes::patchProbes diff --git a/src/sampling/probes/patchProbes.H b/src/sampling/probes/patchProbes.H index 01a3559bad..8f5974adb7 100644 --- a/src/sampling/probes/patchProbes.H +++ b/src/sampling/probes/patchProbes.H @@ -37,11 +37,6 @@ SourceFiles #ifndef patchProbes_H #define patchProbes_H -#include "HashPtrTable.H" -#include "OFstream.H" -#include "polyMesh.H" -#include "pointField.H" -#include "volFieldsFwd.H" #include "probes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //