54 Info<<
"probes: resetting sample locations" <<
endl;
75 scalar minDistance = great;
79 label facei = cellFaces[i];
81 if (
mag(dist) < minDistance)
83 minDistance =
mag(dist);
96 Pout<<
"probes : found point " << location
119 <<
"Did not find location " << location
120 <<
" in any cell. Skipping location." <<
endl;
123 else if (facei == -1)
128 <<
"Did not find location " << location
129 <<
" in any face. Skipping location." <<
endl;
138 <<
"Location " << location
139 <<
" seems to be on multiple domains:"
142 <<
" and cell " << celli <<
" on some other domain."
144 <<
"This might happen if the probe location is on"
145 <<
" a processor patch. Change the location slightly"
146 <<
" to prevent this." <<
endl;
152 <<
"Location " << location
153 <<
" seems to be on multiple domains:"
156 <<
" and face " << facei <<
" on some other domain."
158 <<
"This might happen if the probe location is on"
159 <<
" a processor patch. Change the location slightly"
160 <<
" to prevent this." <<
endl;
169 const label nFields = classifyFields();
176 currentFields.
insert(scalarFields_);
177 currentFields.
insert(vectorFields_);
178 currentFields.
insert(sphericalTensorFields_);
179 currentFields.
insert(symmTensorFields_);
180 currentFields.
insert(tensorFields_);
182 currentFields.
insert(surfaceScalarFields_);
183 currentFields.
insert(surfaceVectorFields_);
184 currentFields.
insert(surfaceSphericalTensorFields_);
185 currentFields.
insert(surfaceSymmTensorFields_);
186 currentFields.
insert(surfaceTensorFields_);
190 Info<<
"Probing fields: " << currentFields <<
nl
191 <<
"Probing locations: " << *
this <<
nl
196 mesh_.time().globalPath()
200 /mesh_.time().name();
205 if (!currentFields.
erase(iter.key()))
209 Info<<
"close probe stream: " << iter()->name() <<
endl;
212 delete probeFilePtrs_.remove(iter);
219 const word& fieldName = iter.key();
232 probeFilePtrs_.insert(fieldName, fPtr);
235 os <<
setf(ios_base::left);
239 os<<
"# Probe " << probei <<
' ' << operator[](probei)
243 os <<
setw(w) <<
"# Time";
247 os<<
' ' <<
setw(w) << probei;
279 fixedLocations_(true),
280 interpolationScheme_(
"cell")
302 if (!fixedLocations_ && interpolationScheme_ !=
"cell")
305 <<
"Only cell interpolation can be applied when "
306 <<
"not using fixedLocations. InterpolationScheme "
307 <<
"entry will be ignored";
334 if (size() && prepare())
336 sampleAndWrite(scalarFields_);
337 sampleAndWrite(vectorFields_);
338 sampleAndWrite(sphericalTensorFields_);
339 sampleAndWrite(symmTensorFields_);
340 sampleAndWrite(tensorFields_);
342 sampleAndWriteSurfaceFields(surfaceScalarFields_);
343 sampleAndWriteSurfaceFields(surfaceVectorFields_);
344 sampleAndWriteSurfaceFields(surfaceSphericalTensorFields_);
345 sampleAndWriteSurfaceFields(surfaceSymmTensorFields_);
346 sampleAndWriteSurfaceFields(surfaceTensorFields_);
357 if (fixedLocations_ && &mesh == &mesh_)
368 if (&map.
mesh() != &mesh_)
381 Info<<
"probes: remapping sample locations" <<
endl;
392 const label celli = elementList_[i];
393 const label newCelli = reverseMap[celli];
399 else if (newCelli < -1)
402 elems.
append(-newCelli - 2);
411 elementList_.transfer(elems);
422 const label facei = faceList_[i];
423 const label newFacei = reverseMap[facei];
429 else if (newFacei < -1)
432 elems.
append(-newFacei - 2);
441 faceList_.transfer(elems);
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
#define forAll(list, i)
Loop across all elements in list.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Macros for easy insertion into run-time selection tables.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
A HashTable specialisation for hashing pointers.
A HashTable with keys but without contents.
bool insert(const Key &key)
Insert a new entry.
bool erase(const iterator &)
Erase a hashedEntry specified by given iterator.
static unsigned int defaultPrecision()
Return the default precision.
label size() const
Return the number of elements in the UList.
void clear()
Clear the list, i.e. set size to zero.
void setSize(const label)
Reset size of List.
const fileName & name() const
Return the name of the stream.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
T & operator[](const label)
Return element of UList.
static bool master(const label communicator=0)
Am I the master process.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
A list of keyword definitions, which are a keyword followed by any number of values (e....
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
A class for handling file names.
Abstract base-class for Time/database functionObjects.
static const word outputPrefix
Directory prefix.
Mesh data needed to do the Finite Volume discretisation.
Registry of regIOobjects.
Class containing mesh-to-mesh mapping information.
Mesh consisting of general polyhedral cells.
static word defaultRegion
Return the default region name.
label findCell(const point &p, const cellDecomposition=CELL_TETS) const
Find cell enclosing this location and return index.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const labelList & reverseCellMap() const
Reverse cell map.
const labelList & reverseFaceMap() const
Reverse face map.
const polyMesh & mesh() const
Return polyMesh.
const vectorField & faceCentres() const
const vectorField & cellCentres() const
const cellList & cells() const
Set of locations to sample.
virtual ~probes()
Destructor.
virtual wordList fields() const
Return the list of fields required.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
label prepare()
Classify field type and Open/close file streams,.
probes(const word &name, const Time &time, const dictionary &dict)
Construct from Time and dictionary.
virtual void findElements(const fvMesh &)
Find cells and faces containing probes.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
virtual void movePoints(const polyMesh &)
Update topology using the given map.
virtual bool execute()
Execute, currently does nothing.
virtual bool write()
Sample and write.
virtual bool read(const dictionary &)
Read the probes.
A class for handling words, derived from string.
#define DebugInfo
Report an information message using Foam::Info.
#define WarningInFunction
Report a warning using Foam::Warning.
Smanip< ios_base::fmtflags > setf(const ios_base::fmtflags flags)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
To & refCast(From &r)
Reference type cast template function.
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
Omanip< int > setw(const int i)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
dimensioned< scalar > mag(const dimensioned< Type > &)
defineTypeNameAndDebug(combustionModel, 0)
prefixOSstream Pout(cout, "Pout")