cyclicGAMGInterface.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 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::cyclicGAMGInterface
26 
27 Description
28  GAMG agglomerated cyclic interface.
29 
30 SourceFiles
31  cyclicGAMGInterface.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef cyclicGAMGInterface_H
36 #define cyclicGAMGInterface_H
37 
38 #include "GAMGInterface.H"
39 #include "cyclicLduInterface.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class cyclicGAMGInterface Declaration
48 \*---------------------------------------------------------------------------*/
49 
51 :
52  public GAMGInterface,
53  public cyclicLduInterface
54 {
55  // Private Data
56 
57  //- Neighbour patch number
58  label nbrPatchID_;
59 
60  //- Am I owner?
61  bool owner_;
62 
63  //- Transformation
64  transformer transform_;
65 
66 
67 public:
68 
69  //- Runtime type information
70  TypeName("cyclic");
71 
72 
73  // Constructors
74 
75  //- Construct from fine level interface,
76  // local and neighbour restrict addressing
78  (
79  const label index,
81  const lduInterface& fineInterface,
82  const labelField& restrictAddressing,
83  const labelField& neighbourRestrictAddressing,
84  const label fineLevelIndex,
85  const label coarseComm
86  );
87 
88  //- Construct from Istream
90  (
91  const label index,
92  const lduInterfacePtrsList& coarseInterfaces,
93  Istream& is
94  );
95 
96  //- Disallow default bitwise copy construction
98 
99 
100  //- Destructor
101  virtual ~cyclicGAMGInterface();
102 
103 
104  // Member Functions
105 
106  // Interface transfer functions
107 
108  //- Transfer and return internal field adjacent to the interface
110  (
111  const Pstream::commsTypes commsType,
112  const labelUList& iF
113  ) const;
114 
115 
116  //- Cyclic interface functions
117 
118  //- Return neighbour processor number
119  virtual label nbrPatchID() const
120  {
121  return nbrPatchID_;
122  }
124  virtual bool owner() const
125  {
126  return owner_;
127  }
129  virtual const cyclicGAMGInterface& nbrPatch() const
130  {
131  return dynamic_cast<const cyclicGAMGInterface&>
132  (
134  );
135  }
136 
137  //- Return face transformation tensor
138  virtual const transformer& transform() const
139  {
140  return transform_;
141  }
142 
143 
144  // I/O
145 
146  //- Write to stream
147  virtual void write(Ostream&) const;
148 
149 
150  // Member Operators
151 
152  //- Disallow default bitwise assignment
153  void operator=(const cyclicGAMGInterface&) = delete;
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165 // ************************************************************************* //
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
Vector-tensor class used to perform translations, rotations and scaling operations in 3D space...
Definition: transformer.H:83
commsTypes
Types of communications.
Definition: UPstream.H:64
virtual label index() const
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const
Transfer and return internal field adjacent to the interface.
An abstract base class for cyclic coupled interfaces.
const lduInterfacePtrsList & coarseInterfaces_
All interfaces.
Definition: GAMGInterface.H:64
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:54
virtual label nbrPatchID() const
Cyclic interface functions.
virtual const cyclicGAMGInterface & nbrPatch() const
Return processor number.
Abstract base class for GAMG agglomerated interfaces.
Definition: GAMGInterface.H:51
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 transformer & transform() const
Return face transformation tensor.
A class for managing temporary objects.
Definition: PtrList.H:53
cyclicGAMGInterface(const label index, const lduInterfacePtrsList &coarseInterfaces, const lduInterface &fineInterface, const labelField &restrictAddressing, const labelField &neighbourRestrictAddressing, const label fineLevelIndex, const label coarseComm)
Construct from fine level interface,.
TypeName("cyclic")
Runtime type information.
virtual ~cyclicGAMGInterface()
Destructor.
virtual void write(Ostream &) const
Write to stream.
void operator=(const cyclicGAMGInterface &)=delete
Disallow default bitwise assignment.
virtual bool owner() const
Namespace for OpenFOAM.
GAMG agglomerated cyclic interface.