GeometricField: corrected assignment to tmp which wraps a non-tmp

This commit is contained in:
Henry Weller 2017-02-22 13:20:49 +00:00
parent 5991e30fc1
commit 12dd3c9c6b

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -1164,11 +1164,18 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::operator=
this->dimensions() = gf.dimensions(); this->dimensions() = gf.dimensions();
// Transfer the storage from the tmp if (tgf.isTmp())
primitiveFieldRef().transfer {
( // Transfer the storage from the tmp
const_cast<Field<Type>&>(gf.primitiveField()) primitiveFieldRef().transfer
); (
const_cast<Field<Type>&>(gf.primitiveField())
);
}
else
{
primitiveFieldRef() = gf.primitiveField();
}
boundaryFieldRef() = gf.boundaryField(); boundaryFieldRef() = gf.boundaryField();