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 Region couple patch coupled two mesh regions for a solution in the same
32 Hrvoje Jasak, Wikki Ltd. All rights reserved
37 \*---------------------------------------------------------------------------*/
39 #ifndef regionCoupleFvPatch_H
40 #define regionCoupleFvPatch_H
42 #include "coupledFvPatch.H"
43 #include "ggiLduInterface.H"
44 #include "regionCouplePolyPatch.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 /*---------------------------------------------------------------------------*\
54 Class regionCoupleFvPatch Declaration
55 \*---------------------------------------------------------------------------*/
57 class regionCoupleFvPatch
59 public coupledFvPatch,
60 public ggiLduInterface
64 //- Reference to polyPatch
65 const regionCouplePolyPatch& rcPolyPatch_;
70 // Protected Member functions
72 //- Make patch weighting factors
73 virtual void makeWeights(scalarField&) const;
75 //- Make patch face - neighbour cell distances
76 virtual void makeDeltaCoeffs(scalarField&) const;
78 //- Make patch face non-orthogonality correction vectors
79 virtual void makeCorrVecs(vectorField&) const;
84 //- Runtime type information
85 TypeName(regionCouplePolyPatch::typeName_());
90 //- Construct from components
91 regionCoupleFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
93 coupledFvPatch(patch, bm),
94 rcPolyPatch_(refCast<const regionCouplePolyPatch>(patch))
100 virtual ~regionCoupleFvPatch();
107 //- Return true if coupled
108 virtual bool coupled() const;
110 //- Return shadow patch
111 const fvMesh& shadowRegion() const;
113 //- Return shadow patch
114 const regionCoupleFvPatch& shadow() const;
116 //- Use bridging to fix overlap error in interpolation
117 bool bridgeOverlap() const
119 return rcPolyPatch_.bridgeOverlap();
122 //- Return delta (P to N) vectors across coupled patch
123 virtual tmp<vectorField> delta() const;
128 //- Interpolate face field
130 tmp<Field<Type> > interpolate(const Field<Type>& pf) const
132 return rcPolyPatch_.interpolate(pf);
136 tmp<Field<Type> > interpolate(const tmp<Field<Type> >& tpf) const
138 return rcPolyPatch_.interpolate(tpf);
141 //- Bridge interpolated face field for uncovered faces
145 const Field<Type>& bridgeField,
149 return rcPolyPatch_.bridge(bridgeField, ff);
153 // Interface transfer functions
155 //- Is this the master side?
156 virtual bool master() const;
158 //- Is this the fine level?
159 virtual bool fineLevel() const;
161 //- Return shadow patch index
162 virtual label shadowIndex() const;
164 //- Return shadow interface
165 virtual const ggiLduInterface& shadowInterface() const;
168 virtual label zoneSize() const;
170 //- Return zone addressing
171 virtual const labelList& zoneAddressing() const;
173 //- Return addressing. Master side returns own addressing and
174 // slave side returns addressing from master
175 virtual const labelListList& addressing() const;
177 //- Is the patch localised on a single processor
178 virtual bool localParallel() const;
180 //- Return weights. Master side returns own weights and
181 // slave side returns weights from master
182 virtual const scalarListList& weights() const;
184 //- Return face transformation tensor
185 virtual const tensorField& forwardT() const
187 return coupledFvPatch::forwardT();
190 //- Return neighbour-cell transformation tensor
191 virtual const tensorField& reverseT() const
193 return coupledFvPatch::reverseT();
196 //- Return the values of the given internal data adjacent to
197 // the interface as a field
198 virtual tmp<labelField> interfaceInternalField
200 const unallocLabelList& internalData
203 //- Initialise interface data transfer
204 virtual void initTransfer
206 const Pstream::commsTypes commsType,
207 const unallocLabelList& interfaceData
210 //- Transfer and return neighbour field
211 virtual tmp<labelField> transfer
213 const Pstream::commsTypes commsType,
214 const unallocLabelList& interfaceData
217 //- Initialise transfer of internal field adjacent to the interface
218 virtual void initInternalFieldTransfer
220 const Pstream::commsTypes commsType,
221 const unallocLabelList& iF
224 //- Return neighbour field
225 virtual tmp<labelField> internalFieldTransfer
227 const Pstream::commsTypes commsType,
228 const unallocLabelList& internalData
233 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 } // End namespace Foam
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
241 // ************************************************************************* //