From 87dc042618253e981c45df52e740acd12221a369 Mon Sep 17 00:00:00 2001
From: Henry <Henry>
Date: Thu, 26 Apr 2012 15:17:35 +0100
Subject: [PATCH] LduMatrix: Added support for AMI and jump conditions

---
 applications/test/PisoFoam/PisoFoam.C         |  4 +-
 .../LduInterfaceField/LduInterfaceField.H     | 43 ++++------
 .../cyclicGAMGInterfaceField.H                | 26 +++---
 .../processorCyclicGAMGInterfaceField.C       | 43 ----------
 .../processorCyclicGAMGInterfaceField.H       | 79 ------------------
 src/finiteVolume/Make/files                   |  1 -
 .../basic/coupled/coupledFvPatchField.H       | 10 +++
 .../constraint/cyclic/cyclicFvPatchField.C    | 14 +---
 .../cyclicAMI/cyclicAMIFvPatchField.C         | 29 +++++++
 .../cyclicAMI/cyclicAMIFvPatchField.H         |  9 ++
 .../jumpCyclic/jumpCyclicFvPatchField.C       | 50 ++++++++++-
 .../jumpCyclic/jumpCyclicFvPatchField.H       | 11 ++-
 .../processorCyclicFvPatchField.H             |  2 -
 .../processorCyclicFvPatchFields.H            |  2 +-
 .../processorCyclicFvPatchScalarField.C       | 83 -------------------
 .../processorCyclicFvPatchScalarField.H       | 69 ---------------
 .../cyclicAMILduInterfaceField.H              | 28 +++++++
 17 files changed, 171 insertions(+), 332 deletions(-)
 delete mode 100644 src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchScalarField.C
 delete mode 100644 src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchScalarField.H

diff --git a/applications/test/PisoFoam/PisoFoam.C b/applications/test/PisoFoam/PisoFoam.C
index a3ea54b5681..67f0084e719 100644
--- a/applications/test/PisoFoam/PisoFoam.C
+++ b/applications/test/PisoFoam/PisoFoam.C
@@ -102,8 +102,8 @@ int main(int argc, char *argv[])
                         "{"
                         "    /*solver          SmoothSolver;*/"
                         "    smoother        GaussSeidel;"
-                        "    solver           PBiCCCG;"
-                        "    preconditioner   DILU;"
+                        "    solver           PBiCICG;"
+                        "    preconditioner   none;"
                         "    tolerance        (1e-7 1e-7 1);"
                         "    relTol           (0 0 0);"
                         "}"
diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduInterfaceField/LduInterfaceField.H b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduInterfaceField/LduInterfaceField.H
index adacc45ed24..06718d1c786 100644
--- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduInterfaceField/LduInterfaceField.H
+++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduInterfaceField/LduInterfaceField.H
@@ -88,33 +88,26 @@ public:
 
     // Member Functions
 
-        //- Initialise neighbour matrix update
-        virtual void initInterfaceMatrixUpdate
-        (
-            Field<Type>&,
-            const Field<Type>&,
-            const scalarField&,
-            const Pstream::commsTypes commsType
-        ) const
-        {}
+        // Coupled interface functionality
 
-        //- Update result field based on interface functionality
-        virtual void updateInterfaceMatrix
-        (
-            Field<Type>&,
-            const Field<Type>&,
-            const scalarField&,
-            const Pstream::commsTypes commsType
-        ) const // = 0;
-        {
-            notImplemented
+            //- Initialise neighbour matrix update
+            virtual void initInterfaceMatrixUpdate
+            (
+                Field<Type>&,
+                const Field<Type>&,
+                const scalarField&,
+                const Pstream::commsTypes commsType
+            ) const
+            {}
+
+            //- Update result field based on interface functionality
+            virtual void updateInterfaceMatrix
             (
-                "updateInterfaceMatrix"
-                "(Field<Type>&, const Field<Type>&,"
-                "const scalarField&,"
-                "const Pstream::commsTypes commsType) const"
-            );
-        }
+                Field<Type>&,
+                const Field<Type>&,
+                const scalarField&,
+                const Pstream::commsTypes commsType
+            ) const = 0;
 };
 
 
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 6224dc0ac65..29677f0c503 100644
--- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.H
+++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.H
@@ -105,19 +105,6 @@ public:
             }
 
 
-        // Interface matrix update
-
-            //- Update result field based on interface functionality
-            virtual void updateInterfaceMatrix
-            (
-                scalarField& result,
-                const scalarField& psiInternal,
-                const scalarField& coeffs,
-                const direction cmpt,
-                const Pstream::commsTypes commsType
-            ) const;
-
-
         //- Cyclic interface functions
 
             //- Does the interface field perform the transfromation
@@ -143,6 +130,19 @@ public:
             {
                 return rank_;
             }
+
+
+        // Interface matrix update
+
+            //- Update result field based on interface functionality
+            virtual void updateInterfaceMatrix
+            (
+                scalarField& result,
+                const scalarField& psiInternal,
+                const scalarField& coeffs,
+                const direction cmpt,
+                const Pstream::commsTypes commsType
+            ) const;
 };
 
 
diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorCyclicGAMGInterfaceField/processorCyclicGAMGInterfaceField.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorCyclicGAMGInterfaceField/processorCyclicGAMGInterfaceField.C
index df3ae4b4086..c0b1d8927da 100644
--- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorCyclicGAMGInterfaceField/processorCyclicGAMGInterfaceField.C
+++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorCyclicGAMGInterfaceField/processorCyclicGAMGInterfaceField.C
@@ -59,47 +59,4 @@ Foam::processorCyclicGAMGInterfaceField::~processorCyclicGAMGInterfaceField()
 {}
 
 
-// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
-
-//void Foam::processorCyclicGAMGInterfaceField::initInterfaceMatrixUpdate
-//(
-//    scalarField&,
-//    const scalarField&,
-//    const scalarField&,
-//    const direction,
-//    const Pstream::commsTypes commsType
-//) const
-//{
-//    procInterface_.compressedSend
-//    (
-//        commsType,
-//        procInterface_.interfaceInternalField(psiInternal)()
-//    );
-//}
-//
-//
-//void Foam::processorCyclicGAMGInterfaceField::updateInterfaceMatrix
-//(
-//    scalarField& result,
-//    const scalarField&,
-//    const scalarField& coeffs,
-//    const direction cmpt,
-//    const Pstream::commsTypes commsType
-//) const
-//{
-//    scalarField pnf
-//    (
-//        procInterface_.compressedReceive<scalar>(commsType, coeffs.size())
-//    );
-//    transformCoupleField(pnf, cmpt);
-//
-//    const labelUList& faceCells = procInterface_.faceCells();
-//
-//    forAll(faceCells, elemI)
-//    {
-//        result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
-//    }
-//}
-
-
 // ************************************************************************* //
diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorCyclicGAMGInterfaceField/processorCyclicGAMGInterfaceField.H b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorCyclicGAMGInterfaceField/processorCyclicGAMGInterfaceField.H
index 3c842dac9c1..55e6471b46a 100644
--- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorCyclicGAMGInterfaceField/processorCyclicGAMGInterfaceField.H
+++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorCyclicGAMGInterfaceField/processorCyclicGAMGInterfaceField.H
@@ -50,18 +50,6 @@ class processorCyclicGAMGInterfaceField
 :
     public processorGAMGInterfaceField
 {
-    // Private data
-
-//        //- Local reference cast into the processor interface
-//        const processorCyclicGAMGInterface& procInterface_;
-//
-//        //- Is the transform required
-//        bool doTransform_;
-//
-//        //- Rank of component for transformation
-//        int rank_;
-//
-
     // Private Member Functions
 
         //- Disallow default bitwise copy construct
@@ -93,73 +81,6 @@ public:
     // Destructor
 
         virtual ~processorCyclicGAMGInterfaceField();
-
-
-    // Member Functions
-
-//        // Access
-//
-//            //- Return size
-//            label size() const
-//            {
-//                return procInterface_.size();
-//            }
-//
-//
-//        // Interface matrix update
-//
-//            //- Initialise neighbour matrix update
-//            virtual void initInterfaceMatrixUpdate
-//            (
-//                scalarField& result,
-//                const scalarField& psiInternal,
-//                const scalarField& coeffs,
-//                const direction cmpt,
-//                const Pstream::commsTypes commsType
-//            ) const;
-//
-//            //- Update result field based on interface functionality
-//            virtual void updateInterfaceMatrix
-//            (
-//                scalarField& result,
-//                const scalarField& psiInternal,
-//                const scalarField& coeffs,
-//                const direction cmpt,
-//                const Pstream::commsTypes commsType
-//            ) const;
-//
-//
-//        //- Processor interface functions
-//
-//            //- Return processor number
-//            virtual int myProcNo() const
-//            {
-//                return procInterface_.myProcNo();
-//            }
-//
-//            //- Return neigbour processor number
-//            virtual int neighbProcNo() const
-//            {
-//                return procInterface_.neighbProcNo();
-//            }
-//
-//            //- Does the interface field perform the transfromation
-//            virtual bool doTransform() const
-//            {
-//                return doTransform_;
-//            }
-//
-//            //- Return face transformation tensor
-//            virtual const tensorField& forwardT() const
-//            {
-//                return procInterface_.forwardT();
-//            }
-//
-//            //- Return rank of component for transform
-//            virtual int rank() const
-//            {
-//                return rank_;
-//            }
 };
 
 
diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files
index c7e7453b1f5..3691354d0bc 100644
--- a/src/finiteVolume/Make/files
+++ b/src/finiteVolume/Make/files
@@ -107,7 +107,6 @@ $(constraintFvPatchFields)/nonuniformTransformCyclic/nonuniformTransformCyclicFv
 $(constraintFvPatchFields)/processor/processorFvPatchFields.C
 $(constraintFvPatchFields)/processor/processorFvPatchScalarField.C
 $(constraintFvPatchFields)/processorCyclic/processorCyclicFvPatchFields.C
-$(constraintFvPatchFields)/processorCyclic/processorCyclicFvPatchScalarField.C
 $(constraintFvPatchFields)/symmetry/symmetryFvPatchFields.C
 $(constraintFvPatchFields)/wedge/wedgeFvPatchFields.C
 $(constraintFvPatchFields)/wedge/wedgeFvPatchScalarField.C
diff --git a/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.H
index 88f473829f8..8677c34ed3d 100644
--- a/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.H
+++ b/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.H
@@ -185,6 +185,16 @@ public:
                 const Pstream::commsTypes commsType
             ) const = 0;
 
+            //- Update result field based on interface functionality
+            virtual void updateInterfaceMatrix
+            (
+                Field<Type>&,
+                const Field<Type>&,
+                const scalarField&,
+                const Pstream::commsTypes commsType
+            ) const = 0;
+
+
         //- Write
         virtual void write(Ostream&) const;
 };
diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C
index 90638bf40c3..0e23db6c3cd 100644
--- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C
@@ -198,15 +198,10 @@ void cyclicFvPatchField<Type>::updateInterfaceMatrix
     const Pstream::commsTypes
 ) const
 {
-    scalarField pnf(this->size());
-
     const labelUList& nbrFaceCells =
         cyclicPatch().cyclicPatch().neighbPatch().faceCells();
 
-    forAll(pnf, facei)
-    {
-        pnf[facei] = psiInternal[nbrFaceCells[facei]];
-    }
+    scalarField pnf(psiInternal, nbrFaceCells);
 
     // Transform according to the transformation tensors
     transformCoupleField(pnf, cmpt);
@@ -230,15 +225,10 @@ void cyclicFvPatchField<Type>::updateInterfaceMatrix
     const Pstream::commsTypes
 ) const
 {
-    Field<Type> pnf(this->size());
-
     const labelUList& nbrFaceCells =
         cyclicPatch().cyclicPatch().neighbPatch().faceCells();
 
-    forAll(pnf, facei)
-    {
-        pnf[facei] = psiInternal[nbrFaceCells[facei]];
-    }
+    Field<Type> pnf(psiInternal, nbrFaceCells);
 
     // Transform according to the transformation tensors
     transformCoupleField(pnf);
diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.C
index 287d036f5e1..fc488487573 100644
--- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.C
@@ -229,6 +229,35 @@ void Foam::cyclicAMIFvPatchField<Type>::updateInterfaceMatrix
 }
 
 
+template<class Type>
+void Foam::cyclicAMIFvPatchField<Type>::updateInterfaceMatrix
+(
+    Field<Type>& result,
+    const Field<Type>& psiInternal,
+    const scalarField& coeffs,
+    const Pstream::commsTypes
+) const
+{
+    const labelUList& nbrFaceCells =
+        cyclicAMIPatch_.cyclicAMIPatch().neighbPatch().faceCells();
+
+    Field<Type> pnf(psiInternal, nbrFaceCells);
+
+    // Transform according to the transformation tensors
+    transformCoupleField(pnf);
+
+    pnf = cyclicAMIPatch_.interpolate(pnf);
+
+    // Multiply the field by coefficients and add into the result
+    const labelUList& faceCells = cyclicAMIPatch_.faceCells();
+
+    forAll(faceCells, elemI)
+    {
+        result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
+    }
+}
+
+
 template<class Type>
 void Foam::cyclicAMIFvPatchField<Type>::write(Ostream& os) const
 {
diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.H
index 8814a7584a8..933a865f300 100644
--- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.H
+++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.H
@@ -167,6 +167,15 @@ public:
                 const Pstream::commsTypes commsType
             ) const;
 
+            //- Update result field based on interface functionality
+            virtual void updateInterfaceMatrix
+            (
+                Field<Type>&,
+                const Field<Type>&,
+                const scalarField&,
+                const Pstream::commsTypes commsType
+            ) const;
+
 
         // Cyclic AMI coupled interface functions
 
diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C
index 669ea108b45..193008daffc 100644
--- a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C
@@ -151,7 +151,7 @@ void jumpCyclicFvPatchField<Type>::updateInterfaceMatrix
 
     if (&psiInternal == &this->internalField())
     {
-        tmp<Field<scalar> > tjf = jump();
+        tmp<Field<scalar> > tjf = jump()().component(cmpt);
         if (!this->cyclicPatch().owner())
         {
             tjf = -tjf;
@@ -183,6 +183,54 @@ void jumpCyclicFvPatchField<Type>::updateInterfaceMatrix
 }
 
 
+template<class Type>
+void jumpCyclicFvPatchField<Type>::updateInterfaceMatrix
+(
+    Field<Type>& result,
+    const Field<Type>& psiInternal,
+    const scalarField& coeffs,
+    const Pstream::commsTypes
+) const
+{
+    Field<Type> pnf(this->size());
+
+    const labelUList& nbrFaceCells =
+        this->cyclicPatch().neighbFvPatch().faceCells();
+
+    if (&psiInternal == &this->internalField())
+    {
+        tmp<Field<Type> > tjf = jump();
+        if (!this->cyclicPatch().owner())
+        {
+            tjf = -tjf;
+        }
+        const Field<Type>& jf = tjf();
+
+        forAll(*this, facei)
+        {
+            pnf[facei] = psiInternal[nbrFaceCells[facei]] - jf[facei];
+        }
+    }
+    else
+    {
+        forAll(*this, facei)
+        {
+            pnf[facei] = psiInternal[nbrFaceCells[facei]];
+        }
+    }
+
+    // Transform according to the transformation tensors
+    this->transformCoupleField(pnf);
+
+    // Multiply the field by coefficients and add into the result
+    const labelUList& faceCells = this->cyclicPatch().faceCells();
+    forAll(faceCells, elemI)
+    {
+        result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
+    }
+}
+
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 } // End namespace Foam
diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.H
index 72113a56260..4c4f94bce6e 100644
--- a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.H
+++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.H
@@ -109,7 +109,7 @@ public:
             }
 
             //- Return the "jump" across the patch as a "half" field
-            virtual tmp<Field<scalar> > jump() const = 0;
+            virtual tmp<Field<Type> > jump() const = 0;
 
 
         // Evaluation functions
@@ -126,6 +126,15 @@ public:
                 const direction cmpt,
                 const Pstream::commsTypes commsType
             ) const;
+
+            //- Update result field based on interface functionality
+            virtual void updateInterfaceMatrix
+            (
+                Field<Type>&,
+                const Field<Type>&,
+                const scalarField&,
+                const Pstream::commsTypes commsType
+            ) const;
 };
 
 
diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchField.H
index 6447c9e067c..e9bd3620e60 100644
--- a/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchField.H
+++ b/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchField.H
@@ -150,8 +150,6 @@ public:
             {
                 return procPatch_.forwardT();
             }
-
-
 };
 
 
diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchFields.H
index 93bfe8a2f57..608bf073243 100644
--- a/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchFields.H
+++ b/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchFields.H
@@ -26,7 +26,7 @@ License
 #ifndef processorCyclicFvPatchFields_H
 #define processorCyclicFvPatchFields_H
 
-#include "processorCyclicFvPatchScalarField.H"
+#include "processorCyclicFvPatchField.H"
 #include "fieldTypes.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchScalarField.C
deleted file mode 100644
index f70ca47a783..00000000000
--- a/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchScalarField.C
+++ /dev/null
@@ -1,83 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
-     \\/     M anipulation  |
--------------------------------------------------------------------------------
-License
-    This file is part of OpenFOAM.
-
-    OpenFOAM is free software: you can redistribute it and/or modify it
-    under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
-    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-    for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
-
-\*---------------------------------------------------------------------------*/
-
-#include "processorCyclicFvPatchScalarField.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-
-// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
-
-//template<>
-//void processorCyclicFvPatchField<scalar>::initInterfaceMatrixUpdate
-//(
-//    const scalarField& psiInternal,
-//    scalarField&,
-//    const lduMatrix&,
-//    const scalarField&,
-//    const direction,
-//    const Pstream::commsTypes commsType
-//) const
-//{
-//    procPatch_.compressedSend
-//    (
-//        commsType,
-//        patch().patchInternalField(psiInternal)()
-//    );
-//}
-//
-//
-//template<>
-//void processorCyclicFvPatchField<scalar>::updateInterfaceMatrix
-//(
-//    const scalarField&,
-//    scalarField& result,
-//    const lduMatrix&,
-//    const scalarField& coeffs,
-//    const direction,
-//    const Pstream::commsTypes commsType
-//) const
-//{
-//    scalarField pnf
-//    (
-//        procPatch_.compressedReceive<scalar>(commsType, this->size())()
-//    );
-//
-//    const labelUList& faceCells = patch().faceCells();
-//
-//    forAll(faceCells, facei)
-//    {
-//        result[faceCells[facei]] -= coeffs[facei]*pnf[facei];
-//    }
-//}
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace Foam
-
-// ************************************************************************* //
diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchScalarField.H
deleted file mode 100644
index 5a17b10fef3..00000000000
--- a/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchScalarField.H
+++ /dev/null
@@ -1,69 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
-     \\/     M anipulation  |
--------------------------------------------------------------------------------
-License
-    This file is part of OpenFOAM.
-
-    OpenFOAM is free software: you can redistribute it and/or modify it
-    under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
-    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-    for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
-
-\*---------------------------------------------------------------------------*/
-
-#ifndef processorCyclicFvPatchScalarField_H
-#define processorCyclicFvPatchScalarField_H
-
-#include "processorCyclicFvPatchField.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-
-// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
-
-//template<>
-//void processorCyclicFvPatchField<scalar>::initInterfaceMatrixUpdate
-//(
-//    scalarField&,
-//    const scalarField&,
-//    const scalarField&,
-//    const direction,
-//    const Pstream::commsTypes commsType
-//) const;
-//
-//
-//template<>
-//void processorCyclicFvPatchField<scalar>::updateInterfaceMatrix
-//(
-//    scalarField& result,
-//    const scalarField&,
-//    const scalarField& coeffs,
-//    const direction,
-//    const Pstream::commsTypes commsType
-//) const;
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace Foam
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-#endif
-
-// ************************************************************************* //
diff --git a/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMILduInterfaceField/cyclicAMILduInterfaceField.H b/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMILduInterfaceField/cyclicAMILduInterfaceField.H
index d34c04406b4..fd72bb07850 100644
--- a/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMILduInterfaceField/cyclicAMILduInterfaceField.H
+++ b/src/meshTools/AMIInterpolation/patches/cyclic/cyclicAMILduInterfaceField/cyclicAMILduInterfaceField.H
@@ -83,6 +83,10 @@ public:
             virtual int rank() const = 0;
 
 
+        //- Transform given patch field
+        template<class Type>
+        void transformCoupleField(Field<Type>& f) const;
+
         //- Transform given patch internal field
         void transformCoupleField
         (
@@ -96,6 +100,30 @@ public:
 
 } // End namespace Foam
 
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#include "tensorField.H"
+
+template<class Type>
+void Foam::cyclicAMILduInterfaceField::transformCoupleField
+(
+    Field<Type>& f
+) const
+{
+    if (doTransform())
+    {
+        if (forwardT().size() == 1)
+        {
+            transform(f, forwardT()[0], f);
+        }
+        else
+        {
+            transform(f, forwardT(), f);
+        }
+    }
+}
+
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 #endif
-- 
GitLab