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{
48
49/*---------------------------------------------------------------------------*\
50 Class cyclicGAMGInterface Declaration
51\*---------------------------------------------------------------------------*/
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
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
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
105 (
106 const label index,
108 Istream& is
109 );
110
111
112 //- Destructor
113 virtual ~cyclicGAMGInterface() = default;
114
115
116 // Member Functions
117
118 // Interface transfer functions
119
120 //- Transfer and return internal field adjacent to the interface
122 (
123 const Pstream::commsTypes commsType,
124 const labelUList& iF
125 ) const;
126
127
128 //- Cyclic interface functions
129
130 //- Return neighbour processor number
131 virtual label neighbPatchID() const
132 {
133 return neighbPatchID_;
134 }
136 virtual bool owner() const
137 {
138 return owner_;
139 }
141 virtual const cyclicGAMGInterface& neighbPatch() const
142 {
143 return dynamic_cast<const cyclicGAMGInterface&>
144 (
146 );
147 }
148
149 //- Return face transformation tensor
150 virtual const tensorField& forwardT() const
151 {
152 return forwardT_;
153 }
154
155 //- Return neighbour-cell transformation tensor
156 virtual const tensorField& reverseT() const
157 {
158 return reverseT_;
159 }
160
161
162 // I/O
163
164 //- Write to stream
165 virtual void write(Ostream& os) const;
166};
167
168
169// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170
171} // End namespace Foam
172
173// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174
175#endif
176
177// ************************************************************************* //
Abstract base class for GAMG agglomerated interfaces.
Definition: GAMGInterface.H:57
virtual label index() const
virtual const lduInterfacePtrsList & coarseInterfaces() const
const lduInterfacePtrsList & coarseInterfaces_
All interfaces.
Definition: GAMGInterface.H:66
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
commsTypes
Types of communications.
Definition: UPstream.H:67
GAMG agglomerated cyclic interface.
virtual bool owner() const
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
virtual label neighbPatchID() const
Cyclic interface functions.
virtual ~cyclicGAMGInterface()=default
Destructor.
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.
An abstract base class for cyclic coupled interfaces.
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches.
Definition: lduInterface.H:58
A class for managing temporary objects.
Definition: tmp.H:65
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73