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
59 
60  //- Am I owner?
61  bool owner_;
62 
63  //- Transformation tensor
65 
66  //- Transformation tensor
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,
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  }
132 
133  virtual bool owner() const
134  {
135  return owner_;
136  }
137 
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 // ************************************************************************* //
Foam::cyclicGAMGInterface::~cyclicGAMGInterface
virtual ~cyclicGAMGInterface()
Destructor.
Definition: cyclicGAMGInterface.C:169
Foam::cyclicGAMGInterface::cyclicGAMGInterface
cyclicGAMGInterface(const cyclicGAMGInterface &)
Disallow default bitwise copy construct.
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::cyclicGAMGInterface::neighbPatchID_
label neighbPatchID_
Neigbour patch number.
Definition: cyclicGAMGInterface.H:57
Foam::lduInterface
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches.
Definition: lduInterface.H:53
Foam::cyclicGAMGInterface::reverseT
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: cyclicGAMGInterface.H:152
Foam::cyclicGAMGInterface::write
virtual void write(Ostream &) const
Write to stream.
Definition: cyclicGAMGInterface.C:196
cyclicLduInterface.H
GAMGInterface.H
Foam::label
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
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::GAMGInterface::coarseInterfaces_
const lduInterfacePtrsList & coarseInterfaces_
All interfaces.
Definition: GAMGInterface.H:64
Foam::GAMGInterface
Abstract base class for GAMG agglomerated interfaces.
Definition: GAMGInterface.H:51
Foam::cyclicGAMGInterface::neighbPatchID
virtual label neighbPatchID() const
Cyclic interface functions.
Definition: cyclicGAMGInterface.H:127
Foam::UPtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: UPtrList.H:53
Foam::cyclicGAMGInterface::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: cyclicGAMGInterface.H:146
Foam::cyclicGAMGInterface::forwardT_
tensorField forwardT_
Transformation tensor.
Definition: cyclicGAMGInterface.H:63
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::cyclicGAMGInterface::TypeName
TypeName("cyclic")
Runtime type information.
Foam::GAMGInterface::index
virtual label index() const
Definition: GAMGInterface.H:210
Foam::cyclicGAMGInterface::operator=
void operator=(const cyclicGAMGInterface &)
Disallow default bitwise assignment.
Foam::cyclicGAMGInterface::internalFieldTransfer
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const
Transfer and return internal field adjacent to the interface.
Definition: cyclicGAMGInterface.C:176
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:64
Foam::cyclicGAMGInterface::neighbPatch
virtual const cyclicGAMGInterface & neighbPatch() const
Return processor number.
Definition: cyclicGAMGInterface.H:137
Foam::UList
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
Foam::cyclicGAMGInterface::owner_
bool owner_
Am I owner?
Definition: cyclicGAMGInterface.H:60
Foam::cyclicGAMGInterface
GAMG agglomerated cyclic interface.
Definition: cyclicGAMGInterface.H:49
Foam::GAMGInterface::coarseInterfaces
virtual const lduInterfacePtrsList & coarseInterfaces() const
Definition: GAMGInterface.H:215
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::cyclicGAMGInterface::owner
virtual bool owner() const
Definition: cyclicGAMGInterface.H:132
Foam::cyclicLduInterface
An abstract base class for cyclic coupled interfaces.
Definition: cyclicLduInterface.H:49
Foam::cyclicGAMGInterface::reverseT_
tensorField reverseT_
Transformation tensor.
Definition: cyclicGAMGInterface.H:66