Loading...
Searching...
No Matches
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 Foam_cyclicFvPatch_H
39#define Foam_cyclicFvPatch_H
40
41#include "cyclicPolyPatch.H"
42#include "coupledFvPatch.H"
43#include "cyclicLduInterface.H"
44#include "fvBoundaryMesh.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
51/*---------------------------------------------------------------------------*\
52 Class cyclicFvPatch Declaration
53\*---------------------------------------------------------------------------*/
54
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 // Access
92
93 //- Return local reference cast into the cyclic patch
94 const cyclicPolyPatch& cyclicPatch() const
95 {
96 return cyclicPolyPatch_;
97 }
98
99 //- Return neighbour
100 virtual label neighbPatchID() const
101 {
102 return cyclicPolyPatch_.neighbPatchID();
103 }
104
105 virtual bool owner() const
106 {
107 return cyclicPolyPatch_.owner();
108 }
109
110 //- Return processor number
111 virtual const cyclicFvPatch& neighbPatch() const
112 {
114 (
115 this->boundaryMesh()[cyclicPolyPatch_.neighbPatchID()]
116 );
117 }
119 //- Are the cyclic planes parallel
120 virtual bool parallel() const
121 {
122 return cyclicPolyPatch_.parallel();
123 }
124
125 //- Return face transformation tensor
126 virtual const tensorField& forwardT() const
127 {
128 return cyclicPolyPatch_.forwardT();
130
131 //- Return neighbour-cell transformation tensor
132 virtual const tensorField& reverseT() const
133 {
134 return cyclicPolyPatch_.reverseT();
135 }
136
138 {
140 (
141 this->boundaryMesh()[cyclicPolyPatch_.neighbPatchID()]
142 );
143 }
144
146 //- Return delta (P to N) vectors across coupled patch
147 virtual tmp<vectorField> delta() const;
148
149
150 // Interface transfer functions
151
152 //- Return the values of the given internal data adjacent to
153 //- the interface as a field
155 (
156 const labelUList& internalData
157 ) const;
158
159
160 //- Return the values of the given internal data adjacent to
161 //- the interface as a field using a mapping faceCell
163 (
164 const labelUList& internalData,
165 const labelUList& faceCell
166 ) const;
167
168
169 //- Return neighbour field
171 (
172 const Pstream::commsTypes commsType,
173 const labelUList& internalData
174 ) const;
175};
176
177
178// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179
180} // End namespace Foam
181
182// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183
184#endif
185
186// ************************************************************************* //
commsTypes
Communications types.
Definition UPstream.H:81
coupledFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from polyPatch.
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
virtual const tensorField & forwardT() const
Return face transformation tensor.
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.
cyclicFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from polyPatch.
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.
const cyclicFvPatch & neighbFvPatch() const
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
Return the values of the given internal data adjacent to the interface as a field.
const cyclicPolyPatch & cyclicPatch() const
Return local reference cast into the cyclic patch.
virtual const cyclicFvPatch & neighbPatch() const
Return processor number.
virtual const tensorField & forwardT() const
Return face transformation tensor.
cyclicLduInterface() noexcept=default
Default construct.
Cyclic plane patch.
virtual label neighbPatchID() const
Neighbour patchID.
A fvBoundaryMesh is a fvPatch list with a reference to the associated fvMesh, with additional search ...
const polyPatch & patch() const noexcept
Return the polyPatch.
Definition fvPatch.H:202
const fvBoundaryMesh & boundaryMesh() const noexcept
Return boundaryMesh reference.
Definition fvPatch.H:268
A patch is a list of labels that address the faces in the global face list.
Definition polyPatch.H:73
A class for managing temporary objects.
Definition tmp.H:75
Namespace for OpenFOAM.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
Definition typeInfo.H:172
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
UList< label > labelUList
A UList of labels.
Definition UList.H:75
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68