Transferred copyright to the OpenFOAM Foundation
[OpenFOAM-2.0.x.git] / src / finiteVolume / fvMesh / fvPatches / constraint / cyclic / cyclicFvPatch.H
blob107a085927dbe51569f32436708e48865da77924
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
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
13     the Free Software Foundation, either version 3 of the License, or
14     (at your 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, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::cyclicFvPatch
27 Description
28     Cyclic-plane patch.
30 SourceFiles
31     cyclicFvPatch.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef cyclicFvPatch_H
36 #define cyclicFvPatch_H
38 #include "coupledFvPatch.H"
39 #include "cyclicLduInterface.H"
40 #include "cyclicPolyPatch.H"
41 #include "fvBoundaryMesh.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 /*---------------------------------------------------------------------------*\
49                            Class cyclicFvPatch Declaration
50 \*---------------------------------------------------------------------------*/
52 class cyclicFvPatch
54     public coupledFvPatch,
55     public cyclicLduInterface
57     // Private data
59         const cyclicPolyPatch& cyclicPolyPatch_;
62 protected:
64     // Protected Member functions
66         //- Make patch weighting factors
67         void makeWeights(scalarField&) const;
69         //- Make patch face - neighbour cell distances
70         void makeDeltaCoeffs(scalarField&) const;
73 public:
75     //- Runtime type information
76     TypeName(cyclicPolyPatch::typeName_());
79     // Constructors
81         //- Construct from polyPatch
82         cyclicFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
83         :
84             coupledFvPatch(patch, bm),
85             cyclicPolyPatch_(refCast<const cyclicPolyPatch>(patch))
86         {}
89     // Member functions
91         // Access
93             //- Return local reference cast into the cyclic patch
94             const cyclicPolyPatch& cyclicPatch() const
95             {
96                 return cyclicPolyPatch_;
97             }
99             //- Return neighbour
100             virtual label neighbPatchID() const
101             {
102                 return cyclicPolyPatch_.neighbPatchID();
103             }
105             virtual bool owner() const
106             {
107                 return cyclicPolyPatch_.owner();
108             }
110             //- Return processor number
111             virtual const cyclicFvPatch& neighbPatch() const
112             {
113                 return refCast<const cyclicFvPatch>
114                 (
115                     this->boundaryMesh()[cyclicPolyPatch_.neighbPatchID()]
116                 );
117             }
119             //- Are the cyclic planes parallel
120             virtual bool parallel() const
121             {
122                 return cyclicPolyPatch_.parallel();
123             }
125             //- Return face transformation tensor
126             virtual const tensorField& forwardT() const
127             {
128                 return cyclicPolyPatch_.forwardT();
129             }
131             //- Return neighbour-cell transformation tensor
132             virtual const tensorField& reverseT() const
133             {
134                 return cyclicPolyPatch_.reverseT();
135             }
137             const cyclicFvPatch& neighbFvPatch() const
138             {
139                 return refCast<const cyclicFvPatch>
140                 (
141                     this->boundaryMesh()[cyclicPolyPatch_.neighbPatchID()]
142                 );
143             }
146             //- Return delta (P to N) vectors across coupled patch
147             virtual tmp<vectorField> delta() const;
150         // Interface transfer functions
152             //- Return the values of the given internal data adjacent to
153             //  the interface as a field
154             virtual tmp<labelField> interfaceInternalField
155             (
156                 const labelUList& internalData
157             ) const;
159             //- Return neighbour field
160             virtual tmp<labelField> internalFieldTransfer
161             (
162                 const Pstream::commsTypes commsType,
163                 const labelUList& internalData
164             ) const;
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 } // End namespace Foam
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 #endif
176 // ************************************************************************* //