29#ifndef Foam_DimensionedFieldReuseFunctions_H
30#define Foam_DimensionedFieldReuseFunctions_H
40template<
class TypeR,
class Type1,
class GeoMesh>
67 const auto& f1 = tf1();
79template<
class TypeR,
class GeoMesh>
89 const bool initCopy =
false
94 auto& f1 = tf1.constCast();
97 f1.dimensions().reset(dimensions);
101 const auto& f1 = tf1();
112 tresult.ref().field() = f1.field();
121template<
class TypeR,
class GeoMesh>
122tmp<DimensionedField<TypeR, GeoMesh>>
New
127 const bool initCopy =
false
140template<
class TypeR,
class Type1,
class Type12,
class Type2,
class GeoMesh>
141struct reuseTmpTmpDimensionedField
151 const auto& f1 = tf1();
163template<
class TypeR,
class Type1,
class Type12,
class GeoMesh>
164struct reuseTmpTmpDimensionedField<TypeR, Type1, Type12, TypeR, GeoMesh>
176 auto& f2 = tf2.constCast();
179 f2.dimensions().reset(dimensions);
183 const auto& f1 = tf1();
195template<
class TypeR,
class Type2,
class GeoMesh>
196struct reuseTmpTmpDimensionedField<TypeR, TypeR, TypeR, Type2, GeoMesh>
208 auto& f1 = tf1.constCast();
211 f1.dimensions().reset(dimensions);
215 const auto& f1 = tf1();
227template<
class TypeR,
class GeoMesh>
228struct reuseTmpTmpDimensionedField<TypeR, TypeR, TypeR, TypeR, GeoMesh>
240 auto& f1 = tf1.constCast();
243 f1.dimensions().reset(dimensions);
248 auto& f2 = tf2.constCast();
251 f2.dimensions().reset(dimensions);
255 const auto& f1 = tf1();
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.
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....
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
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.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
static tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Allow optional copy assignment of the initial content for identical input and output types.
static tmp< DimensionedField< TypeR, GeoMesh > > New(const DimensionedField< Type1, GeoMesh > &f1, const word &name, const dimensionSet &dimensions)
Pass-through to New DimensionedField.
static tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< Type1, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions)
Dissimilar types: return new field.
static tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< Type1, GeoMesh > > &tf1, const tmp< DimensionedField< TypeR, GeoMesh > > &tf2, const word &name, const dimensionSet &dimensions)
static tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const tmp< DimensionedField< Type2, GeoMesh > > &tf2, const word &name, const dimensionSet &dimensions)
static tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const tmp< DimensionedField< TypeR, GeoMesh > > &tf2, const word &name, const dimensionSet &dimensions)
static tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< Type1, GeoMesh > > &tf1, const tmp< DimensionedField< Type2, GeoMesh > > &tf2, const word &name, const dimensionSet &dimensions)