cyclicFvPatch.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2026 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::cyclicFvPatch
26 
27 Description
28  Cyclic-plane patch.
29 
30 SourceFiles
31  cyclicFvPatch.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef cyclicFvPatch_H
36 #define cyclicFvPatch_H
37 
38 #include "coupledFvPatch.H"
39 #include "cyclicLduInterface.H"
40 #include "cyclicPolyPatch.H"
41 #include "fvBoundaryMesh.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class cyclicFvPatch Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class cyclicFvPatch
53 :
54  public coupledFvPatch,
55  public cyclicLduInterface
56 {
57  // Private Data
58 
59  //- Reference to the corresponding cyclicPolyPatch
60  const cyclicPolyPatch& cyclicPoly_;
61 
62 
63 protected:
64 
65  // Protected Member functions
66 
67  //- Make patch weighting factors
68  void makeWeights(scalarField&) const;
69 
70 
71 public:
72 
73  //- Runtime type information
74  TypeName(cyclicPolyPatch::typeName_());
75 
76 
77  // Constructors
78 
79  //- Construct from polyPatch
80  cyclicFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
81  :
82  coupledFvPatch(patch, bm),
83  cyclicPoly_(refCast<const cyclicPolyPatch>(patch))
84  {}
85 
86 
87  // Member Functions
88 
89  // Access
90 
91  //- Return neighbour
92  virtual label nbrPatchIndex() const
93  {
94  return cyclicPoly_.nbrPatchIndex();
95  }
96 
97  virtual bool owner() const
98  {
99  return cyclicPoly_.owner();
100  }
101 
102  //- Return processor number
103  virtual const cyclicFvPatch& nbrPatch() const
104  {
105  return refCast<const cyclicFvPatch>
106  (
107  this->boundaryMesh()[cyclicPoly_.nbrPatchIndex()]
108  );
109  }
110 
111  //- Return transformation between the coupled patches
112  virtual const transformer& transform() const
113  {
114  return cyclicPoly_.transform();
115  }
116 
117  const cyclicFvPatch& neighbFvPatch() const
118  {
119  return refCast<const cyclicFvPatch>
120  (
121  this->boundaryMesh()[cyclicPoly_.nbrPatchIndex()]
122  );
123  }
124 
125 
126  //- Return delta (P to N) vectors across coupled patch
127  virtual tmp<vectorField> delta() const;
128 
129 
130  // Interface transfer functions
131 
132  //- Return the values of the given internal data adjacent to
133  // the interface as a field
135  (
136  const labelUList& internalData
137  ) const;
138 
139  //- Return neighbour field
141  (
142  const Pstream::commsTypes commsType,
143  const labelUList& internalData
144  ) const;
145 };
146 
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 } // End namespace Foam
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #endif
155 
156 // ************************************************************************* //
commsTypes
Types of communications.
Definition: UPstream.H:65
An abstract base class for patches that couple regions of the computational domain e....
Cyclic-plane patch.
Definition: cyclicFvPatch.H:55
virtual label nbrPatchIndex() const
Return neighbour.
Definition: cyclicFvPatch.H:91
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
Definition: cyclicFvPatch.C:73
virtual bool owner() const
Does this side own the patch ?
Definition: cyclicFvPatch.H:96
void makeWeights(scalarField &) const
Make patch weighting factors.
Definition: cyclicFvPatch.C:42
cyclicFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from polyPatch.
Definition: cyclicFvPatch.H:79
TypeName(cyclicPolyPatch::typeName_())
Runtime type information.
virtual const transformer & transform() const
Return transformation between the coupled patches.
const cyclicFvPatch & neighbFvPatch() const
virtual tmp< vectorField > delta() const
Return delta (P to N) vectors across coupled patch.
Definition: cyclicFvPatch.C:55
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
Return the values of the given internal data adjacent to.
Definition: cyclicFvPatch.C:64
virtual const cyclicFvPatch & nbrPatch() const
Return processor number.
An abstract base class for cyclic coupled interfaces.
Cyclic plane patch.
virtual bool owner() const
Does this side own the patch ?
virtual const transformer & transform() const
Return transformation between the coupled patches.
virtual label nbrPatchIndex() const
Neighbour patchID.
Foam::fvBoundaryMesh.
const fvBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Definition: fvPatch.H:180
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:71
A class for managing temporary objects.
Definition: tmp.H:55
Vector-tensor class used to perform translations, rotations and scaling operations in 3D space.
Definition: transformer.H:84
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:141