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 Generalized grid interface patch.
31 Hrvoje Jasak, Wikki Ltd. All rights reserved
36 \*---------------------------------------------------------------------------*/
41 #include "coupledFvPatch.H"
42 #include "ggiLduInterface.H"
43 #include "ggiPolyPatch.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 /*---------------------------------------------------------------------------*\
51 Class ggiFvPatch Declaration
52 \*---------------------------------------------------------------------------*/
56 public coupledFvPatch,
57 public ggiLduInterface
61 //- Reference to polyPatch
62 const ggiPolyPatch& ggiPolyPatch_;
67 // Protected Member functions
69 //- Make patch weighting factors
70 virtual void makeWeights(scalarField&) const;
72 //- Make patch face - neighbour cell distances
73 virtual void makeDeltaCoeffs(scalarField&) const;
75 //- Make patch face non-orthogonality correction vectors
76 virtual void makeCorrVecs(vectorField&) const;
81 //- Runtime type information
82 TypeName(ggiPolyPatch::typeName_());
87 //- Construct from components
88 ggiFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
90 coupledFvPatch(patch, bm),
91 ggiPolyPatch_(refCast<const ggiPolyPatch>(patch))
97 virtual ~ggiFvPatch();
104 //- Return shadow patch
105 const ggiFvPatch& shadow() const;
107 //- Use bridging to fix overlap error in interpolation
108 bool bridgeOverlap() const
110 return ggiPolyPatch_.bridgeOverlap();
113 //- Return delta (P to N) vectors across coupled patch
114 virtual tmp<vectorField> delta() const;
119 //- Interpolate face field
121 tmp<Field<Type> > interpolate(const Field<Type>& pf) const
123 return ggiPolyPatch_.interpolate(pf);
127 tmp<Field<Type> > interpolate(const tmp<Field<Type> >& tpf) const
129 return ggiPolyPatch_.interpolate(tpf);
132 //- Bridge interpolated face field for uncovered faces
136 const Field<Type>& bridgeField,
140 return ggiPolyPatch_.bridge(bridgeField, ff);
144 // Interface transfer functions
146 //- Is this the master side?
147 virtual bool master() const;
149 //- Is this the fine level?
150 virtual bool fineLevel() const;
152 //- Return shadow patch index
153 virtual label shadowIndex() const;
155 //- Return shadow interface
156 virtual const ggiLduInterface& shadowInterface() const;
159 virtual label zoneSize() const;
161 //- Return zone addressing
162 virtual const labelList& zoneAddressing() const;
164 //- Return addressing. Master side returns own addressing and
165 // slave side returns addressing from master
166 virtual const labelListList& addressing() const;
168 //- Is the patch localised on a single processor
169 virtual bool localParallel() const;
171 //- Return weights. Master side returns own weights and
172 // slave side returns weights from master
173 virtual const scalarListList& weights() const;
175 //- Return face transformation tensor
176 virtual const tensorField& forwardT() const
178 return coupledFvPatch::forwardT();
181 //- Return neighbour-cell transformation tensor
182 virtual const tensorField& reverseT() const
184 return coupledFvPatch::reverseT();
187 //- Return the values of the given internal data adjacent to
188 // the interface as a field
189 virtual tmp<labelField> interfaceInternalField
191 const unallocLabelList& internalData
194 //- Initialise interface data transfer
195 virtual void initTransfer
197 const Pstream::commsTypes commsType,
198 const unallocLabelList& interfaceData
201 //- Transfer and return neighbour field
202 virtual tmp<labelField> transfer
204 const Pstream::commsTypes commsType,
205 const unallocLabelList& interfaceData
208 //- Initialise transfer of internal field adjacent to the interface
209 virtual void initInternalFieldTransfer
211 const Pstream::commsTypes commsType,
212 const unallocLabelList& iF
215 //- Return neighbour field
216 virtual tmp<labelField> internalFieldTransfer
218 const Pstream::commsTypes commsType,
219 const unallocLabelList& internalData
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 } // End namespace Foam
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 // ************************************************************************* //