Forward compatibility: flex
[foam-extend-3.2.git] / src / finiteVolume / fvMesh / fvPatches / constraint / overlapGgi / overlapGgiFvPatch.H
blob759bbe98a4eea980a88e270be1b3c3bf7af8cf54
1 /*---------------------------------------------------------------------------*\
2   =========                 |
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 -------------------------------------------------------------------------------
8 License
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/>.
24 Class
25     overlapGgiFvPatch
27 Description
28     Partial overlap generalised grid interface (GGI) patch.  Master side
29     remains unchanged and the slave side will be copied as needed
30     to pave the master patch surface.
32     This implies that the master patch has got a larger angular pitch than
33     the slave and that master and slave are aligned at one edge.
34     Master and slave will specify the pitch, based on which the expansion
35     of the master side will be performed and used in interpolation.
37 Author
38     Hrvoje Jasak, Wikki Ltd.  All rights reserved.
40 SourceFiles
41     overlapGgiFvPatch.C
43 \*---------------------------------------------------------------------------*/
45 #ifndef overlapGgiFvPatch_H
46 #define overlapGgiFvPatch_H
48 #include "ggiFvPatch.H"
49 #include "overlapGgiLduInterface.H"
50 #include "overlapGgiPolyPatch.H"
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 namespace Foam
57 /*---------------------------------------------------------------------------*\
58                          Class overlapGgiFvPatch Declaration
59 \*---------------------------------------------------------------------------*/
61 class overlapGgiFvPatch
63     public coupledFvPatch,
64     public overlapGgiLduInterface
66     // Private Data
68         //- Reference to polyPatch
69         const overlapGgiPolyPatch& overlapGgiPolyPatch_;
72 protected:
74     // Protected Member functions
76         //- Make patch weighting factors
77         virtual void makeWeights(scalarField&) const;
79         //- Make patch face - neighbour cell distances
80         virtual void makeDeltaCoeffs(scalarField&) const;
82         //- Make patch face non-orthogonality correction vectors
83         virtual void makeCorrVecs(vectorField&) const;
86 public:
88     //- Runtime type information
89     TypeName(overlapGgiPolyPatch::typeName_());
92     // Constructors
94         //- Construct from components
95         overlapGgiFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
96         :
97             coupledFvPatch(patch, bm),
98             overlapGgiPolyPatch_(refCast<const overlapGgiPolyPatch>(patch))
99         {}
102     // Destructor
104         virtual ~overlapGgiFvPatch()
105         {}
108     // Member functions
110         // Access
112             //- Is this the master side?
113             bool master() const
114             {
115                 return overlapGgiPolyPatch_.master();
116             }
118             //- Return shadow patch
119             const overlapGgiFvPatch& shadow() const;
121             //- Interpolate face field
122             template<class Type>
123             tmp<Field<Type> > interpolate(const Field<Type>& pf) const
124             {
125                 return overlapGgiPolyPatch_.interpolate(pf);
126             }
128             template<class Type>
129             tmp<Field<Type> > interpolate(const tmp<Field<Type> >& tpf) const
130             {
131                 return overlapGgiPolyPatch_.interpolate(tpf);
132             }
134             //- Return delta (P to N) vectors across coupled patch
135             virtual tmp<vectorField> delta() const;
138         // Interface transfer functions
140             //- Return the values of the given internal data adjacent to
141             //  the interface as a field
142             virtual tmp<labelField> interfaceInternalField
143             (
144                 const unallocLabelList& internalData
145             ) const;
147             //- Transfer and return neighbour field
148             virtual tmp<labelField> transfer
149             (
150                 const Pstream::commsTypes commsType,
151                 const unallocLabelList& interfaceData
152             ) const;
154             //- Return neighbour field
155             virtual tmp<labelField> internalFieldTransfer
156             (
157                 const Pstream::commsTypes commsType,
158                 const unallocLabelList& internalData
159             ) const;
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 } // End namespace Foam
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 #endif
171 // ************************************************************************* //