Loading...
Searching...
No Matches
cyclicGAMGInterface.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-2013 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::cyclicGAMGInterface
29
30Description
31 GAMG agglomerated cyclic interface.
32
33SourceFiles
34 cyclicGAMGInterface.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef cyclicGAMGInterface_H
39#define cyclicGAMGInterface_H
40
41#include "GAMGInterface.H"
42#include "cyclicLduInterface.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
49/*---------------------------------------------------------------------------*\
50 Class cyclicGAMGInterface Declaration
51\*---------------------------------------------------------------------------*/
52
53class cyclicGAMGInterface
54:
55 public GAMGInterface,
56 virtual public cyclicLduInterface
57{
58 // Private data
59
60 //- Neighbour patch number
61 label neighbPatchID_;
62
63 //- Am I owner?
64 bool owner_;
65
66 //- Transformation tensor
67 tensorField forwardT_;
68
69 //- Transformation tensor
70 tensorField reverseT_;
71
72
73 // Private Member Functions
74
75 //- No copy construct
76 cyclicGAMGInterface(const cyclicGAMGInterface&) = delete;
77
78 //- No copy assignment
79 void operator=(const cyclicGAMGInterface&) = delete;
80
81
82public:
83
84 //- Runtime type information
85 TypeName("cyclic");
86
87
88 // Constructors
89
90 //- Construct from fine level interface,
91 // local and neighbour restrict addressing
92 cyclicGAMGInterface
93 (
94 const label index,
96 const lduInterface& fineInterface,
97 const labelField& restrictAddressing,
98 const labelField& neighbourRestrictAddressing,
99 const label fineLevelIndex,
100 const label coarseComm
101 );
102
103 //- Construct from Istream
104 cyclicGAMGInterface
105 (
106 const label index,
108 Istream& is
109 );
110
111 //- Construct from fine level interface,
112 //- local and neighbour restrict addressing
113 cyclicGAMGInterface
114 (
115 const label index,
117 const lduInterface& fineInterface,
118 const labelList& interfaceMap,
119 const labelUList& faceCells,
120 const labelUList& faceRestrictAddresssing,
121 const labelUList& faceOffsets,
122 const lduInterfacePtrsList& allInterfaces
123 );
124
125 //- Construct by assembling and returning a clone.
127 (
128 const label index,
130 const labelList& interfaceMap,
131 const labelUList& faceCells,
132 const labelUList& faceRestrictAddresssing,
133 const labelUList& faceOffsets,
134 const lduInterfacePtrsList& allInterfaces,
135 const label coarseComm,
136 const label myProcNo,
137 const labelList& procAgglomMap
138 ) const
139 {
141 (
142 new cyclicGAMGInterface
143 (
146 *this,
147 interfaceMap,
148 faceCells,
149 faceRestrictAddresssing,
150 faceOffsets,
151 allInterfaces
152 )
153 );
154 }
155
156
157 //- Destructor
158 virtual ~cyclicGAMGInterface() = default;
159
160
161 // Member Functions
162
163 // Interface transfer functions
164
165 //- Transfer and return internal field adjacent to the interface
167 (
168 const Pstream::commsTypes commsType,
169 const labelUList& iF
170 ) const;
171
172
173 //- Cyclic interface functions
174
175 //- Return neighbour processor number
176 virtual label neighbPatchID() const
177 {
178 return neighbPatchID_;
179 }
180
181 virtual bool owner() const
182 {
183 return owner_;
184 }
185
186 virtual const cyclicGAMGInterface& neighbPatch() const
187 {
188 return dynamic_cast<const cyclicGAMGInterface&>
189 (
191 );
192 }
193
194 //- Return face transformation tensor
195 virtual const tensorField& forwardT() const
196 {
197 return forwardT_;
198 }
199
200 //- Return neighbour-cell transformation tensor
201 virtual const tensorField& reverseT() const
203 return reverseT_;
204 }
205
206
207 // I/O
208
209 //- Write to stream
210 virtual void write(Ostream& os) const;
211};
213
214// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215
216} // End namespace Foam
217
218// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219
220#endif
221
222// ************************************************************************* //
virtual label index() const
virtual const lduInterfacePtrsList & coarseInterfaces() const
virtual const labelUList & faceCells() const
Return faceCell addressing.
const lduInterfacePtrsList & coarseInterfaces_
All interfaces.
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
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
virtual label neighbPatchID() const
Cyclic interface functions.
virtual ~cyclicGAMGInterface()=default
Destructor.
virtual autoPtr< GAMGInterface > clone(const label index, const lduInterfacePtrsList &coarseInterfaces, const labelList &interfaceMap, const labelUList &faceCells, const labelUList &faceRestrictAddresssing, const labelUList &faceOffsets, const lduInterfacePtrsList &allInterfaces, const label coarseComm, const label myProcNo, const labelList &procAgglomMap) const
Construct by assembling and returning a clone.
virtual const cyclicGAMGInterface & neighbPatch() const
Return processor number.
TypeName("cyclic")
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 const tensorField & forwardT() const
Return face transformation tensor.
cyclicLduInterface() noexcept=default
Default construct.
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches.
A class for managing temporary objects.
Definition tmp.H:75
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
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