diff --git a/src/foam/interpolations/interpolateXY/interpolateXY.C b/src/foam/interpolations/interpolateXY/interpolateXY.C index 3b73558dd..dc3683db1 100644 --- a/src/foam/interpolations/interpolateXY/interpolateXY.C +++ b/src/foam/interpolations/interpolateXY/interpolateXY.C @@ -34,21 +34,22 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // template -Field interpolateXY +tmp > interpolateXY ( const scalarField& xNew, const scalarField& xOld, const Field& yOld ) { - scalarField yNew(xNew.size()); + tmp > tyNew(new Field(xNew.size())); + Field& yNew = tyNew(); forAll(xNew, i) { yNew[i] = interpolateXY(xNew[i], xOld, yOld); } - return yNew; + return tyNew; } diff --git a/src/foam/interpolations/interpolateXY/interpolateXY.H b/src/foam/interpolations/interpolateXY/interpolateXY.H index 72cb1eb0f..d354dbfba 100644 --- a/src/foam/interpolations/interpolateXY/interpolateXY.H +++ b/src/foam/interpolations/interpolateXY/interpolateXY.H @@ -47,7 +47,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // template -Field interpolateXY +tmp > interpolateXY ( const scalarField& xNew, const scalarField& xOld,