oversetFvPatch.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) 2016-2021 OpenCFD Ltd.
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::oversetFvPatch
28 
29 Description
30  Patch for indicating interpolated boundaries (in overset meshes).
31 
32 SourceFiles
33  oversetFvPatch.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef oversetFvPatch_H
38 #define oversetFvPatch_H
39 
40 #include "coupledFvPatch.H"
41 #include "oversetLduInterface.H"
42 #include "lduInterface.H"
43 #include "fvPatch.H"
44 #include "oversetPolyPatch.H"
45 #include "fvBoundaryMesh.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class oversetFvPatch Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 class oversetFvPatch
57 :
58  public fvPatch,
59  public lduInterface,
60  public oversetLduInterface
61 {
62  // Private Data
63 
64  const oversetPolyPatch& oversetPolyPatch_;
65 
66 
67 public:
68 
69  //- Runtime type information
70  TypeName(oversetPolyPatch::typeName_());
71 
72 
73  // Constructors
74 
75  //- Construct from polyPatch
76  oversetFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
77  :
78  fvPatch(patch, bm),
79  oversetPolyPatch_(refCast<const oversetPolyPatch>(patch))
80  {}
81 
82 
83  // Member Functions
84 
85  // Access
86 
87  //- Return local reference cast into the overset patch
88  const oversetPolyPatch& oversetPatch() const
89  {
90  return oversetPolyPatch_;
91  }
92 
93  //- Return faceCell addressing
94  virtual const labelUList& faceCells() const
95  {
96  return oversetPolyPatch_.faceCells();
97  }
98 
99  //- Am I the master interface
100  virtual bool master() const
101  {
102  return oversetPolyPatch_.master();
103  }
104 
106  // Interface Transfer Functions
107 
108  //- Return the values of the given internal data adjacent to
109  //- the interface as a field
111  (
112  const labelUList& internalData
113  ) const;
114 
115  //- Return the values of the given internal data adjacent to
116  //- the interface as a field using faceCell mapping
118  (
119  const labelUList& internalData,
120  const labelUList& faceCells
121  ) const;
122 
123  //- Initialise transfer of internal field adjacent to the interface
124  virtual void initInternalFieldTransfer
125  (
126  const Pstream::commsTypes commsType,
127  const labelUList& iF
128  ) const;
129 
130  //- Initialise transfer of internal field adjacent to the interface
131  //- using faceCells mapping
132  virtual void initInternalFieldTransfer
133  (
134  const Pstream::commsTypes commsType,
135  const labelUList& iF,
136  const labelUList& faceCells
137  ) const;
138 
139  //- Transfer and return internal field adjacent to the interface
141  (
142  const Pstream::commsTypes commsType,
143  const labelUList& iF
144  ) const;
145 
146  //- Transfer and return internal field adjacent to the interface
147  //- using nbrFaceCells mapping
149  (
150  const Pstream::commsTypes commsType,
151  const labelUList& iF,
152  const labelUList& nbrFaceCells
153  ) const;
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165 // ************************************************************************* //
Patch for indicating interpolated boundaries (in overset meshes).
commsTypes
Communications types.
Definition: UPstream.H:72
const oversetPolyPatch & oversetPatch() const
Return local reference cast into the overset patch.
Type & refCast(U &obj)
A dynamic_cast (for references). Generates a FatalError on failed casts and uses the virtual type() m...
Definition: typeInfo.H:159
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
virtual const labelUList & faceCells() const
Return faceCell addressing.
Patch for indicating interpolated boundaries (in overset meshes).
Smooth ATC in cells next to a set of patches supplied by type.
Definition: faceCells.H:52
TypeName(oversetPolyPatch::typeName_())
Runtime type information.
virtual bool master() const
Am I the master interface.
const labelUList & faceCells() const
Return face-cell addressing.
Definition: polyPatch.C:365
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const
Initialise transfer of internal field adjacent to the interface.
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
Return the values of the given internal data adjacent to the interface as a field.
bool master() const
Am I master patch? The master is responsible for doing all.
oversetFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from polyPatch.
Foam::fvBoundaryMesh.
An abstract base class for overset coupled interfaces.
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches...
Definition: lduInterface.H:53
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const
Transfer and return internal field adjacent to the interface.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:69
const polyPatch & patch() const noexcept
Return the polyPatch.
Definition: fvPatch.H:202
Namespace for OpenFOAM.