1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
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 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
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
29 An abstract base class for patches that couple regions of the
30 computational domain e.g. cyclic and processor-processor links.
35 \*---------------------------------------------------------------------------*/
37 #ifndef coupledFvPatch_H
38 #define coupledFvPatch_H
41 #include "lduInterface.H"
42 #include "coupledPolyPatch.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 /*---------------------------------------------------------------------------*\
50 Class coupledFvPatch Declaration
51 \*---------------------------------------------------------------------------*/
60 const coupledPolyPatch& coupledPolyPatch_;
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;
76 friend class surfaceInterpolation;
79 //- Runtime type information
80 TypeName(coupledPolyPatch::typeName_());
85 //- Construct from polyPatch
86 coupledFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
89 coupledPolyPatch_(refCast<const coupledPolyPatch>(patch))
95 virtual ~coupledFvPatch();
102 //- Return true because this patch is coupled
103 virtual bool coupled() const
105 return coupledPolyPatch_.coupled();
108 //- Return face transformation tensor
109 const tensorField& forwardT() const
111 return coupledPolyPatch_.forwardT();
114 //- Return neighbour-cell transformation tensor
115 const tensorField& reverseT() const
117 return coupledPolyPatch_.reverseT();
120 //- Are the cyclic planes parallel
121 bool parallel() const
123 return coupledPolyPatch_.parallel();
126 //- Return faceCell addressing
127 virtual const unallocLabelList& faceCells() const
129 return fvPatch::faceCells();
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
142 const unallocLabelList& internalData
145 //- Initialise interface data transfer
146 virtual void initTransfer
148 const Pstream::commsTypes commsType,
149 const unallocLabelList& interfaceData
153 //- Transfer and return neighbour field
154 virtual tmp<labelField> transfer
156 const Pstream::commsTypes commsType,
157 const unallocLabelList& interfaceData
160 //- Initialise neighbour field transfer
161 virtual void initInternalFieldTransfer
163 const Pstream::commsTypes commsType,
168 //- Return neighbour field
169 virtual tmp<labelField> internalFieldTransfer
171 const Pstream::commsTypes commsType,
172 const unallocLabelList& iF
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 } // End namespace Foam
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 // ************************************************************************* //