regionCoupledBaseGAMGInterface.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::regionCoupledBaseGAMGInterface
26 
27 Description
28  Base class for GAMG agglomerated coupled region interface.
29 
30 SourceFiles
31  regionCoupledBaseGAMGInterface.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef regionCoupledBaseGAMGInterface_H
36 #define regionCoupledBaseGAMGInterface_H
37 
38 #include "GAMGInterface.H"
40 #include "GAMGAgglomeration.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class regionCoupledBaseGAMGInterface Declaration
49 \*---------------------------------------------------------------------------*/
50 
52 :
53  public GAMGInterface,
54  virtual public regionCoupledLduInterface
55 {
56  // Private Data
57 
58  //- Reference for the regionCoupledBaseFvPatch from which this is
59  // agglomerated
60  const regionCoupledLduInterface& fineRegionCoupledLduInterface_;
61 
62 
63 public:
64 
65 
66  // Constructors
67 
68  //- Construct from fine level interface,
69  // local and neighbour restrict addressing
71  (
72  const label index,
74  const lduInterface& fineInterface,
75  const labelField& restrictAddressing,
76  const labelField& neighbourRestrictAddressing,
77  const label fineLevelIndex,
78  const label coarseComm
79  );
80 
81  //- Disallow default bitwise copy construction
83  (
85  ) = delete;
86 
87 
88  //- Destructor
90 
91 
92  // Member Functions
93 
94  // Interface transfer functions
95 
96  //- Transfer and return internal field adjacent to the interface
98  (
99  const Pstream::commsTypes commsType,
100  const labelUList& iF
101  ) const;
102 
103 
104  //- Cyclic interface functions
105 
106  //- Return neighbour processor number
107  virtual label nbrPatchID() const
108  {
109  return fineRegionCoupledLduInterface_.nbrPatchID();
110  }
112  virtual bool owner() const
113  {
114  return fineRegionCoupledLduInterface_.owner();
115  }
117  virtual const regionCoupledBaseGAMGInterface& nbrPatch() const
118  {
119  return dynamic_cast<const regionCoupledBaseGAMGInterface&>
120  (
121  fineRegionCoupledLduInterface_.nbrPatch()
122  );
123  }
124 
125  // virtual const AMIInterpolation& AMI() const
126  //{
127  // return amiPtr_();
128  //}
130  virtual const polyMesh& nbrMesh() const
131  {
132  return fineRegionCoupledLduInterface_.nbrMesh();
133  }
134 
136  (
137  const label fineLevelIndex,
138  const label index
139  ) const
140  {
142  <
144  >
145  (
146  GAMGAgglomeration::typeName
147  );
148 
149  const lduMesh& mesh = agg.meshLevel(fineLevelIndex);
150  return mesh.interfaces()[index];
151  }
152 
153 
154  // Member Operators
155 
156  //- Disallow default bitwise assignment
157  void operator=(const regionCoupledBaseGAMGInterface&) = delete;
158 };
159 
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 } // End namespace Foam
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #endif
168 
169 // ************************************************************************* //
virtual lduInterfacePtrsList interfaces() const =0
Return a list of pointers for each patch.
virtual bool owner() const =0
Is it owner?
An abstract base class for region coupled interfaces.
Base class for GAMG agglomerated coupled region interface.
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
regionCoupledBaseGAMGInterface(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,.
const lduMesh & meshLevel(const label leveli) const
Return LDU mesh of given level.
commsTypes
Types of communications.
Definition: UPstream.H:64
virtual label index() const
virtual label nbrPatchID() const
Cyclic interface functions.
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Definition: lduMesh.H:59
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const
Transfer and return internal field adjacent to the interface.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
virtual const polyMesh & nbrMesh() const =0
Return AMI.
virtual label nbrPatchID() const =0
Return neighbour.
void operator=(const regionCoupledBaseGAMGInterface &)=delete
Disallow default bitwise assignment.
virtual const polyMesh & nbrMesh() const
Return AMI.
dynamicFvMesh & mesh
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
virtual const regionCoupledLduInterface & nbrPatch() const =0
Return neighb regionCoupledLduInterface.
virtual const regionCoupledBaseGAMGInterface & nbrPatch() const
Return neighb regionCoupledLduInterface.
Abstract base class for GAMG agglomerated interfaces.
Definition: GAMGInterface.H:51
virtual const lduInterfacePtrsList & coarseInterfaces() const
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches...
Definition: lduInterface.H:53
const objectRegistry & thisDb() const
Return the object registry.
Definition: polyMesh.H:497
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
A class for managing temporary objects.
Definition: PtrList.H:53
Geometric agglomerated algebraic multigrid agglomeration class.
const lduInterface & nbrLduInterface(const label fineLevelIndex, const label index) const
Namespace for OpenFOAM.