31bool Foam::functionObjects::multiply::initialiseResult(
const word& fieldName)
33 typedef GeometricField<Type, fvPatchField, volMesh> volFieldType;
35 auto* fieldPtr =
mesh_.cfindObject<volFieldType>(fieldName);
43 resultFieldPtr->checkOut();
46 Log <<
" Initialising "
57bool 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);
90template<
class Type1,
class Type2>
91bool 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 <<
')'
word resultName_
Name of result fields.
const fvMesh & mesh_
Reference to the fvMesh.
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.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.