67template<
class GeoField>
105 const word& fieldName,
110 const Type avgVal =
average(values);
112 this->setResult(
"average(" + fieldName +
")", avgVal);
113 this->setResult(
"min(" + fieldName +
")", limits.
min());
114 this->setResult(
"max(" + fieldName +
")", limits.
max());
115 this->setResult(
"size(" + fieldName +
")", values.size());
120 <<
" avg: " << avgVal <<
nl
121 <<
" min: " << limits.
min() <<
nl
122 <<
" max: " << limits.
max() <<
nl <<
nl;
130void Foam::probes::writeValues
132 const word& fieldName,
134 const scalar timeValue
142 os <<
setw(width) << timeValue;
146 if (includeOutOfBounds_ || processor_[probei] != -1)
148 os <<
' ' <<
setw(width) << values[probei];
156template<
class GeoField>
157void Foam::probes::performAction
159 const fieldGroup<GeoField>& fieldNames,
163 for (
const word& fieldName : fieldNames)
165 tmp<GeoField> tfield = getOrLoadField<GeoField>(fieldName);
169 const auto&
field = tfield();
170 const scalar timeValue =
field.time().timeOutputValue();
174 this->storeResults(fieldName, values);
175 if (request & ACTION_WRITE)
177 this->writeValues(fieldName, values, timeValue);
193 auto& values = tvalues.ref();
204 if (elementList_[probei] >= 0)
206 const vector& position = operator[](probei);
208 values[probei] = interpPtr().interpolate
211 elementList_[probei],
221 if (elementList_[probei] >= 0)
223 values[probei] = vField[elementList_[probei]];
241 auto& values = tvalues.ref();
245 if (faceList_[probei] >= 0)
247 values[probei] = sField[faceList_[probei]];
Istream and Ostream manipulators taking arguments.
Generic templated field type.
Minimal example by using system/controlDict.functions:
Generic GeometricField class.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
static unsigned int defaultPrecision() noexcept
Return the default precision.
A min/max value pair with additional methods. In addition to conveniently storing values,...
const T & max() const noexcept
The max value (second)
const T & min() const noexcept
The min value (first)
Output to file stream, using an OSstream.
static void listCombineAllGather(const List< commsStruct > &comms, List< T > &values, const CombineOp &cop, const int tag, const label comm)
After completion all processors have the same data.
static word timeName(const scalar t, const int precision=precision_)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
const fvMesh & mesh_
Reference to the fvMesh.
const Time & time() const
Return the top-level database.
Abstract base class for volume field interpolation.
const Type * cfindObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
void storeResults(const word &fieldName, const Field< Type > &values)
Store results: min/max/average/size.
bool loadFromFiles_
Load fields from files (not from objectRegistry)
tmp< GeoField > getOrLoadField(const word &fieldName) const
Get from registry or load from disk.
tmp< Field< Type > > sampleSurfaceField(const word &fieldName) const
Sample a surface field at all locations.
splitCell * master() const
A class for managing temporary objects.
void reset(tmp< T > &&other) noexcept
Clear existing and transfer ownership.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
messageStream Info
Information stream (stdout output on master, null elsewhere)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
Omanip< int > setw(const int i)
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
void operator()(T &x, const T &y) const