mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
GeometricField: Added another constructor from tmp<GeometricField>
which supports re-using the internalField storage
This commit is contained in:
@ -422,7 +422,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
|
|||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
InfoInFunction
|
InfoInFunction
|
||||||
<< "Constructing as copy" << endl << this->info() << endl;
|
<< "Constructing from tmp" << endl << this->info() << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->writeOpt() = IOobject::NO_WRITE;
|
this->writeOpt() = IOobject::NO_WRITE;
|
||||||
@ -634,6 +634,47 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef NoConstructFromTmp
|
||||||
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
|
||||||
|
(
|
||||||
|
const IOobject& io,
|
||||||
|
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf,
|
||||||
|
const wordList& patchFieldTypes,
|
||||||
|
const wordList& actualPatchTypes
|
||||||
|
)
|
||||||
|
:
|
||||||
|
DimensionedField<Type, GeoMesh>
|
||||||
|
(
|
||||||
|
io,
|
||||||
|
const_cast<GeometricField<Type, PatchField, GeoMesh>&>(tgf()),
|
||||||
|
tgf.isTmp()
|
||||||
|
),
|
||||||
|
timeIndex_(tgf().timeIndex()),
|
||||||
|
field0Ptr_(NULL),
|
||||||
|
fieldPrevIterPtr_(NULL),
|
||||||
|
boundaryField_
|
||||||
|
(
|
||||||
|
this->mesh().boundary(),
|
||||||
|
*this,
|
||||||
|
patchFieldTypes,
|
||||||
|
actualPatchTypes
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
InfoInFunction
|
||||||
|
<< "Constructing from tmp resetting IO params and patch types"
|
||||||
|
<< endl << this->info() << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
boundaryField_ == tgf().boundaryField_;
|
||||||
|
|
||||||
|
tgf.clear();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type, template<class> class PatchField, class GeoMesh>
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
|||||||
@ -411,6 +411,17 @@ public:
|
|||||||
const wordList& actualPatchTypes = wordList()
|
const wordList& actualPatchTypes = wordList()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Construct as copy resetting IO parameters and boundary types
|
||||||
|
#ifndef NoConstructFromTmp
|
||||||
|
GeometricField
|
||||||
|
(
|
||||||
|
const IOobject&,
|
||||||
|
const tmp<GeometricField<Type, PatchField, GeoMesh>>&,
|
||||||
|
const wordList& patchFieldTypes,
|
||||||
|
const wordList& actualPatchTypes = wordList()
|
||||||
|
);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~GeometricField();
|
virtual ~GeometricField();
|
||||||
|
|||||||
Reference in New Issue
Block a user