55 (void)
mesh.tetBasePtIs();
74 treeBoundBox overallBb;
82 bndFaces[nFaces++] =
pp.start()+i;
83 const face&
f =
pp[i];
86 overallBb.add(
pp.points(),
f);
91 overallBb.inflate(
rndGen, 1
e-4, ROOTVSMALL);
94 const indexedOctree<treeDataFace> boundaryTree
96 treeDataFace(
mesh, bndFaces),
106 const auto& treeData = boundaryTree.shapes();
120 const label facei = treeData.objectIndex(info.index());
124 if (isA<emptyPolyPatch>(bm[patchi]))
127 <<
" The sample point: " <<
sample 128 <<
" belongs to " << patchi
129 <<
" which is an empty patch. This is not permitted. " 130 <<
" This sample will not be included " 141 const point& facePt = info.point();
147 sampleInfo.second().first() = facePt.distSqr(
sample);
150 nearest[probei] = sampleInfo;
165 operator[](samplei) = nearest[samplei].first().point();
173 label proci = nearest[samplei].second().second();
174 label locali = nearest[samplei].first().index();
177 <<
" found on processor:" << proci
178 <<
" in local face:" << locali
179 <<
" with location:" << nearest[samplei].first().point()
205 processor_[sampleI] = nearest[sampleI].second().second();
226 Foam::patchProbes::patchProbes
230 const dictionary&
dict,
231 const bool loadFromFiles,
246 bool Foam::patchProbes::performAction(
unsigned request)
250 performAction(scalarFields_, request);
251 performAction(vectorFields_, request);
252 performAction(sphericalTensorFields_, request);
253 performAction(symmTensorFields_, request);
254 performAction(tensorFields_, request);
256 performAction(surfaceScalarFields_, request);
257 performAction(surfaceVectorFields_, request);
258 performAction(surfaceSphericalTensorFields_, request);
259 performAction(surfaceSymmTensorFields_, request);
260 performAction(surfaceTensorFields_, request);
270 return performAction(ACTION_ALL & ~ACTION_WRITE);
279 return performAction(ACTION_ALL);
287 patchNames_.resize(1);
const labelList patchIDs(pbm.indices(polyPatchNames, true))
virtual void findElements(const fvMesh &mesh)
Find elements containing patchProbes.
void resize(const label len)
Adjust allocated size of list.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
pointField oldPoints_
Original probes location (only used for patchProbes)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
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.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
constexpr char nl
The newline '\n' character (0x0a)
bool empty() const noexcept
True if List is empty (ie, size() is zero)
virtual bool read(const dictionary &)
Read.
T & first()
Access first element of the list, position [0].
Ostream & endl(Ostream &os)
Add newline and flush stream.
wordRes patchNames_
Patches to sample.
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
labelList processor_
Processor holding the cell or face (-1 if point not found.
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
T & operator[](const label i)
Return element of UList.
labelList faceList_
Faces to be probed.
const dimensionedScalar e
Elementary charge.
virtual const pointField & probeLocations() const noexcept
Return locations to probe.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const NameMatchPredicate &selectedFields, DynamicList< regIOobject *> &storedObjects)
Read the selected GeometricFields of the templated type and store on the objectRegistry.
virtual bool execute()
Sample and store result if the sampleOnExecute is enabled.
A class for handling words, derived from Foam::string.
label size() const noexcept
The number of entries in the list.
label whichPatch(const label meshFacei) const
Return patch index for a given mesh face index. Uses binary search.
Set of locations to sample at patches.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
Istream and Ostream manipulators taking arguments.
label size() const noexcept
The number of elements in the container.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens i...
defineTypeNameAndDebug(combustionModel, 0)
tmp< Field< Type > > sample(const VolumeField< Type > &) const
Sample a volume field at all locations.
Tuple2< pointIndexHit, Tuple2< scalar, label > > nearInfo
Helper class for finding nearest.
vector point
Point is a vector.
#define WarningInFunction
Report a warning using Foam::Warning.
Mesh data needed to do the Finite Volume discretisation.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
labelList elementList_
Cells to be probed (obtained from the locations)
virtual bool write()
Sample and write.
virtual bool read(const dictionary &)
Read the probes.
messageStream Info
Information stream (stdout output on master, null elsewhere)
List< label > labelList
A List of labels.
labelList patchIDList_
Patch IDs on which the new probes are located (for patchProbes)
void reduce(T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) using linear/tree communication schedule.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
static int debug
Flag to execute debug content.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
static void listCombineReduce(List< T > &values, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Combines List elements. After completion all processors have the same data.
#define InfoInFunction
Report an information message using Foam::Info.