cyclicAMIGAMGInterface.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-2015 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::cyclicAMIGAMGInterface
28 
29 Description
30  GAMG agglomerated cyclic AMI interface.
31 
32 SourceFiles
33  cyclicAMIGAMGInterface.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef cyclicAMIGAMGInterface_H
38 #define cyclicAMIGAMGInterface_H
39 
40 #include "GAMGInterface.H"
41 #include "cyclicAMILduInterface.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class cyclicAMIGAMGInterface Declaration
50 \*---------------------------------------------------------------------------*/
51 
53 :
54  public GAMGInterface,
55  virtual public cyclicAMILduInterface
56 {
57  // Private data
58 
59  //- Reference for the cyclicLduInterface from which this is
60  // agglomerated
61  const cyclicAMILduInterface& fineCyclicAMIInterface_;
62 
63  //- AMI interface
65 
66 
67  // Private Member Functions
68 
69  //- No copy construct
71 
72  //- No copy assignment
73  void operator=(const cyclicAMIGAMGInterface&) = delete;
74 
75 
76 public:
77 
78  //- Runtime type information
79  TypeName("cyclicAMI");
80 
81 
82  // Constructors
83 
84  //- Construct from fine level interface,
85  //- local and neighbour restrict addressing
87  (
88  const label index,
90  const lduInterface& fineInterface,
91  const labelField& restrictAddressing,
92  const labelField& neighbourRestrictAddressing,
93  const label fineLevelIndex,
94  const label coarseComm
95  );
96 
97 
98  //- Destructor
99  virtual ~cyclicAMIGAMGInterface();
100 
101 
102  // Member Functions
103 
104  // Interface transfer functions
105 
106  //- Transfer and return internal field adjacent to the interface
108  (
109  const Pstream::commsTypes commsType,
110  const labelUList& iF
111  ) const;
112 
113 
114  //- Cyclic interface functions
115 
116  //- Return neighbour processor number
117  virtual label neighbPatchID() const
118  {
119  return fineCyclicAMIInterface_.neighbPatchID();
120  }
121 
122  virtual bool owner() const
123  {
124  return fineCyclicAMIInterface_.owner();
125  }
126 
127  virtual const cyclicAMIGAMGInterface& neighbPatch() const
128  {
129  return dynamic_cast<const cyclicAMIGAMGInterface&>
130  (
132  );
133  }
134 
135  virtual const AMIPatchToPatchInterpolation& AMI() const
136  {
137  return *amiPtr_;
138  }
139 
140  //- Return face transformation tensor
141  virtual const tensorField& forwardT() const
142  {
143  return fineCyclicAMIInterface_.forwardT();
144  }
145 
146  //- Return neighbour-cell transformation tensor
147  virtual const tensorField& reverseT() const
148  {
149  return fineCyclicAMIInterface_.reverseT();
150  }
151 
152 
153  // I/O
154 
155  //- Write to stream
156  virtual void write(Ostream&) const
157  {
158  //TBD. How to serialise the AMI such that we can stream
159  // cyclicAMIGAMGInterface.
161  }
162 };
163 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #endif
172 
173 // ************************************************************************* //
Foam::cyclicAMIGAMGInterface::neighbPatch
virtual const cyclicAMIGAMGInterface & neighbPatch() const
Return processor number.
Definition: cyclicAMIGAMGInterface.H:126
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::cyclicAMILduInterface
An abstract base class for cyclic AMI coupled interfaces.
Definition: cyclicAMILduInterface.H:52
Foam::lduInterface
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches.
Definition: lduInterface.H:54
Foam::cyclicAMIGAMGInterface::owner
virtual bool owner() const
Definition: cyclicAMIGAMGInterface.H:121
Foam::cyclicAMIGAMGInterface::write
virtual void write(Ostream &) const
Write to stream.
Definition: cyclicAMIGAMGInterface.H:155
Foam::cyclicAMIGAMGInterface::reverseT
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: cyclicAMIGAMGInterface.H:146
Foam::cyclicAMIGAMGInterface::TypeName
TypeName("cyclicAMI")
Runtime type information.
Foam::cyclicAMILduInterface::neighbPatchID
virtual label neighbPatchID() const =0
Return neighbour.
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
GAMGInterface.H
Foam::cyclicAMIGAMGInterface::neighbPatchID
virtual label neighbPatchID() const
Cyclic interface functions.
Definition: cyclicAMIGAMGInterface.H:116
Foam::Field< label >
Foam::cyclicAMILduInterface::reverseT
virtual const tensorField & reverseT() const =0
Return face reverse transformation tensor.
Foam::GAMGInterface::coarseInterfaces_
const lduInterfacePtrsList & coarseInterfaces_
All interfaces.
Definition: GAMGInterface.H:66
Foam::GAMGInterface
Abstract base class for GAMG agglomerated interfaces.
Definition: GAMGInterface.H:54
Foam::cyclicAMILduInterface::owner
virtual bool owner() const =0
Foam::UPtrList< const lduInterface >
Foam::cyclicAMIGAMGInterface::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: cyclicAMIGAMGInterface.H:140
Foam::cyclicAMIGAMGInterface::AMI
virtual const AMIPatchToPatchInterpolation & AMI() const
Definition: cyclicAMIGAMGInterface.H:134
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::GAMGInterface::index
virtual label index() const
Definition: GAMGInterface.H:210
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:69
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::cyclicAMIGAMGInterface
GAMG agglomerated cyclic AMI interface.
Definition: cyclicAMIGAMGInterface.H:51
Foam::cyclicAMIGAMGInterface::~cyclicAMIGAMGInterface
virtual ~cyclicAMIGAMGInterface()
Destructor.
Definition: cyclicAMIGAMGInterface.C:162
Foam::AMIInterpolation
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
Definition: AMIInterpolation.H:79
Foam::UList< label >
Foam::cyclicAMIGAMGInterface::internalFieldTransfer
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const
Transfer and return internal field adjacent to the interface.
Definition: cyclicAMIGAMGInterface.C:169
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::cyclicAMILduInterface::forwardT
virtual const tensorField & forwardT() const =0
Return face transformation tensor.
cyclicAMILduInterface.H