Go to the documentation of this file.
47 Info<<
"probes: resetting sample locations" <<
endl;
58 const vector& location = operator[](probeI);
60 const label cellI =
mesh.findCell(location);
67 const vector& cellCentre =
mesh.cellCentres()[cellI];
68 scalar minDistance = GREAT;
72 label faceI = cellFaces[i];
73 vector dist =
mesh.faceCentres()[faceI] - cellCentre;
74 if (
mag(dist) < minDistance)
76 minDistance =
mag(dist);
89 Pout<<
"probes : found point " << location
99 const vector& location = operator[](probeI);
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." <<
endl
136 <<
"This might happen if the probe location is on"
137 <<
" a processor patch. Change the location slightly"
138 <<
" to prevent this." <<
endl;
144 <<
"Location " << location
145 <<
" seems to be on multiple domains:"
148 <<
" and face " << faceI <<
" on some other domain." <<
endl
149 <<
"This might happen if the probe location is on"
150 <<
" a processor patch. Change the location slightly"
151 <<
" to prevent this." <<
endl;
160 const label nFields = classifyFields();
167 currentFields.
insert(scalarFields_);
168 currentFields.
insert(vectorFields_);
169 currentFields.
insert(sphericalTensorFields_);
170 currentFields.
insert(symmTensorFields_);
171 currentFields.
insert(tensorFields_);
173 currentFields.
insert(surfaceScalarFields_);
174 currentFields.
insert(surfaceVectorFields_);
175 currentFields.
insert(surfaceSphericalTensorFields_);
176 currentFields.
insert(surfaceSymmTensorFields_);
177 currentFields.
insert(surfaceTensorFields_);
181 Info<<
"Probing fields: " << currentFields <<
nl
182 <<
"Probing locations: " << *
this <<
nl
192 probeSubDir = probeSubDir/mesh_.
name();
194 probeSubDir =
"postProcessing"/probeSubDir/mesh_.time().timeName();
200 probeDir = mesh_.time().
path()/
".."/probeSubDir;
204 probeDir = mesh_.time().
path()/probeSubDir;
210 if (!currentFields.
erase(iter.key()))
214 Info<<
"close probe stream: " << iter()->name() <<
endl;
217 delete probeFilePtrs_.remove(iter);
224 const word& fieldName = iter.key();
238 probeFilePtrs_.insert(fieldName, fPtr);
244 fout<<
"# Probe " << probeI <<
' ' << operator[](probeI)
253 fout<<
' ' <<
setw(
w) << probeI;
274 if (!fixedLocations_ && interpolationScheme_ !=
"cell")
277 <<
"Only cell interpolation can be applied when "
278 <<
"not using fixedLocations. InterpolationScheme "
279 <<
"entry will be ignored";
292 const bool loadFromFiles,
293 const bool doFindElements
298 mesh_(refCast<const fvMesh>(obr)),
299 loadFromFiles_(loadFromFiles),
301 fixedLocations_(
true),
302 interpolationScheme_(
"cell")
347 if (size() && prepare())
349 sampleAndWrite(scalarFields_);
350 sampleAndWrite(vectorFields_);
351 sampleAndWrite(sphericalTensorFields_);
352 sampleAndWrite(symmTensorFields_);
353 sampleAndWrite(tensorFields_);
355 sampleAndWriteSurfaceFields(surfaceScalarFields_);
356 sampleAndWriteSurfaceFields(surfaceVectorFields_);
357 sampleAndWriteSurfaceFields(surfaceSphericalTensorFields_);
358 sampleAndWriteSurfaceFields(surfaceSymmTensorFields_);
359 sampleAndWriteSurfaceFields(surfaceTensorFields_);
372 if (!fixedLocations_ && interpolationScheme_ !=
"cell")
375 <<
"Only cell interpolation can be applied when "
376 <<
"not using fixedLocations. InterpolationScheme "
377 <<
"entry will be ignored";
393 Info<<
"probes: updateMesh" <<
endl;
404 Info<<
"probes: remapping sample locations" <<
endl;
414 label cellI = elementList_[i];
417 label newCellI = reverseMap[cellI];
422 else if (newCellI < -1)
425 elems.
append(-newCellI - 2);
440 elementList_.transfer(elems);
450 label faceI = faceList_[i];
453 label newFaceI = reverseMap[faceI];
458 else if (newFaceI < -1)
461 elems.
append(-newFaceI - 2);
476 faceList_.transfer(elems);
486 Info<<
"probes: movePoints" <<
endl;
vectorField pointField
pointField is a vectorField.
volScalarField w(IOobject("w", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE), mesh, dimensionedScalar("w", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0.0))
A class for handling words, derived from string.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
A class for handling file names.
static word defaultRegion
Return the default region name.
#define forAll(list, i)
Loop across all elements in list.
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
static bool & parRun()
Is this a parallel run?
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
fileName path() const
Return directory path name (part before last /)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< scalar > mag(const dimensioned< Type > &)
A HashTable with keys but without contents.
Mesh consisting of general polyhedral cells.
word name() const
Return file name (part beyond last /)
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Registry of regIOobjects.
virtual void end()
Execute at the final time-loop, currently does nothing.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
virtual void updateMesh(const mapPolyMesh &)
Update for changes of mesh.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual void write()
Sample and write.
Istream and Ostream manipulators taking arguments.
probes(const probes &)
Disallow default bitwise copy construct.
bool erase(const iterator &)
Erase a hashedEntry specified by given iterator.
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....
Mesh data needed to do the Finite Volume discretisation.
Omanip< int > setw(const int i)
virtual void read(const dictionary &)
Read the probes.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
virtual void findElements(const fvMesh &)
Find cells and faces containing probes.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
static bool master(const label communicator=0)
Am I the master process.
const labelList & reverseFaceMap() const
Reverse face map.
void setSize(const label)
Reset size of List.
const labelList & reverseCellMap() const
Reverse cell map.
static unsigned int defaultPrecision()
Return the default precision.
prefixOSstream Pout(cout, "Pout")
A HashTable specialization for hashing pointers.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
virtual void execute()
Execute, currently does nothing.
void clear()
Clear the list, i.e. set size to zero.
bool insert(const Key &key)
Insert a new entry.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const fileName & name() const
Return the name of the stream.
virtual void movePoints(const polyMesh &)
Update for changes of mesh.
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
void readDict(const dictionary &dict)
Read dictionary settings.
virtual ~probes()
Destructor.
defineTypeNameAndDebug(combustionModel, 0)
virtual void timeSet()
Called when time was set at the end of the Time::operator++.
#define WarningInFunction
Report a warning using Foam::Warning.
word name(const complex &)
Return a string representation of a complex.