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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::cyclicFvPatch
29 
30 Description
31  Cyclic-plane patch.
32 
33 SourceFiles
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 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class cyclicFvPatch Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class cyclicFvPatch
56 :
57  public coupledFvPatch,
58  public cyclicLduInterface
59 {
60  // Private Data
61 
62  const cyclicPolyPatch& cyclicPolyPatch_;
63 
64 
65 protected:
66 
67  // Protected Member functions
68 
69  //- Make patch weighting factors
70  void makeWeights(scalarField&) const;
71 
72 
73 public:
74 
75  //- Runtime type information
76  TypeName(cyclicPolyPatch::typeName_());
77 
78 
79  // Constructors
80 
81  //- Construct from polyPatch
82  cyclicFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
83  :
84  coupledFvPatch(patch, bm),
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  {
113  return refCast<const cyclicFvPatch>
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();
129  }
130 
131  //- Return neighbour-cell transformation tensor
132  virtual const tensorField& reverseT() const
133  {
134  return cyclicPolyPatch_.reverseT();
135  }
136 
138  {
139  return refCast<const cyclicFvPatch>
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 // ************************************************************************* //
const cyclicPolyPatch & cyclicPatch() const
Return local reference cast into the cyclic patch.
Definition: cyclicFvPatch.H:97
virtual label neighbPatchID() const
Return neighbour.
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
commsTypes
Communications types.
Definition: UPstream.H:72
const cyclicFvPatch & neighbFvPatch() const
Type & refCast(U &obj)
A dynamic_cast (for references). Generates a FatalError on failed casts and uses the virtual type() m...
Definition: typeInfo.H:159
An abstract base class for patches that couple regions of the computational domain e...
An abstract base class for cyclic coupled interfaces.
virtual const tensorField & forwardT() const
Return face transformation tensor.
virtual bool parallel() const
Are the cyclic planes parallel.
virtual bool owner() const
Does this side own the patch ?
cyclicFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from polyPatch.
Definition: cyclicFvPatch.H:83
void makeWeights(scalarField &) const
Make patch weighting factors.
Definition: cyclicFvPatch.C:38
Cyclic plane patch.
virtual const cyclicFvPatch & neighbPatch() const
Return processor number.
virtual const tensorField & forwardT() const
Return face transformation tensor.
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
Return the values of the given internal data adjacent to the interface as a field.
Definition: cyclicFvPatch.C:90
Cyclic-plane patch.
Definition: cyclicFvPatch.H:50
const fvBoundaryMesh & boundaryMesh() const noexcept
Return boundaryMesh reference.
Definition: fvPatch.H:260
virtual tmp< vectorField > delta() const
Return delta (P to N) vectors across coupled patch.
Definition: cyclicFvPatch.C:55
TypeName(cyclicPolyPatch::typeName_())
Runtime type information.
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
virtual bool owner() const
Foam::fvBoundaryMesh.
virtual label neighbPatchID() const
Neighbour patchID.
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:69
const polyPatch & patch() const noexcept
Return the polyPatch.
Definition: fvPatch.H:202
virtual bool parallel() const
Are the cyclic planes parallel.
Namespace for OpenFOAM.