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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2013 OpenFOAM Foundation
9  Copyright (C) 2019 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::cyclicGAMGInterface
29 
30 Description
31  GAMG agglomerated cyclic interface.
32 
33 SourceFiles
34  cyclicGAMGInterface.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef cyclicGAMGInterface_H
39 #define cyclicGAMGInterface_H
40 
41 #include "GAMGInterface.H"
42 #include "cyclicLduInterface.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class cyclicGAMGInterface Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
55  public GAMGInterface,
56  virtual public cyclicLduInterface
57 {
58  // Private data
59 
60  //- Neighbour patch number
61  label neighbPatchID_;
62 
63  //- Am I owner?
64  bool owner_;
65 
66  //- Transformation tensor
67  tensorField forwardT_;
68 
69  //- Transformation tensor
70  tensorField reverseT_;
71 
72 
73  // Private Member Functions
74 
75  //- No copy construct
77 
78  //- No copy assignment
79  void operator=(const cyclicGAMGInterface&) = delete;
80 
81 
82 public:
83 
84  //- Runtime type information
85  TypeName("cyclic");
86 
87 
88  // Constructors
89 
90  //- Construct from fine level interface,
91  // local and neighbour restrict addressing
93  (
94  const label index,
96  const lduInterface& fineInterface,
97  const labelField& restrictAddressing,
98  const labelField& neighbourRestrictAddressing,
99  const label fineLevelIndex,
100  const label coarseComm
101  );
102 
103  //- Construct from Istream
105  (
106  const label index,
108  Istream& is
109  );
110 
111 
112  //- Destructor
113  virtual ~cyclicGAMGInterface() = default;
114 
115 
116  // Member Functions
117 
118  // Interface transfer functions
119 
120  //- Transfer and return internal field adjacent to the interface
122  (
123  const Pstream::commsTypes commsType,
124  const labelUList& iF
125  ) const;
126 
127 
128  //- Cyclic interface functions
129 
130  //- Return neighbour processor number
131  virtual label neighbPatchID() const
132  {
133  return neighbPatchID_;
134  }
135 
136  virtual bool owner() const
137  {
138  return owner_;
139  }
140 
141  virtual const cyclicGAMGInterface& neighbPatch() const
142  {
143  return dynamic_cast<const cyclicGAMGInterface&>
144  (
146  );
147  }
148 
149  //- Return face transformation tensor
150  virtual const tensorField& forwardT() const
151  {
152  return forwardT_;
153  }
154 
155  //- Return neighbour-cell transformation tensor
156  virtual const tensorField& reverseT() const
157  {
158  return reverseT_;
159  }
160 
161 
162  // I/O
163 
164  //- Write to stream
165  virtual void write(Ostream& os) const;
166 };
167 
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 } // End namespace Foam
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 #endif
176 
177 // ************************************************************************* //
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::lduInterface
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches.
Definition: lduInterface.H:54
Foam::cyclicGAMGInterface::reverseT
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: cyclicGAMGInterface.H:155
cyclicLduInterface.H
GAMGInterface.H
Foam::Field< tensor >
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::GAMGInterface::coarseInterfaces_
const lduInterfacePtrsList & coarseInterfaces_
All interfaces.
Definition: GAMGInterface.H:66
Foam::cyclicGAMGInterface::write
virtual void write(Ostream &os) const
Write to stream.
Definition: cyclicGAMGInterface.C:188
Foam::GAMGInterface
Abstract base class for GAMG agglomerated interfaces.
Definition: GAMGInterface.H:54
Foam::cyclicGAMGInterface::neighbPatchID
virtual label neighbPatchID() const
Cyclic interface functions.
Definition: cyclicGAMGInterface.H:130
Foam::UPtrList< const lduInterface >
Foam::cyclicGAMGInterface::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: cyclicGAMGInterface.H:149
os
OBJstream os(runTime.globalPath()/outputName)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::cyclicGAMGInterface::TypeName
TypeName("cyclic")
Runtime type information.
Foam::GAMGInterface::index
virtual label index() const
Definition: GAMGInterface.H:210
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:69
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:168
Foam::cyclicGAMGInterface::neighbPatch
virtual const cyclicGAMGInterface & neighbPatch() const
Return processor number.
Definition: cyclicGAMGInterface.H:140
Foam::cyclicGAMGInterface::~cyclicGAMGInterface
virtual ~cyclicGAMGInterface()=default
Destructor.
Foam::UList< label >
Foam::cyclicGAMGInterface
GAMG agglomerated cyclic interface.
Definition: cyclicGAMGInterface.H:52
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:56
Foam::cyclicGAMGInterface::owner
virtual bool owner() const
Definition: cyclicGAMGInterface.H:135
Foam::cyclicLduInterface
An abstract base class for cyclic coupled interfaces.
Definition: cyclicLduInterface.H:52