All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
processorGAMGInterface.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::processorGAMGInterface
26 
27 Description
28  GAMG agglomerated processor interface.
29 
30 SourceFiles
31  processorGAMGInterface.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef processorGAMGInterface_H
36 #define processorGAMGInterface_H
37 
38 #include "GAMGInterface.H"
39 #include "processorLduInterface.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class processorGAMGInterface Declaration
48 \*---------------------------------------------------------------------------*/
49 
51 :
52  public GAMGInterface,
54 {
55  // Private Data
56 
57  //- Communicator to use for parallel communication
58  const label comm_;
59 
60  //- My processor rank in communicator
61  label myProcNo_;
62 
63  //- Neighbouring processor rank in communicator
64  label neighbProcNo_;
65 
66  //- Transformation
67  transformer transform_;
68 
69  //- Message tag used for sending
70  int tag_;
71 
72 
73 public:
74 
75  //- Runtime type information
76  TypeName("processor");
77 
78  // Constructors
79 
80  //- Construct from fine-level interface,
81  // local and neighbour restrict addressing
83  (
84  const label index,
86  const lduInterface& fineInterface,
87  const labelField& restrictAddressing,
88  const labelField& neighbourRestrictAddressing,
89  const label fineLevelIndex,
90  const label coarseComm
91  );
92 
93  //- Construct from components
95  (
96  const label index,
97  const lduInterfacePtrsList& coarseInterfaces,
98  const labelUList& faceCells,
99  const labelUList& faceRestrictAddresssing,
100  const label coarseComm,
101  const label myProcNo,
102  const label neighbProcNo,
103  const transformer& transform,
104  const int tag
105  );
106 
107  //- Construct from Istream
109  (
110  const label index,
111  const lduInterfacePtrsList& coarseInterfaces,
112  Istream& is
113  );
114 
115  //- Disallow default bitwise copy construction
117 
118 
119  //- Destructor
120  virtual ~processorGAMGInterface();
121 
122 
123  // Member Functions
124 
125  // Interface transfer functions
126 
127  //- Initialise neighbour field transfer
128  virtual void initInternalFieldTransfer
129  (
130  const Pstream::commsTypes commsType,
131  const labelUList& iF
132  ) const;
133 
134  //- Transfer and return internal field adjacent to the interface
136  (
137  const Pstream::commsTypes commsType,
138  const labelUList& iF
139  ) const;
140 
141 
142  //- Processor interface functions
143 
144  //- Return communicator used for sending
145  virtual label comm() const
146  {
147  return comm_;
148  }
149 
150  //- Return processor number (rank in communicator)
151  virtual int myProcNo() const
152  {
153  return myProcNo_;
154  }
155 
156  //- Return neighbour processor number (rank in communicator)
157  virtual int neighbProcNo() const
158  {
159  return neighbProcNo_;
160  }
161 
162  //- Return transformation between the coupled patches
163  virtual const transformer& transform() const
164  {
165  return transform_;
166  }
167 
168  //- Return message tag used for sending
169  virtual int tag() const
170  {
171  return tag_;
172  }
173 
174 
175  // I/O
176 
177  //- Write to stream
178  virtual void write(Ostream&) const;
179 
180 
181  // Member Operators
182 
183  //- Disallow default bitwise assignment
184  void operator=(const processorGAMGInterface&) = delete;
185 };
186 
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 } // End namespace Foam
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #endif
195 
196 // ************************************************************************* //
virtual ~processorGAMGInterface()
Destructor.
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 and rotations in 3D space.
Definition: transformer.H:83
commsTypes
Types of communications.
Definition: UPstream.H:64
virtual label index() const
processorGAMGInterface(const label index, const lduInterfacePtrsList &coarseInterfaces, const lduInterface &fineInterface, const labelField &restrictAddressing, const labelField &neighbourRestrictAddressing, const label fineLevelIndex, const label coarseComm)
Construct from fine-level interface,.
virtual int tag() const
Return message tag used for sending.
virtual const labelUList & faceCells() const
Return faceCell addressing.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
virtual void write(Ostream &) const
Write to stream.
virtual int myProcNo() const
Return processor number (rank in communicator)
void operator=(const processorGAMGInterface &)=delete
Disallow default bitwise assignment.
TypeName("processor")
Runtime type information.
virtual int neighbProcNo() const
Return neighbour processor number (rank in communicator)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
An abstract base class for processor coupled interfaces.
GAMG agglomerated processor interface.
virtual label comm() const
Processor interface functions.
Abstract base class for GAMG agglomerated interfaces.
Definition: GAMGInterface.H:51
virtual const lduInterfacePtrsList & coarseInterfaces() const
virtual const transformer & transform() const
Return transformation between the coupled patches.
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches...
Definition: lduInterface.H:53
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const
Transfer and return internal field adjacent to the interface.
A class for managing temporary objects.
Definition: PtrList.H:53
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const
Initialise neighbour field transfer.
Namespace for OpenFOAM.