From 4f0e38ce4a2cde99d24f64a3fe4667ab9f2cb706 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Thu, 2 Jan 2020 17:05:01 +0000 Subject: [PATCH] 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. --- .../conformalVoronoiMeshZones.C | 4 +- .../manipulation/createPatch/createPatch.C | 28 +++++----- .../constraint/cyclic/cyclicPointPatchField.C | 9 ++-- .../constraint/cyclic/cyclicPointPatchField.H | 18 +++---- .../processor/processorPointPatchField.H | 8 ++- .../processorCyclicPointPatchField.C | 12 ++--- .../processorCyclicPointPatchField.H | 8 ++- .../lduInterface/cyclicLduInterface.H | 10 ++-- .../lduInterface/processorLduInterface.H | 8 +-- .../cyclicLduInterfaceField.C | 6 +-- .../cyclicLduInterfaceField.H | 14 +++-- .../processorLduInterfaceField.C | 4 +- .../processorLduInterfaceField.H | 9 ++-- .../cyclicGAMGInterfaceField.H | 14 ++--- .../processorGAMGInterfaceField.H | 8 +-- .../cyclicGAMGInterface/cyclicGAMGInterface.C | 11 ++-- .../cyclicGAMGInterface/cyclicGAMGInterface.H | 19 ++----- .../processorGAMGInterface.C | 15 +++--- .../processorGAMGInterface.H | 14 ++--- .../meshes/lduMesh/lduPrimitiveMesh.C | 4 +- .../constraint/cyclic/cyclicPointPatch.H | 20 ++----- .../mapPolyMesh/mapDistribute/mapDistribute.H | 10 ++-- .../basic/coupled/coupledPolyPatch.H | 33 +++--------- .../constraint/cyclic/cyclicPolyPatch.C | 34 ++++++++---- .../processorCyclicPolyPatch.H | 30 ++--------- .../globalIndexAndTransform.C | 18 +++---- .../transform/transformer/transformer.H | 18 ++++++- .../transform/transformer/transformerI.H | 15 +++++- .../transformer/transformerTemplates.C | 16 +++++- .../motionSmoother/motionSmootherAlgo.C | 7 ++- .../constraint/cyclic/cyclicFvPatchField.C | 7 +-- .../constraint/cyclic/cyclicFvPatchField.H | 18 +++---- .../cyclicAMI/cyclicAMIFvPatchField.C | 4 +- .../cyclicAMI/cyclicAMIFvPatchField.H | 17 +++--- .../jumpCyclic/jumpCyclicFvPatchField.C | 9 ++-- .../jumpCyclicAMI/jumpCyclicAMIFvPatchField.C | 4 +- .../processor/processorFvPatchField.C | 4 +- .../processor/processorFvPatchField.H | 13 ++--- .../processorCyclicFvPatchField.H | 12 +++-- .../cellToCell/extendedCellToCellStencil.C | 4 +- .../cellToFace/extendedCellToFaceStencil.C | 4 +- .../faceToCell/extendedFaceToCellStencil.C | 4 +- .../fvPatches/basic/coupled/coupledFvPatch.H | 12 ++--- .../constraint/cyclic/cyclicFvPatch.C | 8 +-- .../constraint/cyclic/cyclicFvPatch.H | 20 ++----- .../constraint/cyclicAMI/cyclicAMIFvPatch.C | 8 +-- .../constraint/cyclicAMI/cyclicAMIFvPatch.H | 20 ++----- .../constraint/processor/processorFvPatch.C | 17 +++--- .../constraint/processor/processorFvPatch.H | 20 ++----- .../processorCyclic/processorCyclicFvPatch.H | 20 ++----- src/lagrangian/basic/particle/particle.C | 10 ++-- .../basic/particle/particleTemplates.C | 20 +++---- .../meshRefinement/meshRefinement.C | 4 +- .../cyclicAMIGAMGInterfaceField.H | 14 ++--- .../cyclicAMIGAMGInterface.H | 14 ++--- .../cyclicAMILduInterface.H | 9 ++-- .../cyclicAMILduInterfaceField.C | 6 +-- .../cyclicAMILduInterfaceField.H | 12 ++--- .../cyclicAMIPointPatch/cyclicAMIPointPatch.H | 20 ++----- .../cyclicAMIPointPatchField.C | 6 +-- .../cyclicAMIPointPatchField.H | 20 +++---- .../cyclicAMIPolyPatch/cyclicAMIPolyPatch.C | 52 ++++++++++--------- .../cyclicRepeatAMILduInterfaceField.C | 4 +- .../cyclicRepeatAMIPolyPatch.C | 14 +---- .../algorithms/MeshWave/FaceCellWave.C | 18 +++---- .../algorithms/PointEdgeWave/PointEdgeWave.C | 10 ++-- 66 files changed, 372 insertions(+), 510 deletions(-) diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshZones.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshZones.C index 430cd32344..79abcb7e2e 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshZones.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshZones.C @@ -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) { diff --git a/applications/utilities/mesh/manipulation/createPatch/createPatch.C b/applications/utilities/mesh/manipulation/createPatch/createPatch.C index 5519810807..6725b427c6 100644 --- a/applications/utilities/mesh/manipulation/createPatch/createPatch.C +++ b/applications/utilities/mesh/manipulation/createPatch/createPatch.C @@ -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(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(pp) && pp.size()) { @@ -784,20 +784,20 @@ int main(int argc, char *argv[]) { const cyclicPolyPatch& nbr = cycpp.neighbPatch(); - const_cast(cpp.separation()) = + const_cast(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; } } } diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.C index 48e44111aa..354a8a0d80 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.C @@ -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 @@ -138,7 +138,7 @@ void Foam::cyclicPointPatchField::swapAddSeparated const edgeList& pairs = cyclicPatch_.transformPairs(); - if (doTransform()) + if (transform().template transforms()) { // Transform both sides. forAll(pairs, pairi) @@ -147,8 +147,8 @@ void Foam::cyclicPointPatchField::swapAddSeparated label nbrPointi = pairs[pairi][1]; Type tmp = pf[pointi]; - pf[pointi] = transform(forwardT(), nbrPf[nbrPointi]); - nbrPf[nbrPointi] = transform(reverseT(), tmp); + pf[pointi] = transform().transform(nbrPf[nbrPointi]); + nbrPf[nbrPointi] = transform().invTransform(tmp); } } else @@ -158,6 +158,7 @@ void Foam::cyclicPointPatchField::swapAddSeparated Swap(pf[pairs[pairi][0]], nbrPf[pairs[pairi][1]]); } } + this->addToInternalField(pField, pf); nbr.addToInternalField(pField, nbrPf); } diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.H index 4175beb71e..34edd903d3 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.H @@ -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 @@ -141,19 +141,15 @@ public: //- Does the patch field perform the transformation virtual bool doTransform() const { - return !(cyclicPatch_.parallel() || pTraits::rank == 0); + return + cyclicPatch_.transform().rotates() + && pTraits::rank != 0; } - //- Return face transformation tensor - virtual const tensor& forwardT() const + //- Return transformation between the coupled patches + virtual const transformer& transform() const { - return cyclicPatch_.forwardT(); - } - - //- Return neighbour-cell transformation tensor - virtual const tensor& reverseT() const - { - return cyclicPatch_.reverseT(); + return cyclicPatch_.transform(); } diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/processor/processorPointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/constraint/processor/processorPointPatchField.H index dbe32ddbcd..5d2ab59a0f 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/processor/processorPointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/processor/processorPointPatchField.H @@ -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 @@ -150,10 +150,8 @@ public: virtual bool doTransform() const { return - !( - procPatch_.procPolyPatch().parallel() - || pTraits::rank == 0 - ); + procPatch_.procPolyPatch().transform().rotates() + && pTraits::rank != 0; } diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.C index d7a924d00b..6ed5ca2b02 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.C @@ -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 @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "processorCyclicPointPatchField.H" -#include "transformField.H" #include "processorPolyPatch.H" @@ -165,10 +164,11 @@ void Foam::processorCyclicPointPatchField::swapAddSeparated if (doTransform()) { - const processorCyclicPolyPatch& ppp = - procPatch_.procCyclicPolyPatch(); - - transform(receiveBuf_, ppp.forwardT(), receiveBuf_); + procPatch_.procCyclicPolyPatch().transform().transform + ( + receiveBuf_, + receiveBuf_ + ); } // All points are separated diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.H index a3a4df7380..c7e1ddef54 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.H @@ -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 @@ -154,10 +154,8 @@ public: virtual bool doTransform() const { return - !( - pTraits::rank == 0 - || procPatch_.procPolyPatch().parallel() - ); + procPatch_.procPolyPatch().transform().rotates() + && pTraits::rank != 0; } diff --git a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/cyclicLduInterface.H b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/cyclicLduInterface.H index 46738f13d4..41ecf2af20 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/cyclicLduInterface.H +++ b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/cyclicLduInterface.H @@ -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 @@ -36,6 +36,7 @@ SourceFiles #define cyclicLduInterface_H #include "lduInterface.H" +#include "transformer.H" #include "primitiveFieldsFwd.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -73,11 +74,8 @@ public: //- Return processor number virtual const cyclicLduInterface& neighbPatch() const = 0; - //- Return face transformation tensor - virtual const tensor& forwardT() const = 0; - - //- Return face reverse transformation tensor - virtual const tensor& reverseT() const = 0; + //- Return transformation between the coupled patches + virtual const transformer& transform() const = 0; }; diff --git a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterface.H b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterface.H index 37ee99bacd..c1ac67f464 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterface.H +++ b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterface.H @@ -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 @@ -37,6 +37,7 @@ SourceFiles #define processorLduInterface_H #include "lduInterface.H" +#include "transformer.H" #include "primitiveFieldsFwd.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -93,12 +94,13 @@ public: //- Return neighbour processor number (rank in communicator) virtual int neighbProcNo() const = 0; - //- Return face transformation tensor - virtual const tensor& forwardT() const = 0; + //- Return transformation between the coupled patches + virtual const transformer& transform() const = 0; //- Return message tag used for sending virtual int tag() const = 0; + // Transfer functions //- Raw send function diff --git a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/cyclicLduInterfaceField/cyclicLduInterfaceField.C b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/cyclicLduInterfaceField/cyclicLduInterfaceField.C index 7fe4188ced..c79e0cd3bf 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/cyclicLduInterfaceField/cyclicLduInterfaceField.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/cyclicLduInterfaceField/cyclicLduInterfaceField.C @@ -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 @@ -30,7 +30,7 @@ License namespace Foam { -defineTypeNameAndDebug(cyclicLduInterfaceField, 0); + defineTypeNameAndDebug(cyclicLduInterfaceField, 0); } @@ -50,7 +50,7 @@ void Foam::cyclicLduInterfaceField::transformCoupleField { if (doTransform()) { - f *= pow(diag(forwardT()).component(cmpt), rank()); + f *= pow(diag(transform().R()).component(cmpt), rank()); } } diff --git a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/cyclicLduInterfaceField/cyclicLduInterfaceField.H b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/cyclicLduInterfaceField/cyclicLduInterfaceField.H index 17fbc1d5b3..7bfa988d30 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/cyclicLduInterfaceField/cyclicLduInterfaceField.H +++ b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/cyclicLduInterfaceField/cyclicLduInterfaceField.H @@ -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 @@ -36,6 +36,7 @@ SourceFiles #define cyclicLduInterfaceField_H #include "primitiveFieldsFwd.H" +#include "transformer.H" #include "typeInfo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -74,11 +75,8 @@ public: //- Is the transform required virtual bool doTransform() const = 0; - //- Return face transformation tensor - virtual const tensor& forwardT() const = 0; - - //- Return neighbour-cell transformation tensor - virtual const tensor& reverseT() const = 0; + //- Return the transformation + virtual const transformer& transform() const = 0; //- Return rank of component for transform virtual int rank() const = 0; @@ -106,14 +104,14 @@ public: #include "tensorField.H" template -void Foam::cyclicLduInterfaceField::transformCoupleField +inline void Foam::cyclicLduInterfaceField::transformCoupleField ( Field& f ) const { if (doTransform()) { - transform(f, forwardT(), f); + transform().transform(f, f); } } diff --git a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/processorLduInterfaceField/processorLduInterfaceField.C b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/processorLduInterfaceField/processorLduInterfaceField.C index b6177259c4..ea77a34bf8 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/processorLduInterfaceField/processorLduInterfaceField.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/processorLduInterfaceField/processorLduInterfaceField.C @@ -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 @@ -50,7 +50,7 @@ void Foam::processorLduInterfaceField::transformCoupleField { if (doTransform()) { - f *= pow(diag(forwardT()).component(cmpt), rank()); + f *= pow(diag(transform().R()).component(cmpt), rank()); } } diff --git a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/processorLduInterfaceField/processorLduInterfaceField.H b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/processorLduInterfaceField/processorLduInterfaceField.H index 66edd906eb..1e1ed83d20 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/processorLduInterfaceField/processorLduInterfaceField.H +++ b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/processorLduInterfaceField/processorLduInterfaceField.H @@ -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 @@ -36,6 +36,7 @@ SourceFiles #define processorLduInterfaceField_H #include "primitiveFieldsFwd.H" +#include "transformer.H" #include "typeInfo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -83,8 +84,8 @@ public: //- Is the transform required virtual bool doTransform() const = 0; - //- Return face transformation tensor - virtual const tensor& forwardT() const = 0; + //- Return transformation between the coupled patches + virtual const transformer& transform() const = 0; //- Return rank of component for transform virtual int rank() const = 0; @@ -119,7 +120,7 @@ void Foam::processorLduInterfaceField::transformCoupleField { if (doTransform()) { - transform(f, forwardT(), f); + transform().transform(f, f); } } diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.H b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.H index 078bdd4871..92167abb25 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.H +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.H @@ -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 @@ -115,16 +115,10 @@ public: return doTransform_; } - //- Return face transformation tensor - virtual const tensor& forwardT() const + //- Return the transformation + virtual const transformer& transform() const { - return cyclicInterface_.forwardT(); - } - - //- Return neighbour-cell transformation tensor - virtual const tensor& reverseT() const - { - return cyclicInterface_.reverseT(); + return cyclicInterface_.transform(); } //- Return rank of component for transform diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorGAMGInterfaceField/processorGAMGInterfaceField.H b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorGAMGInterfaceField/processorGAMGInterfaceField.H index 723956eaf4..a06eddd1a7 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorGAMGInterfaceField/processorGAMGInterfaceField.H +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorGAMGInterfaceField/processorGAMGInterfaceField.H @@ -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 @@ -174,10 +174,10 @@ public: return doTransform_; } - //- Return face transformation tensor - virtual const tensor& forwardT() const + //- Return transformation between the coupled patches + virtual const transformer& transform() const { - return procInterface_.forwardT(); + return procInterface_.transform(); } //- Return rank of component for transform diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.C index 0e1d1a62bb..27501a39d5 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -84,8 +84,7 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface refCast(fineInterface).neighbPatchID() ), owner_(refCast(fineInterface).owner()), - forwardT_(refCast(fineInterface).forwardT()), - reverseT_(refCast(fineInterface).reverseT()) + transform_(refCast(fineInterface).transform()) { // From coarse face to coarse cell DynamicList