31 bool Foam::functionObjects::multiply::initialiseResult(
const word& fieldName)
33 typedef GeometricField<Type, fvPatchField, volMesh> volFieldType;
43 resultFieldPtr->checkOut();
46 Log <<
" Initialising " 57 bool Foam::functionObjects::multiply::multiplyResult
59 const word& fieldName,
63 typedef GeometricField<Type, fvPatchField, volMesh> volFieldType;
65 auto* resultFieldPtr = mesh_.getObjectPtr<volFieldType>(resultName_);
69 multiplyFieldType<Type, scalar>(*resultFieldPtr, fieldName, processed);
70 multiplyFieldType<Type, vector>(*resultFieldPtr, fieldName, processed);
71 multiplyFieldType<Type, sphericalTensor>
77 multiplyFieldType<Type, symmTensor>
83 multiplyFieldType<Type, tensor>(*resultFieldPtr, fieldName, processed);
90 template<
class Type1,
class Type2>
91 bool Foam::functionObjects::multiply::multiplyFieldType
93 GeometricField<Type1, fvPatchField, volMesh>& result,
94 const word& fieldName,
98 if (processed)
return processed;
100 typedef GeometricField<Type2, fvPatchField, volMesh> volFieldType;
102 auto* fieldPtr = mesh_.cfindObject<volFieldType>(fieldName);
108 Foam::functionObjects::multiply::is_valid_op<Type1, Type2>::value
111 Log <<
" Performing " 112 << result.name() <<
" * " << fieldPtr->name()
115 auto newResult(result*(*fieldPtr));
118 store(resultName_, newResult);
124 Info<<
" Unsupported operation for " 125 << result.name() <<
'(' << pTraits<Type1>::typeName <<
')' 127 << fieldPtr->name() <<
'(' << pTraits<Type2>::typeName <<
')' Ostream & endl(Ostream &os)
Add newline and flush stream.
const Type * cfindObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
Type * getObjectPtr(const word &name, const bool recursive=false) const
Return non-const pointer to the object of the given Type, using a const-cast to have it behave like a...
bool store(word &fieldName, const tmp< ObjectType > &tfield, bool cacheable=false)
Store the field in the (sub) objectRegistry under the given name.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
word resultName_
Name of result fields.
messageStream Info
Information stream (stdout output on master, null elsewhere)
const fvMesh & mesh_
Reference to the fvMesh.