Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::processorGAMGInterface
29
30Description
31 GAMG agglomerated processor interface.
32
33SourceFiles
34 processorGAMGInterface.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef processorGAMGInterface_H
39#define processorGAMGInterface_H
40
41#include "GAMGInterface.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
49/*---------------------------------------------------------------------------*\
50 Class processorGAMGInterface Declaration
51\*---------------------------------------------------------------------------*/
52
53class processorGAMGInterface
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
79 processorGAMGInterface(const processorGAMGInterface&) = delete;
80
81 //- No copy assignment
82 void operator=(const processorGAMGInterface&) = delete;
83
84
85public:
86
87 //- Runtime type information
88 TypeName("processor");
89
90 // Constructors
91
92 //- Construct from fine-level interface,
93 //- local and neighbour restrict addressing
94 processorGAMGInterface
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
106 processorGAMGInterface
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
120 processorGAMGInterface
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
144 //- Initialise neighbour field transfer using faceCells mapping
145 virtual void initInternalFieldTransfer
146 (
147 const Pstream::commsTypes commsType,
148 const labelUList& iF,
149 const labelUList& faceCells
150 ) const;
151
152 //- Transfer and return internal field adjacent to the interface
154 (
155 const Pstream::commsTypes commsType,
156 const labelUList& iF
157 ) const;
158
159
160 //- Processor interface functions
161
162 //- Return communicator used for sending
163 virtual label comm() const
164 {
165 return comm_;
166 }
167
168 //- Return processor number (rank in communicator)
169 virtual int myProcNo() const
170 {
171 return myProcNo_;
172 }
173
174 //- Return neighbour processor number (rank in communicator)
175 virtual int neighbProcNo() const
176 {
177 return neighbProcNo_;
178 }
179
180 //- Return face transformation tensor
181 virtual const tensorField& forwardT() const
182 {
183 return forwardT_;
184 }
185
186 //- Return message tag used for sending
187 virtual int tag() const
188 {
189 return tag_;
190 }
191
193 // I/O
194
195 //- Write to stream
196 virtual void write(Ostream& os) const;
197};
198
199
200// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201
202} // End namespace Foam
203
204// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205
206#endif
207
208// ************************************************************************* //
virtual label index() const
virtual const lduInterfacePtrsList & coarseInterfaces() const
virtual const labelUList & faceCells() const
Return faceCell addressing.
GAMGInterface(const GAMGInterface &)=delete
No copy construct.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
commsTypes
Communications types.
Definition UPstream.H:81
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches.
virtual int myProcNo() const
Return processor number (rank in communicator).
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const
Initialise neighbour field transfer.
virtual label comm() const
Processor interface functions.
virtual int tag() const
Return message tag used for sending.
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 ~processorGAMGInterface()=default
Destructor.
virtual int neighbProcNo() const
Return neighbour processor number (rank in communicator).
virtual const tensorField & forwardT() const
Return face transformation tensor.
processorLduInterface() noexcept=default
Default construct.
A class for managing temporary objects.
Definition tmp.H:75
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
UPtrList< const lduInterface > lduInterfacePtrsList
Store lists of lduInterface as a UPtrList.
Field< label > labelField
Specialisation of Field<T> for label.
Definition labelField.H:48
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
UList< label > labelUList
A UList of labels.
Definition UList.H:75
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68