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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::coupledFvPatch
28
29Description
30 An abstract base class for patches that couple regions of the
31 computational domain e.g. cyclic and processor-processor links.
32
33SourceFiles
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
47namespace Foam
48{
49
50/*---------------------------------------------------------------------------*\
51 Class coupledFvPatch Declaration
52\*---------------------------------------------------------------------------*/
55:
56 public lduInterface,
57 public fvPatch
58{
59 // Private data
60
61 const coupledPolyPatch& coupledPolyPatch_;
62
63
64protected:
65
66 // Protected Member Functions
67
68 //- Make patch weighting factors
69 virtual void makeWeights(scalarField&) const = 0;
70
71
72public:
74 friend class surfaceInterpolation;
75
76
77 //- Runtime type information
78 TypeName(coupledPolyPatch::typeName_());
79
80
81 // Constructors
82
83 //- Construct from polyPatch
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
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
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// ************************************************************************* //
commsTypes
Types of communications.
Definition: UPstream.H:67
An abstract base class for patches that couple regions of the computational domain e....
TypeName(coupledPolyPatch::typeName_())
Runtime type information.
virtual bool parallel() const =0
Are the cyclic planes parallel.
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, labelUList &iF, const labelUList &faceCell) const
Initialise neighbour field transfer using faceCells map.
virtual bool coupled() const
Return true because this patch is coupled.
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, labelUList &iF) const
Initialise neighbour field transfer.
virtual void makeWeights(scalarField &) const =0
Make patch weighting factors.
virtual const labelUList & faceCells() const
Return faceCell addressing.
coupledFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from polyPatch.
virtual const tensorField & forwardT() const =0
Return face transformation tensor.
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const =0
Return neighbour field.
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const =0
virtual ~coupledFvPatch()
Destructor.
virtual tmp< vectorField > delta() const =0
Return delta (P to N) vectors across coupled patch.
virtual const tensorField & reverseT() const =0
Return neighbour-cell transformation tensor.
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData, const labelUList &faceCell) const =0
The coupledPolyPatch is an abstract base class for patches that couple regions of the computational d...
virtual bool coupled() const
Return true because this patch is coupled.
Foam::fvBoundaryMesh.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:167
virtual const labelUList & faceCells() const
Return faceCells.
Definition: fvPatch.C:113
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches.
Definition: lduInterface.H:58
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const
Initialise transfer of internal field adjacent to the interface.
Definition: lduInterface.H:103
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
Cell to surface interpolation scheme. Included in fvMesh.
A class for managing temporary objects.
Definition: tmp.H:65
Namespace for OpenFOAM.
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:131
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73