cyclicAMIGAMGInterface.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 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,
54 {
55  // Private Data
56 
57  //- Reference for the cyclicLduInterface from which this is
58  // agglomerated
59  const cyclicAMILduInterface& fineCyclicAMIInterface_;
60 
61  //- AMI interfaces
63 
64  //- AMI transformations
65  List<transformer> AMITransforms_;
66 
67 
68 public:
69 
70  //- Runtime type information
71  TypeName("cyclicAMI");
72 
73 
74  // Constructors
75 
76  //- Construct from fine level interface,
77  // local and neighbour restrict addressing
79  (
80  const label index,
82  const lduInterface& fineInterface,
83  const labelField& restrictAddressing,
84  const labelField& neighbourRestrictAddressing,
85  const label fineLevelIndex,
86  const label coarseComm
87  );
88 
89  //- Disallow default bitwise copy construction
91 
92 
93  //- Destructor
94  virtual ~cyclicAMIGAMGInterface();
95 
96 
97  // Member Functions
98 
99  // Interface transfer functions
100 
101  //- Transfer and return internal field adjacent to the interface
103  (
104  const Pstream::commsTypes commsType,
105  const labelUList& iF
106  ) const;
107 
108 
109  //- Cyclic interface functions
110 
111  //- Return neighbour processor number
112  virtual label nbrPatchID() const
113  {
114  return fineCyclicAMIInterface_.nbrPatchID();
115  }
116 
117  //- Does this side own the interface?
118  virtual bool owner() const
119  {
120  return fineCyclicAMIInterface_.owner();
121  }
122 
123  //- Return neighbour patch
124  virtual const cyclicAMIGAMGInterface& nbrPatch() const
125  {
126  return dynamic_cast<const cyclicAMIGAMGInterface&>
127  (
129  );
130  }
131 
132  //- Return a reference to the AMI interpolators
133  virtual const PtrList<AMIInterpolation>& AMIs() const
134  {
135  return AMIs_;
136  }
137 
138  // Return a reference to the AMI transformations
139  virtual const List<transformer>& AMITransforms() const
140  {
141  return AMITransforms_;
142  }
143 
144  //- Return transformation between the coupled patches
145  virtual const transformer& transform() const
146  {
147  return fineCyclicAMIInterface_.transform();
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  // Member Operators
163 
164  //- Disallow default bitwise assignment
165  void operator=(const cyclicAMIGAMGInterface&) = delete;
166 };
167 
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 } // End namespace Foam
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 #endif
176 
177 // ************************************************************************* //
virtual const PtrList< AMIInterpolation > & AMIs() const
Return a reference to the AMI interpolators.
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
Vector-tensor class used to perform translations and rotations in 3D space.
Definition: transformer.H:83
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.
commsTypes
Types of communications.
Definition: UPstream.H:64
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
virtual label index() const
TypeName("cyclicAMI")
Runtime type information.
virtual label nbrPatchID() const
Cyclic interface functions.
virtual label nbrPatchID() const =0
Return neighbour.
virtual const transformer & transform() const
Return transformation between the coupled patches.
const lduInterfacePtrsList & coarseInterfaces_
All interfaces.
Definition: GAMGInterface.H:64
virtual bool owner() const =0
Does this side own the interface?
An abstract base class for cyclic AMI coupled interfaces.
virtual void write(Ostream &) const
Write to stream.
void operator=(const cyclicAMIGAMGInterface &)=delete
Disallow default bitwise assignment.
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
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
cyclicAMIGAMGInterface(const label index, const lduInterfacePtrsList &coarseInterfaces, const lduInterface &fineInterface, const labelField &restrictAddressing, const labelField &neighbourRestrictAddressing, const label fineLevelIndex, const label coarseComm)
Construct from fine level interface,.
Abstract base class for GAMG agglomerated interfaces.
Definition: GAMGInterface.H:51
virtual const lduInterfacePtrsList & coarseInterfaces() const
virtual const transformer & transform() const =0
Return transformation between the coupled patches.
virtual const List< transformer > & AMITransforms() const
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:70
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches...
Definition: lduInterface.H:53
virtual const cyclicAMIGAMGInterface & nbrPatch() const
Return neighbour patch.
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.
virtual bool owner() const
Does this side own the interface?