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 | Copyright (C) 2011-2015 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::cyclicAMIGAMGInterface
26 
27 Description
28  GAMG agglomerated cyclic AMI interface.
29 
30 SourceFiles
31  cyclicAMIGAMGInterface.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef cyclicAMIGAMGInterface_H
36 #define cyclicAMIGAMGInterface_H
37 
38 #include "GAMGInterface.H"
39 #include "cyclicAMILduInterface.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class cyclicAMIGAMGInterface Declaration
48 \*---------------------------------------------------------------------------*/
49 
51 :
52  public GAMGInterface,
53  virtual public cyclicAMILduInterface
54 {
55  // Private data
56 
57  //- Reference for the cyclicLduInterface from which this is
58  // agglomerated
59  const cyclicAMILduInterface& fineCyclicAMIInterface_;
60 
61  //- AMI interface
63 
64 
65  // Private Member Functions
66 
67  //- Disallow default bitwise copy construct
69 
70  //- Disallow default bitwise assignment
71  void operator=(const cyclicAMIGAMGInterface&);
72 
73 
74 public:
75 
76  //- Runtime type information
77  TypeName("cyclicAMI");
78 
79 
80  // Constructors
81 
82  //- Construct from fine level interface,
83  // local and neighbour restrict addressing
85  (
86  const label index,
88  const lduInterface& fineInterface,
89  const labelField& restrictAddressing,
90  const labelField& neighbourRestrictAddressing,
91  const label fineLevelIndex,
92  const label coarseComm
93  );
94 
95 
96  //- Destructor
97  virtual ~cyclicAMIGAMGInterface();
98 
99 
100  // Member Functions
101 
102  // Interface transfer functions
103 
104  //- Transfer and return internal field adjacent to the interface
106  (
107  const Pstream::commsTypes commsType,
108  const labelUList& iF
109  ) const;
110 
111 
112  //- Cyclic interface functions
113 
114  //- Return neighbour processor number
115  virtual label neighbPatchID() const
116  {
117  return fineCyclicAMIInterface_.neighbPatchID();
118  }
120  virtual bool owner() const
121  {
122  return fineCyclicAMIInterface_.owner();
123  }
125  virtual const cyclicAMIGAMGInterface& neighbPatch() const
126  {
127  return dynamic_cast<const cyclicAMIGAMGInterface&>
128  (
130  );
131  }
133  virtual const AMIPatchToPatchInterpolation& AMI() const
134  {
135  return amiPtr_();
136  }
137 
138  //- Return face transformation tensor
139  virtual const tensorField& forwardT() const
140  {
141  return fineCyclicAMIInterface_.forwardT();
142  }
143 
144  //- Return neighbour-cell transformation tensor
145  virtual const tensorField& reverseT() const
146  {
147  return fineCyclicAMIInterface_.reverseT();
148  }
149 
150 
151  // I/O
152 
153  //- Write to stream
154  virtual void write(Ostream&) const
155  {
156  //TBD. How to serialise the AMI such that we can stream
157  // cyclicAMIGAMGInterface.
159  }
160 };
161 
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 } // End namespace Foam
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
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
GAMG agglomerated cyclic AMI interface.
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const
Transfer and return internal field adjacent to the interface.
virtual const tensorField & forwardT() const =0
Return face transformation tensor.
commsTypes
Types of communications.
Definition: UPstream.H:64
virtual label index() const
TypeName("cyclicAMI")
Runtime type information.
const lduInterfacePtrsList & coarseInterfaces_
All interfaces.
Definition: GAMGInterface.H:64
virtual const cyclicAMIGAMGInterface & neighbPatch() const
Return processor number.
virtual bool owner() const =0
An abstract base class for cyclic AMI coupled interfaces.
virtual void write(Ostream &) const
Write to stream.
virtual const tensorField & forwardT() const
Return face 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
virtual label neighbPatchID() const =0
Return neighbour.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual label neighbPatchID() const
Cyclic interface functions.
virtual const tensorField & reverseT() const =0
Return face reverse transformation tensor.
Abstract base class for GAMG agglomerated interfaces.
Definition: GAMGInterface.H:51
virtual const AMIPatchToPatchInterpolation & AMI() const
virtual const lduInterfacePtrsList & coarseInterfaces() const
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches...
Definition: lduInterface.H:53
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
A class for managing temporary objects.
Definition: PtrList.H:53
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:366
virtual ~cyclicAMIGAMGInterface()
Destructor.
Namespace for OpenFOAM.