39 if (obr_.foundObject<vf>(fieldName))
57 if (obr_.foundObject<vf>(fieldName))
59 return filterField(obr_.lookupObject<vf>(fieldName));
63 <<
"Field " << fieldName <<
" not found in database" 81 if (op(values[j], values[i]))
87 result.
value = values[i];
88 result.
celli =
isNull(cellIDs()) ? i : cellIDs()[i];
89 result.
proci = Pstream::parRun() ? Pstream::myProcNo() : -1;
90 result.
cc = fieldValue::mesh_.C()[result.
celli];
103 template<
class Type,
class ResultType>
125 return processValuesTypeType(values, weights, V, result);
140 case operationType::minMag:
145 case operationType::maxMag:
184 case operationType::volAverage:
189 case operationType::volIntegrate:
204 case operationType::CoV:
206 Type meanValue =
gSum(values*V)/this->V();
216 res =
sqrt(
gSum(V*
sqr(vals - mean))/this->V())/mean;
221 case operationType::none:
238 const word& fieldName,
243 const bool ok = validField<Type>(fieldName);
248 Field<Type> values(getFieldValues<Type>(fieldName));
257 fieldName +
'_' + regionTypeNames_[regionType_]
258 +
'-' + volRegion::regionName_,
259 obr_.time().timeName(),
264 (weights*values).ref()
269 if (operation_ != operationType::none)
272 values *= scaleFactor_;
276 #define writeValuesFieldType(fieldType, none) \ 279 || writeValues<Type, fieldType> \ 287 #undef writeValuesFieldType 292 <<
"Operation " << operationTypeNames_[operation_]
293 <<
" not available for values of type " 304 template<
class Type,
class ResultType>
307 const word& fieldName,
315 if (processValues(values, weights, V, result))
318 resultDict_.add(fieldName, result.
value,
true);
320 if (Pstream::master())
324 Log <<
" " << operationTypeNames_[operation_]
325 <<
"(" << volRegion::regionName_ <<
") of " << fieldName
326 <<
" = " << result.
value;
328 if (result.
celli != -1)
330 Log <<
" at location " << result.
cc;
331 if (writeLocation_)
file() <<
tab << result.
cc;
334 if (result.
celli != -1)
340 if (result.
proci != -1)
342 Log <<
" on processor " << result.
proci;
bool processValues(const Field< Type > &values, const scalarField &weights, const scalarField &V, Result< ResultType > &result) const
Apply the operation to the values, and return true if successful.
#define forAll(list, i)
Loop across all elements in list.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
void compareScalars(const scalarField &values, Result< scalar > &result, const Op &op) const
Apply a comparison operation to the values, returning the limiting.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Type gMin(const FieldField< Field, Type > &f)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Forward declare the result structure.
dimensionedScalar sqrt(const dimensionedScalar &ds)
const dimensionedScalar b
Wien displacement law constant: default SI units: [m K].
Ostream & endl(Ostream &os)
Add newline and flush stream.
Traits class for primitives.
#define FOR_ALL_FIELD_TYPES(Macro,...)
Generic GeometricField class.
bool processValuesTypeType(const Field< Type > &values, const scalarField &weights, const scalarField &V, Result< Type > &result) const
Apply a Type -> Type operation to the values.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
bool isNull(const T &t)
Return true if t is a reference to the nullObject of type T.
Type gSum(const FieldField< Field, Type > &f)
bool validField(const word &fieldName) const
Return true if the field name is valid.
A class for handling words, derived from string.
tmp< Field< Type > > filterField(const Field< Type > &field) const
Filter a field according to cellIds.
dimensionSet cmptMag(const dimensionSet &)
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
bool writeValues(const word &fieldName, const scalarField &weights, const scalarField &V)
Templated helper function to output field values.
errorManip< error > abort(error &err)
tmp< Field< cmptType > > component(const direction) const
Return a component field of the field.
tmp< Field< Type > > getFieldValues(const word &fieldName) const
Insert field values into values list.
Type gMax(const FieldField< Field, Type > &f)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
#define Log
Report write to Foam::Info if the local log switch is true.
tmp< GeometricField< Type, fvPatchField, volMesh > > average(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Area-weighted average a surfaceField creating a volField.
dimensioned< scalar > mag(const dimensioned< Type > &)
A class for managing temporary objects.
label & setComponent(label &l, const direction)
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
#define writeValuesFieldType(fieldType, none)
A primitive field of type <T> with automated input and output.
dimensioned< scalar > sumMag(const DimensionedField< Type, GeoMesh > &df)