46 (void)
mesh.tetBasePtIs();
65 treeBoundBox overallBb;
73 bndFaces[nFaces++] =
pp.start()+i;
74 const face&
f =
pp[i];
77 overallBb.add(
pp.points(),
f);
82 overallBb.inflate(
rndGen, 1
e-4, ROOTVSMALL);
85 const indexedOctree<treeDataFace> boundaryTree
87 treeDataFace(
mesh, bndFaces),
97 const auto& treeData = boundaryTree.shapes();
111 const label facei = treeData.objectIndex(info.index());
118 <<
" The sample point: " <<
sample
119 <<
" belongs to " << patchi
120 <<
" which is an empty patch. This is not permitted. "
121 <<
" This sample will not be included "
132 const point& facePt = info.point();
138 sampleInfo.second().first() = facePt.distSqr(
sample);
141 nearest[probei] = sampleInfo;
165 label proci = nearest[samplei].second().second();
166 label locali = nearest[samplei].first().index();
169 <<
" found on processor:" << proci
170 <<
" in local face:" << locali
171 <<
" with location:" << nearest[samplei].first().point()
183 cellIds_.resize_nocopy(nearest.size());
186 faceIds_.resize_nocopy(nearest.size());
189 procIds_.resize_nocopy(nearest.size());
197 procIds_[sampleI] = nearest[sampleI].second().second();
202 faceIds_[sampleI] = nearest[sampleI].first().index();
203 const label facei =
faceIds_[sampleI];
239 if (!
dict.readIfPresent(
"patches", patchNames_))
241 patchNames_.resize(1);
242 patchNames_.first() =
dict.get<word>(
"patch");
246 findElements(thisMesh_);
Macros for easy insertion into run-time selection tables.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
label index() const noexcept
Return the hit index.
bool hit() const noexcept
Is there a hit?
const point_type & point() const noexcept
Return point, no checks.
static void listCombineReduce(UList< T > &values, CombineOp cop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Forwards to Pstream::listReduce with an in-place cop.
const T1 & first() const noexcept
Access the first element.
const T2 & second() const noexcept
Access the second element.
T & first()
Access first element of the list, position [0].
void size(const label n)
Older name for setAddressableSize.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Negative if the process is not a...
label size() const noexcept
The number of entries in the list.
scalar distSqr(const Vector< Cmpt > &v2) const
The L2-norm distance squared from another vector. The magSqr() of the difference.
void add(const boundBox &bb)
Extend to include the second box.
scalar mag() const
The magnitude/length of the bounding box diagonal.
void inflate(const scalar factor)
Expand box by factor*mag(span) in all dimensions.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A face is a list of labels corresponding to mesh vertices.
Mesh data needed to do the Finite Volume discretisation.
Non-pointer based hierarchical recursive searching.
const Type & shapes() const noexcept
Reference to shape.
const treeBoundBox & bb() const
Top bounding box.
Tuple2< pointIndexHit, Tuple2< scalar, label > > nearInfo
Helper class for finding nearest.
Utility class for probing specified points on user-selected boundary patches. The input points are pr...
virtual void findElements(const fvMesh &mesh)
Find elements containing patchFieldProbe.
patchFieldProbe(const fvMesh &mesh, const dictionary &dict)
Construct from Time and dictionary.
wordRes patchNames_
Names of the patches to sample.
tmp< Field< Type > > sample(const VolumeField< Type > &) const
Sample a volume field at all locations.
labelList patchIDs_
Index of the patches to sample.
virtual bool read(const dictionary &)
Read the settings dictionary.
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh,...
label whichPatch(const label meshFacei) const
Return patch index for a given mesh face index. Uses binary search.
labelHashSet patchSet(const UList< wordRe > &select, const bool warnNotFound=true, const bool useGroups=true) const
Return the set of patch IDs corresponding to the given names.
A patch is a list of labels that address the faces in the global face list.
labelList cellIds_
Cells to be probed (obtained from the locations).
labelList patchIds_
Patch IDs on which the new probes are located.
labelList faceIds_
Faces to be probed.
pointField oldPoints_
Original probes location.
labelList procIds_
Processor holding the cell or face (-1 if point not found on any processor).
const fvMesh & thisMesh_
Const reference to the mesh.
label size() const
Return number of probe locations.
const pointField & probeLocations() const
Return const reference to the probe locations.
virtual bool read(const dictionary &)
Read the settings dictionary.
probeModel(const probeModel &)=delete
No copy construct.
Standard boundBox with extra functionality for use in octree.
Encapsulation of data for searching on faces.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define WarningInFunction
Report a warning using Foam::Warning.
#define InfoInFunction
Report an information message using Foam::Info.
Namespace for handling debugging switches.
bool read(const char *buf, int32_t &val)
Same as readInt32.
List< label > labelList
A List of labels.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
void reduce(T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce).
vector point
Point is a vector.
vectorField pointField
pointField is a vectorField.
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.