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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::processorGAMGInterfaceField
29 
30 Description
31  GAMG agglomerated processor interface field.
32 
33 SourceFiles
34  processorGAMGInterfaceField.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef processorGAMGInterfaceField_H
39 #define processorGAMGInterfaceField_H
40 
41 #include "GAMGInterfaceField.H"
42 #include "processorGAMGInterface.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class processorGAMGInterfaceField Declaration
52 \*---------------------------------------------------------------------------*/
53 
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 
99 public:
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 // ************************************************************************* //
Foam::processorGAMGInterface::comm
virtual label comm() const
Processor interface functions.
Definition: processorGAMGInterface.H:162
Foam::lduAddressing
The class contains the addressing required by the lduMatrix: upper, lower and losort.
Definition: lduAddressing.H:114
Foam::processorGAMGInterfaceField::myProcNo
virtual int myProcNo() const
Return processor number.
Definition: processorGAMGInterfaceField.H:175
Foam::GAMGInterface::size
virtual label size() const
Return size.
Definition: GAMGInterface.H:205
Foam::processorGAMGInterfaceField::initInterfaceMatrixUpdate
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.
Definition: processorGAMGInterfaceField.C:91
Foam::processorGAMGInterfaceField::updateInterfaceMatrix
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.
Definition: processorGAMGInterfaceField.C:144
Foam::processorGAMGInterfaceField::comm
virtual label comm() const
Processor interface functions.
Definition: processorGAMGInterfaceField.H:169
Foam::processorGAMGInterfaceField::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: processorGAMGInterfaceField.H:193
processorLduInterfaceField.H
Foam::processorGAMGInterface::neighbProcNo
virtual int neighbProcNo() const
Return neighbour processor number (rank in communicator)
Definition: processorGAMGInterface.H:174
Foam::processorGAMGInterfaceField
GAMG agglomerated processor interface field.
Definition: processorGAMGInterfaceField.H:53
Foam::processorGAMGInterfaceField::size
label size() const
Return size.
Definition: processorGAMGInterfaceField.H:131
Foam::Field< solveScalar >
Foam::GAMGInterface
Abstract base class for GAMG agglomerated interfaces.
Definition: GAMGInterface.H:54
Foam::processorGAMGInterfaceField::neighbProcNo
virtual int neighbProcNo() const
Return neighbour processor number.
Definition: processorGAMGInterfaceField.H:181
Foam::processorGAMGInterface::myProcNo
virtual int myProcNo() const
Return processor number (rank in communicator)
Definition: processorGAMGInterface.H:168
Foam::GAMGInterfaceField
Abstract base class for GAMG agglomerated interface fields.
Definition: GAMGInterfaceField.H:54
Foam::add
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Definition: FieldFieldFunctions.C:939
processorGAMGInterface.H
GAMGInterfaceField.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::processorGAMGInterfaceField::~processorGAMGInterfaceField
virtual ~processorGAMGInterfaceField()=default
Destructor.
Foam::lduInterfaceField
An abstract base class for implicitly-coupled interface fields e.g. processor and cyclic patch fields...
Definition: lduInterfaceField.H:58
Foam::processorGAMGInterface
GAMG agglomerated processor interface.
Definition: processorGAMGInterface.H:52
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:69
Foam::processorGAMGInterfaceField::TypeName
TypeName("processor")
Runtime type information.
Foam::processorGAMGInterfaceField::doTransform
virtual bool doTransform() const
Does the interface field perform the transformation.
Definition: processorGAMGInterfaceField.H:187
Foam::direction
uint8_t direction
Definition: direction.H:52
patchId
label patchId(-1)
Foam::processorLduInterfaceField
Abstract base class for processor coupled interfaces.
Definition: processorLduInterfaceField.H:52
Foam::processorGAMGInterface::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: processorGAMGInterface.H:180
Foam::processorGAMGInterfaceField::rank
virtual int rank() const
Return rank of component for transform.
Definition: processorGAMGInterfaceField.H:199