processorFvPatch.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 Copyright (C) 2019 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::processorFvPatch
29
30Description
31 Processor patch.
32
33SourceFiles
34 processorFvPatch.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef processorFvPatch_H
39#define processorFvPatch_H
40
41#include "coupledFvPatch.H"
43#include "processorPolyPatch.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50/*---------------------------------------------------------------------------*\
51 Class processorFvPatch Declaration
52\*---------------------------------------------------------------------------*/
55:
56 public coupledFvPatch,
58{
59 // Private Data
60
61 const processorPolyPatch& procPolyPatch_;
62
63
64protected:
65
66 // Protected Member functions
67
68 //- Make patch weighting factors
69 void makeWeights(scalarField&) const;
70
71
72public:
73
74 //- Runtime type information
75 TypeName(processorPolyPatch::typeName_());
76
77
78 // Constructors
79
80 //- Construct from components
82 :
84 procPolyPatch_(refCast<const processorPolyPatch>(patch))
85 {}
86
87
88 // Member functions
89
90 //- Return communicator used for comms
91 virtual label comm() const
92 {
93 return procPolyPatch_.comm();
94 }
95
96 //- Return processor number
97 virtual int myProcNo() const
98 {
99 return procPolyPatch_.myProcNo();
100 }
101
102 //- Return neighbour processor number
103 virtual int neighbProcNo() const
104 {
105 return procPolyPatch_.neighbProcNo();
106 }
107
108 //- Return message tag used for sending
109 virtual int tag() const
110 {
111 return UPstream::msgType();
112 }
113
114 //- Return true if running parallel
115 virtual bool coupled() const
116 {
117 return Pstream::parRun();
118 }
120 const processorPolyPatch& procPolyPatch() const
121 {
122 return procPolyPatch_;
123 }
124
125 //- Are the cyclic planes parallel
126 virtual bool parallel() const
127 {
128 return procPolyPatch_.parallel();
129 }
130
131 //- Return face transformation tensor
132 virtual const tensorField& forwardT() const
133 {
134 return procPolyPatch_.forwardT();
135 }
136
137 //- Return neighbour-cell transformation tensor.
138 virtual const tensorField& reverseT() const
139 {
140 return procPolyPatch_.reverseT();
141 }
142
143 //- Return delta (P to N) vectors across coupled patch
144 virtual tmp<vectorField> delta() const;
145
146
147 // Interface transfer functions
148
149 //- Return the values of the given internal data adjacent to
150 //- the interface as a field
152 (
153 const labelUList& internalData
154 ) const;
155
156 //- Return the values of the given internal data adjacent to
157 //- the interface as a field using a mapping faceCell
159 (
160 const labelUList& internalData,
161 const labelUList& faceCells
162 ) const;
163
164 //- Inherit initInternalFieldTransfer from coupledFvPatch
166
167 //- Initialise neighbour field transfer
168 virtual void initInternalFieldTransfer
169 (
170 const Pstream::commsTypes commsType,
171 const labelUList& internalData
172 ) const;
173
174 //- Initialise neighbour field transfer using faceCells map
175 virtual void initInternalFieldTransfer
176 (
177 const Pstream::commsTypes commsType,
178 const labelUList& iF,
179 const labelUList& faceCells
180 ) const;
181
182 //- Return neighbour field
184 (
185 const Pstream::commsTypes commsType,
186 const labelUList& internalData
187 ) const;
188
189};
190
191
192// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193
194} // End namespace Foam
195
196// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197
198#endif
199
200// ************************************************************************* //
commsTypes
Types of communications.
Definition: UPstream.H:67
static int & msgType() noexcept
Message tag of standard messages.
Definition: UPstream.H:556
static bool & parRun() noexcept
Test if this a parallel run.
Definition: UPstream.H:433
An abstract base class for patches that couple regions of the computational domain e....
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, labelUList &iF) const
Initialise neighbour field transfer.
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
virtual bool parallel() const
Are the cyclic planes parallel.
virtual const tensorField & forwardT() const
Return face transformation tensor.
Smooth ATC in cells next to a set of patches supplied by type.
Definition: faceCells.H:59
Foam::fvBoundaryMesh.
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:167
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
virtual bool coupled() const
Return true if running parallel.
void makeWeights(scalarField &) const
Make patch weighting factors.
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
processorFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from components.
virtual bool parallel() const
Are the cyclic planes parallel.
virtual int myProcNo() const
Return processor number.
virtual label comm() const
Return communicator used for comms.
virtual tmp< vectorField > delta() const
Return delta (P to N) vectors across coupled patch.
TypeName(processorPolyPatch::typeName_())
Runtime type information.
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Initialise neighbour field transfer.
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
virtual int tag() const
Return message tag used for sending.
const processorPolyPatch & procPolyPatch() const
virtual int neighbProcNo() const
Return neighbour processor number.
virtual const tensorField & forwardT() const
Return face transformation tensor.
An abstract base class for processor coupled interfaces.
Neighbour processor patch.
int myProcNo() const
Return processor number.
int neighbProcNo() const
Return neighbour processor number.
virtual label comm() const
Return communicator used for communication.
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