1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
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
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/>.
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 /*---------------------------------------------------------------------------*\
49 Class cyclicFvPatch Declaration
50 \*---------------------------------------------------------------------------*/
54 public coupledFvPatch,
55 public cyclicLduInterface
59 const cyclicPolyPatch& cyclicPolyPatch_;
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;
75 //- Runtime type information
76 TypeName(cyclicPolyPatch::typeName_());
81 //- Construct from polyPatch
82 cyclicFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
84 coupledFvPatch(patch, bm),
85 cyclicPolyPatch_(refCast<const cyclicPolyPatch>(patch))
93 //- Return local reference cast into the cyclic patch
94 const cyclicPolyPatch& cyclicPatch() const
96 return cyclicPolyPatch_;
100 virtual label neighbPatchID() const
102 return cyclicPolyPatch_.neighbPatchID();
105 virtual bool owner() const
107 return cyclicPolyPatch_.owner();
110 //- Return processor number
111 virtual const cyclicFvPatch& neighbPatch() const
113 return refCast<const cyclicFvPatch>
115 this->boundaryMesh()[cyclicPolyPatch_.neighbPatchID()]
119 //- Are the cyclic planes parallel
120 virtual bool parallel() const
122 return cyclicPolyPatch_.parallel();
125 //- Return face transformation tensor
126 virtual const tensorField& forwardT() const
128 return cyclicPolyPatch_.forwardT();
131 //- Return neighbour-cell transformation tensor
132 virtual const tensorField& reverseT() const
134 return cyclicPolyPatch_.reverseT();
137 const cyclicFvPatch& neighbFvPatch() const
139 return refCast<const cyclicFvPatch>
141 this->boundaryMesh()[cyclicPolyPatch_.neighbPatchID()]
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
156 const labelUList& internalData
159 //- Return neighbour field
160 virtual tmp<labelField> internalFieldTransfer
162 const Pstream::commsTypes commsType,
163 const labelUList& internalData
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 } // End namespace Foam
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 // ************************************************************************* //