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-2019 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 neighbPatchID_;
59 
60  //- Am I owner?
61  bool owner_;
62 
63  //- Transformation tensor
64  tensorField forwardT_;
65 
66  //- Transformation tensor
67  tensorField reverseT_;
68 
69 
70 public:
71 
72  //- Runtime type information
73  TypeName("cyclic");
74 
75 
76  // Constructors
77 
78  //- Construct from fine level interface,
79  // local and neighbour restrict addressing
81  (
82  const label index,
84  const lduInterface& fineInterface,
85  const labelField& restrictAddressing,
86  const labelField& neighbourRestrictAddressing,
87  const label fineLevelIndex,
88  const label coarseComm
89  );
90 
91  //- Construct from Istream
93  (
94  const label index,
95  const lduInterfacePtrsList& coarseInterfaces,
96  Istream& is
97  );
98 
99  //- Disallow default bitwise copy construction
100  cyclicGAMGInterface(const cyclicGAMGInterface&) = delete;
101 
102 
103  //- Destructor
104  virtual ~cyclicGAMGInterface();
105 
106 
107  // Member Functions
108 
109  // Interface transfer functions
110 
111  //- Transfer and return internal field adjacent to the interface
113  (
114  const Pstream::commsTypes commsType,
115  const labelUList& iF
116  ) const;
117 
118 
119  //- Cyclic interface functions
120 
121  //- Return neighbour processor number
122  virtual label neighbPatchID() const
123  {
124  return neighbPatchID_;
125  }
127  virtual bool owner() const
128  {
129  return owner_;
130  }
132  virtual const cyclicGAMGInterface& neighbPatch() const
133  {
134  return dynamic_cast<const cyclicGAMGInterface&>
135  (
137  );
138  }
139 
140  //- Return face transformation tensor
141  virtual const tensorField& forwardT() const
142  {
143  return forwardT_;
144  }
145 
146  //- Return neighbour-cell transformation tensor
147  virtual const tensorField& reverseT() const
148  {
149  return reverseT_;
150  }
151 
152 
153  // I/O
154 
155  //- Write to stream
156  virtual void write(Ostream&) const;
157 
158 
159  // Member Operators
160 
161  //- Disallow default bitwise assignment
162  void operator=(const cyclicGAMGInterface&) = delete;
163 };
164 
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 } // End namespace Foam
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #endif
173 
174 // ************************************************************************* //
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
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.
virtual const cyclicGAMGInterface & neighbPatch() const
Return processor number.
const lduInterfacePtrsList & coarseInterfaces_
All interfaces.
Definition: GAMGInterface.H:64
virtual label neighbPatchID() const
Cyclic interface functions.
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
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:53
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
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
virtual const tensorField & forwardT() const
Return face transformation tensor.
Namespace for OpenFOAM.
GAMG agglomerated cyclic interface.