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-2020 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  const cyclicPolyPatch& cyclicPolyPatch_;
60 
61 
62 protected:
63 
64  // Protected Member functions
65 
66  //- Make patch weighting factors
67  void makeWeights(scalarField&) const;
68 
69 
70 public:
71 
72  //- Runtime type information
73  TypeName(cyclicPolyPatch::typeName_());
74 
75 
76  // Constructors
77 
78  //- Construct from polyPatch
79  cyclicFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
80  :
81  coupledFvPatch(patch, bm),
82  cyclicPolyPatch_(refCast<const cyclicPolyPatch>(patch))
83  {}
84 
85 
86  // Member Functions
87 
88  // Access
89 
90  //- Return local reference cast into the cyclic patch
91  const cyclicPolyPatch& cyclicPatch() const
92  {
93  return cyclicPolyPatch_;
94  }
95 
96  //- Return neighbour
97  virtual label nbrPatchID() const
98  {
99  return cyclicPolyPatch_.nbrPatchID();
100  }
102  virtual bool owner() const
103  {
104  return cyclicPolyPatch_.owner();
105  }
106 
107  //- Return processor number
108  virtual const cyclicFvPatch& nbrPatch() const
109  {
110  return refCast<const cyclicFvPatch>
111  (
112  this->boundaryMesh()[cyclicPolyPatch_.nbrPatchID()]
113  );
114  }
115 
116  //- Return transformation between the coupled patches
117  virtual const transformer& transform() const
118  {
119  return cyclicPolyPatch_.transform();
120  }
122  const cyclicFvPatch& neighbFvPatch() const
123  {
124  return refCast<const cyclicFvPatch>
125  (
126  this->boundaryMesh()[cyclicPolyPatch_.nbrPatchID()]
127  );
128  }
129 
130 
131  //- Return delta (P to N) vectors across coupled patch
132  virtual tmp<vectorField> delta() const;
133 
134 
135  // Interface transfer functions
136 
137  //- Return the values of the given internal data adjacent to
138  // the interface as a field
140  (
141  const labelUList& internalData
142  ) const;
143 
144  //- Return neighbour field
146  (
147  const Pstream::commsTypes commsType,
148  const labelUList& internalData
149  ) const;
150 };
151 
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 } // End namespace Foam
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 #endif
160 
161 // ************************************************************************* //
const fvBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Definition: fvPatch.H:180
const cyclicPolyPatch & cyclicPatch() const
Return local reference cast into the cyclic patch.
Definition: cyclicFvPatch.H:90
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
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
Vector-tensor class used to perform translations, rotations and scaling operations in 3D space...
Definition: transformer.H:83
const cyclicFvPatch & neighbFvPatch() const
virtual label nbrPatchID() const
Return neighbour.
Definition: cyclicFvPatch.H:96
commsTypes
Types of communications.
Definition: UPstream.H:64
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:106
An abstract base class for patches that couple regions of the computational domain e...
An abstract base class for cyclic coupled interfaces.
virtual const transformer & transform() const
Return transformation between the coupled patches.
virtual const transformer & transform() const
Return transformation between the coupled patches.
virtual bool owner() const
Does this side own the patch ?
cyclicFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from polyPatch.
Definition: cyclicFvPatch.H:78
void makeWeights(scalarField &) const
Make patch weighting factors.
Definition: cyclicFvPatch.C:42
Cyclic plane patch.
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:138
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
Return the values of the given internal data adjacent to.
Cyclic-plane patch.
Definition: cyclicFvPatch.H:51
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:60
virtual tmp< vectorField > delta() const
Return delta (P to N) vectors across coupled patch.
Definition: cyclicFvPatch.C:74
TypeName(cyclicPolyPatch::typeName_())
Runtime type information.
virtual bool owner() const
virtual const cyclicFvPatch & nbrPatch() const
Return processor number.
Foam::fvBoundaryMesh.
A class for managing temporary objects.
Definition: PtrList.H:53
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
virtual label nbrPatchID() const
Neighbour patchID.
Namespace for OpenFOAM.