processorGAMGInterfaceField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::processorGAMGInterfaceField
26 
27 Description
28  GAMG agglomerated processor interface field.
29 
30 SourceFiles
31  processorGAMGInterfaceField.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef processorGAMGInterfaceField_H
36 #define processorGAMGInterfaceField_H
37 
38 #include "GAMGInterfaceField.H"
39 #include "processorGAMGInterface.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class processorGAMGInterfaceField Declaration
49 \*---------------------------------------------------------------------------*/
50 
52 :
53  public GAMGInterfaceField,
55 {
56  // Private Data
57 
58  //- Local reference cast into the processor interface
59  const processorGAMGInterface& procInterface_;
60 
61  //- Rank of component for transformation
62  int rank_;
63 
64 
65  // Sending and receiving
66 
67  //- Outstanding request
68  mutable label outstandingSendRequest_;
69 
70  //- Outstanding request
71  mutable label outstandingRecvRequest_;
72 
73  //- Scalar send buffer
74  mutable Field<scalar> scalarSendBuf_;
75 
76  //- Scalar receive buffer
77  mutable Field<scalar> scalarReceiveBuf_;
78 
79 
80 public:
81 
82  //- Runtime type information
83  TypeName("processor");
84 
85 
86  // Constructors
87 
88  //- Construct from GAMG interface and fine level interface field
90  (
91  const GAMGInterface& GAMGCp,
92  const lduInterfaceField& fineInterface
93  );
94 
95  //- Construct from GAMG interface and fine level interface field
97  (
98  const GAMGInterface& GAMGCp,
99  const int rank
100  );
101 
102  //- Disallow default bitwise copy construction
104  (
106  ) = delete;
107 
108 
109  //- Destructor
111 
112 
113  // Member Functions
114 
115  // Access
116 
117  //- Return size
118  label size() const
119  {
120  return procInterface_.size();
121  }
122 
123 
124  // Interface matrix update
125 
126  //- Initialise neighbour matrix update
127  virtual void initInterfaceMatrixUpdate
128  (
129  scalarField& result,
130  const scalarField& psiInternal,
131  const scalarField& coeffs,
132  const direction cmpt,
133  const Pstream::commsTypes commsType
134  ) const;
135 
136  //- Update result field based on interface functionality
137  virtual void updateInterfaceMatrix
138  (
139  scalarField& result,
140  const scalarField& psiInternal,
141  const scalarField& coeffs,
142  const direction cmpt,
143  const Pstream::commsTypes commsType
144  ) const;
145 
146 
147  //- Processor interface functions
148 
149  //- Return communicator used for comms
150  virtual label comm() const
151  {
152  return procInterface_.comm();
153  }
154 
155  //- Return processor number
156  virtual int myProcNo() const
157  {
158  return procInterface_.myProcNo();
159  }
160 
161  //- Return neighbour processor number
162  virtual int neighbProcNo() const
163  {
164  return procInterface_.neighbProcNo();
165  }
166 
167  //- Return transformation between the coupled patches
168  virtual const transformer& transform() const
169  {
170  return procInterface_.transform();
171  }
172 
173  //- Return rank of component for transform
174  virtual int rank() const
175  {
176  return rank_;
177  }
178 
179 
180  // Member Operators
181 
182  //- Disallow default bitwise assignment
183  void operator=(const processorGAMGInterfaceField&) = delete;
184 };
185 
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 } // End namespace Foam
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 #endif
194 
195 // ************************************************************************* //
virtual label size() const
Return size.
virtual const transformer & transform() const
Return transformation between the coupled patches.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Vector-tensor class used to perform translations, rotations and scaling operations in 3D space...
Definition: transformer.H:83
virtual int rank() const
Return rank of component for transform.
commsTypes
Types of communications.
Definition: UPstream.H:64
uint8_t direction
Definition: direction.H:45
virtual void updateInterfaceMatrix(scalarField &result, const scalarField &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 (rank in communicator)
An abstract base class for implicitly-coupled interface fields e.g. processor and cyclic patch fields...
virtual int myProcNo() const
Return processor number.
virtual int neighbProcNo() const
Return neighbour processor number.
void operator=(const processorGAMGInterfaceField &)=delete
Disallow default bitwise assignment.
Abstract base class for processor coupled interfaces.
virtual void initInterfaceMatrixUpdate(scalarField &result, const scalarField &psiInternal, const scalarField &coeffs, const direction cmpt, const Pstream::commsTypes commsType) const
Initialise neighbour matrix update.
TypeName("processor")
Runtime type information.
virtual int neighbProcNo() const
Return neighbour processor number (rank in communicator)
GAMG agglomerated processor interface.
virtual label comm() const
Processor interface functions.
Abstract base class for GAMG agglomerated interfaces.
Definition: GAMGInterface.H:51
processorGAMGInterfaceField(const GAMGInterface &GAMGCp, const lduInterfaceField &fineInterface)
Construct from GAMG interface and fine level interface field.
virtual const transformer & transform() const
Return transformation between the coupled patches.
Abstract base class for GAMG agglomerated interface fields.
GAMG agglomerated processor interface field.
virtual label comm() const
Processor interface functions.
Namespace for OpenFOAM.