71 <<
"Field " << fieldName <<
" not found in database"
82 const scalar emptyVal,
93 if (op(values[j], values[i]))
99 result.
value = values[i];
100 result.
celli = celli(i);
105 result.
value = emptyVal;
115 return op(a.
value,
b.value) ? a :
b;
121 template<
class Type,
class ResultType>
143 return processValuesTypeType(values, weights, V, result);
158 case operationType::minMag:
163 case operationType::maxMag:
202 case operationType::volAverage:
207 case operationType::volIntegrate:
222 case operationType::CoV:
224 Type meanValue =
gSum(values*V)/this->V();
234 res =
sqrt(
gSum(V*
sqr(vals - mean))/this->V())/mean;
239 case operationType::none:
256 const word& fieldName,
261 const bool ok = validField<Type>(fieldName);
266 Field<Type> values(getFieldValues<Type>(fieldName));
275 fieldName +
'_' + selectionTypeNames[selectionType()]
276 +
'-' + cellSetName(),
282 (weights*values).ref()
287 if (operation_ != operationType::none)
290 values *= scaleFactor_;
294 #define writeValuesFieldType(fieldType, none) \
297 || writeValues<Type, fieldType> \
305 #undef writeValuesFieldType
310 <<
"Operation " << operationTypeNames_[operation_]
311 <<
" not available for values of type "
322 template<
class Type,
class ResultType>
325 const word& fieldName,
333 if (processValues(values, weights, V, result))
336 resultDict_.add(fieldName, result.value,
true);
342 Log <<
" " << operationTypeNames_[operation_]
343 <<
"(" << cellSetName() <<
") of " << fieldName
344 <<
" = " << result.value;
346 if (result.celli != -1)
348 Log <<
" at location " << result.cc;
349 if (writeLocation_)
file() <<
tab << result.cc;
352 if (result.celli != -1)
354 Log <<
" in cell " << result.celli;
355 if (writeLocation_)
file() <<
tab << result.celli;
358 if (result.proci != -1)
360 Log <<
" on processor " << result.proci;
361 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...
void size(const label)
Override size to be inconsistent with allocated storage.
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.
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.
void compareScalars(const scalarField &values, const scalar emptyVal, Result< scalar > &result, const Op &op) const
Apply a comparison operation to the values, returning the limiting.
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)
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 &)
FOR_ALL_FIELD_TYPES(makeFieldSourceTypedef)
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)