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 | Copyright (C) 2011 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 neighbPatchID() const
98  {
99  return cyclicPolyPatch_.neighbPatchID();
100  }
102  virtual bool owner() const
103  {
104  return cyclicPolyPatch_.owner();
105  }
106 
107  //- Return processor number
108  virtual const cyclicFvPatch& neighbPatch() const
109  {
110  return refCast<const cyclicFvPatch>
111  (
112  this->boundaryMesh()[cyclicPolyPatch_.neighbPatchID()]
113  );
114  }
115 
116  //- Are the cyclic planes parallel
117  virtual bool parallel() const
118  {
119  return cyclicPolyPatch_.parallel();
120  }
121 
122  //- Return face transformation tensor
123  virtual const tensorField& forwardT() const
124  {
125  return cyclicPolyPatch_.forwardT();
126  }
127 
128  //- Return neighbour-cell transformation tensor
129  virtual const tensorField& reverseT() const
130  {
131  return cyclicPolyPatch_.reverseT();
132  }
134  const cyclicFvPatch& neighbFvPatch() const
135  {
136  return refCast<const cyclicFvPatch>
137  (
138  this->boundaryMesh()[cyclicPolyPatch_.neighbPatchID()]
139  );
140  }
141 
142 
143  //- Return delta (P to N) vectors across coupled patch
144  virtual tmp<vectorField> delta() const;
145 
146 
147  // Interface transfer functions
148 
149  //- Return the values of the given internal data adjacent to
150  // the interface as a field
152  (
153  const labelUList& internalData
154  ) const;
155 
156  //- Return neighbour field
158  (
159  const Pstream::commsTypes commsType,
160  const labelUList& internalData
161  ) const;
162 };
163 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #endif
172 
173 // ************************************************************************* //
virtual tmp< vectorField > delta() const
Return delta (P to N) vectors across coupled patch.
Definition: cyclicFvPatch.C:59
virtual label neighbPatchID() const
Return neighbour.
Definition: cyclicFvPatch.H:96
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
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
void makeWeights(scalarField &) const
Make patch weighting factors.
Definition: cyclicFvPatch.C:42
commsTypes
Types of communications.
Definition: UPstream.H:64
virtual label neighbPatchID() const
Neighbour patchID.
virtual const tensorField & forwardT() const
Return face transformation tensor.
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 cyclicFvPatch & neighbPatch() const
Return processor number.
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:143
virtual bool owner() const
cyclicFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from polyPatch.
Definition: cyclicFvPatch.H:78
Cyclic plane patch.
const cyclicPolyPatch & cyclicPatch() const
Return local reference cast into the cyclic patch.
Definition: cyclicFvPatch.H:90
virtual bool parallel() const
Are the cyclic planes parallel.
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
TypeName(cyclicPolyPatch::typeName_())
Runtime type information.
const cyclicFvPatch & neighbFvPatch() const
virtual bool parallel() const
Are the cyclic planes parallel.
Foam::fvBoundaryMesh.
virtual bool owner() const
Does this side own the patch ?
virtual const tensorField & forwardT() const
Return face transformation tensor.
A class for managing temporary objects.
Definition: PtrList.H:54
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
Return the values of the given internal data adjacent to.
Definition: cyclicFvPatch.C:94
Namespace for OpenFOAM.
const fvBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Definition: fvPatch.H:185