38static inline scalar
MagOp(
const Type& val)
56bool Foam::functionObjects::fieldValues::multiFieldValue::applyOperation
58 const word& resultType,
59 const wordList& foNames,
60 const wordList& entryNames
70 Field<Type>
values(foNames.size());
89 for (label i = 1; i <
values.size(); ++i)
98 for (label i = 1; i <
values.size(); ++i)
107 for (label i = 1; i <
values.size(); ++i)
115 result =
min(values);
120 result =
max(values);
131 <<
"Unable to process operation "
138 os << opName <<
flatOutput(entryNames, FlatOutput::ParenComma{});
139 const word resultName(
os.str());
140 Log <<
" " << resultName <<
" = " << result <<
endl;
static const Enum< operationType > operationTypeNames_
Operation type names.
@ opDivide
Divide first entry by values.
@ opAverage
Average value.
@ opCmptDivide
Divide first entry by values componentwise.
@ opSubtract
Subtract values from first entry.
@ opAdd
Add values (same as sum).
void setResult(const word &entryName, const Type &value)
Add result.
Type getObjectResult(const word &objectName, const word &entryName, const Type &defaultValue=Type(Zero)) const
Retrieve result from named object.
word resultType(const word &entryName) const
Retrieve the result type.
virtual OFstream & file()
Return access to the file (if only 1).
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
scalar MagOp< scalar >(const scalar &val)
Return self if a given Type is scalar.
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
errorManip< error > abort(error &err)
dimensionedScalar stabilise(const dimensionedScalar &x, const dimensionedScalar &y)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1, const label comm)
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
static scalar MagOp(const Type &val)
Return magnitude of a given value unless the given Type is scalar.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &f1, const label comm)
constexpr char tab
The tab '\t' character(0x09).
#define forAll(list, i)
Loop across all elements in list.