mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add invTransform for fields (#1076)
This commit is contained in:
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -21,141 +21,260 @@ License
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Description
|
|
||||||
Spatial transformation functions for FieldField.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "transformFieldField.H"
|
#include "transformFieldField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * global functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<template<class> class Field, class Type>
|
template<template<class> class Field, class Type>
|
||||||
void transform
|
void Foam::transform
|
||||||
(
|
(
|
||||||
FieldField<Field, Type>& rtf,
|
FieldField<Field, Type>& result,
|
||||||
const FieldField<Field, tensor>& trf,
|
const tensor& rot,
|
||||||
const FieldField<Field, Type>& tf
|
const FieldField<Field, Type>& fld
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
forAll(rtf, i)
|
forAll(result, i)
|
||||||
{
|
{
|
||||||
transform(rtf[i], trf[i], tf[i]);
|
transform(result[i], rot, fld[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<template<class> class Field, class Type>
|
template<template<class> class Field, class Type>
|
||||||
tmp<FieldField<Field, Type>> transform
|
void Foam::transform
|
||||||
(
|
(
|
||||||
const FieldField<Field, tensor>& trf,
|
FieldField<Field, Type>& result,
|
||||||
const FieldField<Field, Type>& tf
|
const FieldField<Field, tensor>& rot,
|
||||||
|
const FieldField<Field, Type>& fld
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
tmp<FieldField<Field, Type>> tranf
|
forAll(result, i)
|
||||||
(
|
|
||||||
FieldField<Field, Type>::NewCalculatedType(tf)
|
|
||||||
);
|
|
||||||
transform(tranf(), trf, tf);
|
|
||||||
return tranf;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<template<class> class Field, class Type>
|
|
||||||
tmp<FieldField<Field, Type>> transform
|
|
||||||
(
|
|
||||||
const FieldField<Field, tensor>& trf,
|
|
||||||
const tmp<FieldField<Field, Type>>& ttf
|
|
||||||
)
|
|
||||||
{
|
|
||||||
tmp<FieldField<Field, Type>> tranf(ttf.ptr());
|
|
||||||
transform(tranf(), trf, tranf());
|
|
||||||
return tranf;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<template<class> class Field, class Type>
|
|
||||||
tmp<FieldField<Field, Type>> transform
|
|
||||||
(
|
|
||||||
const tmp<FieldField<Field, tensor>>& ttrf,
|
|
||||||
const FieldField<Field, Type>& tf
|
|
||||||
)
|
|
||||||
{
|
|
||||||
tmp<FieldField<Field, Type>> tranf
|
|
||||||
(
|
|
||||||
FieldField<Field, Type>::NewCalculatedType(tf)
|
|
||||||
);
|
|
||||||
transform(tranf(), ttrf(), tf);
|
|
||||||
ttrf.clear();
|
|
||||||
return tranf;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<template<class> class Field, class Type>
|
|
||||||
tmp<FieldField<Field, Type>> transform
|
|
||||||
(
|
|
||||||
const tmp<FieldField<Field, tensor>>& ttrf,
|
|
||||||
const tmp<FieldField<Field, Type>>& ttf
|
|
||||||
)
|
|
||||||
{
|
|
||||||
tmp<FieldField<Field, Type>> tranf(ttf.ptr());
|
|
||||||
transform(tranf(), ttrf(), tranf());
|
|
||||||
ttrf.clear();
|
|
||||||
return tranf;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<template<class> class Field, class Type>
|
|
||||||
void transform
|
|
||||||
(
|
|
||||||
FieldField<Field, Type>& rtf,
|
|
||||||
const tensor& t,
|
|
||||||
const FieldField<Field, Type>& tf
|
|
||||||
)
|
|
||||||
{
|
|
||||||
forAll(rtf, i)
|
|
||||||
{
|
{
|
||||||
transform(rtf[i], t, tf[i]);
|
transform(result[i], rot[i], fld[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<template<class> class Field, class Type>
|
template<template<class> class Field, class Type>
|
||||||
tmp<FieldField<Field, Type>> transform
|
Foam::tmp<Foam::FieldField<Field, Type>>
|
||||||
|
Foam::transform
|
||||||
(
|
(
|
||||||
const tensor& t,
|
const FieldField<Field, tensor>& rot,
|
||||||
const FieldField<Field, Type>& tf
|
const FieldField<Field, Type>& fld
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
tmp<FieldField<Field, Type>> tranf
|
tmp<FieldField<Field, Type>> tranf
|
||||||
(
|
(
|
||||||
FieldField<Field, Type>::NewCalculatedType(tf)
|
FieldField<Field, Type>::NewCalculatedType(fld)
|
||||||
);
|
);
|
||||||
transform(tranf(), t, tf);
|
transform(tranf(), rot, fld);
|
||||||
return tranf;
|
return tranf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<template<class> class Field, class Type>
|
template<template<class> class Field, class Type>
|
||||||
tmp<FieldField<Field, Type>> transform
|
Foam::tmp<Foam::FieldField<Field, Type>>
|
||||||
|
Foam::transform
|
||||||
(
|
(
|
||||||
const tensor& t,
|
const FieldField<Field, tensor>& rot,
|
||||||
const tmp<FieldField<Field, Type>>& ttf
|
const tmp<FieldField<Field, Type>>& tfld
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
tmp<FieldField<Field, Type>> tranf(ttf.ptr());
|
tmp<FieldField<Field, Type>> tresult(tfld.ptr());
|
||||||
transform(tranf(), t, tranf());
|
transform(tresult(), rot, tresult());
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<template<class> class Field, class Type>
|
||||||
|
Foam::tmp<Foam::FieldField<Field, Type>>
|
||||||
|
Foam::transform
|
||||||
|
(
|
||||||
|
const tmp<FieldField<Field, tensor>>& trot,
|
||||||
|
const FieldField<Field, Type>& fld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
tmp<FieldField<Field, Type>> tresult
|
||||||
|
(
|
||||||
|
FieldField<Field, Type>::NewCalculatedType(fld)
|
||||||
|
);
|
||||||
|
transform(tresult(), trot(), fld);
|
||||||
|
trot.clear();
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<template<class> class Field, class Type>
|
||||||
|
Foam::tmp<Foam::FieldField<Field, Type>>
|
||||||
|
Foam::transform
|
||||||
|
(
|
||||||
|
const tmp<FieldField<Field, tensor>>& trot,
|
||||||
|
const tmp<FieldField<Field, Type>>& tfld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
tmp<FieldField<Field, Type>> tresult(tfld.ptr());
|
||||||
|
transform(tresult(), trot(), tresult());
|
||||||
|
trot.clear();
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<template<class> class Field, class Type>
|
||||||
|
Foam::tmp<Foam::FieldField<Field, Type>>
|
||||||
|
Foam::transform
|
||||||
|
(
|
||||||
|
const tensor& rot,
|
||||||
|
const FieldField<Field, Type>& fld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
tmp<FieldField<Field, Type>> tresult
|
||||||
|
(
|
||||||
|
FieldField<Field, Type>::NewCalculatedType(fld)
|
||||||
|
);
|
||||||
|
transform(tresult(), rot, fld);
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<template<class> class Field, class Type>
|
||||||
|
Foam::tmp<Foam::FieldField<Field, Type>>
|
||||||
|
Foam::transform
|
||||||
|
(
|
||||||
|
const tensor& rot,
|
||||||
|
const tmp<FieldField<Field, Type>>& tfld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
tmp<FieldField<Field, Type>> tresult(tfld.ptr());
|
||||||
|
transform(tresult(), rot, tresult());
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<template<class> class Field, class Type>
|
||||||
|
void Foam::invTransform
|
||||||
|
(
|
||||||
|
FieldField<Field, Type>& result,
|
||||||
|
const tensor& rot,
|
||||||
|
const FieldField<Field, Type>& fld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
forAll(result, i)
|
||||||
|
{
|
||||||
|
invTransform(result[i], rot, fld[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<template<class> class Field, class Type>
|
||||||
|
void Foam::invTransform
|
||||||
|
(
|
||||||
|
FieldField<Field, Type>& result,
|
||||||
|
const FieldField<Field, tensor>& rot,
|
||||||
|
const FieldField<Field, Type>& fld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
forAll(result, i)
|
||||||
|
{
|
||||||
|
invTransform(result[i], rot[i], fld[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<template<class> class Field, class Type>
|
||||||
|
Foam::tmp<Foam::FieldField<Field, Type>>
|
||||||
|
Foam::invTransform
|
||||||
|
(
|
||||||
|
const FieldField<Field, tensor>& rot,
|
||||||
|
const FieldField<Field, Type>& fld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
tmp<FieldField<Field, Type>> tranf
|
||||||
|
(
|
||||||
|
FieldField<Field, Type>::NewCalculatedType(fld)
|
||||||
|
);
|
||||||
|
invTransform(tranf(), rot, fld);
|
||||||
return tranf;
|
return tranf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
template<template<class> class Field, class Type>
|
||||||
|
Foam::tmp<Foam::FieldField<Field, Type>>
|
||||||
|
Foam::invTransform
|
||||||
|
(
|
||||||
|
const FieldField<Field, tensor>& rot,
|
||||||
|
const tmp<FieldField<Field, Type>>& tfld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
tmp<FieldField<Field, Type>> tresult(tfld.ptr());
|
||||||
|
invTransform(tresult(), rot, tresult());
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<template<class> class Field, class Type>
|
||||||
|
Foam::tmp<Foam::FieldField<Field, Type>>
|
||||||
|
Foam::invTransform
|
||||||
|
(
|
||||||
|
const tmp<FieldField<Field, tensor>>& trot,
|
||||||
|
const FieldField<Field, Type>& fld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
tmp<FieldField<Field, Type>> tresult
|
||||||
|
(
|
||||||
|
FieldField<Field, Type>::NewCalculatedType(fld)
|
||||||
|
);
|
||||||
|
invTransform(tresult(), trot(), fld);
|
||||||
|
trot.clear();
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<template<class> class Field, class Type>
|
||||||
|
Foam::tmp<Foam::FieldField<Field, Type>>
|
||||||
|
Foam::invTransform
|
||||||
|
(
|
||||||
|
const tmp<FieldField<Field, tensor>>& trot,
|
||||||
|
const tmp<FieldField<Field, Type>>& tfld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
tmp<FieldField<Field, Type>> tresult(tfld.ptr());
|
||||||
|
invTransform(tresult(), trot(), tresult());
|
||||||
|
trot.clear();
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<template<class> class Field, class Type>
|
||||||
|
Foam::tmp<Foam::FieldField<Field, Type>>
|
||||||
|
Foam::invTransform
|
||||||
|
(
|
||||||
|
const tensor& rot,
|
||||||
|
const FieldField<Field, Type>& fld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
tmp<FieldField<Field, Type>> tresult
|
||||||
|
(
|
||||||
|
FieldField<Field, Type>::NewCalculatedType(fld)
|
||||||
|
);
|
||||||
|
invTransform(tresult(), rot, fld);
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<template<class> class Field, class Type>
|
||||||
|
Foam::tmp<Foam::FieldField<Field, Type>>
|
||||||
|
Foam::invTransform
|
||||||
|
(
|
||||||
|
const tensor& rot,
|
||||||
|
const tmp<FieldField<Field, Type>>& tfld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
tmp<FieldField<Field, Type>> tresult(tfld.ptr());
|
||||||
|
invTransform(tresult(), rot, tresult());
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -46,63 +46,127 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<template<class> class Field, class Type>
|
// transform()
|
||||||
void transform
|
|
||||||
(
|
|
||||||
FieldField<Field, Type>&,
|
|
||||||
const FieldField<Field, tensor>&,
|
|
||||||
const FieldField<Field, Type>&
|
|
||||||
);
|
|
||||||
|
|
||||||
template<template<class> class Field, class Type>
|
|
||||||
tmp<FieldField<Field, Type>> transform
|
|
||||||
(
|
|
||||||
const FieldField<Field, tensor>&,
|
|
||||||
const FieldField<Field, Type>&
|
|
||||||
);
|
|
||||||
|
|
||||||
template<template<class> class Field, class Type>
|
|
||||||
tmp<FieldField<Field, Type>> transform
|
|
||||||
(
|
|
||||||
const FieldField<Field, tensor>&,
|
|
||||||
const tmp<FieldField<Field, Type>>&
|
|
||||||
);
|
|
||||||
|
|
||||||
template<template<class> class Field, class Type>
|
|
||||||
tmp<FieldField<Field, Type>> transform
|
|
||||||
(
|
|
||||||
const tmp<FieldField<Field, tensor>>&,
|
|
||||||
const FieldField<Field, Type>&
|
|
||||||
);
|
|
||||||
|
|
||||||
template<template<class> class Field, class Type>
|
|
||||||
tmp<FieldField<Field, Type>> transform
|
|
||||||
(
|
|
||||||
const tmp<FieldField<Field, tensor>>&,
|
|
||||||
const tmp<FieldField<Field, Type>>&
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
template<template<class> class Field, class Type>
|
template<template<class> class Field, class Type>
|
||||||
void transform
|
void transform
|
||||||
(
|
(
|
||||||
FieldField<Field, Type>&,
|
FieldField<Field, Type>& result,
|
||||||
const tensor&,
|
const tensor& rot,
|
||||||
const FieldField<Field, Type>&
|
const FieldField<Field, Type>& fld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<template<class> class Field, class Type>
|
||||||
|
void transform
|
||||||
|
(
|
||||||
|
FieldField<Field, Type>& result,
|
||||||
|
const FieldField<Field, tensor>& rot,
|
||||||
|
const FieldField<Field, Type>& fld
|
||||||
);
|
);
|
||||||
|
|
||||||
template<template<class> class Field, class Type>
|
template<template<class> class Field, class Type>
|
||||||
tmp<FieldField<Field, Type>> transform
|
tmp<FieldField<Field, Type>> transform
|
||||||
(
|
(
|
||||||
const tensor&,
|
const FieldField<Field, tensor>& rot,
|
||||||
const FieldField<Field, Type>&
|
const FieldField<Field, Type>& fld
|
||||||
);
|
);
|
||||||
|
|
||||||
template<template<class> class Field, class Type>
|
template<template<class> class Field, class Type>
|
||||||
tmp<FieldField<Field, Type>> transform
|
tmp<FieldField<Field, Type>> transform
|
||||||
(
|
(
|
||||||
const tensor&,
|
const FieldField<Field, tensor>& rot,
|
||||||
const tmp<FieldField<Field, Type>>&
|
const tmp<FieldField<Field, Type>>& tfld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<template<class> class Field, class Type>
|
||||||
|
tmp<FieldField<Field, Type>> transform
|
||||||
|
(
|
||||||
|
const tmp<FieldField<Field, tensor>>& trot,
|
||||||
|
const FieldField<Field, Type>& fld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<template<class> class Field, class Type>
|
||||||
|
tmp<FieldField<Field, Type>> transform
|
||||||
|
(
|
||||||
|
const tmp<FieldField<Field, tensor>>& trot,
|
||||||
|
const tmp<FieldField<Field, Type>>& tfld
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
template<template<class> class Field, class Type>
|
||||||
|
tmp<FieldField<Field, Type>> transform
|
||||||
|
(
|
||||||
|
const tensor& rot,
|
||||||
|
const FieldField<Field, Type>& fld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<template<class> class Field, class Type>
|
||||||
|
tmp<FieldField<Field, Type>> transform
|
||||||
|
(
|
||||||
|
const tensor& rot,
|
||||||
|
const tmp<FieldField<Field, Type>>& tfld
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// invTransform()
|
||||||
|
|
||||||
|
template<template<class> class Field, class Type>
|
||||||
|
void invTransform
|
||||||
|
(
|
||||||
|
FieldField<Field, Type>& result,
|
||||||
|
const tensor& rot,
|
||||||
|
const FieldField<Field, Type>& fld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<template<class> class Field, class Type>
|
||||||
|
void invTransform
|
||||||
|
(
|
||||||
|
FieldField<Field, Type>& result,
|
||||||
|
const FieldField<Field, tensor>& rot,
|
||||||
|
const FieldField<Field, Type>& fld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<template<class> class Field, class Type>
|
||||||
|
tmp<FieldField<Field, Type>> invTransform
|
||||||
|
(
|
||||||
|
const FieldField<Field, tensor>& rot,
|
||||||
|
const FieldField<Field, Type>& fld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<template<class> class Field, class Type>
|
||||||
|
tmp<FieldField<Field, Type>> invTransform
|
||||||
|
(
|
||||||
|
const FieldField<Field, tensor>& rot,
|
||||||
|
const tmp<FieldField<Field, Type>>& tfld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<template<class> class Field, class Type>
|
||||||
|
tmp<FieldField<Field, Type>> invTransform
|
||||||
|
(
|
||||||
|
const tmp<FieldField<Field, tensor>>& trot,
|
||||||
|
const FieldField<Field, Type>& fld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<template<class> class Field, class Type>
|
||||||
|
tmp<FieldField<Field, Type>> invTransform
|
||||||
|
(
|
||||||
|
const tmp<FieldField<Field, tensor>>& trot,
|
||||||
|
const tmp<FieldField<Field, Type>>& tfld
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
template<template<class> class Field, class Type>
|
||||||
|
tmp<FieldField<Field, Type>> invTransform
|
||||||
|
(
|
||||||
|
const tensor& rot,
|
||||||
|
const FieldField<Field, Type>& fld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<template<class> class Field, class Type>
|
||||||
|
tmp<FieldField<Field, Type>> invTransform
|
||||||
|
(
|
||||||
|
const tensor& rot,
|
||||||
|
const tmp<FieldField<Field, Type>>& tfld
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -36,59 +36,59 @@ void Foam::transform
|
|||||||
const vectorField& tf
|
const vectorField& tf
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
tensor t = q.R();
|
tensor rot = q.R();
|
||||||
TFOR_ALL_F_OP_FUNC_S_F(vector, rtf, =, transform, tensor, t, vector, tf)
|
TFOR_ALL_F_OP_FUNC_S_F(vector, rtf, =, transform, tensor, rot, vector, tf)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::vectorField> Foam::transform
|
Foam::tmp<Foam::vectorField> Foam::transform
|
||||||
(
|
(
|
||||||
const quaternion& q,
|
const quaternion& q,
|
||||||
const vectorField& tf
|
const vectorField& fld
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
tmp<vectorField > tranf(new vectorField(tf.size()));
|
auto tresult = tmp<vectorField>::New(fld.size());
|
||||||
transform(tranf.ref(), q, tf);
|
transform(tresult.ref(), q, fld);
|
||||||
return tranf;
|
return tresult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::vectorField> Foam::transform
|
Foam::tmp<Foam::vectorField> Foam::transform
|
||||||
(
|
(
|
||||||
const quaternion& q,
|
const quaternion& q,
|
||||||
const tmp<vectorField>& ttf
|
const tmp<vectorField>& tfld
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
tmp<vectorField > tranf = New(ttf);
|
tmp<vectorField> tresult = New(tfld);
|
||||||
transform(tranf.ref(), q, ttf());
|
transform(tresult.ref(), q, tfld());
|
||||||
ttf.clear();
|
tfld.clear();
|
||||||
return tranf;
|
return tresult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::transformPoints
|
void Foam::transformPoints
|
||||||
(
|
(
|
||||||
vectorField& rtf,
|
vectorField& result,
|
||||||
const septernion& tr,
|
const septernion& tr,
|
||||||
const vectorField& tf
|
const vectorField& fld
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
vector T = tr.t();
|
vector trans = tr.t();
|
||||||
|
|
||||||
// Check if any translation
|
// Check if any translation
|
||||||
if (mag(T) > VSMALL)
|
if (mag(trans) > VSMALL)
|
||||||
{
|
{
|
||||||
TFOR_ALL_F_OP_F_OP_S(vector, rtf, =, vector, tf, -, vector, T);
|
TFOR_ALL_F_OP_F_OP_S(vector, result, =, vector, fld, -, vector, trans);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rtf = tf;
|
result = fld;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if any rotation
|
// Check if any rotation
|
||||||
if (mag(tr.r().R() - I) > SMALL)
|
if (mag(tr.r().R() - I) > SMALL)
|
||||||
{
|
{
|
||||||
transform(rtf, tr.r(), rtf);
|
transform(result, tr.r(), result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,25 +96,25 @@ void Foam::transformPoints
|
|||||||
Foam::tmp<Foam::vectorField> Foam::transformPoints
|
Foam::tmp<Foam::vectorField> Foam::transformPoints
|
||||||
(
|
(
|
||||||
const septernion& tr,
|
const septernion& tr,
|
||||||
const vectorField& tf
|
const vectorField& fld
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
tmp<vectorField > tranf(new vectorField(tf.size()));
|
auto tresult = tmp<vectorField>::New(fld.size());
|
||||||
transformPoints(tranf.ref(), tr, tf);
|
transformPoints(tresult.ref(), tr, fld);
|
||||||
return tranf;
|
return tresult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::vectorField> Foam::transformPoints
|
Foam::tmp<Foam::vectorField> Foam::transformPoints
|
||||||
(
|
(
|
||||||
const septernion& tr,
|
const septernion& tr,
|
||||||
const tmp<vectorField>& ttf
|
const tmp<vectorField>& tfld
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
tmp<vectorField > tranf = New(ttf);
|
tmp<vectorField> tresult = New(tfld);
|
||||||
transformPoints(tranf.ref(), tr, ttf());
|
transformPoints(tresult.ref(), tr, tfld());
|
||||||
ttf.clear();
|
tfld.clear();
|
||||||
return tranf;
|
return tresult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -48,63 +48,157 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
// transform()
|
||||||
void transform(Field<Type>&, const tensorField&, const Field<Type>&);
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
tmp<Field<Type>> transform(const tensorField&, const Field<Type>&);
|
void transform
|
||||||
|
(
|
||||||
|
Field<Type>& result,
|
||||||
|
const tensor& rot,
|
||||||
|
const Field<Type>& fld
|
||||||
|
);
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
tmp<Field<Type>> transform(const tensorField&, const tmp<Field<Type>>&);
|
void transform
|
||||||
|
(
|
||||||
template<class Type>
|
Field<Type>& result,
|
||||||
tmp<Field<Type>> transform(const tmp<tensorField>&, const Field<Type>&);
|
const tensorField& rot,
|
||||||
|
const Field<Type>& fld
|
||||||
template<class Type>
|
);
|
||||||
tmp<Field<Type>> transform(const tmp<tensorField>&, const tmp<Field<Type>>&);
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void transform(Field<Type>&, const tensor&, const Field<Type>&);
|
tmp<Field<Type>> transform
|
||||||
|
(
|
||||||
|
const tensorField& rot,
|
||||||
|
const Field<Type>& fld
|
||||||
|
);
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
tmp<Field<Type>> transform(const tensor&, const Field<Type>&);
|
tmp<Field<Type>> transform
|
||||||
|
(
|
||||||
|
const tensorField& rot,
|
||||||
|
const tmp<Field<Type>>& tfld
|
||||||
|
);
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
tmp<Field<Type>> transform(const tensor&, const tmp<Field<Type>>&);
|
tmp<Field<Type>> transform
|
||||||
|
(
|
||||||
|
const tmp<tensorField>& trot,
|
||||||
|
const Field<Type>& fld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
tmp<Field<Type>> transform
|
||||||
|
(
|
||||||
|
const tmp<tensorField>& trot,
|
||||||
|
const tmp<Field<Type>>& tfld
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
tmp<Field<Type>> transform
|
||||||
|
(
|
||||||
|
const tensor& rot,
|
||||||
|
const Field<Type>& fld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
tmp<Field<Type>> transform
|
||||||
|
(
|
||||||
|
const tensor& rot,
|
||||||
|
const tmp<Field<Type>>& tfld
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// invTransform()
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void invTransform
|
||||||
|
(
|
||||||
|
Field<Type>& result,
|
||||||
|
const tensor& rot,
|
||||||
|
const Field<Type>& fld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void invTransform
|
||||||
|
(
|
||||||
|
Field<Type>& result,
|
||||||
|
const tensorField& rot,
|
||||||
|
const Field<Type>& fld
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
tmp<Field<Type>> invTransform
|
||||||
|
(
|
||||||
|
const tensorField& rot,
|
||||||
|
const Field<Type>& fld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
tmp<Field<Type>> invTransform
|
||||||
|
(
|
||||||
|
const tensorField& rot,
|
||||||
|
const tmp<Field<Type>>& tfld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
tmp<Field<Type>> invTransform
|
||||||
|
(
|
||||||
|
const tmp<tensorField>& trot,
|
||||||
|
const Field<Type>& fld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
tmp<Field<Type>> invTransform
|
||||||
|
(
|
||||||
|
const tmp<tensorField>& trot,
|
||||||
|
const tmp<Field<Type>>& tfld
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
tmp<Field<Type>> invTransform
|
||||||
|
(
|
||||||
|
const tensor& rot,
|
||||||
|
const Field<Type>& fld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
tmp<Field<Type>> invTransform
|
||||||
|
(
|
||||||
|
const tensor& rot,
|
||||||
|
const tmp<Field<Type>>& tfld
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type1, class Type2>
|
template<class Type1, class Type2>
|
||||||
tmp<Field<Type1>> transformFieldMask(const Field<Type2>&);
|
tmp<Field<Type1>> transformFieldMask(const Field<Type2>& fld);
|
||||||
|
|
||||||
template<class Type1, class Type2>
|
template<class Type1, class Type2>
|
||||||
tmp<Field<Type1>> transformFieldMask(const tmp<Field<Type2>>&);
|
tmp<Field<Type1>> transformFieldMask(const tmp<Field<Type2>>& tfld);
|
||||||
|
|
||||||
|
|
||||||
|
// Specializations
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
tmp<Field<symmTensor>> transformFieldMask<symmTensor>
|
tmp<Field<symmTensor>>
|
||||||
(
|
transformFieldMask<symmTensor>(const tensorField&);
|
||||||
const tensorField&
|
|
||||||
);
|
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
tmp<Field<symmTensor>> transformFieldMask<symmTensor>
|
tmp<Field<symmTensor>>
|
||||||
(
|
transformFieldMask<symmTensor>(const tmp<tensorField>&);
|
||||||
const tmp<tensorField>&
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
tmp<Field<sphericalTensor>> transformFieldMask<sphericalTensor>
|
tmp<Field<sphericalTensor>>
|
||||||
(
|
transformFieldMask<sphericalTensor>(const tensorField&);
|
||||||
const tensorField&
|
|
||||||
);
|
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
tmp<Field<sphericalTensor>> transformFieldMask<sphericalTensor>
|
tmp<Field<sphericalTensor>>
|
||||||
(
|
transformFieldMask<sphericalTensor>(const tmp<tensorField>&);
|
||||||
const tmp<tensorField>&
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Rotate given vectorField with the given quaternion
|
//- Rotate given vectorField with the given quaternion
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -26,145 +26,269 @@ License
|
|||||||
#include "transformField.H"
|
#include "transformField.H"
|
||||||
#include "FieldM.H"
|
#include "FieldM.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * global functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void transform
|
void Foam::transform
|
||||||
(
|
(
|
||||||
Field<Type>& rtf,
|
Field<Type>& result,
|
||||||
const tensorField& trf,
|
const tensor& rot,
|
||||||
const Field<Type>& tf
|
const Field<Type>& fld
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (trf.size() == 1)
|
TFOR_ALL_F_OP_FUNC_S_F
|
||||||
|
(
|
||||||
|
Type, result, =, transform, tensor, rot, Type, fld
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::transform
|
||||||
|
(
|
||||||
|
Field<Type>& result,
|
||||||
|
const tensorField& rot,
|
||||||
|
const Field<Type>& fld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (rot.size() == 1)
|
||||||
{
|
{
|
||||||
return transform(rtf, trf[0], tf);
|
return transform(result, rot.first(), fld);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
TFOR_ALL_F_OP_FUNC_F_F
|
||||||
|
(
|
||||||
|
Type, result, =, transform, tensor, rot, Type, fld
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::tmp<Foam::Field<Type>>
|
||||||
|
Foam::transform
|
||||||
|
(
|
||||||
|
const tensorField& rot,
|
||||||
|
const Field<Type>& fld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto tresult = tmp<Field<Type>>::New(fld.size());
|
||||||
|
transform(tresult.ref(), rot, fld);
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::tmp<Foam::Field<Type>>
|
||||||
|
Foam::transform
|
||||||
|
(
|
||||||
|
const tensorField& rot,
|
||||||
|
const tmp<Field<Type>>& tfld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
tmp<Field<Type>> tresult = New(tfld);
|
||||||
|
transform(tresult.ref(), rot, tfld());
|
||||||
|
tfld.clear();
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::tmp<Foam::Field<Type>>
|
||||||
|
Foam::transform
|
||||||
|
(
|
||||||
|
const tmp<tensorField>& trot,
|
||||||
|
const Field<Type>& fld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto tresult = tmp<Field<Type>>::New(fld.size());
|
||||||
|
transform(tresult.ref(), trot(), fld);
|
||||||
|
trot.clear();
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::tmp<Foam::Field<Type>>
|
||||||
|
Foam::transform
|
||||||
|
(
|
||||||
|
const tmp<tensorField>& trot,
|
||||||
|
const tmp<Field<Type>>& tfld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
tmp<Field<Type>> tresult = New(tfld);
|
||||||
|
transform(tresult.ref(), trot(), tfld());
|
||||||
|
trot.clear();
|
||||||
|
tfld.clear();
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::tmp<Foam::Field<Type>>
|
||||||
|
Foam::transform
|
||||||
|
(
|
||||||
|
const tensor& rot,
|
||||||
|
const Field<Type>& fld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto tresult = tmp<Field<Type>>::New(fld.size());
|
||||||
|
transform(tresult.ref(), rot, fld);
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::tmp<Foam::Field<Type>>
|
||||||
|
Foam::transform
|
||||||
|
(
|
||||||
|
const tensor& rot,
|
||||||
|
const tmp<Field<Type>>& tfld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
tmp<Field<Type>> tresult = New(tfld);
|
||||||
|
transform(tresult.ref(), rot, tfld());
|
||||||
|
tfld.clear();
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::invTransform
|
||||||
|
(
|
||||||
|
Field<Type>& result,
|
||||||
|
const tensor& rot,
|
||||||
|
const Field<Type>& fld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
TFOR_ALL_F_OP_FUNC_S_F
|
||||||
|
(
|
||||||
|
Type, result, =, invTransform, tensor, rot, Type, fld
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::invTransform
|
||||||
|
(
|
||||||
|
Field<Type>& result,
|
||||||
|
const tensorField& rot,
|
||||||
|
const Field<Type>& fld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (rot.size() == 1)
|
||||||
{
|
{
|
||||||
TFOR_ALL_F_OP_FUNC_F_F
|
return invTransform(result, rot.first(), fld);
|
||||||
(
|
|
||||||
Type, rtf, =, transform, tensor, trf, Type, tf
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TFOR_ALL_F_OP_FUNC_F_F
|
||||||
|
(
|
||||||
|
Type, result, =, invTransform, tensor, rot, Type, fld
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
tmp<Field<Type>> transform
|
Foam::tmp<Foam::Field<Type>>
|
||||||
|
Foam::invTransform
|
||||||
(
|
(
|
||||||
const tensorField& trf,
|
const tensorField& rot,
|
||||||
const Field<Type>& tf
|
const Field<Type>& fld
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
tmp<Field<Type>> tranf(new Field<Type> (tf.size()));
|
auto tresult = tmp<Field<Type>>::New(fld.size());
|
||||||
transform(tranf.ref(), trf, tf);
|
invTransform(tresult.ref(), rot, fld);
|
||||||
return tranf;
|
return tresult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
tmp<Field<Type>> transform
|
Foam::tmp<Foam::Field<Type>>
|
||||||
|
Foam::invTransform
|
||||||
(
|
(
|
||||||
const tensorField& trf,
|
const tensorField& rot,
|
||||||
const tmp<Field<Type>>& ttf
|
const tmp<Field<Type>>& tfld
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
tmp<Field<Type>> tranf = New(ttf);
|
tmp<Field<Type>> tresult = New(tfld);
|
||||||
transform(tranf.ref(), trf, ttf());
|
invTransform(tresult.ref(), rot, tfld());
|
||||||
ttf.clear();
|
tfld.clear();
|
||||||
return tranf;
|
return tresult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
tmp<Field<Type>> transform
|
Foam::tmp<Foam::Field<Type>>
|
||||||
|
Foam::invTransform
|
||||||
(
|
(
|
||||||
const tmp<tensorField>& ttrf,
|
const tmp<tensorField>& trot,
|
||||||
const Field<Type>& tf
|
const Field<Type>& fld
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
tmp<Field<Type>> tranf(new Field<Type> (tf.size()));
|
auto tresult = tmp<Field<Type>>::New(fld.size());
|
||||||
transform(tranf.ref(), ttrf(), tf);
|
invTransform(tresult.ref(), trot(), fld);
|
||||||
ttrf.clear();
|
trot.clear();
|
||||||
return tranf;
|
return tresult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
tmp<Field<Type>> transform
|
Foam::tmp<Foam::Field<Type>>
|
||||||
|
Foam::invTransform
|
||||||
(
|
(
|
||||||
const tmp<tensorField>& ttrf,
|
const tmp<tensorField>& trot,
|
||||||
const tmp<Field<Type>>& ttf
|
const tmp<Field<Type>>& tfld
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
tmp<Field<Type>> tranf = New(ttf);
|
tmp<Field<Type>> tresult = New(tfld);
|
||||||
transform(tranf.ref(), ttrf(), ttf());
|
invTransform(tresult.ref(), trot(), tfld());
|
||||||
ttf.clear();
|
trot.clear();
|
||||||
ttrf.clear();
|
tfld.clear();
|
||||||
return tranf;
|
return tresult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void transform
|
Foam::tmp<Foam::Field<Type>>
|
||||||
|
Foam::invTransform
|
||||||
(
|
(
|
||||||
Field<Type>& rtf,
|
const tensor& rot,
|
||||||
const tensor& t,
|
const Field<Type>& fld
|
||||||
const Field<Type>& tf
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
TFOR_ALL_F_OP_FUNC_S_F(Type, rtf, =, transform, tensor, t, Type, tf)
|
auto tresult = tmp<Field<Type>>::New(fld.size());
|
||||||
|
invTransform(tresult.ref(), rot, fld);
|
||||||
|
return tresult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
tmp<Field<Type>> transform
|
Foam::tmp<Foam::Field<Type>>
|
||||||
|
Foam::invTransform
|
||||||
(
|
(
|
||||||
const tensor& t,
|
const tensor& rot,
|
||||||
const Field<Type>& tf
|
const tmp<Field<Type>>& tfld
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
tmp<Field<Type>> tranf(new Field<Type>(tf.size()));
|
tmp<Field<Type>> tresult = New(tfld);
|
||||||
transform(tranf.ref(), t, tf);
|
invTransform(tresult.ref(), rot, tfld());
|
||||||
return tranf;
|
tfld.clear();
|
||||||
}
|
return tresult;
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
tmp<Field<Type>> transform
|
|
||||||
(
|
|
||||||
const tensor& t,
|
|
||||||
const tmp<Field<Type>>& ttf
|
|
||||||
)
|
|
||||||
{
|
|
||||||
tmp<Field<Type>> tranf = New(ttf);
|
|
||||||
transform(tranf.ref(), t, ttf());
|
|
||||||
ttf.clear();
|
|
||||||
return tranf;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type1, class Type2>
|
template<class Type1, class Type2>
|
||||||
tmp<Field<Type1>> transformFieldMask(const Field<Type2>& f)
|
Foam::tmp<Foam::Field<Type1>>
|
||||||
|
Foam::transformFieldMask(const Field<Type2>& fld)
|
||||||
{
|
{
|
||||||
return f;
|
return fld;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class Type1, class Type2>
|
template<class Type1, class Type2>
|
||||||
tmp<Field<Type1>> transformFieldMask(const tmp<Field<Type2>>& tf)
|
Foam::tmp<Foam::Field<Type1>>
|
||||||
|
Foam::transformFieldMask(const tmp<Field<Type2>>& tfld)
|
||||||
{
|
{
|
||||||
return tmp<Field<Type1>>(tf.ptr());
|
return tmp<Field<Type1>>(tfld.ptr());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -29,169 +29,328 @@ Description
|
|||||||
#include "transformGeometricField.H"
|
#include "transformGeometricField.H"
|
||||||
#include "transformField.H"
|
#include "transformField.H"
|
||||||
#include "transformFieldField.H"
|
#include "transformFieldField.H"
|
||||||
|
#include "GeometricField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * Transform Global Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * global functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Type, template<class> class PatchField, class GeoMesh>
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
void transform
|
void Foam::transform
|
||||||
(
|
(
|
||||||
GeometricField<Type, PatchField, GeoMesh>& rtf,
|
GeometricField<Type, PatchField, GeoMesh>& result,
|
||||||
const GeometricField<tensor, PatchField, GeoMesh>& trf,
|
const dimensionedTensor& rot,
|
||||||
const GeometricField<Type, PatchField, GeoMesh>& tf
|
const GeometricField<Type, PatchField, GeoMesh>& fld
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
transform
|
transform
|
||||||
(
|
(
|
||||||
rtf.primitiveFieldRef(),
|
result.primitiveFieldRef(),
|
||||||
trf.primitiveField(),
|
rot.value(),
|
||||||
tf.primitiveField()
|
fld.primitiveField()
|
||||||
);
|
);
|
||||||
transform
|
transform
|
||||||
(
|
(
|
||||||
rtf.boundaryFieldRef(),
|
result.boundaryFieldRef(),
|
||||||
trf.boundaryField(),
|
rot.value(),
|
||||||
tf.boundaryField()
|
fld.boundaryField()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type, template<class> class PatchField, class GeoMesh>
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
tmp<GeometricField<Type, PatchField, GeoMesh>> transform
|
void Foam::transform
|
||||||
(
|
(
|
||||||
const GeometricField<tensor, PatchField, GeoMesh>& trf,
|
GeometricField<Type, PatchField, GeoMesh>& result,
|
||||||
const GeometricField<Type, PatchField, GeoMesh>& tf
|
const GeometricField<tensor, PatchField, GeoMesh>& rot,
|
||||||
|
const GeometricField<Type, PatchField, GeoMesh>& fld
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
tmp<GeometricField<Type, PatchField, GeoMesh>> tranf
|
transform
|
||||||
(
|
(
|
||||||
new GeometricField<Type, PatchField, GeoMesh>
|
result.primitiveFieldRef(),
|
||||||
(
|
rot.primitiveField(),
|
||||||
IOobject
|
fld.primitiveField()
|
||||||
(
|
|
||||||
"transform(" + trf.name() + ',' + tf.name() + ')',
|
|
||||||
tf.instance(),
|
|
||||||
tf.db(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
tf.mesh(),
|
|
||||||
tf.dimensions()
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
transform
|
||||||
transform(tranf.ref(), trf, tf);
|
|
||||||
|
|
||||||
return tranf;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type, template<class> class PatchField, class GeoMesh>
|
|
||||||
tmp<GeometricField<Type, PatchField, GeoMesh>> transform
|
|
||||||
(
|
|
||||||
const GeometricField<tensor, PatchField, GeoMesh>& trf,
|
|
||||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& ttf
|
|
||||||
)
|
|
||||||
{
|
|
||||||
tmp<GeometricField<Type, PatchField, GeoMesh>> tranf =
|
|
||||||
transform(trf, ttf());
|
|
||||||
ttf.clear();
|
|
||||||
return tranf;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type, template<class> class PatchField, class GeoMesh>
|
|
||||||
tmp<GeometricField<Type, PatchField, GeoMesh>> transform
|
|
||||||
(
|
|
||||||
const tmp<GeometricField<tensor, PatchField, GeoMesh>>& ttrf,
|
|
||||||
const GeometricField<Type, PatchField, GeoMesh>& tf
|
|
||||||
)
|
|
||||||
{
|
|
||||||
tmp<GeometricField<Type, PatchField, GeoMesh>> tranf =
|
|
||||||
transform(ttrf(), tf);
|
|
||||||
ttrf.clear();
|
|
||||||
return tranf;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type, template<class> class PatchField, class GeoMesh>
|
|
||||||
tmp<GeometricField<Type, PatchField, GeoMesh>> transform
|
|
||||||
(
|
|
||||||
const tmp<GeometricField<tensor, PatchField, GeoMesh>>& ttrf,
|
|
||||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& ttf
|
|
||||||
)
|
|
||||||
{
|
|
||||||
tmp<GeometricField<Type, PatchField, GeoMesh>> tranf =
|
|
||||||
transform(ttrf(), ttf());
|
|
||||||
ttf.clear();
|
|
||||||
ttrf.clear();
|
|
||||||
return tranf;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type, template<class> class PatchField, class GeoMesh>
|
|
||||||
void transform
|
|
||||||
(
|
|
||||||
GeometricField<Type, PatchField, GeoMesh>& rtf,
|
|
||||||
const dimensionedTensor& t,
|
|
||||||
const GeometricField<Type, PatchField, GeoMesh>& tf
|
|
||||||
)
|
|
||||||
{
|
|
||||||
transform(rtf.primitiveFieldRef(), t.value(), tf.primitiveField());
|
|
||||||
transform(rtf.boundaryFieldRef(), t.value(), tf.boundaryField());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type, template<class> class PatchField, class GeoMesh>
|
|
||||||
tmp<GeometricField<Type, PatchField, GeoMesh>> transform
|
|
||||||
(
|
|
||||||
const dimensionedTensor& t,
|
|
||||||
const GeometricField<Type, PatchField, GeoMesh>& tf
|
|
||||||
)
|
|
||||||
{
|
|
||||||
tmp<GeometricField<Type, PatchField, GeoMesh>> tranf
|
|
||||||
(
|
(
|
||||||
new GeometricField<Type, PatchField, GeoMesh>
|
result.boundaryFieldRef(),
|
||||||
(
|
rot.boundaryField(),
|
||||||
IOobject
|
fld.boundaryField()
|
||||||
(
|
|
||||||
"transform(" + t.name() + ',' + tf.name() + ')',
|
|
||||||
tf.instance(),
|
|
||||||
tf.db(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
tf.mesh(),
|
|
||||||
tf.dimensions()
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
transform(tranf.ref(), t, tf);
|
|
||||||
|
|
||||||
return tranf;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type, template<class> class PatchField, class GeoMesh>
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
tmp<GeometricField<Type, PatchField, GeoMesh>> transform
|
Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh>>
|
||||||
|
Foam::transform
|
||||||
(
|
(
|
||||||
const dimensionedTensor& t,
|
const GeometricField<tensor, PatchField, GeoMesh>& rot,
|
||||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>& ttf
|
const GeometricField<Type, PatchField, GeoMesh>& fld
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
tmp<GeometricField<Type, PatchField, GeoMesh>> tranf =
|
auto tresult = tmp<GeometricField<Type, PatchField, GeoMesh>>::New
|
||||||
transform(t, ttf());
|
(
|
||||||
ttf.clear();
|
IOobject
|
||||||
return tranf;
|
(
|
||||||
|
"transform(" + rot.name() + ',' + fld.name() + ')',
|
||||||
|
fld.instance(),
|
||||||
|
fld.db(),
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
fld.mesh(),
|
||||||
|
fld.dimensions()
|
||||||
|
);
|
||||||
|
|
||||||
|
transform(tresult.ref(), rot, fld);
|
||||||
|
|
||||||
|
return tresult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh>>
|
||||||
|
Foam::transform
|
||||||
|
(
|
||||||
|
const GeometricField<tensor, PatchField, GeoMesh>& rot,
|
||||||
|
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tfld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto tresult = transform(rot, tfld());
|
||||||
|
tfld.clear();
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh>>
|
||||||
|
Foam::transform
|
||||||
|
(
|
||||||
|
const tmp<GeometricField<tensor, PatchField, GeoMesh>>& trot,
|
||||||
|
const GeometricField<Type, PatchField, GeoMesh>& fld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto tresult = transform(trot(), fld);
|
||||||
|
trot.clear();
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh>>
|
||||||
|
Foam::transform
|
||||||
|
(
|
||||||
|
const tmp<GeometricField<tensor, PatchField, GeoMesh>>& trot,
|
||||||
|
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tfld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto tresult = transform(trot(), tfld());
|
||||||
|
tfld.clear();
|
||||||
|
trot.clear();
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh>>
|
||||||
|
Foam::transform
|
||||||
|
(
|
||||||
|
const dimensionedTensor& rot,
|
||||||
|
const GeometricField<Type, PatchField, GeoMesh>& fld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto tresult = tmp<GeometricField<Type, PatchField, GeoMesh>>::New
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"transform(" + rot.name() + ',' + fld.name() + ')',
|
||||||
|
fld.instance(),
|
||||||
|
fld.db(),
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
fld.mesh(),
|
||||||
|
fld.dimensions()
|
||||||
|
);
|
||||||
|
|
||||||
|
transform(tresult.ref(), rot, fld);
|
||||||
|
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh>>
|
||||||
|
Foam::transform
|
||||||
|
(
|
||||||
|
const dimensionedTensor& rot,
|
||||||
|
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tfld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto tresult = transform(rot, tfld());
|
||||||
|
tfld.clear();
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * invTransform Global Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
void Foam::invTransform
|
||||||
|
(
|
||||||
|
GeometricField<Type, PatchField, GeoMesh>& result,
|
||||||
|
const dimensionedTensor& rot,
|
||||||
|
const GeometricField<Type, PatchField, GeoMesh>& fld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
invTransform
|
||||||
|
(
|
||||||
|
result.primitiveFieldRef(),
|
||||||
|
rot.value(),
|
||||||
|
fld.primitiveField()
|
||||||
|
);
|
||||||
|
invTransform
|
||||||
|
(
|
||||||
|
result.boundaryFieldRef(),
|
||||||
|
rot.value(),
|
||||||
|
fld.boundaryField()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
void Foam::invTransform
|
||||||
|
(
|
||||||
|
GeometricField<Type, PatchField, GeoMesh>& result,
|
||||||
|
const GeometricField<tensor, PatchField, GeoMesh>& rot,
|
||||||
|
const GeometricField<Type, PatchField, GeoMesh>& fld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
invTransform
|
||||||
|
(
|
||||||
|
result.primitiveFieldRef(),
|
||||||
|
rot.primitiveField(),
|
||||||
|
fld.primitiveField()
|
||||||
|
);
|
||||||
|
invTransform
|
||||||
|
(
|
||||||
|
result.boundaryFieldRef(),
|
||||||
|
rot.boundaryField(),
|
||||||
|
fld.boundaryField()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh>>
|
||||||
|
Foam::invTransform
|
||||||
|
(
|
||||||
|
const GeometricField<tensor, PatchField, GeoMesh>& rot,
|
||||||
|
const GeometricField<Type, PatchField, GeoMesh>& fld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto tresult = tmp<GeometricField<Type, PatchField, GeoMesh>>::New
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"invTransform(" + rot.name() + ',' + fld.name() + ')',
|
||||||
|
fld.instance(),
|
||||||
|
fld.db(),
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
fld.mesh(),
|
||||||
|
fld.dimensions()
|
||||||
|
);
|
||||||
|
|
||||||
|
invTransform(tresult.ref(), rot, fld);
|
||||||
|
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh>>
|
||||||
|
Foam::invTransform
|
||||||
|
(
|
||||||
|
const GeometricField<tensor, PatchField, GeoMesh>& rot,
|
||||||
|
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tfld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto tresult = invTransform(rot, tfld());
|
||||||
|
tfld.clear();
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh>>
|
||||||
|
Foam::invTransform
|
||||||
|
(
|
||||||
|
const tmp<GeometricField<tensor, PatchField, GeoMesh>>& trot,
|
||||||
|
const GeometricField<Type, PatchField, GeoMesh>& fld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto tresult = invTransform(trot(), fld);
|
||||||
|
trot.clear();
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh>>
|
||||||
|
Foam::invTransform
|
||||||
|
(
|
||||||
|
const tmp<GeometricField<tensor, PatchField, GeoMesh>>& trot,
|
||||||
|
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tfld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto tresult = invTransform(trot(), tfld());
|
||||||
|
tfld.clear();
|
||||||
|
trot.clear();
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh>>
|
||||||
|
Foam::invTransform
|
||||||
|
(
|
||||||
|
const dimensionedTensor& rot,
|
||||||
|
const GeometricField<Type, PatchField, GeoMesh>& fld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto tresult = tmp<GeometricField<Type, PatchField, GeoMesh>>::New
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"invTransform(" + rot.name() + ',' + fld.name() + ')',
|
||||||
|
fld.instance(),
|
||||||
|
fld.db(),
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
fld.mesh(),
|
||||||
|
fld.dimensions()
|
||||||
|
);
|
||||||
|
|
||||||
|
invTransform(tresult.ref(), rot, fld);
|
||||||
|
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh>>
|
||||||
|
Foam::invTransform
|
||||||
|
(
|
||||||
|
const dimensionedTensor& rot,
|
||||||
|
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tfld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto tresult = invTransform(rot, tfld());
|
||||||
|
tfld.clear();
|
||||||
|
return tresult;
|
||||||
|
}
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -25,7 +25,7 @@ InClass
|
|||||||
Foam::transformGeometricField
|
Foam::transformGeometricField
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Spatial transformation functions for FieldFields.
|
Spatial transformation functions for GeometricField
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
transformGeometricField.C
|
transformGeometricField.C
|
||||||
@ -45,63 +45,128 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type, template<class> class PatchField, class GeoMesh>
|
// transform()
|
||||||
void transform
|
|
||||||
(
|
|
||||||
GeometricField<Type, PatchField, GeoMesh>&,
|
|
||||||
const GeometricField<tensor, PatchField, GeoMesh>&,
|
|
||||||
const GeometricField<Type, PatchField, GeoMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
template<class Type, template<class> class PatchField, class GeoMesh>
|
|
||||||
tmp<GeometricField<Type, PatchField, GeoMesh>> transform
|
|
||||||
(
|
|
||||||
const GeometricField<tensor, PatchField, GeoMesh>&,
|
|
||||||
const GeometricField<Type, PatchField, GeoMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
template<class Type, template<class> class PatchField, class GeoMesh>
|
|
||||||
tmp<GeometricField<Type, PatchField, GeoMesh>> transform
|
|
||||||
(
|
|
||||||
const GeometricField<tensor, PatchField, GeoMesh>&,
|
|
||||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>&
|
|
||||||
);
|
|
||||||
|
|
||||||
template<class Type, template<class> class PatchField, class GeoMesh>
|
|
||||||
tmp<GeometricField<Type, PatchField, GeoMesh>> transform
|
|
||||||
(
|
|
||||||
const tmp<GeometricField<tensor, PatchField, GeoMesh>>&,
|
|
||||||
const GeometricField<Type, PatchField, GeoMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
template<class Type, template<class> class PatchField, class GeoMesh>
|
|
||||||
tmp<GeometricField<Type, PatchField, GeoMesh>> transform
|
|
||||||
(
|
|
||||||
const tmp<GeometricField<tensor, PatchField, GeoMesh>>&,
|
|
||||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>&
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type, template<class> class PatchField, class GeoMesh>
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
void transform
|
void transform
|
||||||
(
|
(
|
||||||
GeometricField<Type, PatchField, GeoMesh>&,
|
GeometricField<Type, PatchField, GeoMesh>& result,
|
||||||
const dimensionedTensor&,
|
const dimensionedTensor& rot,
|
||||||
const GeometricField<Type, PatchField, GeoMesh>&
|
const GeometricField<Type, PatchField, GeoMesh>& fld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
void transform
|
||||||
|
(
|
||||||
|
GeometricField<Type, PatchField, GeoMesh>& result,
|
||||||
|
const GeometricField<tensor, PatchField, GeoMesh>& rot,
|
||||||
|
const GeometricField<Type, PatchField, GeoMesh>& fld
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
tmp<GeometricField<Type, PatchField, GeoMesh>> transform
|
||||||
|
(
|
||||||
|
const GeometricField<tensor, PatchField, GeoMesh>& rot,
|
||||||
|
const GeometricField<Type, PatchField, GeoMesh>& fld
|
||||||
);
|
);
|
||||||
|
|
||||||
template<class Type, template<class> class PatchField, class GeoMesh>
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
tmp<GeometricField<Type, PatchField, GeoMesh>> transform
|
tmp<GeometricField<Type, PatchField, GeoMesh>> transform
|
||||||
(
|
(
|
||||||
const dimensionedTensor&,
|
const GeometricField<tensor, PatchField, GeoMesh>& rot,
|
||||||
const GeometricField<Type, PatchField, GeoMesh>&
|
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tfld
|
||||||
);
|
);
|
||||||
|
|
||||||
template<class Type, template<class> class PatchField, class GeoMesh>
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
tmp<GeometricField<Type, PatchField, GeoMesh>> transform
|
tmp<GeometricField<Type, PatchField, GeoMesh>> transform
|
||||||
(
|
(
|
||||||
const dimensionedTensor&,
|
const tmp<GeometricField<tensor, PatchField, GeoMesh>>& trot,
|
||||||
const tmp<GeometricField<Type, PatchField, GeoMesh>>&
|
const GeometricField<Type, PatchField, GeoMesh>& fld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
tmp<GeometricField<Type, PatchField, GeoMesh>> transform
|
||||||
|
(
|
||||||
|
const tmp<GeometricField<tensor, PatchField, GeoMesh>>& trot,
|
||||||
|
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tfld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
tmp<GeometricField<Type, PatchField, GeoMesh>> transform
|
||||||
|
(
|
||||||
|
const dimensionedTensor& rot,
|
||||||
|
const GeometricField<Type, PatchField, GeoMesh>& fld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
tmp<GeometricField<Type, PatchField, GeoMesh>> transform
|
||||||
|
(
|
||||||
|
const dimensionedTensor& rot,
|
||||||
|
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tfld
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// invTransform()
|
||||||
|
|
||||||
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
void invTransform
|
||||||
|
(
|
||||||
|
GeometricField<Type, PatchField, GeoMesh>& result,
|
||||||
|
const dimensionedTensor& rot,
|
||||||
|
const GeometricField<Type, PatchField, GeoMesh>& fld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
void invTransform
|
||||||
|
(
|
||||||
|
GeometricField<Type, PatchField, GeoMesh>& result,
|
||||||
|
const GeometricField<tensor, PatchField, GeoMesh>& rot,
|
||||||
|
const GeometricField<Type, PatchField, GeoMesh>& fld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
tmp<GeometricField<Type, PatchField, GeoMesh>> invTransform
|
||||||
|
(
|
||||||
|
const GeometricField<tensor, PatchField, GeoMesh>& rot,
|
||||||
|
const GeometricField<Type, PatchField, GeoMesh>& fld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
tmp<GeometricField<Type, PatchField, GeoMesh>> invTransform
|
||||||
|
(
|
||||||
|
const GeometricField<tensor, PatchField, GeoMesh>& rot,
|
||||||
|
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tfld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
tmp<GeometricField<Type, PatchField, GeoMesh>> invTransform
|
||||||
|
(
|
||||||
|
const tmp<GeometricField<tensor, PatchField, GeoMesh>>& trot,
|
||||||
|
const GeometricField<Type, PatchField, GeoMesh>& fld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
tmp<GeometricField<Type, PatchField, GeoMesh>> invTransform
|
||||||
|
(
|
||||||
|
const tmp<GeometricField<tensor, PatchField, GeoMesh>>& trot,
|
||||||
|
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tfld
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
tmp<GeometricField<Type, PatchField, GeoMesh>> invTransform
|
||||||
|
(
|
||||||
|
const dimensionedTensor& rot,
|
||||||
|
const GeometricField<Type, PatchField, GeoMesh>& fld
|
||||||
|
);
|
||||||
|
|
||||||
|
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||||
|
tmp<GeometricField<Type, PatchField, GeoMesh>> invTransform
|
||||||
|
(
|
||||||
|
const dimensionedTensor& rot,
|
||||||
|
const tmp<GeometricField<Type, PatchField, GeoMesh>>& tfld
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user