cyclicFvPatch.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011 OpenFOAM Foundation
9 Copyright (C) 2019 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::cyclicFvPatch
29
30Description
31 Cyclic-plane patch.
32
33SourceFiles
34 cyclicFvPatch.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef cyclicFvPatch_H
39#define cyclicFvPatch_H
40
41#include "coupledFvPatch.H"
42#include "cyclicLduInterface.H"
43#include "cyclicPolyPatch.H"
44#include "fvBoundaryMesh.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51/*---------------------------------------------------------------------------*\
52 Class cyclicFvPatch Declaration
53\*---------------------------------------------------------------------------*/
55class cyclicFvPatch
56:
57 public coupledFvPatch,
59{
60 // Private data
61
62 const cyclicPolyPatch& cyclicPolyPatch_;
63
64
65protected:
66
67 // Protected Member functions
68
69 //- Make patch weighting factors
70 void makeWeights(scalarField&) const;
71
72
73public:
74
75 //- Runtime type information
76 TypeName(cyclicPolyPatch::typeName_());
77
78
79 // Constructors
80
81 //- Construct from polyPatch
83 :
85 cyclicPolyPatch_(refCast<const cyclicPolyPatch>(patch))
86 {}
87
88
89 // Member functions
90
91
92 // Access
93
94 //- Return local reference cast into the cyclic patch
95 const cyclicPolyPatch& cyclicPatch() const
96 {
97 return cyclicPolyPatch_;
98 }
99
100 //- Return neighbour
101 virtual label neighbPatchID() const
102 {
103 return cyclicPolyPatch_.neighbPatchID();
104 }
106 virtual bool owner() const
107 {
108 return cyclicPolyPatch_.owner();
109 }
110
111 //- Return processor number
112 virtual const cyclicFvPatch& neighbPatch() const
113 {
114 return refCast<const cyclicFvPatch>
115 (
116 this->boundaryMesh()[cyclicPolyPatch_.neighbPatchID()]
117 );
118 }
119
120 //- Are the cyclic planes parallel
121 virtual bool parallel() const
122 {
123 return cyclicPolyPatch_.parallel();
124 }
125
126 //- Return face transformation tensor
127 virtual const tensorField& forwardT() const
128 {
129 return cyclicPolyPatch_.forwardT();
130 }
131
132 //- Return neighbour-cell transformation tensor
133 virtual const tensorField& reverseT() const
134 {
135 return cyclicPolyPatch_.reverseT();
136 }
138 const cyclicFvPatch& neighbFvPatch() const
139 {
140 return refCast<const cyclicFvPatch>
141 (
142 this->boundaryMesh()[cyclicPolyPatch_.neighbPatchID()]
143 );
144 }
145
146
147 //- Return delta (P to N) vectors across coupled patch
148 virtual tmp<vectorField> delta() const;
149
150
151 // Interface transfer functions
152
153 //- Return the values of the given internal data adjacent to
154 //- the interface as a field
156 (
157 const labelUList& internalData
158 ) const;
159
160
161 //- Return the values of the given internal data adjacent to
162 //- the interface as a field using a mapping faceCell
164 (
165 const labelUList& internalData,
166 const labelUList& faceCell
167 ) const;
168
169
170 //- Return neighbour field
172 (
173 const Pstream::commsTypes commsType,
174 const labelUList& internalData
175 ) const;
176
177};
178
179
180// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181
182} // End namespace Foam
183
184// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185
186#endif
187
188// ************************************************************************* //
commsTypes
Types of communications.
Definition: UPstream.H:67
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
Definition: boundaryMesh.H:63
An abstract base class for patches that couple regions of the computational domain e....
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
virtual bool parallel() const
Are the cyclic planes parallel.
virtual const tensorField & forwardT() const
Return face transformation tensor.
Cyclic-plane patch.
Definition: cyclicFvPatch.H:58
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
virtual bool owner() const
void makeWeights(scalarField &) const
Make patch weighting factors.
Definition: cyclicFvPatch.C:45
cyclicFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from polyPatch.
Definition: cyclicFvPatch.H:81
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
TypeName(cyclicPolyPatch::typeName_())
Runtime type information.
virtual label neighbPatchID() const
Return neighbour.
virtual bool parallel() const
Are the cyclic planes parallel.
virtual tmp< vectorField > delta() const
Return delta (P to N) vectors across coupled patch.
Definition: cyclicFvPatch.C:62
const cyclicFvPatch & neighbFvPatch() const
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
Definition: cyclicFvPatch.C:97
const cyclicPolyPatch & cyclicPatch() const
Return local reference cast into the cyclic patch.
Definition: cyclicFvPatch.H:94
virtual const cyclicFvPatch & neighbPatch() const
Return processor number.
virtual const tensorField & forwardT() const
Return face transformation tensor.
An abstract base class for cyclic coupled interfaces.
Cyclic plane patch.
virtual bool owner() const
Does this side own the patch ?
virtual label neighbPatchID() const
Neighbour patchID.
Foam::fvBoundaryMesh.
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:167
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
A class for managing temporary objects.
Definition: tmp.H:65
Namespace for OpenFOAM.
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:131
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73