mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: patchProbes : split off nearInfo
This commit is contained in:
@ -35,6 +35,7 @@ License
|
|||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
#include "polyPatch.H"
|
#include "polyPatch.H"
|
||||||
#include "Time.H"
|
#include "Time.H"
|
||||||
|
#include "mapDistribute.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -64,34 +65,6 @@ namespace Foam
|
|||||||
|
|
||||||
const NamedEnum<directMappedPatchBase::offsetMode, 3>
|
const NamedEnum<directMappedPatchBase::offsetMode, 3>
|
||||||
directMappedPatchBase::offsetModeNames_;
|
directMappedPatchBase::offsetModeNames_;
|
||||||
|
|
||||||
|
|
||||||
//- Private class for finding nearest
|
|
||||||
// - point+local index
|
|
||||||
// - sqr(distance)
|
|
||||||
// - processor
|
|
||||||
typedef Tuple2<pointIndexHit, Tuple2<scalar, label> > 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -70,8 +70,6 @@ SourceFiles
|
|||||||
#include "pointField.H"
|
#include "pointField.H"
|
||||||
#include "Tuple2.H"
|
#include "Tuple2.H"
|
||||||
#include "pointIndexHit.H"
|
#include "pointIndexHit.H"
|
||||||
#include "mapDistribute.H"
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -80,6 +78,7 @@ namespace Foam
|
|||||||
|
|
||||||
class polyPatch;
|
class polyPatch;
|
||||||
class polyMesh;
|
class polyMesh;
|
||||||
|
class mapDistribute;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class directMappedPatchBase Declaration
|
Class directMappedPatchBase Declaration
|
||||||
@ -106,6 +105,34 @@ public:
|
|||||||
NORMAL // use face normal + distance
|
NORMAL // use face normal + distance
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//- Helper class for finding nearest
|
||||||
|
// - point+local index
|
||||||
|
// - sqr(distance)
|
||||||
|
// - processor
|
||||||
|
typedef Tuple2<pointIndexHit, Tuple2<scalar, label> > 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:
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
|
|||||||
@ -25,10 +25,10 @@ License
|
|||||||
|
|
||||||
#include "patchProbes.H"
|
#include "patchProbes.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "dictionary.H"
|
|
||||||
#include "Time.H"
|
|
||||||
#include "IOmanip.H"
|
#include "IOmanip.H"
|
||||||
#include "directMappedPatchBase.C"
|
// For 'nearInfo' helper class only
|
||||||
|
#include "directMappedPatchBase.H"
|
||||||
|
#include "meshSearch.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -41,11 +41,10 @@ namespace Foam
|
|||||||
|
|
||||||
void Foam::patchProbes::findElements(const fvMesh& mesh)
|
void Foam::patchProbes::findElements(const fvMesh& mesh)
|
||||||
{
|
{
|
||||||
|
|
||||||
elementList_.clear();
|
elementList_.clear();
|
||||||
elementList_.setSize(size());
|
elementList_.setSize(size());
|
||||||
// All the info for nearest. Construct to miss
|
// All the info for nearest. Construct to miss
|
||||||
List<nearInfo> nearest(this->size());
|
List<directMappedPatchBase::nearInfo> nearest(this->size());
|
||||||
|
|
||||||
// Octree based search engine
|
// Octree based search engine
|
||||||
meshSearch meshSearchEngine(mesh, false);
|
meshSearch meshSearchEngine(mesh, false);
|
||||||
@ -75,7 +74,7 @@ void Foam::patchProbes::findElements(const fvMesh& mesh)
|
|||||||
|
|
||||||
|
|
||||||
// Find nearest.
|
// Find nearest.
|
||||||
Pstream::listCombineGather(nearest, nearestEqOp());
|
Pstream::listCombineGather(nearest, directMappedPatchBase::nearestEqOp());
|
||||||
Pstream::listCombineScatter(nearest);
|
Pstream::listCombineScatter(nearest);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -118,7 +117,6 @@ void Foam::patchProbes::findElements(const fvMesh& mesh)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::patchProbes::patchProbes
|
Foam::patchProbes::patchProbes
|
||||||
|
|||||||
@ -37,11 +37,6 @@ SourceFiles
|
|||||||
#ifndef patchProbes_H
|
#ifndef patchProbes_H
|
||||||
#define patchProbes_H
|
#define patchProbes_H
|
||||||
|
|
||||||
#include "HashPtrTable.H"
|
|
||||||
#include "OFstream.H"
|
|
||||||
#include "polyMesh.H"
|
|
||||||
#include "pointField.H"
|
|
||||||
#include "volFieldsFwd.H"
|
|
||||||
#include "probes.H"
|
#include "probes.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
Reference in New Issue
Block a user