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