71 <<
"Field " << fieldName <<
" not found in database"
89 if (op(values[j], values[i]))
95 result.
value = values[i];
96 result.
celli = celli(i);
105 return op(a.
value,
b.value) ? a :
b;
111 template<
class Type,
class ResultType>
133 return processValuesTypeType(values, weights, V, result);
148 case operationType::minMag:
153 case operationType::maxMag:
192 case operationType::volAverage:
197 case operationType::volIntegrate:
212 case operationType::CoV:
214 Type meanValue =
gSum(values*V)/this->V();
224 res =
sqrt(
gSum(V*
sqr(vals - mean))/this->V())/mean;
229 case operationType::none:
246 const word& fieldName,
251 const bool ok = validField<Type>(fieldName);
256 Field<Type> values(getFieldValues<Type>(fieldName));
265 fieldName +
'_' + selectionTypeNames[selectionType()]
266 +
'-' + cellSetName(),
272 (weights*values).ref()
277 if (operation_ != operationType::none)
280 values *= scaleFactor_;
284 #define writeValuesFieldType(fieldType, none) \
287 || writeValues<Type, fieldType> \
295 #undef writeValuesFieldType
300 <<
"Operation " << operationTypeNames_[operation_]
301 <<
" not available for values of type "
312 template<
class Type,
class ResultType>
315 const word& fieldName,
323 if (processValues(values, weights, V, result))
326 resultDict_.add(fieldName, result.value,
true);
332 Log <<
" " << operationTypeNames_[operation_]
333 <<
"(" << cellSetName() <<
") of " << fieldName
334 <<
" = " << result.value;
336 if (result.celli != -1)
338 Log <<
" at location " << result.cc;
339 if (writeLocation_)
file() <<
tab << result.cc;
342 if (result.celli != -1)
344 Log <<
" in cell " << result.celli;
345 if (writeLocation_)
file() <<
tab << result.celli;
348 if (result.proci != -1)
350 Log <<
" on processor " << result.proci;
351 if (writeLocation_)
file() <<
tab << result.proci;
#define forAll(list, i)
Loop across all elements in list.
tmp< Field< cmptType > > component(const direction) const
Return a component field of the field.
Generic GeometricField class.
A primitive field of type <Type> with automated input and output.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
static bool master(const label communicator=0)
Am I the master process.
static bool & parRun()
Is this a parallel run?
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
static Form uniform(const Cmpt &s)
Return a VectorSpace with all elements = s.
bool writeValues(const word &fieldName, const scalarField &weights, const scalarField &V)
Templated helper function to output field values.
bool processValuesTypeType(const Field< Type > &values, const scalarField &weights, const scalarField &V, Result< Type > &result) const
Apply a Type -> Type operation to the values.
tmp< Field< Type > > getFieldValues(const word &fieldName) const
Insert field values into values list.
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.
void compareScalars(const scalarField &values, Result< scalar > &result, const Op &op) const
Apply a comparison operation to the values, returning the limiting.
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.
const fvMesh & mesh_
Reference to the fvMesh.
const objectRegistry & obr_
Reference to the region objectRegistry.
const volVectorField & C() const
Return cell centres.
bool foundObject(const word &name) const
Is the named Type in registry.
Traits class for primitives.
virtual bool write(const bool write=true) const
Write using setting from DB.
A class for managing temporary objects.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define Log
Report write to Foam::Info if the local log switch is true.
tmp< VolField< Type > > average(const SurfaceField< Type > &ssf)
Area-weighted average a surfaceField creating a volField.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Type gSum(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.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Ostream & endl(Ostream &os)
Add newline and flush stream.
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
label & setComponent(label &l, const direction)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
errorManip< error > abort(error &err)
FOR_ALL_FIELD_TYPES(DefineContiguousFvWallLocationDataType)
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< scalar > mag(const dimensioned< Type > &)
typename VolField< Type >::Internal VolInternalField
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
dimensionSet cmptMag(const dimensionSet &)
Type gMin(const FieldField< Field, Type > &f)
Type gMax(const FieldField< Field, Type > &f)
dimensioned< scalar > sumMag(const DimensionedField< Type, GeoMesh > &df)
Forward declare the result structure.
#define writeValuesFieldType(fieldType, none)