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" 70 template<
class Type,
class Op>
83 if (op(magValues[j], magValues[i]))
89 result.
value = magValues[i];
90 result.
celli =
isNull(cellIDs()) ? i : cellIDs()[i];
91 result.
proci = Pstream::parRun() ? Pstream::myProcNo() : -1;
92 result.
cc = fieldValue::mesh_.C()[result.
celli];
105 template<
class Type,
class ResultType>
127 return processValuesTypeType(values, weights, V, result);
142 case operationType::minMag:
147 case operationType::maxMag:
186 case operationType::volAverage:
191 case operationType::volIntegrate:
206 case operationType::CoV:
208 Type meanValue =
gSum(values*V)/this->V();
218 res =
sqrt(
gSum(V*
sqr(vals - mean))/this->V())/mean;
223 case operationType::none:
240 const word& fieldName,
245 const bool ok = validField<Type>(fieldName);
250 Field<Type> values(getFieldValues<Type>(fieldName));
259 fieldName +
'_' + regionTypeNames_[regionType_]
260 +
'-' + volRegion::regionName_,
261 obr_.time().timeName(),
266 (weights*values).ref()
271 if (operation_ != operationType::none)
274 values *= scaleFactor_;
278 #define writeValuesFieldType(fieldType, none) \ 281 || writeValues<Type, fieldType> \ 289 #undef writeValuesFieldType 294 <<
"Operation " << operationTypeNames_[operation_]
295 <<
" not available for values of type " 306 template<
class Type,
class ResultType>
309 const word& fieldName,
317 if (processValues(values, weights, V, result))
320 resultDict_.add(fieldName, result.
value,
true);
322 if (Pstream::master())
326 Log <<
" " << operationTypeNames_[operation_]
327 <<
"(" << volRegion::regionName_ <<
") of " << fieldName
328 <<
" = " << result.
value;
330 if (result.
celli != -1)
332 Log <<
" at location " << result.
cc;
333 if (writeLocation_)
file() <<
tab << result.
cc;
336 if (result.
celli != -1)
342 if (result.
proci != -1)
344 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.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#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)
void opMag(const Field< Type > &values, Result< scalar > &result, const Op &op) const
Apply a comparison operation (min/max) to the field magnitude,.
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)
Pre-declare SubField and related Field type.
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.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
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.
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
tmp< Field< Type > > getFieldValues(const word &fieldName) const
Insert field values into values list.
Type gMax(const FieldField< Field, Type > &f)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
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)