vectorTensorTransform: Primitive transformations

This commit is contained in:
Will Bainbridge
2018-04-17 15:30:11 +01:00
parent 61f1fe8834
commit ab81dffe4e
2 changed files with 36 additions and 0 deletions

View File

@ -145,10 +145,18 @@ public:
//- Inverse transform the given pointField
inline pointField invTransformPosition(const pointField& pts) const;
//- Transform the given type
template<class Type>
Type transform(const Type&) const;
//- Transform the given field
template<class Type>
tmp<Field<Type>> transform(const Field<Type>&) const;
//- Inverse transform the given type
template<class Type>
Type invTransform(const Type&) const;
//- Inverse transform the given field
template<class Type>
tmp<Field<Type>> invTransform(const Field<Type>&) const;

View File

@ -25,6 +25,20 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Type Foam::vectorTensorTransform::transform(const Type& x) const
{
if (hasR_)
{
return Foam::transform(R(), x);
}
else
{
return x;
}
}
template<class Type>
Foam::tmp<Foam::Field<Type>> Foam::vectorTensorTransform::transform
(
@ -42,6 +56,20 @@ Foam::tmp<Foam::Field<Type>> Foam::vectorTensorTransform::transform
}
template<class Type>
Type Foam::vectorTensorTransform::invTransform(const Type& x) const
{
if (hasR_)
{
return Foam::transform(R().T(), x);
}
else
{
return x;
}
}
template<class Type>
Foam::tmp<Foam::Field<Type>> Foam::vectorTensorTransform::invTransform
(