regionCoupledBaseFvPatch.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::regionCoupledBaseFvPatch
26 
27 Description
28  Base class of regionCoupledFvPatch with common functionality for
29  regionCoupledFvPatch and regionCoupledWallFvPatch
30 
31 SourceFiles
32  regionCoupledBaseFvPatch.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef regionCoupledBaseFvPatch_H
37 #define regionCoupledBaseFvPatch_H
38 
39 #include "regionCoupledBase.H"
40 #include "fvMesh.H"
41 #include "Time.H"
42 #include "polyPatch.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class regionCoupledBaseFvPatch Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 :
57 {
58 protected:
59 
60  // Protected data
61 
62  //- Reference to regionCoupledBase
64 
65  //- Reference to fvPatch
66  const fvPatch& patch_;
67 
68 
69  // Protected members
70 
71  //- Returns fvMesh
72  const fvMesh& nbrFvMesh() const
73  {
74  return
75  (
77  (
78  regionCoupledBase_.nbrRegionName()
79  )
80  );
81  }
82 
83 
84 public:
85 
86  //- Runtime type information
87  TypeName("regionCoupledBase");
88 
89 
90  // Constructors
91 
92  //- Construct from polyPatch
94  (
95  const polyPatch& pp,
96  const fvPatch& patch
97  )
98  :
100  regionCoupledBase_
101  (
102  refCast<const regionCoupledBase>(pp)
103  ),
104  patch_(patch)
105  {}
106 
107 
108  //- Destructor
109  virtual ~regionCoupledBaseFvPatch()
110  {}
111 
112 
113  // Member Functions
114 
115  // Access
116 
117  //- Return neighbour
118  virtual label neighbPatchID() const
119  {
120  return regionCoupledBase_.neighbPatchID();
121  }
122 
123  //- Is it the owner?
124  virtual bool owner() const
125  {
126  return regionCoupledBase_.owner();
127  }
128 
129  //- Return regionCoupledBase neighb Patch
130  virtual const regionCoupledBaseFvPatch& neighbPatch() const
131  {
132  return refCast<const regionCoupledBaseFvPatch>
133  (
134  nbrFvMesh().boundary()
135  [
136  regionCoupledBase_.neighbPatchID()
137  ]
138  );
139  }
140 
141  //- Return a reference to the AMI interpolator
142  virtual const AMIPatchToPatchInterpolation& AMI() const
143  {
144  return regionCoupledBase_.AMI();
145  }
146 
147  //- Returns neighbour polyMesh
148  virtual const polyMesh& nbrMesh() const
149  {
150  return
151  (
153  (
154  regionCoupledBase_.nbrRegionName()
155  )
156  );
157  }
158 
159  //- Return fvPatch
160  const fvPatch& patch() const
161  {
162  return patch_;
163  }
164 
165  //- Returns if it is the same Region
166  bool sameRegion() const
167  {
168  return regionCoupledBase_.sameRegion();
169  }
170 
171  //- Return regionCoupledPolyPatch
173  {
174  return regionCoupledBase_;
175  }
176 
177  //- Return neighbor fvPatch
178  const fvPatch& neighbFvPatch() const
179  {
180  return refCast<const fvPatch>
181  (
182  nbrFvMesh().boundary()
183  [
184  regionCoupledBase_.neighbPatchID()
185  ]
186  );
187  }
188 
189  //- Return the interface type
190  const word& regionCoupleType() const
191  {
192  return regionCoupledBase_.regionCoupleType();
193  }
194 
195 
196  //- Return faceCell addressing
197  virtual const labelUList& faceCells() const = 0;
198 
199 };
200 
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 } // End namespace Foam
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 #endif
209 
210 // ************************************************************************* //
virtual const AMIPatchToPatchInterpolation & AMI() const
Return a reference to the AMI interpolator.
label neighbPatchID() const
Neighbour patch ID.
const AMIPatchToPatchInterpolation & AMI() const
Return a reference to the AMI interpolator.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
virtual const polyMesh & nbrMesh() const
Returns neighbour polyMesh.
virtual const labelUList & faceCells() const =0
Return faceCell addressing.
Base class of regionCoupledFvPatch with common functionality for regionCoupledFvPatch and regionCoupl...
TypeName("regionCoupledBase")
Runtime type information.
const fvPatch & patch_
Reference to fvPatch.
A class for handling words, derived from string.
Definition: word.H:59
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 label neighbPatchID() const
Return neighbour.
const fvPatch & neighbFvPatch() const
Return neighbor fvPatch.
Namespace for OpenFOAM.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:243
virtual const regionCoupledBaseFvPatch & neighbPatch() const
Return regionCoupledBase neighb Patch.
const fvBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Definition: fvPatch.H:185
Base class with common functinality for regionCoupled polyPatch. It includes AMI. ...
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
bool owner() const
Does this side own the patch?
bool sameRegion() const
Cached sampleRegion != mesh.name()
const fvPatch & patch() const
Return fvPatch.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
const regionCoupledBase & regionCoupledPatch() const
Return regionCoupledPolyPatch.
const word & nbrRegionName() const
Neighbour region name.
An abstract base class for region coupled interfaces.
virtual const word & regionCoupleType() const =0
Return the type.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
const fvMesh & mesh() const
Return the mesh reference.
const word & regionCoupleType() const
Return the interface type.
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
const fvMesh & nbrFvMesh() const
Returns fvMesh.
bool sameRegion() const
Returns if it is the same Region.
const regionCoupledBase & regionCoupledBase_
Reference to regionCoupledBase.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:106
virtual ~regionCoupledBaseFvPatch()
Destructor.
regionCoupledBaseFvPatch(const polyPatch &pp, const fvPatch &patch)
Construct from polyPatch.
virtual bool owner() const
Is it the owner?
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
Definition: fvMesh.C:552