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 | Copyright (C) 2011-2013 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  virtual public cyclicLduInterface
54 {
55  // Private data
56 
57  //- Neigbour 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  // Private Member Functions
71 
72  //- Disallow default bitwise copy construct
74 
75  //- Disallow default bitwise assignment
76  void operator=(const cyclicGAMGInterface&);
77 
78 
79 public:
80 
81  //- Runtime type information
82  TypeName("cyclic");
83 
84 
85  // Constructors
86 
87  //- Construct from fine level interface,
88  // local and neighbour restrict addressing
90  (
91  const label index,
93  const lduInterface& fineInterface,
94  const labelField& restrictAddressing,
95  const labelField& neighbourRestrictAddressing,
96  const label fineLevelIndex,
97  const label coarseComm
98  );
99 
100  //- Construct from Istream
102  (
103  const label index,
104  const lduInterfacePtrsList& coarseInterfaces,
105  Istream& is
106  );
107 
108 
109  //- Destructor
110  virtual ~cyclicGAMGInterface();
111 
112 
113  // Member Functions
114 
115  // Interface transfer functions
116 
117  //- Transfer and return internal field adjacent to the interface
119  (
120  const Pstream::commsTypes commsType,
121  const labelUList& iF
122  ) const;
123 
124 
125  //- Cyclic interface functions
126 
127  //- Return neigbour processor number
128  virtual label neighbPatchID() const
129  {
130  return neighbPatchID_;
131  }
133  virtual bool owner() const
134  {
135  return owner_;
136  }
138  virtual const cyclicGAMGInterface& neighbPatch() const
139  {
140  return dynamic_cast<const cyclicGAMGInterface&>
141  (
143  );
144  }
145 
146  //- Return face transformation tensor
147  virtual const tensorField& forwardT() const
148  {
149  return forwardT_;
150  }
151 
152  //- Return neighbour-cell transformation tensor
153  virtual const tensorField& reverseT() const
154  {
155  return reverseT_;
156  }
157 
158 
159  // I/O
160 
161  //- Write to stream
162  virtual void write(Ostream&) const;
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:61
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
TypeName("cyclic")
Runtime type information.
virtual ~cyclicGAMGInterface()
Destructor.
virtual void write(Ostream &) const
Write to stream.
virtual bool owner() const
virtual const tensorField & forwardT() const
Return face transformation tensor.
Namespace for OpenFOAM.
GAMG agglomerated cyclic interface.