cyclicAMIGAMGInterface.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-2015 OpenFOAM Foundation
9  Copyright (C) 2023 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::cyclicAMIGAMGInterface
29 
30 Description
31  GAMG agglomerated cyclic AMI interface.
32 
33 SourceFiles
34  cyclicAMIGAMGInterface.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef Foam_cyclicAMIGAMGInterface_H
39 #define Foam_cyclicAMIGAMGInterface_H
40 
41 #include "GAMGInterface.H"
42 #include "cyclicAMILduInterface.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class cyclicAMIGAMGInterface Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
55  public GAMGInterface,
56  virtual public cyclicAMILduInterface
57 {
58  // Private data
59 
60  label neighbPatchID_;
61 
62  bool owner_;
63 
64  tensorField forwardT_;
65 
66  tensorField reverseT_;
67 
68  //- AMI interface
70 
71 
72  // Private Member Functions
73 
74  //- No copy construct
76 
77  //- No copy assignment
78  void operator=(const cyclicAMIGAMGInterface&) = delete;
79 
80 
81 public:
82 
83  //- Runtime type information
84  TypeName("cyclicAMI");
85 
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 Istream
104  (
105  const label index,
107  Istream& is
108  );
109 
110  //- Construct from fine level interface,
111  //- local and neighbour restrict addressing
113  (
114  const label index,
116  const lduInterface& fineInterface,
117  const labelList& interfaceMap,
118  const labelUList& faceCells,
119  const labelUList& faceRestrictAddresssing,
120  const labelUList& faceOffsets,
121  const lduInterfacePtrsList& allInterfaces,
122  const label coarseComm,
123  const label myProcNo,
124  const labelList& procAgglomMap
125  );
126 
127  //- Construct by assembling and returning a clone.
129  (
130  const label index,
132  const labelList& interfaceMap,
133  const labelUList& faceCells,
134  const labelUList& faceRestrictAddresssing,
135  const labelUList& faceOffsets,
136  const lduInterfacePtrsList& allInterfaces,
137  const label coarseComm,
138  const label myProcNo,
139  const labelList& procAgglomMap
140  ) const
141  {
143  (
145  (
146  index,
148  *this,
149  interfaceMap,
150  faceCells,
151  faceRestrictAddresssing,
152  faceOffsets,
153  allInterfaces,
154  coarseComm,
155  myProcNo,
156  procAgglomMap
157  )
158  );
159  }
160 
161 
162  //- Destructor
163  virtual ~cyclicAMIGAMGInterface() = default;
164 
165 
166  // Member Functions
167 
168  // Interface transfer functions
169 
170  //- Transfer and return internal field adjacent to the interface
172  (
173  const Pstream::commsTypes commsType,
174  const labelUList& iF
175  ) const;
176 
177 
178  //- Cyclic interface functions
179 
180  //- Return neighbour processor number
181  virtual label neighbPatchID() const
182  {
183  return neighbPatchID_;
184  }
185 
186  virtual bool owner() const
187  {
188  return owner_;
189  }
190 
191  virtual const cyclicAMIGAMGInterface& neighbPatch() const
192  {
193  return dynamic_cast<const cyclicAMIGAMGInterface&>
194  (
196  );
197  }
198 
199  virtual const AMIPatchToPatchInterpolation& AMI() const
200  {
201  return *amiPtr_;
202  }
203 
204  //- Return face transformation tensor
205  virtual const tensorField& forwardT() const
206  {
207  return forwardT_;
208  }
209 
210  //- Return neighbour-cell transformation tensor
211  virtual const tensorField& reverseT() const
212  {
213  return reverseT_;
214  }
215 
216 
217  // I/O
219  //- Write to stream
220  virtual void write(Ostream&) const;
221 };
222 
223 
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 
226 } // End namespace Foam
227 
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 
230 #endif
231 
232 // ************************************************************************* //
virtual ~cyclicAMIGAMGInterface()=default
Destructor.
GAMG agglomerated cyclic AMI interface.
commsTypes
Communications types.
Definition: UPstream.H:72
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const
Transfer and return internal field adjacent to the interface.
AMIInterpolation AMIPatchToPatchInterpolation
Patch-to-patch interpolation == Foam::AMIInterpolation.
virtual label index() const
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
TypeName("cyclicAMI")
Runtime type information.
Smooth ATC in cells next to a set of patches supplied by type.
Definition: faceCells.H:52
const lduInterfacePtrsList & coarseInterfaces_
All interfaces.
Definition: GAMGInterface.H:66
virtual const cyclicAMIGAMGInterface & neighbPatch() const
Return processor number.
An abstract base class for cyclic AMI coupled interfaces.
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 tensorField & forwardT() const
Return face transformation tensor.
virtual void write(Ostream &) const
Write to stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
virtual label neighbPatchID() const
Cyclic interface functions.
Abstract base class for GAMG agglomerated interfaces.
Definition: GAMGInterface.H:50
virtual const AMIPatchToPatchInterpolation & AMI() const
virtual const lduInterfacePtrsList & coarseInterfaces() const
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches...
Definition: lduInterface.H:53
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.