OpenFOAM-4.x/applications/solvers/compressible/rhoCentralFoam/directionInterpolate.H
Henry Weller 7859083246 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.
2016-02-26 17:31:28 +00:00

32 lines
708 B
C++

namespace Foam
{
//- Interpolate field vf according to direction dir
template<class Type>
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> interpolate
(
const GeometricField<Type, fvPatchField, volMesh>& vf,
const surfaceScalarField& dir,
const word& reconFieldName = word::null
)
{
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> tsf
(
fvc::interpolate
(
vf,
dir,
"reconstruct("
+ (reconFieldName != word::null ? reconFieldName : vf.name())
+ ')'
)
);
GeometricField<Type, fvsPatchField, surfaceMesh>& sf = tsf.ref();
sf.rename(vf.name() + '_' + dir.name());
return tsf;
}
}