43 DebugInfo<<
"internalFieldProbe: resetting sample locations" <<
endl;
57 const label celli =
mesh.findCell(location);
64 const vector& cellCentre =
mesh.cellCentres()[celli];
65 scalar minDistance = GREAT;
69 label facei = cellFaces[i];
70 vector dist =
mesh.faceCentres()[facei] - cellCentre;
71 if (
mag(dist) < minDistance)
73 minDistance =
mag(dist);
86 Pout<<
"internalFieldProbe : found point " << location
103 reduce(celli, maxOp<label>());
104 reduce(facei, maxOp<label>());
112 <<
"Did not find location " << location
113 <<
" in any cell. Skipping location." <<
endl;
116 else if (facei == -1)
121 <<
"Did not find location " << location
122 <<
" in any face. Skipping location." <<
endl;
131 <<
"Location " << location
132 <<
" seems to be on multiple domains:"
135 <<
" and cell " << celli <<
" on some other domain."
137 <<
"This might happen if the probe location is on"
138 <<
" a processor patch. Change the location slightly"
139 <<
" to prevent this." <<
endl;
145 <<
"Location " << location
146 <<
" seems to be on multiple domains:"
149 <<
" and face " << facei <<
" on some other domain."
151 <<
"This might happen if the probe location is on"
152 <<
" a processor patch. Change the location slightly"
153 <<
" to prevent this." <<
endl;
184 findElements(thisMesh_);
Macros for easy insertion into run-time selection tables.
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
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...
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Mesh data needed to do the Finite Volume discretisation.
A utility class for probing field values at specified point locations within an fvMesh.
virtual void findElements(const fvMesh &mesh)
Find cells and faces containing probes.
internalFieldProbe(const fvMesh &mesh, const dictionary &dict)
Construct from Time and dictionary.
virtual bool read(const dictionary &)
Read the settings dictionary.
Base class for sampling fields at specified internal and boundary locations.
labelList cellIds_
Cells to be probed (obtained from the locations).
labelList faceIds_
Faces to be probed.
labelList procIds_
Processor holding the cell or face (-1 if point not found on any processor).
const fvMesh & thisMesh_
Const reference to the mesh.
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.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define DebugInfo
Report an information message using Foam::Info.
#define WarningInFunction
Report a warning using Foam::Warning.
Namespace for handling debugging switches.
bool read(const char *buf, int32_t &val)
Same as readInt32.
List< label > labelList
A List of labels.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
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.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
vectorField pointField
pointField is a vectorField.
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.