Loading...
Searching...
No Matches
calculatedProcessorGAMGInterfaceField.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) 2019-2023 OpenCFD Ltd.
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::calculatedProcessorGAMGInterfaceField
28
29Description
30 GAMG agglomerated processor interface field.
31
32SourceFiles
33 calculatedProcessorGAMGInterfaceField.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef Foam_calculatedProcessorGAMGInterfaceField_H
38#define Foam_calculatedProcessorGAMGInterfaceField_H
39
40#include "GAMGInterfaceField.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
49/*---------------------------------------------------------------------------*\
50 Class calculatedProcessorGAMGInterfaceField Declaration
51\*---------------------------------------------------------------------------*/
52
53class calculatedProcessorGAMGInterfaceField
54:
55 public GAMGInterfaceField,
57{
58 // Private Data
59
60 //- Local reference cast into the processor interface
61 const calculatedProcessorGAMGInterface& procInterface_;
62
63 //- Is the transform required
64 bool doTransform_;
65
66 //- Rank of component for transformation
67 int rank_;
68
69
70 // Sending and receiving
71
72 //- Current (non-blocking) send request
73 mutable label sendRequest_;
74
75 //- Current (non-blocking) recv request
76 mutable label recvRequest_;
77
78 //- Scalar send buffer
79 mutable solveScalarField scalarSendBuf_;
80
81 //- Scalar recv buffer
82 mutable solveScalarField scalarRecvBuf_;
83
84
85
86 // Private Member Functions
87
88 //- No copy construct
89 calculatedProcessorGAMGInterfaceField
90 (
91 const calculatedProcessorGAMGInterfaceField&
92 ) = delete;
93
94 //- No copy assignment
95 void operator=(const calculatedProcessorGAMGInterfaceField&) = delete;
96
97
98public:
99
100 //- Runtime type information
101 TypeName("calculatedProcessor");
102
103
104 // Constructors
105
106 //- Construct from GAMG interface and fine level interface field
107 calculatedProcessorGAMGInterfaceField
108 (
109 const GAMGInterface& GAMGCp,
110 const lduInterfaceField& fineInterface
111 );
112
113 //- Construct from GAMG interface and fine level interface field
114 calculatedProcessorGAMGInterfaceField
115 (
116 const GAMGInterface& GAMGCp,
117 const bool doTransform,
118 const int rank
119 );
120
121 //- Construct from GAMG interface and Istream
122 calculatedProcessorGAMGInterfaceField
123 (
124 const GAMGInterface& GAMGCp,
125 Istream& is
126 );
127
128 //- Construct by assembling and return a clone.
130 (
131 const GAMGInterface& GAMGCp,
132 const UPtrList<lduInterfaceField>& other
133 ) const
134 {
136 return nullptr;
137 }
138
139
140 //- Destructor
141 virtual ~calculatedProcessorGAMGInterfaceField() = default;
142
143
144 // Member Functions
145
146 // Access
147
148 //- Return size
149 label size() const
150 {
151 return procInterface_.size();
153
154
155 // Interface matrix update
156
157 //- Initialise neighbour matrix update
158 virtual void initInterfaceMatrixUpdate
159 (
160 solveScalarField& result,
161 const bool add,
162 const lduAddressing& lduAddr,
163 const label patchId,
164 const solveScalarField& psiInternal,
165 const scalarField& coeffs,
166 const direction cmpt,
167 const Pstream::commsTypes commsType
168 ) const;
169
170 //- Update result field based on interface functionality
171 virtual void updateInterfaceMatrix
172 (
173 solveScalarField& result,
174 const bool add,
175 const lduAddressing& lduAddr,
176 const label patchId,
177 const solveScalarField& psiInternal,
178 const scalarField& coeffs,
179 const direction cmpt,
180 const Pstream::commsTypes commsType
181 ) const;
182
183
184 //- Processor interface functions
185
186 //- Return communicator used for comms
187 virtual label comm() const
188 {
189 return procInterface_.comm();
190 }
191
192 //- Return processor number
193 virtual int myProcNo() const
194 {
195 return procInterface_.myProcNo();
196 }
197
198 //- Return neighbour processor number
199 virtual int neighbProcNo() const
200 {
201 return procInterface_.neighbProcNo();
202 }
203
204 //- Does the interface field perform the transformation
205 virtual bool doTransform() const
206 {
207 return doTransform_;
208 }
209
210 //- Return face transformation tensor
211 virtual const tensorField& forwardT() const
212 {
213 return procInterface_.forwardT();
214 }
215
216 //- Return rank of component for transform
217 virtual int rank() const
218 {
219 return rank_;
220 }
221
223 // I/O
224
225 //- Write to stream
226 virtual void write(Ostream&) const;
227};
228
229
230// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231
232} // End namespace Foam
233
234// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235
236#endif
237
238// ************************************************************************* //
Abstract base class for GAMG agglomerated interfaces.
virtual label size() const
Return size.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
commsTypes
Communications types.
Definition UPstream.H:81
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition UPtrList.H:101
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
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 int rank() const
Return rank of component for transform.
virtual autoPtr< GAMGInterfaceField > clone(const GAMGInterface &GAMGCp, const UPtrList< lduInterfaceField > &other) const
Construct by assembling and return a clone.
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 label comm() const
Processor interface functions.
TypeName("calculatedProcessor")
Runtime type information.
virtual ~calculatedProcessorGAMGInterfaceField()=default
Destructor.
virtual int neighbProcNo() const
Return neighbour processor number.
virtual const tensorField & forwardT() const
Return face transformation tensor.
virtual int myProcNo() const
Return processor number (rank in communicator).
virtual int neighbProcNo() const
Return neighbour processor number (rank in communicator).
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...
processorLduInterfaceField()=default
Default construct.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition error.H:688
label patchId(-1)
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void add(DimensionedField< scalar, GeoMesh > &result, const dimensioned< scalar > &dt1, const DimensionedField< scalar, GeoMesh > &f2)
Field< solveScalar > solveScalarField
uint8_t direction
Definition direction.H:49
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68