Bugfix and improvement in interpolateXY function that returns a field. Vuko Vukcevic

This commit is contained in:
Hrvoje Jasak 2019-02-13 15:51:10 +00:00
commit 2fea87c674
2 changed files with 5 additions and 4 deletions

View file

@ -34,21 +34,22 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> template<class Type>
Field<Type> interpolateXY tmp<Field<Type> > interpolateXY
( (
const scalarField& xNew, const scalarField& xNew,
const scalarField& xOld, const scalarField& xOld,
const Field<Type>& yOld const Field<Type>& yOld
) )
{ {
scalarField yNew(xNew.size()); tmp<Field<Type> > tyNew(new Field<Type>(xNew.size()));
Field<Type>& yNew = tyNew();
forAll(xNew, i) forAll(xNew, i)
{ {
yNew[i] = interpolateXY(xNew[i], xOld, yOld); yNew[i] = interpolateXY(xNew[i], xOld, yOld);
} }
return yNew; return tyNew;
} }

View file

@ -47,7 +47,7 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> template<class Type>
Field<Type> interpolateXY tmp<Field<Type> > interpolateXY
( (
const scalarField& xNew, const scalarField& xNew,
const scalarField& xOld, const scalarField& xOld,