53 Info<<
"probes: resetting sample locations" <<
endl;
57 elementList_.setSize(size());
60 faceList_.setSize(size());
64 const vector& location = operator[](probei);
68 elementList_[probei] = celli;
74 scalar minDistance = great;
78 label facei = cellFaces[i];
80 if (
mag(dist) < minDistance)
82 minDistance =
mag(dist);
86 faceList_[probei] = minFaceID;
90 faceList_[probei] = -1;
93 if (debug && (elementList_[probei] != -1 || faceList_[probei] != -1))
95 Pout<<
"probes : found point " << location
96 <<
" in cell " << elementList_[probei]
97 <<
" and face " << faceList_[probei] <<
endl;
103 forAll(elementList_, probei)
105 const vector& location = operator[](probei);
106 label celli = elementList_[probei];
107 label facei = faceList_[probei];
118 <<
"Did not find location " << location
119 <<
" in any cell. Skipping location." <<
endl;
122 else if (facei == -1)
127 <<
"Did not find location " << location
128 <<
" in any face. Skipping location." <<
endl;
134 if (elementList_[probei] != -1 && elementList_[probei] != celli)
137 <<
"Location " << location
138 <<
" seems to be on multiple domains:" 139 <<
" cell " << elementList_[probei]
141 <<
" and cell " << celli <<
" on some other domain." 143 <<
"This might happen if the probe location is on" 144 <<
" a processor patch. Change the location slightly" 145 <<
" to prevent this." <<
endl;
148 if (faceList_[probei] != -1 && faceList_[probei] != facei)
151 <<
"Location " << location
152 <<
" seems to be on multiple domains:" 153 <<
" cell " << faceList_[probei]
155 <<
" and face " << facei <<
" on some other domain." 157 <<
"This might happen if the probe location is on" 158 <<
" a processor patch. Change the location slightly" 159 <<
" to prevent this." <<
endl;
168 const label nFields = classifyFields();
175 currentFields.
insert(scalarFields_);
176 currentFields.
insert(vectorFields_);
177 currentFields.
insert(sphericalTensorFields_);
178 currentFields.
insert(symmTensorFields_);
179 currentFields.
insert(tensorFields_);
181 currentFields.
insert(surfaceScalarFields_);
182 currentFields.
insert(surfaceVectorFields_);
183 currentFields.
insert(surfaceSphericalTensorFields_);
184 currentFields.
insert(surfaceSymmTensorFields_);
185 currentFields.
insert(surfaceTensorFields_);
189 Info<<
"Probing fields: " << currentFields <<
nl 190 <<
"Probing locations: " << *
this <<
nl 200 probeSubDir = probeSubDir/mesh_.
name();
202 probeSubDir =
"postProcessing"/probeSubDir/mesh_.time().timeName();
204 probeDir = mesh_.time().globalPath()/probeSubDir;
209 if (!currentFields.
erase(iter.key()))
213 Info<<
"close probe stream: " << iter()->name() <<
endl;
216 delete probeFilePtrs_.remove(iter);
223 const word& fieldName = iter.key();
236 probeFilePtrs_.insert(fieldName, fPtr);
239 os <<
setf(ios_base::left);
243 os<<
"# Probe " << probei <<
' ' << operator[](probei)
247 os <<
setw(w) <<
"# Time";
251 os<<
' ' <<
setw(w) << probei;
274 refCast<const fvMesh>
283 fixedLocations_(
true),
284 interpolationScheme_(
"cell")
300 dict.
lookup(
"probeLocations") >> *
this;
301 dict.
lookup(
"fields") >> fields_;
304 if (dict.
readIfPresent(
"interpolationScheme", interpolationScheme_))
306 if (!fixedLocations_ && interpolationScheme_ !=
"cell")
309 <<
"Only cell interpolation can be applied when " 310 <<
"not using fixedLocations. InterpolationScheme " 311 <<
"entry will be ignored";
338 if (size() && prepare())
340 sampleAndWrite(scalarFields_);
341 sampleAndWrite(vectorFields_);
342 sampleAndWrite(sphericalTensorFields_);
343 sampleAndWrite(symmTensorFields_);
344 sampleAndWrite(tensorFields_);
346 sampleAndWriteSurfaceFields(surfaceScalarFields_);
347 sampleAndWriteSurfaceFields(surfaceVectorFields_);
348 sampleAndWriteSurfaceFields(surfaceSphericalTensorFields_);
349 sampleAndWriteSurfaceFields(surfaceSymmTensorFields_);
350 sampleAndWriteSurfaceFields(surfaceTensorFields_);
361 if (fixedLocations_ && &mesh == &mesh_)
372 if (&map.
mesh() != &mesh_)
385 Info<<
"probes: remapping sample locations" <<
endl;
395 label celli = elementList_[i];
396 label newCelli = reverseMap[celli];
401 else if (newCelli < -1)
404 elems.
append(-newCelli - 2);
409 elems.append(newCelli);
413 elementList_.transfer(elems);
423 label facei = faceList_[i];
424 label newFacei = reverseMap[facei];
429 else if (newFacei < -1)
432 elems.
append(-newFacei - 2);
437 elems.append(newFacei);
441 faceList_.transfer(elems);
A HashTable with keys but without contents.
#define forAll(list, i)
Loop across all elements in list.
A class for handling file names.
virtual bool write()
Sample and write.
label prepare()
Classify field type and Open/close file streams,.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
virtual bool execute()
Execute, currently does nothing.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
static unsigned int defaultPrecision()
Return the default precision.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
static word defaultRegion
Return the default region name.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool master(const label communicator=0)
Am I the master process.
const cellList & cells() const
A HashTable specialisation for hashing pointers.
Abstract base-class for Time/database functionObjects.
const fileName & name() const
Return the name of the stream.
bool insert(const Key &key)
Insert a new entry.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
bool erase(const iterator &)
Erase a hashedEntry specified by given iterator.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
const labelList & reverseFaceMap() const
Reverse face map.
bool read(const char *, int32_t &)
vectorField pointField
pointField is a vectorField.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
A class for handling words, derived from string.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
virtual void findElements(const fvMesh &)
Find cells and faces containing probes.
word name() const
Return file name (part beyond last /)
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
Smanip< ios_base::fmtflags > setf(const ios_base::fmtflags flags)
const vectorField & cellCentres() const
#define DebugInfo
Report an information message using Foam::Info.
const polyMesh & mesh() const
Return polyMesh.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
const labelList & reverseCellMap() const
Reverse cell map.
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
word name(const complex &)
Return a string representation of a complex.
virtual void movePoints(const polyMesh &)
Update topology using the given map.
const vectorField & faceCentres() const
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
#define WarningInFunction
Report a warning using Foam::Warning.
prefixOSstream Pout(cout, "Pout")
Mesh data needed to do the Finite Volume discretisation.
virtual bool read(const dictionary &)
Read the probes.
label findCell(const point &p, const cellDecomposition=CELL_TETS) const
Find cell enclosing this location and return index.
virtual wordList fields() const
Return the list of fields required.
dimensioned< scalar > mag(const dimensioned< Type > &)
probes(const word &name, const Time &time, const dictionary &dict)
Construct from Time and dictionary.
Mesh consisting of general polyhedral cells.
Omanip< int > setw(const int i)
Registry of regIOobjects.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
Class containing mesh-to-mesh mapping information.
virtual ~probes()
Destructor.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.