55 Info<<
"probes: resetting sample locations" <<
endl;
78 scalar minDistance = great;
82 label facei = cellFaces[i];
84 if (
mag(dist) < minDistance)
86 minDistance =
mag(dist);
99 Pout<<
"probes : found point " << location
122 <<
"Did not find location " << location
123 <<
" in any cell. Skipping location." <<
endl;
126 else if (facei == -1)
131 <<
"Did not find location " << location
132 <<
" in any face. Skipping location." <<
endl;
141 <<
"Location " << location
142 <<
" seems to be on multiple domains:"
145 <<
" and cell " << celli <<
" on some other domain."
147 <<
"This might happen if the probe location is on"
148 <<
" a processor patch. Change the location slightly"
149 <<
" to prevent this." <<
endl;
155 <<
"Location " << location
156 <<
" seems to be on multiple domains:"
159 <<
" and face " << facei <<
" on some other domain."
161 <<
"This might happen if the probe location is on"
162 <<
" a processor patch. Change the location slightly"
163 <<
" to prevent this." <<
endl;
172 const label nFields = classifyFields();
179 currentFields.
insert(scalarFields_);
180 currentFields.
insert(vectorFields_);
181 currentFields.
insert(sphericalTensorFields_);
182 currentFields.
insert(symmTensorFields_);
183 currentFields.
insert(tensorFields_);
185 currentFields.
insert(surfaceScalarFields_);
186 currentFields.
insert(surfaceVectorFields_);
187 currentFields.
insert(surfaceSphericalTensorFields_);
188 currentFields.
insert(surfaceSymmTensorFields_);
189 currentFields.
insert(surfaceTensorFields_);
193 Info<<
"Probing fields: " << currentFields <<
nl
194 <<
"Probing locations: " << *
this <<
nl
199 mesh_.time().globalPath()
203 /mesh_.time().name();
208 if (!currentFields.
erase(iter.key()))
212 Info<<
"close probe stream: " << iter()->name() <<
endl;
215 delete probeFilePtrs_.remove(iter);
222 const word& fieldName = iter.key();
235 probeFilePtrs_.insert(fieldName, fPtr);
238 os <<
setf(ios_base::left);
242 os<<
"# Probe " << probei <<
' ' << operator[](probei)
246 os <<
setw(w) <<
"# Time";
250 os<<
' ' <<
setw(w) << probei;
282 fixedLocations_(true),
283 interpolationScheme_(
"cell")
305 if (!fixedLocations_ && interpolationScheme_ !=
"cell")
308 <<
"Only cell interpolation can be applied when "
309 <<
"not using fixedLocations. InterpolationScheme "
310 <<
"entry will be ignored";
337 if (size() && prepare())
339 sampleAndWrite(scalarFields_);
340 sampleAndWrite(vectorFields_);
341 sampleAndWrite(sphericalTensorFields_);
342 sampleAndWrite(symmTensorFields_);
343 sampleAndWrite(tensorFields_);
345 sampleAndWriteSurfaceFields(surfaceScalarFields_);
346 sampleAndWriteSurfaceFields(surfaceVectorFields_);
347 sampleAndWriteSurfaceFields(surfaceSphericalTensorFields_);
348 sampleAndWriteSurfaceFields(surfaceSymmTensorFields_);
349 sampleAndWriteSurfaceFields(surfaceTensorFields_);
360 if (fixedLocations_ && &
mesh == &mesh_)
371 if (&map.
mesh() != &mesh_)
384 Info<<
"probes: remapping sample locations" <<
endl;
395 const label celli = elementList_[i];
396 const label newCelli = reverseMap[celli];
402 else if (newCelli < -1)
405 elems.
append(-newCelli - 2);
414 elementList_.transfer(elems);
425 const label facei = faceList_[i];
426 const label newFacei = reverseMap[facei];
432 else if (newFacei < -1)
435 elems.
append(-newFacei - 2);
444 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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
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.
Mesh object that implements searches within the local cells and faces.
label findCell(const point &p, const pointInCellShapes=pointInCellShapes::tets) const
Find the cell containing the given point.
static const meshSearch & New(const polyMesh &mesh, const pointInCellShapes=pointInCellShapes::tets)
Lookup or construct from mesh and cell decomposition option.
Registry of regIOobjects.
Class containing mesh-to-mesh mapping information.
Mesh consisting of general polyhedral cells.
static word defaultRegion
Return the default region name.
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.
const fvMesh & mesh_
Const reference to fvMesh.
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.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#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.
Omanip< int > setw(const int i)
void mag(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
defineTypeNameAndDebug(combustionModel, 0)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
prefixOSstream Pout(cout, "Pout")