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-2018 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<vectorTensorTransform> AMITransforms_;
66 
67 
68  // Private Member Functions
69 
70  //- Disallow default bitwise copy construct
72 
73  //- Disallow default bitwise assignment
74  void operator=(const cyclicAMIGAMGInterface&);
75 
76 
77 public:
78 
79  //- Runtime type information
80  TypeName("cyclicAMI");
81 
82 
83  // Constructors
84 
85  //- Construct from fine level interface,
86  // local and neighbour restrict addressing
88  (
89  const label index,
91  const lduInterface& fineInterface,
92  const labelField& restrictAddressing,
93  const labelField& neighbourRestrictAddressing,
94  const label fineLevelIndex,
95  const label coarseComm
96  );
97 
98 
99  //- Destructor
100  virtual ~cyclicAMIGAMGInterface();
101 
102 
103  // Member Functions
104 
105  // Interface transfer functions
106 
107  //- Transfer and return internal field adjacent to the interface
109  (
110  const Pstream::commsTypes commsType,
111  const labelUList& iF
112  ) const;
113 
114 
115  //- Cyclic interface functions
116 
117  //- Return neighbour processor number
118  virtual label neighbPatchID() const
119  {
120  return fineCyclicAMIInterface_.neighbPatchID();
121  }
122 
123  //- Does this side own the interface?
124  virtual bool owner() const
125  {
126  return fineCyclicAMIInterface_.owner();
127  }
128 
129  //- Return neighbour patch
130  virtual const cyclicAMIGAMGInterface& neighbPatch() const
131  {
132  return dynamic_cast<const cyclicAMIGAMGInterface&>
133  (
135  );
136  }
137 
138  //- Return a reference to the AMI interpolators
139  virtual const PtrList<AMIPatchToPatchInterpolation>& AMIs() const
140  {
141  return AMIs_;
142  }
143 
144  // Return a reference to the AMI transformations
145  virtual const List<vectorTensorTransform>& AMITransforms() const
146  {
147  return AMITransforms_;
148  }
149 
150  //- Return face transformation tensor
151  virtual const tensorField& forwardT() const
152  {
153  return fineCyclicAMIInterface_.forwardT();
154  }
155 
156  //- Return neighbour-cell transformation tensor
157  virtual const tensorField& reverseT() const
158  {
159  return fineCyclicAMIInterface_.reverseT();
160  }
161 
162 
163  // I/O
164 
165  //- Write to stream
166  virtual void write(Ostream&) const
167  {
168  // TBD. How to serialise the AMI such that we can stream
169  // cyclicAMIGAMGInterface.
171  }
172 };
173 
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 } // End namespace Foam
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #endif
182 
183 // ************************************************************************* //
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
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:60
virtual label index() const
TypeName("cyclicAMI")
Runtime type information.
const lduInterfacePtrsList & coarseInterfaces_
All interfaces.
Definition: GAMGInterface.H:64
virtual const cyclicAMIGAMGInterface & neighbPatch() const
Return neighbour patch.
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.
virtual const PtrList< AMIPatchToPatchInterpolation > & AMIs() const
Return a reference to the AMI interpolators.
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 lduInterfacePtrsList & coarseInterfaces() 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:63
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.
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?
virtual const List< vectorTensorTransform > & AMITransforms() const