Go to the documentation of this file.
48 const word& fieldName,
54 if (obr_.foundObject<vf>(fieldName))
56 return filterField(obr_.lookupObject<vf>(fieldName));
62 <<
"Field " << fieldName <<
" not found in database"
83 result =
gSum(values);
94 result =
gSum(values)/(scalar(
n) + ROOTVSMALL);
97 case opWeightedAverage:
104 gSum(weightField*values)/(
gSum(weightField) + ROOTVSMALL);
109 result =
gSum(values)/(scalar(
n) + ROOTVSMALL);
115 result =
gSum(values*V)/(
gSum(V) + ROOTVSMALL);
118 case opWeightedVolAverage:
120 result =
gSum(weightField*V*values)/
gSum(weightField*V);
125 result =
gSum(V*values);
130 result =
gMin(values);
135 result =
gMax(values);
140 const scalar sumV =
gSum(V);
142 Type meanValue =
gSum(V*values)/sumV;
152 res =
sqrt(
gSum(V*
sqr(vals - mean))/sumV)/(mean + ROOTVSMALL);
172 const word& fieldName,
176 const bool ok = validField<Type>(fieldName);
180 Field<Type> values(setFieldValues<Type>(fieldName));
186 combineFields(allValues);
194 fieldName +
"_" + sourceTypeNames_[source_] +
"-"
196 obr_.time().timeName(),
207 values *= scaleFactor_;
209 Type result = processValues(values, V, weightField);
211 file()<<
tab << result;
214 <<
" " << operationTypeNames_[operation_]
215 <<
"(" << sourceName_ <<
") of " << fieldName
216 <<
" = " << result <<
endl;
219 const word& opName = operationTypeNames_[operation_];
220 word resultName = opName +
'(' + sourceName_ +
',' + fieldName +
')';
221 this->setResult(resultName, result);
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
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 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.
tmp< Field< Type > > setFieldValues(const word &fieldName, const bool mustGet=false) const
Insert field values into values list.
virtual bool write() const
Write using setting from DB.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Type gSum(const FieldField< Field, Type > &f)
Type processValues(const Field< Type > &values, const scalarField &V, const scalarField &weightField) const
Apply the 'operation' to the values.
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool writeValues(const word &fieldName, const scalarField &weightField)
Templated helper function to output field values.
errorManip< error > abort(error &err)
static bool master(const label communicator=0)
Am I the master process.
bool foundObject(const word &name) const
Is the named Type found?
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar sqrt(const dimensionedScalar &ds)
Traits class for primitives.
tmp< Field< Type > > filterField(const Field< Type > &field) const
Filter a field according to cellIds.
bool validField(const word &fieldName) const
Return true if the field name is valid.
Type gMin(const FieldField< Field, Type > &f)
Generic GeometricField class.
Type gMax(const FieldField< Field, Type > &f)
const objectRegistry & obr_
Database this class is registered to.