cyclic patches: Rationalised the handling of transformation

A single transformer object is now maintained within cyclic patches and returned
from a single virtual functions massively simplifying the interface and allowing
for further rationalisation of the calculation of the transformation.
This commit is contained in:
Henry Weller
2020-01-02 17:05:01 +00:00
parent 745c95849e
commit 4f0e38ce4a
66 changed files with 372 additions and 510 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -92,7 +92,7 @@ void Foam::conformalVoronoiMesh::selectSeparatedCoupledFaces
patches[patchi]
);
if (cpp.separated() || !cpp.parallel())
if (cpp.transform().transformsPosition())
{
forAll(cpp, i)
{

View File

@ -357,15 +357,15 @@ void syncPoints
// Null any value which is not on neighbouring processor
nbrPatchInfo.setSize(procPatch.nPoints(), nullValue);
if (!procPatch.parallel())
if (procPatch.transform().rotates())
{
hasTransformation = true;
transformList(procPatch.forwardT(), nbrPatchInfo);
transformList(procPatch.transform().R(), nbrPatchInfo);
}
else if (procPatch.separated())
else if (procPatch.transform().translates())
{
hasTransformation = true;
nbrPatchInfo -= procPatch.separation();
nbrPatchInfo -= procPatch.transform().t();
}
const labelList& meshPts = procPatch.meshPoints();
@ -407,15 +407,15 @@ void syncPoints
half0Values[i] = points[point0];
}
if (!cycPatch.parallel())
if (cycPatch.transform().rotates())
{
hasTransformation = true;
transformList(cycPatch.reverseT(), half0Values);
transformList(cycPatch.transform().R().T(), half0Values);
}
else if (cycPatch.separated())
else if (cycPatch.transform().translates())
{
hasTransformation = true;
half0Values += cycPatch.separation();
half0Values += cycPatch.transform().t();
}
forAll(coupledPoints, i)
@ -765,11 +765,11 @@ int main(int argc, char *argv[])
const coupledPolyPatch& cpp =
refCast<const coupledPolyPatch>(pp);
if (cpp.separated())
if (cpp.transform().translates())
{
Info<< "On coupled patch " << pp.name()
<< " separation was "
<< cpp.separation() << endl;
<< cpp.transform().t() << endl;
if (isA<cyclicPolyPatch>(pp) && pp.size())
{
@ -784,20 +784,20 @@ int main(int argc, char *argv[])
{
const cyclicPolyPatch& nbr = cycpp.neighbPatch();
const_cast<vector&>(cpp.separation()) =
const_cast<vector&>(cpp.transform().t()) =
nbr[0].centre(mesh.points())
- cycpp[0].centre(mesh.points());
}
}
Info<< "On coupled patch " << pp.name()
<< " forcing uniform separation of "
<< cpp.separation() << endl;
<< cpp.transform().t() << endl;
}
else if (!cpp.parallel())
else if (cpp.transform().rotates())
{
Info<< "On coupled patch " << pp.name()
<< " uniform rotation of "
<< cpp.forwardT() << endl;
<< cpp.transform().R() << endl;
}
}
}