initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / fvMesh / fvPatches / basic / coupled / coupledFvPatch.H
blobb4ff97d2905fede035c947117c387b9ef8eb3179
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM 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 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::coupledFvPatch
28 Description
29     An abstract base class for patches that couple regions of the
30     computational domain e.g. cyclic and processor-processor links.
32 SourceFiles
33     coupledFvPatch.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef coupledFvPatch_H
38 #define coupledFvPatch_H
40 #include "fvPatch.H"
41 #include "lduInterface.H"
42 #include "coupledPolyPatch.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 /*---------------------------------------------------------------------------*\
50                          Class coupledFvPatch Declaration
51 \*---------------------------------------------------------------------------*/
53 class coupledFvPatch
55     public lduInterface,
56     public fvPatch
58     // Private data
60         const coupledPolyPatch& coupledPolyPatch_;
63 protected:
65     // Protected Member Functions
67         //- Make patch weighting factors
68         virtual void makeWeights(scalarField&) const = 0;
70         //- Make patch face - neighbour cell distances
71         virtual void makeDeltaCoeffs(scalarField&) const = 0;
74 public:
76     friend class surfaceInterpolation;
79     //- Runtime type information
80     TypeName(coupledPolyPatch::typeName_());
83     // Constructors
85         //- Construct from polyPatch
86         coupledFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
87         :
88             fvPatch(patch, bm),
89             coupledPolyPatch_(refCast<const coupledPolyPatch>(patch))
90         {}
93     // Destructor
95         virtual ~coupledFvPatch();
98     // Member Functions
100         // Access
102             //- Return true because this patch is coupled
103             virtual bool coupled() const
104             {
105                 return coupledPolyPatch_.coupled();
106             }
108             //- Return face transformation tensor
109             const tensorField& forwardT() const
110             {
111                 return coupledPolyPatch_.forwardT();
112             }
114             //- Return neighbour-cell transformation tensor
115             const tensorField& reverseT() const
116             {
117                 return coupledPolyPatch_.reverseT();
118             }
120             //- Are the cyclic planes parallel
121             bool parallel() const
122             {
123                 return coupledPolyPatch_.parallel();
124             }
126             //- Return faceCell addressing
127             virtual const unallocLabelList& faceCells() const
128             {
129                 return fvPatch::faceCells();
130             }
132             //- Return delta (P to N) vectors across coupled patch
133             virtual tmp<vectorField> delta() const = 0;
136         // Interface transfer functions
138             //- Return the values of the given internal data adjacent to
139             //  the interface as a field
140             virtual tmp<labelField> interfaceInternalField
141             (
142                 const unallocLabelList& internalData
143             ) const = 0;
145             //- Initialise interface data transfer
146             virtual void initTransfer
147             (
148                 const Pstream::commsTypes commsType,
149                 const unallocLabelList& interfaceData
150             ) const
151             {}
153             //- Transfer and return neighbour field
154             virtual tmp<labelField> transfer
155             (
156                 const Pstream::commsTypes commsType,
157                 const unallocLabelList& interfaceData
158             ) const = 0;
160             //- Initialise neighbour field transfer
161             virtual void initInternalFieldTransfer
162             (
163                 const Pstream::commsTypes commsType,
164                 unallocLabelList& iF
165             ) const
166             {}
168             //- Return neighbour field
169             virtual tmp<labelField> internalFieldTransfer
170             (
171                 const Pstream::commsTypes commsType,
172                 const unallocLabelList& iF
173             ) const = 0;
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 } // End namespace Foam
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 #endif
185 // ************************************************************************* //