29 #ifndef Foam_GeometricFieldReuseFunctions_H 30 #define Foam_GeometricFieldReuseFunctions_H 45 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
51 const bool ok = tfld.movable();
55 for (
const auto&
p : tfld().boundaryField())
60 && !
isA<
typename PatchField<Type>::Calculated>(
p)
64 <<
"Attempt to reuse temporary with non-reusable BC " 85 template<
class>
class PatchField,
114 const auto& f1 = tf1();
126 template<
class TypeR,
template<
class>
class PatchField,
class GeoMesh>
136 const bool initCopy =
false 141 auto& f1 = tf1.constCast();
148 const auto& f1 = tf1();
159 tresult.ref() == tf1();
168 template<
class TypeR,
template<
class>
class PatchField,
class GeoMesh>
171 GeometricField<TypeR, PatchField, GeoMesh>
174 const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& tf1,
176 const dimensionSet& dimensions,
177 const bool initCopy =
false 196 template<
class>
class PatchField,
199 struct reuseTmpTmpGeometricField
201 static tmp<GeometricField<TypeR, PatchField, GeoMesh>>
New 209 const auto& f1 = tf1();
226 template<
class>
class PatchField,
229 struct reuseTmpTmpGeometricField
231 TypeR, Type1, Type12, TypeR, PatchField, GeoMesh
244 auto& f2 = tf2.constCast();
247 f2.dimensions().reset(dimensions);
251 const auto& f1 = tf1();
267 template<
class>
class PatchField,
270 struct reuseTmpTmpGeometricField
272 TypeR, TypeR, TypeR, Type2, PatchField, GeoMesh
285 auto& f1 = tf1.constCast();
292 const auto& f1 = tf1();
304 template<
class TypeR,
template<
class>
class PatchField,
class GeoMesh>
305 struct reuseTmpTmpGeometricField
307 TypeR, TypeR, TypeR, TypeR, PatchField, GeoMesh
320 auto& f1 = tf1.constCast();
328 auto& f2 = tf2.constCast();
331 f2.dimensions().reset(dimensions);
335 const auto& f1 = tf1();
Ostream & endl(Ostream &os)
Add newline and flush stream.
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.
Generic GeometricField class.
bool reusable(const tmp< GeometricField< Type, PatchField, GeoMesh >> &tfld)
True if tmp GeometricField has a reusable pointer.
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< GeometricField< TypeR, PatchField, GeoMesh > > New(const GeometricField< Type1, PatchField, GeoMesh > &f1, const word &name, const dimensionSet &dimensions)
Pass-through to New GeometricField.
static tmp< GeometricField< TypeR, PatchField, GeoMesh > > New(const tmp< GeometricField< Type1, PatchField, GeoMesh >> &tf1, const tmp< GeometricField< Type2, PatchField, GeoMesh >> &tf2, const word &name, const dimensionSet &dimensions)
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=PatchField< Type >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions and patch type. [Takes current timeN...
const Mesh & mesh() const noexcept
Return mesh.
virtual void rename(const word &newName)
Rename.
static bool constraintType(const word &patchType)
Return true if the given type is a constraint type.
#define WarningInFunction
Report a warning using Foam::Warning.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
A class for managing temporary objects.
const dimensionSet & dimensions() const noexcept
Return dimensions.