transformer: Generalised to permit scaling and improved abstraction

Transformer now supports scaling matrices. The number of ways in which
transformer can be constructed has also been reduced to null (i.e.,
identity), pure translation, pure scaling and pure rotation. Compound
translations must be constructed by combining transformers with the
dot-product (&) operator. In this way, the details of in what order the
different parts of the transformation are applied have been abstracted.
This commit is contained in:
Will Bainbridge
2020-01-24 15:40:25 +00:00
parent ea3e891dab
commit 55b982eeea
26 changed files with 281 additions and 346 deletions

View File

@ -479,11 +479,11 @@ void Foam::FaceCellWave<Type, TrackingData>::transform
{
// Transform. Implementation referred to Type
if (trans.rotates())
if (trans.transforms())
{
for (label facei = 0; facei < nFaces; facei++)
{
faceInfo[facei].transform(mesh_, trans.R(), td_);
faceInfo[facei].transform(mesh_, trans.T(), td_);
}
}
}
@ -597,11 +597,11 @@ void Foam::FaceCellWave<Type, TrackingData>::handleProcPatches()
}
// Apply transform to received data for non-parallel planes
if (procPatch.transform().rotates())
if (procPatch.transform().transforms())
{
transform
(
procPatch.transform().R(),
procPatch.transform().T(),
receiveFaces.size(),
receiveFacesInfo
);
@ -669,12 +669,12 @@ void Foam::FaceCellWave<Type, TrackingData>::handleCyclicPatches()
const cyclicPolyPatch& cycPatch =
refCast<const cyclicPolyPatch>(patch);
if (cycPatch.transform().rotates())
if (cycPatch.transform().transforms())
{
// received data from other half
transform
(
cycPatch.transform().R(),
cycPatch.transform().T(),
nReceiveFaces,
receiveFacesInfo
);
@ -805,11 +805,11 @@ void Foam::FaceCellWave<Type, TrackingData>::handleAMICyclicPatches()
}
// Apply transform to received data for non-parallel planes
if (cycPatch.transform().rotates())
if (cycPatch.transform().transforms())
{
transform
(
cycPatch.transform().R(),
cycPatch.transform().T(),
receiveInfo.size(),
receiveInfo
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -342,14 +342,14 @@ public:
{
forAll(fld, i)
{
fld[i].transform(mesh_, patch_, vt.R(), tol_, td_);
fld[i].transform(mesh_, patch_, vt.T(), tol_, td_);
}
}
else
{
forAll(fld, i)
{
fld[i].transform(mesh_, patch_, vt.R().T(), tol_, td_);
fld[i].transform(mesh_, patch_, vt.T().T(), tol_, td_);
}
}
}

View File

@ -368,9 +368,9 @@ void Foam::PointEdgeWave<Type, TrackingData>::handleProcPatches()
//}
// Apply transform to received data for non-parallel planes
if (procPatch.transform().rotates())
if (procPatch.transform().transforms())
{
transform(procPatch, procPatch.transform().R(), patchInfo);
transform(procPatch, procPatch.transform().T(), patchInfo);
}
// Adapt for entering domain
@ -453,10 +453,10 @@ void Foam::PointEdgeWave<Type, TrackingData>::handleCyclicPatches()
// Apply rotation for non-parallel planes
if (cycPatch.transform().rotates())
if (cycPatch.transform().transforms())
{
// received data from half1
transform(cycPatch, cycPatch.transform().R(), nbrInfo);
transform(cycPatch, cycPatch.transform().T(), nbrInfo);
}
// if (debug)