mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
functionObjects::add: Add list of fields
The operation can be applied to any volume or surface fields generating a
volume or surface scalar field.
Example of function object specification:
\verbatim
Ttot
{
type add;
libs ("libfieldFunctionObjects.so");
fields (T Tdelta);
result Ttot;
executeControl writeTime;
writeControl writeTime;
}
\endverbatim
Also refactored functionObjects::fieldsExpression to avoid code
duplication between the 'add' and 'subtract' functionObjects.
This commit is contained in:
@ -71,9 +71,27 @@ protected:
|
||||
|
||||
// Protected member functions
|
||||
|
||||
virtual bool calc() = 0;
|
||||
void setResultName
|
||||
(
|
||||
const word& typeName,
|
||||
const wordList& defaultArg = wordList::null()
|
||||
);
|
||||
|
||||
void setResultName(const word& typeName, const wordList& defaultArg);
|
||||
//- Call 'calcFieldType' for the given functionObject
|
||||
// for 'volField' and 'surfaceField' field types
|
||||
template<class Type, class FOType>
|
||||
bool calcFieldTypes(FOType& fo);
|
||||
|
||||
//- Call 'calcFieldTypes' for the given 'Type' and functionObject
|
||||
template<class Type, class FOType>
|
||||
bool calcType(FOType& fo);
|
||||
|
||||
//- Call 'calcType' for the given functionObject
|
||||
// for each primitive type
|
||||
template<class FOType>
|
||||
bool calcAllTypes(FOType& fo);
|
||||
|
||||
virtual bool calc() = 0;
|
||||
|
||||
|
||||
private:
|
||||
@ -133,6 +151,12 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "fieldsExpressionTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
Reference in New Issue
Block a user