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 | Copyright (C) 2011-2014 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 
84  // Private Member Functions
85 
86  //- Disallow default bitwise copy construct
88 
89  //- Disallow default bitwise assignment
90  void operator=(const processorGAMGInterfaceField&);
91 
92 
93 public:
94 
95  //- Runtime type information
96  TypeName("processor");
97 
98 
99  // Constructors
100 
101  //- Construct from GAMG interface and fine level interface field
103  (
104  const GAMGInterface& GAMGCp,
105  const lduInterfaceField& fineInterface
106  );
107 
108  //- Construct from GAMG interface and fine level interface field
110  (
111  const GAMGInterface& GAMGCp,
112  const bool doTransform,
113  const int rank
114  );
115 
116 
117  //- Destructor
119 
120 
121  // Member Functions
122 
123  // Access
124 
125  //- Return size
126  label size() const
127  {
128  return procInterface_.size();
129  }
130 
131 
132  // Interface matrix update
133 
134  //- Initialise neighbour matrix update
135  virtual void initInterfaceMatrixUpdate
136  (
137  scalarField& result,
138  const scalarField& psiInternal,
139  const scalarField& coeffs,
140  const direction cmpt,
141  const Pstream::commsTypes commsType
142  ) const;
143 
144  //- Update result field based on interface functionality
145  virtual void updateInterfaceMatrix
146  (
147  scalarField& result,
148  const scalarField& psiInternal,
149  const scalarField& coeffs,
150  const direction cmpt,
151  const Pstream::commsTypes commsType
152  ) const;
153 
154 
155  //- Processor interface functions
156 
157  //- Return communicator used for comms
158  virtual label comm() const
159  {
160  return procInterface_.comm();
161  }
162 
163  //- Return processor number
164  virtual int myProcNo() const
165  {
166  return procInterface_.myProcNo();
167  }
168 
169  //- Return neigbour processor number
170  virtual int neighbProcNo() const
171  {
172  return procInterface_.neighbProcNo();
173  }
174 
175  //- Does the interface field perform the transfromation
176  virtual bool doTransform() const
177  {
178  return doTransform_;
179  }
180 
181  //- Return face transformation tensor
182  virtual const tensorField& forwardT() const
183  {
184  return procInterface_.forwardT();
185  }
186 
187  //- Return rank of component for transform
188  virtual int rank() const
189  {
190  return rank_;
191  }
192 };
193 
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 } // End namespace Foam
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 #endif
202 
203 // ************************************************************************* //
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 neigbour processor number.
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 neigbour 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
Abstract base class for GAMG agglomerated interface fields.
GAMG agglomerated processor interface field.
virtual bool doTransform() const
Does the interface field perform the transfromation.
virtual label comm() const
Processor interface functions.
Namespace for OpenFOAM.