regionCoupledBaseFvPatch.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::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 nbrPatchID() const
119  {
120  return regionCoupledBase_.nbrPatchID();
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& nbrPatch() const
131  {
132  return refCast<const regionCoupledBaseFvPatch>
133  (
134  nbrFvMesh().boundary()
135  [
136  regionCoupledBase_.nbrPatchID()
137  ]
138  );
139  }
140 
141  //- Return a reference to the AMI interpolator
142  virtual const AMIInterpolation& 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_.nbrPatchID()
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 // ************************************************************************* //
const word & regionCoupleType() const
Return the interface type.
const fvBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Definition: fvPatch.H:180
Base class with common functionality for regionCoupled polyPatch. It includes AMI.
bool sameRegion() const
Returns if it is the same Region.
label nbrPatchID() const
Neighbour patch ID.
An abstract base class for region coupled interfaces.
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
const fvPatch & patch() const
Return fvPatch.
virtual ~regionCoupledBaseFvPatch()
Destructor.
regionCoupledBaseFvPatch(const polyPatch &pp, const fvPatch &patch)
Construct from polyPatch.
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:106
const AMIInterpolation & AMI() const
Return a reference to the AMI interpolator.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:62
TypeName("regionCoupledBase")
Runtime type information.
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:239
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
bool owner() const
Does this side own the patch?
const fvPatch & patch_
Reference to fvPatch.
virtual const labelUList & faceCells() const =0
Return faceCell addressing.
const regionCoupledBase & regionCoupledBase_
Reference to regionCoupledBase.
virtual const polyMesh & nbrMesh() const
Returns neighbour polyMesh.
const fvMesh & mesh() const
Return the mesh reference.
A class for handling words, derived from string.
Definition: word.H:59
virtual bool owner() const
Is it the owner?
virtual const word & regionCoupleType() const =0
Return the type.
virtual label nbrPatchID() const
Return neighbour.
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
Base class of regionCoupledFvPatch with common functionality for regionCoupledFvPatch and regionCoupl...
virtual const AMIInterpolation & AMI() const
Return a reference to the AMI interpolator.
bool sameRegion() const
Cached sampleRegion != mesh.name()
const fvMesh & nbrFvMesh() const
Returns fvMesh.
const word & nbrRegionName() const
Neighbour region name.
const fvPatch & neighbFvPatch() const
Return neighbor fvPatch.
virtual const regionCoupledBaseFvPatch & nbrPatch() const
Return regionCoupledBase neighb Patch.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
const regionCoupledBase & regionCoupledPatch() const
Return regionCoupledPolyPatch.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
Namespace for OpenFOAM.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
Definition: fvMesh.C:540