35 namespace functionObjects
45 template<Foam::direction Rank>
46 template<
class GeoField>
47 bool Foam::functionObjects::tr::CalcTr<Rank>::calc(
tr& fo)
49 if (!fo.foundObject<GeoField>(fo.fieldName_))
return false;
52 <<
" functionObjects::" << fo.type() <<
" " << fo.name()
53 <<
" required object " << fo.fieldName_ <<
" is a field of a "
54 <<
"non-tensor type" <<
endl;
60 template<
class GeoField>
63 if (!fo.foundObject<GeoField>(fo.fieldName_))
return false;
65 const GeoField& geoField =
66 fo.lookupObject<GeoField>(fo.fieldName_);
68 fo.store(fo.resultName_,
Foam::tr(geoField));
74 bool Foam::functionObjects::tr::calc()
76 bool processed =
false;
78 #define calcTrType(Type, GeoField) \
81 || CalcTr<pTraits<Type>::rank>::calc<GeoField<Type>>(*this);
Macros for easy insertion into run-time selection tables.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Abstract base-class for Time/database functionObjects.
const word fieldName_
Name of field to process.
void cannotFindObject(const word &fieldName)
Prints a warning message that fieldName cannot be found.
Calculates and outputs the trace of a tensor.
tr(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
A class for handling words, derived from string.
defineTypeNameAndDebug(adjustTimeStepToCombustion, 0)
addToRunTimeSelectionTable(functionObject, adjustTimeStepToCombustion, dictionary)
Ostream & endl(Ostream &os)
Add newline and flush stream.
typename VolField< Type >::Internal VolInternalField
void tr(LagrangianPatchField< scalar > &f, const LagrangianPatchField< tensor > &f1)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
GeometricField< Type, volMesh, Field > VolField
FOR_ALL_FIELD_TYPES(makeFieldSourceTypedef)
GeometricField< Type, surfaceMesh, Field > SurfaceField
#define calcTrType(Type, GeoField)