Go to the documentation of this file.
42 if (obr_.foundObject<vf>(fieldName))
55 const word& fieldName,
61 if (obr_.foundObject<vf>(fieldName))
63 return filterField(obr_.lookupObject<vf>(fieldName));
69 <<
"Field " << fieldName <<
" not found in database"
110 if (canWeight(weightField))
122 case opWeightedAverage:
124 if (canWeight(weightField))
138 case opWeightedVolAverage:
140 if (canWeight(weightField))
143 /(
gSum(weightField*V) + ROOTVSMALL);
153 case opWeightedVolIntegrate:
155 if (canWeight(weightField))
168 const scalar sumV =
gSum(V);
172 for (
direction d=0; d < pTraits<Type>::nComponents; ++d)
175 const scalar mean =
component(meanValue, d);
178 res =
sqrt(
gSum(V*
sqr(vals - mean))/sumV)/(mean + ROOTVSMALL);
194 const word& fieldName,
199 const bool ok = validField<Type>(fieldName);
208 combineFields(allValues);
210 if (Pstream::master())
212 word outName = fieldName +
'_' + regionTypeNames_[regionType_];
213 if (this->volRegion::regionName_ != polyMesh::defaultRegion)
215 outName = outName +
'-' + this->volRegion::regionName_;
223 obr_.time().timeName(),
228 scaleFactor_*weightField*allValues
233 if (operation_ != opNone)
238 Type result = processValues(
values, V, weightField);
241 const word& opName = operationTypeNames_[operation_];
242 word outName = fieldName;
243 if (this->volRegion::regionName_ != polyMesh::defaultRegion)
245 outName = this->volRegion::regionName_ +
',' + outName;
247 word resultName = opName +
'(' + outName +
')';
249 file()<<
tab << result;
252 <<
'(' << this->volRegion::regionName_ <<
") of " << fieldName
253 <<
" = " << result <<
endl;
255 this->setResult(resultName, result);
270 if (volRegion::vrtAll == this->volRegion::regionType())
Defines the attributes of an object for which implicit objectRegistry management is supported,...
label & setComponent(label &l, const direction)
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
A class for handling words, derived from Foam::string.
A primitive field of type <T> with automated input and output.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
A class for managing temporary objects.
static constexpr const zero Zero
Global zero.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
Type processValues(const Field< Type > &values, const scalarField &V, const scalarField &weightField) const
Apply the 'operation' to the values.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Type gSum(const FieldField< Field, Type > &f)
tmp< Field< Type > > getFieldValues(const word &fieldName, const bool mustGet=false) const
Insert field values into values list.
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
bool validField(const word &fieldName) const
Return true if the field name is valid.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Generic templated field type.
bool writeValues(const word &fieldName, const scalarField &V, const scalarField &weightField)
Templated helper function to output field values.
tmp< Field< Type > > filterField(const Field< Type > &field) const
Filter a field according to cellIds.
errorManip< error > abort(error &err)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar sqrt(const dimensionedScalar &ds)
Type gMin(const FieldField< Field, Type > &f)
Type gMax(const FieldField< Field, Type > &f)
#define Log
Report write to Foam::Info if the local log switch is true.