functionObjects: New abstract base-class 'fieldExpression' for simple field expression evaluation functionObjects

Updated and simplified 'div', 'grad' and 'mag' functionObjects by deriving from 'fieldExpression'.
Corrected the handling of cached gradients in 'grad'.
This commit is contained in:
Henry Weller
2016-05-21 13:58:08 +01:00
parent abd4b881a0
commit 6905425467
15 changed files with 435 additions and 429 deletions

View File

@ -73,6 +73,29 @@ protected:
const fvMesh& mesh_;
// Protected member functions
//- Find field in the objectRegistry
template<class FieldType>
bool foundField(const word& fieldName) const;
//- Lookup field from the objectRegistry
template<class FieldType>
const FieldType& lookupField(const word& fieldName) const;
//- Store the given field in the objectRegistry under the given name
template<class FieldType>
bool store
(
word& fieldName,
tmp<FieldType> tfield,
bool cacheable = false
);
//- Write field if present in objectRegistry
virtual bool write(const word& fieldName);
private:
// Private Member Functions
@ -113,6 +136,12 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "fvMeshFunctionObjectTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //