vectorTensorTransform: Inverse and tensor field transforms

This commit is contained in:
Will Bainbridge
2018-04-12 13:31:08 +01:00
parent 00645cdc1a
commit c2b169c8dd
2 changed files with 25 additions and 3 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -42,6 +42,7 @@ SourceFiles
#include "word.H"
#include "contiguous.H"
#include "pointField.H"
#include "transformField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -148,6 +149,10 @@ public:
template<class Type>
tmp<Field<Type>> transform(const Field<Type>&) const;
//- Inverse transform the given field
template<class Type>
tmp<Field<Type>> invTransform(const Field<Type>&) const;
// Member operators

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -33,7 +33,24 @@ Foam::tmp<Foam::Field<Type>> Foam::vectorTensorTransform::transform
{
if (hasR_)
{
return R() & fld;
return Foam::transform(R(), fld);
}
else
{
return fld;
}
}
template<class Type>
Foam::tmp<Foam::Field<Type>> Foam::vectorTensorTransform::invTransform
(
const Field<Type>& fld
) const
{
if (hasR_)
{
return Foam::transform(R().T(), fld);
}
else
{