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
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
72 
73  //- Outstanding request
75 
76  //- Scalar send buffer
78 
79  //- Scalar receive buffer
81 
82 
83 
84  // Private Member Functions
85 
86  //- Disallow default bitwise copy construct
88 
89  //- Disallow default bitwise assignment
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 // ************************************************************************* //
Foam::processorGAMGInterface::comm
virtual label comm() const
Processor interface functions.
Definition: processorGAMGInterface.H:150
Foam::processorGAMGInterfaceField::procInterface_
const processorGAMGInterface & procInterface_
Local reference cast into the processor interface.
Definition: processorGAMGInterfaceField.H:58
Foam::processorGAMGInterfaceField::doTransform_
bool doTransform_
Is the transform required.
Definition: processorGAMGInterfaceField.H:61
Foam::processorGAMGInterfaceField::myProcNo
virtual int myProcNo() const
Return processor number.
Definition: processorGAMGInterfaceField.H:163
Foam::GAMGInterface::size
virtual label size() const
Return size.
Definition: GAMGInterface.H:205
Foam::processorGAMGInterfaceField::scalarSendBuf_
Field< scalar > scalarSendBuf_
Scalar send buffer.
Definition: processorGAMGInterfaceField.H:76
Foam::processorGAMGInterfaceField::comm
virtual label comm() const
Processor interface functions.
Definition: processorGAMGInterfaceField.H:157
Foam::processorGAMGInterfaceField::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: processorGAMGInterfaceField.H:181
processorLduInterfaceField.H
Foam::processorGAMGInterfaceField::outstandingRecvRequest_
label outstandingRecvRequest_
Outstanding request.
Definition: processorGAMGInterfaceField.H:73
Foam::processorGAMGInterfaceField::initInterfaceMatrixUpdate
virtual void initInterfaceMatrixUpdate(scalarField &result, const scalarField &psiInternal, const scalarField &coeffs, const direction cmpt, const Pstream::commsTypes commsType) const
Initialise neighbour matrix update.
Definition: processorGAMGInterfaceField.C:94
Foam::processorGAMGInterfaceField::outstandingSendRequest_
label outstandingSendRequest_
Outstanding request.
Definition: processorGAMGInterfaceField.H:70
Foam::processorGAMGInterface::neighbProcNo
virtual int neighbProcNo() const
Return neigbour processor number (rank in communicator)
Definition: processorGAMGInterface.H:162
Foam::processorGAMGInterfaceField
GAMG agglomerated processor interface field.
Definition: processorGAMGInterfaceField.H:50
Foam::processorGAMGInterfaceField::size
label size() const
Return size.
Definition: processorGAMGInterfaceField.H:125
Foam::label
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
Foam::Field< scalar >
Foam::processorGAMGInterfaceField::updateInterfaceMatrix
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.
Definition: processorGAMGInterfaceField.C:145
Foam::GAMGInterface
Abstract base class for GAMG agglomerated interfaces.
Definition: GAMGInterface.H:51
Foam::processorGAMGInterfaceField::neighbProcNo
virtual int neighbProcNo() const
Return neigbour processor number.
Definition: processorGAMGInterfaceField.H:169
Foam::processorGAMGInterfaceField::operator=
void operator=(const processorGAMGInterfaceField &)
Disallow default bitwise assignment.
Foam::processorGAMGInterface::myProcNo
virtual int myProcNo() const
Return processor number (rank in communicator)
Definition: processorGAMGInterface.H:156
Foam::processorGAMGInterfaceField::processorGAMGInterfaceField
processorGAMGInterfaceField(const processorGAMGInterfaceField &)
Disallow default bitwise copy construct.
Foam::GAMGInterfaceField
Abstract base class for GAMG agglomerated interface fields.
Definition: GAMGInterfaceField.H:51
processorGAMGInterface.H
GAMGInterfaceField.H
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::lduInterfaceField
An abstract base class for implicitly-coupled interface fields e.g. processor and cyclic patch fields...
Definition: lduInterfaceField.H:55
Foam::processorGAMGInterface
GAMG agglomerated processor interface.
Definition: processorGAMGInterface.H:49
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:64
Foam::processorGAMGInterfaceField::TypeName
TypeName("processor")
Runtime type information.
Foam::processorGAMGInterfaceField::doTransform
virtual bool doTransform() const
Does the interface field perform the transfromation.
Definition: processorGAMGInterfaceField.H:175
Foam::direction
unsigned char direction
Definition: direction.H:43
Foam::processorGAMGInterfaceField::rank_
int rank_
Rank of component for transformation.
Definition: processorGAMGInterfaceField.H:64
Foam::processorLduInterfaceField
Abstract base class for processor coupled interfaces.
Definition: processorLduInterfaceField.H:49
Foam::processorGAMGInterface::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: processorGAMGInterface.H:168
Foam::processorGAMGInterfaceField::rank
virtual int rank() const
Return rank of component for transform.
Definition: processorGAMGInterfaceField.H:187
Foam::processorGAMGInterfaceField::~processorGAMGInterfaceField
virtual ~processorGAMGInterfaceField()
Destructor.
Definition: processorGAMGInterfaceField.C:87
Foam::processorGAMGInterfaceField::scalarReceiveBuf_
Field< scalar > scalarReceiveBuf_
Scalar receive buffer.
Definition: processorGAMGInterfaceField.H:79