STYLE: modernize code for tmp reuse functions (#1160)

- use forwarding tmp factory methods
This commit is contained in:
Mark Olesen
2019-01-10 17:06:04 +01:00
parent fcf4c5fb22
commit 35fc2d1be2
4 changed files with 251 additions and 378 deletions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2018-2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -33,47 +33,9 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class TypeR, class GeoMesh>
tmp<DimensionedField<TypeR, GeoMesh>> New
(
const tmp<DimensionedField<TypeR, GeoMesh>>& tdf1,
const word& name,
const dimensionSet& dimensions
)
{
if (tdf1.isTmp())
{
auto& df1 = tdf1.constCast();
df1.rename(name);
df1.dimensions().reset(dimensions);
return tdf1;
}
const auto& df1 = tdf1();
return tmp<DimensionedField<TypeR, GeoMesh>>
(
new DimensionedField<TypeR, GeoMesh>
(
IOobject
(
name,
df1.instance(),
df1.db()
),
df1.mesh(),
dimensions
)
);
}
template<class TypeR, class Type1, class GeoMesh>
class reuseTmpDimensionedField
struct reuseTmpDimensionedField
{
public:
static tmp<DimensionedField<TypeR, GeoMesh>> New
(
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1,
@ -83,29 +45,24 @@ public:
{
const auto& df1 = tdf1();
return tmp<DimensionedField<TypeR, GeoMesh>>
return tmp<DimensionedField<TypeR, GeoMesh>>::New
(
new DimensionedField<TypeR, GeoMesh>
IOobject
(
IOobject
(
name,
df1.instance(),
df1.db()
),
df1.mesh(),
dimensions
)
name,
df1.instance(),
df1.db()
),
df1.mesh(),
dimensions
);
}
};
template<class TypeR, class GeoMesh>
class reuseTmpDimensionedField<TypeR, TypeR, GeoMesh>
struct reuseTmpDimensionedField<TypeR, TypeR, GeoMesh>
{
public:
static tmp<DimensionedField<TypeR, GeoMesh>> New
(
const tmp<DimensionedField<TypeR, GeoMesh>>& tdf1,
@ -124,29 +81,42 @@ public:
const auto& df1 = tdf1();
return tmp<DimensionedField<TypeR, GeoMesh>>
return tmp<DimensionedField<TypeR, GeoMesh>>::New
(
new DimensionedField<TypeR, GeoMesh>
IOobject
(
IOobject
(
name,
df1.instance(),
df1.db()
),
df1.mesh(),
dimensions
)
name,
df1.instance(),
df1.db()
),
df1.mesh(),
dimensions
);
}
};
template<class TypeR, class Type1, class Type12, class Type2, class GeoMesh>
class reuseTmpTmpDimensionedField
//- Global function forwards to reuseTmpDimensionedField::New
template<class TypeR, class GeoMesh>
tmp<DimensionedField<TypeR, GeoMesh>> New
(
const tmp<DimensionedField<TypeR, GeoMesh>>& tdf1,
const word& name,
const dimensionSet& dimensions
)
{
public:
return reuseTmpDimensionedField<TypeR, TypeR, GeoMesh>::New
(
tdf1,
name,
dimensions
);
}
template<class TypeR, class Type1, class Type12, class Type2, class GeoMesh>
struct reuseTmpTmpDimensionedField
{
static tmp<DimensionedField<TypeR, GeoMesh>> New
(
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1,
@ -157,29 +127,24 @@ public:
{
const auto& df1 = tdf1();
return tmp<DimensionedField<TypeR, GeoMesh>>
return tmp<DimensionedField<TypeR, GeoMesh>>::New
(
new DimensionedField<TypeR, GeoMesh>
IOobject
(
IOobject
(
name,
df1.instance(),
df1.db()
),
df1.mesh(),
dimensions
)
name,
df1.instance(),
df1.db()
),
df1.mesh(),
dimensions
);
}
};
template<class TypeR, class Type1, class Type12, class GeoMesh>
class reuseTmpTmpDimensionedField<TypeR, Type1, Type12, TypeR, GeoMesh>
struct reuseTmpTmpDimensionedField<TypeR, Type1, Type12, TypeR, GeoMesh>
{
public:
static tmp<DimensionedField<TypeR, GeoMesh>> New
(
const tmp<DimensionedField<Type1, GeoMesh>>& tdf1,
@ -199,29 +164,24 @@ public:
const auto& df1 = tdf1();
return tmp<DimensionedField<TypeR, GeoMesh>>
return tmp<DimensionedField<TypeR, GeoMesh>>::New
(
new DimensionedField<TypeR, GeoMesh>
IOobject
(
IOobject
(
name,
df1.instance(),
df1.db()
),
df1.mesh(),
dimensions
)
name,
df1.instance(),
df1.db()
),
df1.mesh(),
dimensions
);
}
};
template<class TypeR, class Type2, class GeoMesh>
class reuseTmpTmpDimensionedField<TypeR, TypeR, TypeR, Type2, GeoMesh>
struct reuseTmpTmpDimensionedField<TypeR, TypeR, TypeR, Type2, GeoMesh>
{
public:
static tmp<DimensionedField<TypeR, GeoMesh>> New
(
const tmp<DimensionedField<TypeR, GeoMesh>>& tdf1,
@ -241,29 +201,24 @@ public:
const auto& df1 = tdf1();
return tmp<DimensionedField<TypeR, GeoMesh>>
return tmp<DimensionedField<TypeR, GeoMesh>>::New
(
new DimensionedField<TypeR, GeoMesh>
IOobject
(
IOobject
(
name,
df1.instance(),
df1.db()
),
df1.mesh(),
dimensions
)
name,
df1.instance(),
df1.db()
),
df1.mesh(),
dimensions
);
}
};
template<class TypeR, class GeoMesh>
class reuseTmpTmpDimensionedField<TypeR, TypeR, TypeR, TypeR, GeoMesh>
struct reuseTmpTmpDimensionedField<TypeR, TypeR, TypeR, TypeR, GeoMesh>
{
public:
static tmp<DimensionedField<TypeR, GeoMesh>> New
(
const tmp<DimensionedField<TypeR, GeoMesh>>& tdf1,
@ -291,19 +246,16 @@ public:
const auto& df1 = tdf1();
return tmp<DimensionedField<TypeR, GeoMesh>>
return tmp<DimensionedField<TypeR, GeoMesh>>::New
(
new DimensionedField<TypeR, GeoMesh>
IOobject
(
IOobject
(
name,
df1.instance(),
df1.db()
),
df1.mesh(),
dimensions
)
name,
df1.instance(),
df1.db()
),
df1.mesh(),
dimensions
);
}
};

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2018-2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -33,58 +33,26 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<template<class> class Field, class TypeR>
tmp<FieldField<Field, TypeR>> New
(
const tmp<FieldField<Field, TypeR>>& tf1,
const bool initRet = false
)
{
if (tf1.isTmp())
{
return tf1;
}
tmp<FieldField<Field, TypeR>> rtf
(
FieldField<Field, TypeR>::NewCalculatedType(tf1())
);
if (initRet)
{
rtf.ref() = tf1();
}
return rtf;
}
template<template<class> class Field, class TypeR, class Type1>
class reuseTmpFieldField
struct reuseTmpFieldField
{
public:
static tmp<FieldField<Field, TypeR>> New
(
const tmp<FieldField<Field, Type1>>& tf1
)
{
return tmp<FieldField<Field, TypeR>>
(
FieldField<Field, TypeR>::NewCalculatedType(tf1())
);
return FieldField<Field, TypeR>::NewCalculatedType(tf1());
}
};
template<template<class> class Field, class TypeR>
class reuseTmpFieldField<Field, TypeR, TypeR>
struct reuseTmpFieldField<Field, TypeR, TypeR>
{
public:
static tmp<FieldField<Field, TypeR>> New
(
const tmp<FieldField<Field, TypeR>>& tf1
const tmp<FieldField<Field, TypeR>>& tf1,
const bool initCopy = false
)
{
if (tf1.isTmp())
@ -92,14 +60,30 @@ public:
return tf1;
}
return tmp<FieldField<Field, TypeR>>
(
FieldField<Field, TypeR>::NewCalculatedType(tf1())
);
auto rtf = FieldField<Field, TypeR>::NewCalculatedType(tf1());
if (initCopy)
{
rtf.ref() = tf1();
}
return rtf;
}
};
//- Global function forwards to reuseTmpFieldField::New
template<template<class> class Field, class TypeR>
tmp<FieldField<Field, TypeR>> New
(
const tmp<FieldField<Field, TypeR>>& tf1,
const bool initCopy = false
)
{
return reuseTmpFieldField<Field, TypeR, TypeR>::New(tf1, initCopy);
}
template
<
template<class> class Field,
@ -108,29 +92,22 @@ template
class Type12,
class Type2
>
class reuseTmpTmpFieldField
struct reuseTmpTmpFieldField
{
public:
static tmp<FieldField<Field, TypeR>> New
(
const tmp<FieldField<Field, Type1>>& tf1,
const tmp<FieldField<Field, Type2>>& tf2
)
{
return tmp<FieldField<Field, TypeR>>
(
FieldField<Field, TypeR>::NewCalculatedType(tf1())
);
return FieldField<Field, TypeR>::NewCalculatedType(tf1());
}
};
template<template<class> class Field, class TypeR, class Type1, class Type12>
class reuseTmpTmpFieldField<Field, TypeR, Type1, Type12, TypeR>
struct reuseTmpTmpFieldField<Field, TypeR, Type1, Type12, TypeR>
{
public:
static tmp<FieldField<Field, TypeR>> New
(
const tmp<FieldField<Field, Type1>>& tf1,
@ -142,19 +119,14 @@ public:
return tf2;
}
return tmp<FieldField<Field, TypeR>>
(
FieldField<Field, TypeR>::NewCalculatedType(tf1())
);
return FieldField<Field, TypeR>::NewCalculatedType(tf1());
}
};
template<template<class> class Field, class TypeR, class Type2>
class reuseTmpTmpFieldField<Field, TypeR, TypeR, TypeR, Type2>
struct reuseTmpTmpFieldField<Field, TypeR, TypeR, TypeR, Type2>
{
public:
static tmp<FieldField<Field, TypeR>> New
(
const tmp<FieldField<Field, TypeR>>& tf1,
@ -166,19 +138,14 @@ public:
return tf1;
}
return tmp<FieldField<Field, TypeR>>
(
FieldField<Field, TypeR>::NewCalculatedType(tf1())
);
return FieldField<Field, TypeR>::NewCalculatedType(tf1());
}
};
template<template<class> class Field, class TypeR>
class reuseTmpTmpFieldField<Field, TypeR, TypeR, TypeR, TypeR>
struct reuseTmpTmpFieldField<Field, TypeR, TypeR, TypeR, TypeR>
{
public:
static tmp<FieldField<Field, TypeR>> New
(
const tmp<FieldField<Field, TypeR>>& tf1,
@ -194,10 +161,7 @@ public:
return tf2;
}
return tmp<FieldField<Field, TypeR>>
(
FieldField<Field, TypeR>::NewCalculatedType(tf1())
);
return FieldField<Field, TypeR>::NewCalculatedType(tf1());
}
};

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -33,79 +33,70 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class TypeR>
tmp<Field<TypeR>> New
(
const tmp<Field<TypeR>>& tf1,
const bool initRet = false
)
{
if (tf1.isTmp())
{
return tf1;
}
tmp<Field<TypeR>> rtf(new Field<TypeR>(tf1().size()));
if (initRet)
{
rtf.ref() = tf1();
}
return rtf;
}
template<class TypeR, class Type1>
class reuseTmp
struct reuseTmp
{
public:
static tmp<Field<TypeR>> New(const tmp<Field<Type1>>& tf1)
{
return tmp<Field<TypeR>>(new Field<TypeR>(tf1().size()));
return tmp<Field<TypeR>>::New(tf1().size());
}
};
template<class TypeR>
class reuseTmp<TypeR, TypeR>
struct reuseTmp<TypeR, TypeR>
{
public:
static tmp<Field<TypeR>> New(const tmp<Field<TypeR>>& tf1)
static tmp<Field<TypeR>> New
(
const tmp<Field<TypeR>>& tf1,
const bool initCopy = false
)
{
if (tf1.isTmp())
{
return tf1;
}
return tmp<Field<TypeR>>(new Field<TypeR>(tf1().size()));
auto rtf = tmp<Field<TypeR>>::New(tf1().size());
if (initCopy)
{
rtf.ref() = tf1();
}
return rtf;
}
};
template<class TypeR, class Type1, class Type12, class Type2>
class reuseTmpTmp
//- This global function forwards to reuseTmp::New
template<class TypeR> tmp<Field<TypeR>> New
(
const tmp<Field<TypeR>>& tf1,
const bool initCopy = false
)
{
public:
return reuseTmp<TypeR, TypeR>::New(tf1, initCopy);
}
template<class TypeR, class Type1, class Type12, class Type2>
struct reuseTmpTmp
{
static tmp<Field<TypeR>> New
(
const tmp<Field<Type1>>& tf1,
const tmp<Field<Type2>>& tf2
)
{
return tmp<Field<TypeR>>(new Field<TypeR>(tf1().size()));
return tmp<Field<TypeR>>::New(tf1().size());
}
};
template<class TypeR, class Type1, class Type12>
class reuseTmpTmp<TypeR, Type1, Type12, TypeR>
struct reuseTmpTmp<TypeR, Type1, Type12, TypeR>
{
public:
static tmp<Field<TypeR>> New
(
const tmp<Field<Type1>>& tf1,
@ -117,16 +108,14 @@ public:
return tf2;
}
return tmp<Field<TypeR>>(new Field<TypeR>(tf1().size()));
return tmp<Field<TypeR>>::New(tf1().size());
}
};
template<class TypeR, class Type2>
class reuseTmpTmp<TypeR, TypeR, TypeR, Type2>
struct reuseTmpTmp<TypeR, TypeR, TypeR, Type2>
{
public:
static tmp<Field<TypeR>> New
(
const tmp<Field<TypeR>>& tf1,
@ -138,16 +127,14 @@ public:
return tf1;
}
return tmp<Field<TypeR>>(new Field<TypeR>(tf1().size()));
return tmp<Field<TypeR>>::New(tf1().size());
}
};
template<class TypeR>
class reuseTmpTmp<TypeR, TypeR, TypeR, TypeR>
struct reuseTmpTmp<TypeR, TypeR, TypeR, TypeR>
{
public:
static tmp<Field<TypeR>> New
(
const tmp<Field<TypeR>>& tf1,
@ -163,7 +150,7 @@ public:
return tf2;
}
return tmp<Field<TypeR>>(new Field<TypeR>(tf1().size()));
return tmp<Field<TypeR>>::New(tf1().size());
}
};

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2018-2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -33,6 +33,11 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Test if a tmp GeometricField is reusable, which means that it has been
//- allocated (not a const-reference).
//
// When GeometricField debug is on, also checks that the patches have
// reusable types.
template
<
class Type,
@ -45,20 +50,17 @@ bool reusable(const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf)
{
if (GeometricField<Type, PatchField, GeoMesh>::debug)
{
const auto& gf = tgf();
const auto& gbf = gf.boundaryField();
forAll(gbf, patchi)
for (const auto& p : tgf().boundaryField())
{
if
(
!polyPatch::constraintType(gbf[patchi].patch().type())
&& !isA<typename PatchField<Type>::Calculated>(gbf[patchi])
!polyPatch::constraintType(p.patch().type())
&& !isA<typename PatchField<Type>::Calculated>(p)
)
{
WarningInFunction
<< "Attempt to reuse temporary with non-reusable BC "
<< gbf[patchi].type() << endl;
<< p.type() << endl;
return false;
}
@ -72,50 +74,6 @@ bool reusable(const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf)
}
template<class TypeR, template<class> class PatchField, class GeoMesh>
tmp<GeometricField<TypeR, PatchField, GeoMesh>> New
(
const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& tgf1,
const word& name,
const dimensionSet& dimensions,
const bool initRet = false
)
{
if (reusable(tgf1))
{
auto& gf1 = tgf1.constCast();
gf1.rename(name);
gf1.dimensions().reset(dimensions);
return tgf1;
}
const auto& gf1 = tgf1();
tmp<GeometricField<TypeR, PatchField, GeoMesh>> rtgf
(
new GeometricField<TypeR, PatchField, GeoMesh>
(
IOobject
(
name,
gf1.instance(),
gf1.db()
),
gf1.mesh(),
dimensions
)
);
if (initRet)
{
rtgf.ref() == gf1;
}
return rtgf;
}
template
<
class TypeR,
@ -123,10 +81,8 @@ template
template<class> class PatchField,
class GeoMesh
>
class reuseTmpGeometricField
struct reuseTmpGeometricField
{
public:
static tmp<GeometricField<TypeR, PatchField, GeoMesh>> New
(
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tgf1,
@ -136,34 +92,32 @@ public:
{
const auto& gf1 = tgf1();
return tmp<GeometricField<TypeR, PatchField, GeoMesh>>
return tmp<GeometricField<TypeR, PatchField, GeoMesh>>::New
(
new GeometricField<TypeR, PatchField, GeoMesh>
IOobject
(
IOobject
(
name,
gf1.instance(),
gf1.db()
),
gf1.mesh(),
dimensions
)
name,
gf1.instance(),
gf1.db()
),
gf1.mesh(),
dimensions
);
}
};
template<class TypeR, template<class> class PatchField, class GeoMesh>
class reuseTmpGeometricField<TypeR, TypeR, PatchField, GeoMesh>
struct reuseTmpGeometricField<TypeR, TypeR, PatchField, GeoMesh>
{
public:
//- Since the input and output types are identical, also allow
//- optional copy assignment of the initial content.
static tmp<GeometricField<TypeR, PatchField, GeoMesh>> New
(
const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& tgf1,
const word& name,
const dimensionSet& dimensions
const dimensionSet& dimensions,
const bool initCopy = false
)
{
if (reusable(tgf1))
@ -177,24 +131,51 @@ public:
const auto& gf1 = tgf1();
return tmp<GeometricField<TypeR, PatchField, GeoMesh>>
auto rtgf = tmp<GeometricField<TypeR, PatchField, GeoMesh>>::New
(
new GeometricField<TypeR, PatchField, GeoMesh>
IOobject
(
IOobject
(
name,
gf1.instance(),
gf1.db()
),
gf1.mesh(),
dimensions
)
name,
gf1.instance(),
gf1.db()
),
gf1.mesh(),
dimensions
);
if (initCopy)
{
rtgf.ref() == gf1;
}
return rtgf;
}
};
//- This global function forwards to reuseTmpGeometricField::New
template<class TypeR, template<class> class PatchField, class GeoMesh>
tmp
<
GeometricField<TypeR, PatchField, GeoMesh>
> New
(
const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& tgf1,
const word& name,
const dimensionSet& dimensions,
const bool initCopy = false
)
{
return reuseTmpGeometricField<TypeR, TypeR, PatchField, GeoMesh>::New
(
tgf1,
name,
dimensions,
initCopy
);
}
template
<
class TypeR,
@ -204,10 +185,8 @@ template
template<class> class PatchField,
class GeoMesh
>
class reuseTmpTmpGeometricField
struct reuseTmpTmpGeometricField
{
public:
static tmp<GeometricField<TypeR, PatchField, GeoMesh>> New
(
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tgf1,
@ -218,19 +197,16 @@ public:
{
const auto& gf1 = tgf1();
return tmp<GeometricField<TypeR, PatchField, GeoMesh>>
return tmp<GeometricField<TypeR, PatchField, GeoMesh>>::New
(
new GeometricField<TypeR, PatchField, GeoMesh>
IOobject
(
IOobject
(
name,
gf1.instance(),
gf1.db()
),
gf1.mesh(),
dimensions
)
name,
gf1.instance(),
gf1.db()
),
gf1.mesh(),
dimensions
);
}
};
@ -244,11 +220,11 @@ template
template<class> class PatchField,
class GeoMesh
>
class reuseTmpTmpGeometricField
<TypeR, Type1, Type12, TypeR, PatchField, GeoMesh>
struct reuseTmpTmpGeometricField
<
TypeR, Type1, Type12, TypeR, PatchField, GeoMesh
>
{
public:
static tmp<GeometricField<TypeR, PatchField, GeoMesh>> New
(
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tgf1,
@ -268,19 +244,16 @@ public:
const auto& gf1 = tgf1();
return tmp<GeometricField<TypeR, PatchField, GeoMesh>>
return tmp<GeometricField<TypeR, PatchField, GeoMesh>>::New
(
new GeometricField<TypeR, PatchField, GeoMesh>
IOobject
(
IOobject
(
name,
gf1.instance(),
gf1.db()
),
gf1.mesh(),
dimensions
)
name,
gf1.instance(),
gf1.db()
),
gf1.mesh(),
dimensions
);
}
};
@ -293,10 +266,11 @@ template
template<class> class PatchField,
class GeoMesh
>
class reuseTmpTmpGeometricField<TypeR, TypeR, TypeR, Type2, PatchField, GeoMesh>
struct reuseTmpTmpGeometricField
<
TypeR, TypeR, TypeR, Type2, PatchField, GeoMesh
>
{
public:
static tmp<GeometricField<TypeR, PatchField, GeoMesh>> New
(
const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& tgf1,
@ -316,29 +290,27 @@ public:
const auto& gf1 = tgf1();
return tmp<GeometricField<TypeR, PatchField, GeoMesh>>
return tmp<GeometricField<TypeR, PatchField, GeoMesh>>::New
(
new GeometricField<TypeR, PatchField, GeoMesh>
IOobject
(
IOobject
(
name,
gf1.instance(),
gf1.db()
),
gf1.mesh(),
dimensions
)
name,
gf1.instance(),
gf1.db()
),
gf1.mesh(),
dimensions
);
}
};
template<class TypeR, template<class> class PatchField, class GeoMesh>
class reuseTmpTmpGeometricField<TypeR, TypeR, TypeR, TypeR, PatchField, GeoMesh>
struct reuseTmpTmpGeometricField
<
TypeR, TypeR, TypeR, TypeR, PatchField, GeoMesh
>
{
public:
static tmp<GeometricField<TypeR, PatchField, GeoMesh>> New
(
const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& tgf1,
@ -366,24 +338,22 @@ public:
const auto& gf1 = tgf1();
return tmp<GeometricField<TypeR, PatchField, GeoMesh>>
return tmp<GeometricField<TypeR, PatchField, GeoMesh>>::New
(
new GeometricField<TypeR, PatchField, GeoMesh>
IOobject
(
IOobject
(
name,
gf1.instance(),
gf1.db()
),
gf1.mesh(),
dimensions
)
name,
gf1.instance(),
gf1.db()
),
gf1.mesh(),
dimensions
);
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam