processorGAMGInterfaceField.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-2014 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::processorGAMGInterfaceField
29
30Description
31 GAMG agglomerated processor interface field.
32
33SourceFiles
34 processorGAMGInterfaceField.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef processorGAMGInterfaceField_H
39#define processorGAMGInterfaceField_H
40
41#include "GAMGInterfaceField.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50/*---------------------------------------------------------------------------*\
51 Class processorGAMGInterfaceField Declaration
52\*---------------------------------------------------------------------------*/
55:
56 public GAMGInterfaceField,
58{
59 // Private data
60
61 //- Local reference cast into the processor interface
62 const processorGAMGInterface& procInterface_;
63
64 //- Is the transform required
65 bool doTransform_;
66
67 //- Rank of component for transformation
68 int rank_;
69
70
71 // Sending and receiving
72
73 //- Outstanding request
74 mutable label outstandingSendRequest_;
75
76 //- Outstanding request
77 mutable label outstandingRecvRequest_;
78
79 //- Scalar send buffer
80 mutable solveScalarField scalarSendBuf_;
81
82 //- Scalar receive buffer
83 mutable solveScalarField scalarReceiveBuf_;
84
85
86
87 // Private Member Functions
88
89 //- No copy construct
91 (
93 ) = delete;
94
95 //- No copy assignment
96 void operator=(const processorGAMGInterfaceField&) = delete;
97
98
99public:
100
101 //- Runtime type information
102 TypeName("processor");
103
104
105 // Constructors
106
107 //- Construct from GAMG interface and fine level interface field
109 (
110 const GAMGInterface& GAMGCp,
111 const lduInterfaceField& fineInterface
112 );
113
114 //- Construct from GAMG interface and fine level interface field
116 (
117 const GAMGInterface& GAMGCp,
118 const bool doTransform,
119 const int rank
120 );
121
122
123 //- Destructor
124 virtual ~processorGAMGInterfaceField() = default;
125
126
127 // Member Functions
128
129 // Access
130
131 //- Return size
132 label size() const
133 {
134 return procInterface_.size();
135 }
136
137
138 // Interface matrix update
139
140 //- Initialise neighbour matrix update
141 virtual void initInterfaceMatrixUpdate
142 (
143 solveScalarField& result,
144 const bool add,
145 const lduAddressing& lduAddr,
146 const label patchId,
147 const solveScalarField& psiInternal,
148 const scalarField& coeffs,
149 const direction cmpt,
150 const Pstream::commsTypes commsType
151 ) const;
152
153 //- Update result field based on interface functionality
154 virtual void updateInterfaceMatrix
155 (
156 solveScalarField& result,
157 const bool add,
158 const lduAddressing& lduAddr,
159 const label patchId,
160 const solveScalarField& psiInternal,
161 const scalarField& coeffs,
162 const direction cmpt,
163 const Pstream::commsTypes commsType
164 ) const;
165
166
167 //- Processor interface functions
168
169 //- Return communicator used for comms
170 virtual label comm() const
171 {
172 return procInterface_.comm();
173 }
174
175 //- Return processor number
176 virtual int myProcNo() const
177 {
178 return procInterface_.myProcNo();
179 }
180
181 //- Return neighbour processor number
182 virtual int neighbProcNo() const
183 {
184 return procInterface_.neighbProcNo();
185 }
186
187 //- Does the interface field perform the transformation
188 virtual bool doTransform() const
189 {
190 return doTransform_;
191 }
192
193 //- Return face transformation tensor
194 virtual const tensorField& forwardT() const
195 {
196 return procInterface_.forwardT();
197 }
198
199 //- Return rank of component for transform
200 virtual int rank() const
201 {
202 return rank_;
203 }
204};
205
206
207// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208
209} // End namespace Foam
210
211// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212
213#endif
214
215// ************************************************************************* //
Abstract base class for GAMG agglomerated interface fields.
Abstract base class for GAMG agglomerated interfaces.
Definition: GAMGInterface.H:57
virtual label size() const
Return size.
commsTypes
Types of communications.
Definition: UPstream.H:67
The class contains the addressing required by the lduMatrix: upper, lower and losort.
An abstract base class for implicitly-coupled interface fields e.g. processor and cyclic patch fields...
GAMG agglomerated processor interface field.
virtual bool doTransform() const
Does the interface field perform the transformation.
virtual void initInterfaceMatrixUpdate(solveScalarField &result, const bool add, const lduAddressing &lduAddr, const label patchId, const solveScalarField &psiInternal, const scalarField &coeffs, const direction cmpt, const Pstream::commsTypes commsType) const
Initialise neighbour matrix update.
virtual ~processorGAMGInterfaceField()=default
Destructor.
virtual int rank() const
Return rank of component for transform.
virtual void updateInterfaceMatrix(solveScalarField &result, const bool add, const lduAddressing &lduAddr, const label patchId, const solveScalarField &psiInternal, const scalarField &coeffs, const direction cmpt, const Pstream::commsTypes commsType) const
Update result field based on interface functionality.
virtual int myProcNo() const
Return processor number.
virtual label comm() const
Processor interface functions.
TypeName("processor")
Runtime type information.
virtual int neighbProcNo() const
Return neighbour processor number.
virtual const tensorField & forwardT() const
Return face transformation tensor.
GAMG agglomerated processor interface.
virtual int myProcNo() const
Return processor number (rank in communicator)
virtual label comm() const
Processor interface functions.
virtual int neighbProcNo() const
Return neighbour processor number (rank in communicator)
virtual const tensorField & forwardT() const
Return face transformation tensor.
Abstract base class for processor coupled interfaces.
label patchId(-1)
Namespace for OpenFOAM.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
uint8_t direction
Definition: direction.H:56
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73