29 #ifndef Foam_DimensionedFieldReuseFunctions_H 30 #define Foam_DimensionedFieldReuseFunctions_H 40 template<
class TypeR,
class Type1,
class GeoMesh>
67 const auto& f1 = tf1();
79 template<
class TypeR,
class GeoMesh>
89 const bool initCopy =
false 101 const auto& f1 = tf1();
112 tresult.ref().field() = f1.
field();
121 template<
class TypeR,
class GeoMesh>
122 tmp<DimensionedField<TypeR, GeoMesh>>
New 127 const bool initCopy =
false 140 template<
class TypeR,
class Type1,
class Type12,
class Type2,
class GeoMesh>
141 struct reuseTmpTmpDimensionedField
151 const auto& f1 = tf1();
163 template<
class TypeR,
class Type1,
class Type12,
class GeoMesh>
164 struct reuseTmpTmpDimensionedField<TypeR, Type1, Type12, TypeR, GeoMesh>
176 auto& f2 = tf2.constCast();
179 f2.dimensions().reset(dimensions);
183 const auto& f1 = tf1();
195 template<
class TypeR,
class Type2,
class GeoMesh>
196 struct reuseTmpTmpDimensionedField<TypeR, TypeR, TypeR, Type2, GeoMesh>
215 const auto& f1 = tf1();
227 template<
class TypeR,
class GeoMesh>
228 struct reuseTmpTmpDimensionedField<TypeR, TypeR, TypeR, TypeR, GeoMesh>
248 auto& f2 = tf2.constCast();
251 f2.dimensions().reset(dimensions);
255 const auto& f1 = tf1();
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
static tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< Type1, GeoMesh >> &tf1, const tmp< DimensionedField< Type2, GeoMesh >> &tf2, const word &name, const dimensionSet &dimensions)
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
A class for handling words, derived from Foam::string.
static tmp< DimensionedField< TypeR, GeoMesh > > New(const DimensionedField< Type1, GeoMesh > &f1, const word &name, const dimensionSet &dimensions)
Pass-through to New DimensionedField.
virtual void rename(const word &newName)
Rename.
const dimensionSet & dimensions() const noexcept
Return dimensions.
const Field< Type > & field() const noexcept
Return const-reference to the primitive field values.
static tmp< DimensionedField< Type, GeoMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const Field< Type > &iField)
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions, copy of internal field...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const Mesh & mesh() const noexcept
Return const reference to mesh.
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
A class for managing temporary objects.
this_type & constCast() const noexcept
Return non-const reference to this field.