Bugfix and improvement in interpolateXY function that returns a field. Vuko Vukcevic
This commit is contained in:
commit
2fea87c674
2 changed files with 5 additions and 4 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Reference in a new issue