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 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::cyclicFvPatch
28 
29 Description
30  Cyclic-plane patch.
31 
32 SourceFiles
33  cyclicFvPatch.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef cyclicFvPatch_H
38 #define cyclicFvPatch_H
39 
40 #include "coupledFvPatch.H"
41 #include "cyclicLduInterface.H"
42 #include "cyclicPolyPatch.H"
43 #include "fvBoundaryMesh.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class cyclicFvPatch Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class cyclicFvPatch
55 :
56  public coupledFvPatch,
57  public cyclicLduInterface
58 {
59  // Private data
60 
61  const cyclicPolyPatch& cyclicPolyPatch_;
62 
63 
64 protected:
65 
66  // Protected Member functions
67 
68  //- Make patch weighting factors
69  void makeWeights(scalarField&) const;
70 
71 
72 public:
73 
74  //- Runtime type information
75  TypeName(cyclicPolyPatch::typeName_());
76 
77 
78  // Constructors
79 
80  //- Construct from polyPatch
81  cyclicFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
82  :
83  coupledFvPatch(patch, bm),
84  cyclicPolyPatch_(refCast<const cyclicPolyPatch>(patch))
85  {}
86 
87 
88  // Member functions
89 
90  // Access
91 
92  //- Return local reference cast into the cyclic patch
93  const cyclicPolyPatch& cyclicPatch() const
94  {
95  return cyclicPolyPatch_;
96  }
97 
98  //- Return neighbour
99  virtual label neighbPatchID() const
100  {
101  return cyclicPolyPatch_.neighbPatchID();
102  }
103 
104  virtual bool owner() const
105  {
106  return cyclicPolyPatch_.owner();
107  }
108 
109  //- Return processor number
110  virtual const cyclicFvPatch& neighbPatch() const
111  {
112  return refCast<const cyclicFvPatch>
113  (
114  this->boundaryMesh()[cyclicPolyPatch_.neighbPatchID()]
115  );
116  }
117 
118  //- Are the cyclic planes parallel
119  virtual bool parallel() const
120  {
121  return cyclicPolyPatch_.parallel();
122  }
123 
124  //- Return face transformation tensor
125  virtual const tensorField& forwardT() const
126  {
127  return cyclicPolyPatch_.forwardT();
128  }
129 
130  //- Return neighbour-cell transformation tensor
131  virtual const tensorField& reverseT() const
132  {
133  return cyclicPolyPatch_.reverseT();
134  }
135 
136  const cyclicFvPatch& neighbFvPatch() const
137  {
138  return refCast<const cyclicFvPatch>
139  (
140  this->boundaryMesh()[cyclicPolyPatch_.neighbPatchID()]
141  );
142  }
143 
144 
145  //- Return delta (P to N) vectors across coupled patch
146  virtual tmp<vectorField> delta() const;
147 
148 
149  // Interface transfer functions
150 
151  //- Return the values of the given internal data adjacent to
152  // the interface as a field
154  (
155  const labelUList& internalData
156  ) const;
157 
158  //- Return neighbour field
160  (
161  const Pstream::commsTypes commsType,
162  const labelUList& internalData
163  ) const;
164 };
165 
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 } // End namespace Foam
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 #endif
174 
175 // ************************************************************************* //
Foam::cyclicFvPatch::parallel
virtual bool parallel() const
Are the cyclic planes parallel.
Definition: cyclicFvPatch.H:118
Foam::cyclicFvPatch::makeWeights
void makeWeights(scalarField &) const
Make patch weighting factors.
Definition: cyclicFvPatch.C:44
Foam::cyclicFvPatch::interfaceInternalField
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
Return the values of the given internal data adjacent to.
Definition: cyclicFvPatch.C:96
cyclicPolyPatch.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::cyclicPolyPatch
Cyclic plane patch.
Definition: cyclicPolyPatch.H:65
Foam::coupledPolyPatch::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: coupledPolyPatch.H:296
Foam::coupledPolyPatch::reverseT
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: coupledPolyPatch.H:302
cyclicLduInterface.H
coupledFvPatch.H
Foam::fvPatch::boundaryMesh
const fvBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Definition: fvPatch.H:203
Foam::fvBoundaryMesh
Foam::fvBoundaryMesh.
Definition: fvBoundaryMesh.H:56
Foam::cyclicFvPatch::reverseT
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: cyclicFvPatch.H:130
Foam::coupledPolyPatch::parallel
virtual bool parallel() const
Are the cyclic planes parallel.
Definition: coupledPolyPatch.H:290
Foam::cyclicFvPatch::neighbFvPatch
const cyclicFvPatch & neighbFvPatch() const
Definition: cyclicFvPatch.H:135
Foam::cyclicFvPatch::TypeName
TypeName(cyclicPolyPatch::typeName_())
Runtime type information.
Foam::Field< scalar >
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::cyclicFvPatch::delta
virtual tmp< vectorField > delta() const
Return delta (P to N) vectors across coupled patch.
Definition: cyclicFvPatch.C:61
fvBoundaryMesh.H
Foam::cyclicPolyPatch::owner
virtual bool owner() const
Does this side own the patch ?
Definition: cyclicPolyPatch.H:320
Foam::cyclicFvPatch::owner
virtual bool owner() const
Definition: cyclicFvPatch.H:103
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::refCast
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:131
Foam::cyclicFvPatch::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: cyclicFvPatch.H:124
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:69
Foam::cyclicFvPatch
Cyclic-plane patch.
Definition: cyclicFvPatch.H:53
Foam::cyclicFvPatch::neighbPatch
virtual const cyclicFvPatch & neighbPatch() const
Return processor number.
Definition: cyclicFvPatch.H:109
Foam::UList< label >
Foam::cyclicFvPatch::neighbPatchID
virtual label neighbPatchID() const
Return neighbour.
Definition: cyclicFvPatch.H:98
Foam::fvPatch::patch
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:161
Foam::cyclicFvPatch::internalFieldTransfer
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
Definition: cyclicFvPatch.C:105
Foam::coupledFvPatch
An abstract base class for patches that couple regions of the computational domain e....
Definition: coupledFvPatch.H:53
Foam::cyclicPolyPatch::neighbPatchID
virtual label neighbPatchID() const
Neighbour patchID.
Definition: cyclicPolyPatch.C:815
Foam::cyclicFvPatch::cyclicFvPatch
cyclicFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from polyPatch.
Definition: cyclicFvPatch.H:80
Foam::cyclicLduInterface
An abstract base class for cyclic coupled interfaces.
Definition: cyclicLduInterface.H:52
Foam::cyclicFvPatch::cyclicPatch
const cyclicPolyPatch & cyclicPatch() const
Return local reference cast into the cyclic patch.
Definition: cyclicFvPatch.H:92