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 | 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::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 tensor
67  tensorField forwardT_;
68 
69  //- Message tag used for sending
70  int tag_;
71 
72 
73  // Private Member Functions
74 
75  //- Disallow default bitwise copy construct
77 
78  //- Disallow default bitwise assignment
79  void operator=(const processorGAMGInterface&);
80 
81 
82 public:
83 
84  //- Runtime type information
85  TypeName("processor");
86 
87  // Constructors
88 
89  //- Construct from fine-level interface,
90  // local and neighbour restrict addressing
92  (
93  const label index,
95  const lduInterface& fineInterface,
96  const labelField& restrictAddressing,
97  const labelField& neighbourRestrictAddressing,
98  const label fineLevelIndex,
99  const label coarseComm
100  );
101 
102  //- Construct from components
104  (
105  const label index,
106  const lduInterfacePtrsList& coarseInterfaces,
107  const labelUList& faceCells,
108  const labelUList& faceRestrictAddresssing,
109  const label coarseComm,
110  const label myProcNo,
111  const label neighbProcNo,
112  const tensorField& forwardT,
113  const int tag
114  );
115 
116  //- Construct from Istream
118  (
119  const label index,
120  const lduInterfacePtrsList& coarseInterfaces,
121  Istream& is
122  );
123 
124 
125  //- Destructor
126  virtual ~processorGAMGInterface();
127 
128 
129  // Member Functions
130 
131  // Interface transfer functions
132 
133  //- Initialise neighbour field transfer
134  virtual void initInternalFieldTransfer
135  (
136  const Pstream::commsTypes commsType,
137  const labelUList& iF
138  ) const;
139 
140  //- Transfer and return internal field adjacent to the interface
142  (
143  const Pstream::commsTypes commsType,
144  const labelUList& iF
145  ) const;
146 
147 
148  //- Processor interface functions
149 
150  //- Return communicator used for sending
151  virtual label comm() const
152  {
153  return comm_;
154  }
155 
156  //- Return processor number (rank in communicator)
157  virtual int myProcNo() const
158  {
159  return myProcNo_;
160  }
161 
162  //- Return neigbour processor number (rank in communicator)
163  virtual int neighbProcNo() const
164  {
165  return neighbProcNo_;
166  }
167 
168  //- Return face transformation tensor
169  virtual const tensorField& forwardT() const
170  {
171  return forwardT_;
172  }
173 
174  //- Return message tag used for sending
175  virtual int tag() const
176  {
177  return tag_;
178  }
179 
180 
181  // I/O
182 
183  //- Write to stream
184  virtual void write(Ostream&) const;
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
commsTypes
Types of communications.
Definition: UPstream.H:64
virtual int tag() const
Return message tag used for sending.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
virtual const tensorField & forwardT() const
Return face transformation tensor.
TypeName("processor")
Runtime type information.
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const
Transfer and return internal field adjacent to the interface.
virtual void write(Ostream &) const
Write to stream.
virtual label comm() const
Processor interface functions.
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const
Initialise neighbour field transfer.
virtual int myProcNo() const
Return 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:53
virtual int neighbProcNo() const
Return neigbour processor number (rank in communicator)
An abstract base class for processor coupled interfaces.
GAMG agglomerated processor interface.
Abstract base class for GAMG agglomerated interfaces.
Definition: GAMGInterface.H:51
virtual label index() const
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches...
Definition: lduInterface.H:53
virtual const lduInterfacePtrsList & coarseInterfaces() const
A class for managing temporary objects.
Definition: PtrList.H:54
virtual const labelUList & faceCells() const
Return faceCell addressing.
Namespace for OpenFOAM.