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-2019 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  //- Is the transform required
62  bool doTransform_;
63 
64  //- Rank of component for transformation
65  int rank_;
66 
67 
68  // Sending and receiving
69 
70  //- Outstanding request
71  mutable label outstandingSendRequest_;
72 
73  //- Outstanding request
74  mutable label outstandingRecvRequest_;
75 
76  //- Scalar send buffer
77  mutable Field<scalar> scalarSendBuf_;
78 
79  //- Scalar receive buffer
80  mutable Field<scalar> scalarReceiveBuf_;
81 
82 
83 public:
84 
85  //- Runtime type information
86  TypeName("processor");
87 
88 
89  // Constructors
90 
91  //- Construct from GAMG interface and fine level interface field
93  (
94  const GAMGInterface& GAMGCp,
95  const lduInterfaceField& fineInterface
96  );
97 
98  //- Construct from GAMG interface and fine level interface field
100  (
101  const GAMGInterface& GAMGCp,
102  const bool doTransform,
103  const int rank
104  );
105 
106  //- Disallow default bitwise copy construction
108  (
110  ) = delete;
111 
112 
113  //- Destructor
115 
116 
117  // Member Functions
118 
119  // Access
120 
121  //- Return size
122  label size() const
123  {
124  return procInterface_.size();
125  }
126 
127 
128  // Interface matrix update
129 
130  //- Initialise neighbour matrix update
131  virtual void initInterfaceMatrixUpdate
132  (
133  scalarField& result,
134  const scalarField& psiInternal,
135  const scalarField& coeffs,
136  const direction cmpt,
137  const Pstream::commsTypes commsType
138  ) const;
139 
140  //- Update result field based on interface functionality
141  virtual void updateInterfaceMatrix
142  (
143  scalarField& result,
144  const scalarField& psiInternal,
145  const scalarField& coeffs,
146  const direction cmpt,
147  const Pstream::commsTypes commsType
148  ) const;
149 
150 
151  //- Processor interface functions
152 
153  //- Return communicator used for comms
154  virtual label comm() const
155  {
156  return procInterface_.comm();
157  }
158 
159  //- Return processor number
160  virtual int myProcNo() const
161  {
162  return procInterface_.myProcNo();
163  }
164 
165  //- Return neighbour processor number
166  virtual int neighbProcNo() const
167  {
168  return procInterface_.neighbProcNo();
169  }
170 
171  //- Does the interface field perform the transformation
172  virtual bool doTransform() const
173  {
174  return doTransform_;
175  }
176 
177  //- Return face transformation tensor
178  virtual const tensorField& forwardT() const
179  {
180  return procInterface_.forwardT();
181  }
182 
183  //- Return rank of component for transform
184  virtual int rank() const
185  {
186  return rank_;
187  }
188 
189 
190  // Member Operators
191 
192  //- Disallow default bitwise assignment
193  void operator=(const processorGAMGInterfaceField&) = delete;
194 };
195 
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 } // End namespace Foam
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 #endif
204 
205 // ************************************************************************* //
virtual label size() const
Return size.
virtual const tensorField & forwardT() const
Return face transformation tensor.
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
virtual const tensorField & forwardT() const
Return face transformation tensor.
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.
Abstract base class for GAMG agglomerated interface fields.
GAMG agglomerated processor interface field.
virtual bool doTransform() const
Does the interface field perform the transformation.
virtual label comm() const
Processor interface functions.
Namespace for OpenFOAM.