regionCoupledFvPatch.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::regionCoupledFvPatch
26 
27 Description
28  Common functionality for regionCoupleFvPatch and regionCoupledWallFvPatch
29 
30 SourceFiles
31  regionCoupledFvPatch.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef regionCoupledFvPatch_H
36 #define regionCoupledFvPatch_H
37 
38 #include "fvPatch.H"
39 #include "fvMesh.H"
40 #include "Time.H"
41 #include "regionCoupledPolyPatch.H"
43 
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class regionCoupledFvPatch Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 :
56  public lduInterface,
57  public fvPatch,
59 {
60  // Private Data
61 
62  const regionCoupledPolyPatch& regionCoupledPolyPatch_;
63 
64  // Private members
65 
66  //- Return regionCoupledFvPatch nbr
67  const regionCoupledFvPatch& neighbFvPatch() const
68  {
69  return refCast<const regionCoupledFvPatch>
70  (
72  [
73  nbrPatchID()
74  ]
75  );
76  }
77 
78 
79 public:
80 
81  //- Runtime type information
82  TypeName(regionCoupledPolyPatch::typeName_());
83 
84 
85  // Constructors
86 
87  //- Construct from polyPatch
89  :
90  fvPatch(patch, bm),
92  (
93  patch,
94  *this
95  ),
96  regionCoupledPolyPatch_
97  (
98  refCast<const regionCoupledPolyPatch>(patch)
99  )
100  {}
101 
102 
103  //- Destructor
105  {}
106 
107 
108  // Member Functions
109 
110 
111  // Access
112 
113  //- Return faceCell addressing
114  virtual const labelUList& faceCells() const
115  {
116  return fvPatch::faceCells();
117  }
118 
119  //- Return true because this patch is coupled
120  virtual bool coupled() const
121  {
122  return regionCoupledPolyPatch_.coupled();
123  }
124 
125 
126  // Interface transfer functions
127 
128  //- Return the values of the given internal data adjacent to
129  // the interface as a field
131  (
132  const labelUList& internalData
133  ) const;
134 
135  //- Inherit initInternalFieldTransfer from lduInterface
137 
138  //- Initialise neighbour field transfer
140  (
141  const Pstream::commsTypes commsType,
142  labelUList& iF
143  ) const
144  {}
145 
146  //- Return neighbour field
148  (
149  const Pstream::commsTypes commsType,
150  const labelUList& iF
151  ) const;
152 };
153 
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 } // End namespace Foam
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 #endif
162 
163 // ************************************************************************* //
const fvPatch & patch() const
Return fvPatch.
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const
Return neighbour field.
virtual bool coupled() const
Is it coupled?
commsTypes
Types of communications.
Definition: UPstream.H:64
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:106
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:62
virtual bool coupled() const
Return true because this patch is coupled.
virtual const labelUList & faceCells() const
Return faceCell addressing.
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const
Initialise transfer of internal field adjacent to the interface.
Definition: lduInterface.H:95
virtual const labelUList & faceCells() const
Return faceCells.
Definition: fvPatch.C:99
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
TypeName(regionCoupledPolyPatch::typeName_())
Runtime type information.
Common functionality for regionCoupleFvPatch and regionCoupledWallFvPatch.
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, labelUList &iF) const
Initialise neighbour field transfer.
Region coupled polyPatch.
Base class of regionCoupledFvPatch with common functionality for regionCoupledFvPatch and regionCoupl...
const fvMesh & nbrFvMesh() const
Returns fvMesh.
Foam::fvBoundaryMesh.
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches...
Definition: lduInterface.H:53
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 tmp< labelField > interfaceInternalField(const labelUList &internalData) const
Return the values of the given internal data adjacent to.
Namespace for OpenFOAM.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
Definition: fvMesh.C:540
regionCoupledFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from polyPatch.