OpenFOAM: Updated all libraries, solvers and utilities to use the new const-safe tmp

The deprecated non-const tmp functionality is now on the compiler switch
NON_CONST_TMP which can be enabled by adding -DNON_CONST_TMP to EXE_INC
in the Make/options file.  However, it is recommended to upgrade all
code to the new safer tmp by using the '.ref()' member function rather
than the non-const '()' dereference operator when non-const access to
the temporary object is required.

Please report any problems on Mantis.

Henry G. Weller
CFD Direct.
This commit is contained in:
Henry Weller
2016-02-26 17:31:28 +00:00
parent f4ba71ddd0
commit cd852be3da
169 changed files with 511 additions and 477 deletions

View File

@ -53,8 +53,8 @@ volField
(
meshSubsetter.interpolate(vf)
);
tfld().checkOut();
tfld().rename(vf.name());
tfld.ref().checkOut();
tfld.ref().rename(vf.name());
return tfld;
}
else
@ -729,7 +729,7 @@ void ensightField
(
volPointInterpolation::New(vf.mesh()).interpolate(vf)
);
pfld().rename(vf.name());
pfld.ref().rename(vf.name());
ensightPointField<Type>
(

View File

@ -37,7 +37,7 @@ Foam::tmp<Field<Type>> Foam::surfaceMeshWriter::getFaceField
const polyBoundaryMesh& patches = sfld.mesh().boundaryMesh();
tmp<Field<Type>> tfld(new Field<Type>(pp_.size()));
Field<Type>& fld = tfld();
Field<Type>& fld = tfld.ref();
forAll(pp_.addressing(), i)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -157,7 +157,7 @@ public:
if (useSubMesh())
{
tmp<GeoField> subFld = subsetter_.interpolate(fld);
subFld().rename(fld.name());
subFld.ref().rename(fld.name());
return subFld;
}
else