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 coupledFvPatch_H
39 #define 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  TypeName(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();
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
147  (
148  const Pstream::commsTypes commsType,
149  labelUList& iF
150  ) const
151  {}
152 
153  //- Initialise neighbour field transfer using faceCells map
155  (
156  const Pstream::commsTypes commsType,
157  labelUList& iF,
158  const labelUList& faceCell
159  ) const
160  {}
161 
162  //- Return neighbour field
164  (
165  const Pstream::commsTypes commsType,
166  const labelUList& iF
167  ) const = 0;
168 };
169 
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 } // End namespace Foam
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #endif
178 
179 // ************************************************************************* //
Foam::coupledFvPatch::initInternalFieldTransfer
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, labelUList &iF) const
Initialise neighbour field transfer.
Definition: coupledFvPatch.H:146
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::coupledFvPatch::interfaceInternalField
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const =0
Foam::coupledFvPatch::TypeName
TypeName(coupledPolyPatch::typeName_())
Runtime type information.
Foam::coupledFvPatch::delta
virtual tmp< vectorField > delta() const =0
Return delta (P to N) vectors across coupled patch.
Definition: coupledFvPatch.C:46
Foam::lduInterface
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches.
Definition: lduInterface.H:54
Foam::coupledFvPatch::~coupledFvPatch
virtual ~coupledFvPatch()
Destructor.
Definition: coupledFvPatch.C:40
Foam::coupledFvPatch::parallel
virtual bool parallel() const =0
Are the cyclic planes parallel.
Foam::coupledFvPatch::coupledFvPatch
coupledFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from polyPatch.
Definition: coupledFvPatch.H:83
Foam::coupledPolyPatch
The coupledPolyPatch is an abstract base class for patches that couple regions of the computational d...
Definition: coupledPolyPatch.H:54
Foam::lduInterface::initInternalFieldTransfer
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const
Initialise transfer of internal field adjacent to the interface.
Definition: lduInterface.H:100
Foam::fvBoundaryMesh
Foam::fvBoundaryMesh.
Definition: fvBoundaryMesh.H:57
Foam::coupledFvPatch::coupled
virtual bool coupled() const
Return true because this patch is coupled.
Definition: coupledFvPatch.H:99
coupledPolyPatch.H
Foam::Field< scalar >
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::coupledFvPatch::forwardT
virtual const tensorField & forwardT() const =0
Return face transformation tensor.
Foam::coupledFvPatch::makeWeights
virtual void makeWeights(scalarField &) const =0
Make patch weighting factors.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::refCast
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:131
Foam::coupledFvPatch::reverseT
virtual const tensorField & reverseT() const =0
Return neighbour-cell transformation tensor.
Foam::coupledFvPatch::faceCells
virtual const labelUList & faceCells() const
Return faceCell addressing.
Definition: coupledFvPatch.H:114
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:69
Foam::UList< label >
Foam::surfaceInterpolation
Cell to surface interpolation scheme. Included in fvMesh.
Definition: surfaceInterpolation.H:58
Foam::coupledPolyPatch::coupled
virtual bool coupled() const
Return true because this patch is coupled.
Definition: coupledPolyPatch.H:248
Foam::fvPatch::faceCells
virtual const labelUList & faceCells() const
Return faceCells.
Definition: fvPatch.C:113
Foam::fvPatch::patch
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:161
fvPatch.H
Foam::coupledFvPatch
An abstract base class for patches that couple regions of the computational domain e....
Definition: coupledFvPatch.H:53
lduInterface.H
Foam::coupledFvPatch::internalFieldTransfer
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const =0
Return neighbour field.