coupledFvPatch.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-2015 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::coupledFvPatch
28 
29 Description
30  An abstract base class for patches that couple regions of the
31  computational domain e.g. cyclic and processor-processor links.
32 
33 SourceFiles
34  coupledFvPatch.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef Foam_coupledFvPatch_H
39 #define Foam_coupledFvPatch_H
40 
41 #include "fvPatch.H"
42 #include "lduInterface.H"
43 #include "coupledPolyPatch.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class coupledFvPatch Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class coupledFvPatch
55 :
56  public lduInterface,
57  public fvPatch
58 {
59  // Private Data
60 
61  const coupledPolyPatch& coupledPolyPatch_;
62 
63 
64 protected:
65 
66  // Protected Member Functions
67 
68  //- Make patch weighting factors
69  virtual void makeWeights(scalarField&) const = 0;
70 
71 
72 public:
73 
74  friend class surfaceInterpolation;
75 
76 
77  //- Runtime type information
78  TypeNameNoDebug(coupledPolyPatch::typeName_());
79 
80 
81  // Constructors
82 
83  //- Construct from polyPatch
84  coupledFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
85  :
86  fvPatch(patch, bm),
87  coupledPolyPatch_(refCast<const coupledPolyPatch>(patch))
88  {}
89 
90 
91  //- Destructor
92  virtual ~coupledFvPatch() = default;
93 
94 
95  // Member Functions
96 
97  // Access
98 
99  //- Return true because this patch is coupled
100  virtual bool coupled() const
101  {
102  return coupledPolyPatch_.coupled();
103  }
104 
105  //- Are the cyclic planes parallel.
106  virtual bool parallel() const = 0;
107 
108  //- Return face transformation tensor.
109  virtual const tensorField& forwardT() const = 0;
110 
111  //- Return neighbour-cell transformation tensor.
112  virtual const tensorField& reverseT() const = 0;
113 
114  //- Return faceCell addressing
115  virtual const labelUList& faceCells() const
116  {
117  return fvPatch::faceCells();
118  }
119 
120  //- Return delta (P to N) vectors across coupled patch
121  virtual tmp<vectorField> delta() const = 0;
122 
123 
124  // Interface transfer functions
125 
126  //- Return the values of the given internal data adjacent to
127  //- the interface as a field
129  (
130  const labelUList& internalData
131  ) const = 0;
132 
133 
134  //- Return the values of the given internal data adjacent to
135  //- the interface as a field using a mapping faceCell
137  (
138  const labelUList& internalData,
139  const labelUList& faceCell
140  ) const = 0;
141 
142  //- Inherit initInternalFieldTransfer from lduInterface
144 
145  //- Initialise neighbour field transfer
146  virtual void initInternalFieldTransfer
147  (
148  const Pstream::commsTypes commsType,
149  labelUList& iF
150  ) const
151  {}
152 
153  //- Initialise neighbour field transfer using faceCells map
154  virtual void initInternalFieldTransfer
155  (
156  const Pstream::commsTypes commsType,
157  labelUList& iF,
158  const labelUList& faceCell
159  ) const
160  {}
161 
162  //- Return neighbour field
163  virtual tmp<labelField> internalFieldTransfer
164  (
165  const Pstream::commsTypes commsType,
166  const labelUList& iF
167  ) const = 0;
168 };
169 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 } // End namespace Foam
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #endif
178 
179 // ************************************************************************* //
virtual bool coupled() const
Return true because this patch is coupled.
commsTypes
Communications types.
Definition: UPstream.H:72
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
An abstract base class for patches that couple regions of the computational domain e...
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, labelUList &iF) const
Initialise neighbour field transfer.
The coupledPolyPatch is an abstract base class for patches that couple regions of the computational d...
Cell to surface interpolation scheme. Included in fvMesh.
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const =0
Return neighbour field.
virtual const labelUList & faceCells() const
Return faceCell addressing.
UList< label > labelUList
A UList of labels.
Definition: UList.H:78
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const =0
Return the values of the given internal data adjacent to the interface as a field.
virtual bool parallel() const =0
Are the cyclic planes parallel.
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const
Initialise transfer of internal field adjacent to the interface.
Definition: lduInterface.H:113
virtual const labelUList & faceCells() const
Return faceCells.
Definition: fvPatch.C:107
virtual bool coupled() const
Return true because this patch is coupled.
Foam::fvBoundaryMesh.
virtual tmp< vectorField > delta() const =0
Return delta (P to N) vectors across coupled patch.
virtual ~coupledFvPatch()=default
Destructor.
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches...
Definition: lduInterface.H:53
virtual const tensorField & forwardT() const =0
Return face transformation tensor.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
TypeNameNoDebug(coupledPolyPatch::typeName_())
Runtime type information.
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
virtual void makeWeights(scalarField &) const =0
Make patch weighting factors.
virtual const tensorField & reverseT() const =0
Return neighbour-cell transformation tensor.
coupledFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from polyPatch.
Namespace for OpenFOAM.