Loading...
Searching...
No Matches
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{
50/*---------------------------------------------------------------------------*\
51 Class processorFvPatch Declaration
52\*---------------------------------------------------------------------------*/
53
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
111 return UPstream::msgType();
112 }
113
114 //- Return true if running parallel
115 virtual bool coupled() const
116 {
117 return UPstream::parRun();
119
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
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;
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
Communications types.
Definition UPstream.H:81
static int & msgType() noexcept
Message tag of standard messages.
Definition UPstream.H:1926
static bool & parRun() noexcept
Test if this a parallel run.
Definition UPstream.H:1681
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, labelUList &iF) const
Initialise neighbour field transfer.
virtual const labelUList & faceCells() const
Return faceCell addressing.
coupledFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from polyPatch.
Smooth ATC in cells next to a set of patches supplied by type.
Definition faceCells.H:55
A fvBoundaryMesh is a fvPatch list with a reference to the associated fvMesh, with additional search ...
const polyPatch & patch() const noexcept
Return the polyPatch.
Definition fvPatch.H:202
A patch is a list of labels that address the faces in the global face list.
Definition polyPatch.H:73
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
Return the values of the given internal data adjacent to the interface as a field.
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.
processorLduInterface() noexcept=default
Default construct.
Neighbour processor patch.
virtual label comm() const
Return communicator used for communication.
int myProcNo() const noexcept
Return processor number.
A class for managing temporary objects.
Definition tmp.H:75
Namespace for OpenFOAM.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
Definition typeInfo.H:172
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
UList< label > labelUList
A UList of labels.
Definition UList.H:75
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68