1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
28 An abstract base class for patches that couple regions of the
29 computational domain e.g. cyclic and processor-processor links.
34 \*---------------------------------------------------------------------------*/
36 #ifndef coupledFvPatch_H
37 #define coupledFvPatch_H
40 #include "lduInterface.H"
41 #include "coupledPolyPatch.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 /*---------------------------------------------------------------------------*\
49 Class coupledFvPatch Declaration
50 \*---------------------------------------------------------------------------*/
59 const coupledPolyPatch& coupledPolyPatch_;
64 // Protected Member Functions
66 //- Make patch weighting factors
67 virtual void makeWeights(scalarField&) const = 0;
69 //- Make patch face - neighbour cell distances
70 virtual void makeDeltaCoeffs(scalarField&) const = 0;
72 //- Make patch face non-orthogonality correction vectors
73 virtual void makeCorrVecs(vectorField&) const;
78 friend class surfaceInterpolation;
81 //- Runtime type information
82 TypeName(coupledPolyPatch::typeName_());
87 //- Construct from polyPatch
88 coupledFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
91 coupledPolyPatch_(refCast<const coupledPolyPatch>(patch))
97 virtual ~coupledFvPatch();
104 //- Return true if patch is coupled
105 virtual bool coupled() const
107 return coupledPolyPatch_.coupled();
110 //- Return face transformation tensor
111 const tensorField& forwardT() const
113 return coupledPolyPatch_.forwardT();
116 //- Return neighbour-cell transformation tensor
117 const tensorField& reverseT() const
119 return coupledPolyPatch_.reverseT();
122 //- Are the cyclic planes parallel
123 bool parallel() const
125 return coupledPolyPatch_.parallel();
128 //- Return faceCell addressing
129 virtual const unallocLabelList& faceCells() const
131 return fvPatch::faceCells();
134 //- Return delta (P to N) vectors across coupled patch
135 virtual tmp<vectorField> delta() const = 0;
138 // Interface transfer functions
140 //- Return the values of the given internal data adjacent to
141 // the interface as a field
142 virtual tmp<labelField> interfaceInternalField
144 const unallocLabelList& internalData
147 //- Initialise interface data transfer
148 virtual void initTransfer
150 const Pstream::commsTypes commsType,
151 const unallocLabelList& interfaceData
155 //- Transfer and return neighbour field
156 virtual tmp<labelField> transfer
158 const Pstream::commsTypes commsType,
159 const unallocLabelList& interfaceData
162 //- Initialise neighbour field transfer
163 virtual void initInternalFieldTransfer
165 const Pstream::commsTypes commsType,
170 //- Return neighbour field
171 virtual tmp<labelField> internalFieldTransfer
173 const Pstream::commsTypes commsType,
174 const unallocLabelList& iF
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 } // End namespace Foam
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 // ************************************************************************* //