regionCoupledBaseGAMGInterface.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-2013 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  //- AMI interface
63  //autoPtr<AMIPatchToPatchInterpolation> amiPtr_;
64 
65 
66  // Private Member Functions
67 
68  //- Disallow default bitwise copy construct
70 
71  //- Disallow default bitwise assignment
72  void operator=(const regionCoupledBaseGAMGInterface&);
73 
74 
75 public:
76 
77 
78  // Constructors
79 
80  //- Construct from fine level interface,
81  // local and neighbour restrict addressing
83  (
84  const label index,
86  const lduInterface& fineInterface,
87  const labelField& restrictAddressing,
88  const labelField& neighbourRestrictAddressing,
89  const label fineLevelIndex,
90  const label coarseComm
91  );
92 
93 
94  //- Destructor
96 
97 
98  // Member Functions
99 
100  // Interface transfer functions
101 
102  //- Transfer and return internal field adjacent to the interface
104  (
105  const Pstream::commsTypes commsType,
106  const labelUList& iF
107  ) const;
108 
109 
110  //- Cyclic interface functions
111 
112  //- Return neigbour processor number
113  virtual label neighbPatchID() const
114  {
115  return fineRegionCoupledLduInterface_.neighbPatchID();
116  }
118  virtual bool owner() const
119  {
120  return fineRegionCoupledLduInterface_.owner();
121  }
123  virtual const regionCoupledBaseGAMGInterface& neighbPatch() const
124  {
125  return dynamic_cast<const regionCoupledBaseGAMGInterface&>
126  (
127  fineRegionCoupledLduInterface_.neighbPatch()
128  );
129  }
130 
131  //virtual const AMIPatchToPatchInterpolation& AMI() const
132  //{
133  // return amiPtr_();
134  //}
136  virtual const polyMesh& nbrMesh() const
137  {
138  return fineRegionCoupledLduInterface_.nbrMesh();
139  }
140 
142  (
143  const label fineLevelIndex,
144  const label index
145  ) const
146  {
148  <
150  >
151  (
152  GAMGAgglomeration::typeName
153  );
154 
155  const lduMesh& mesh = agg.meshLevel(fineLevelIndex);
156  return mesh.interfaces()[index];
157  }
158 
159 };
160 
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 } // End namespace Foam
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 #endif
169 
170 // ************************************************************************* //
virtual label index() const
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const
Transfer and return internal field adjacent to the interface.
virtual const polyMesh & nbrMesh() const
Return AMI.
virtual label neighbPatchID() const
Cyclic interface functions.
Geometric agglomerated algebraic multigrid agglomeration class.
virtual lduInterfacePtrsList interfaces() const =0
Return a list of pointers for each patch.
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
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Definition: lduMesh.H:51
dynamicFvMesh & mesh
Namespace for OpenFOAM.
const lduMesh & meshLevel(const label leveli) const
Return LDU mesh of given level.
virtual const regionCoupledBaseGAMGInterface & neighbPatch() const
Return neighb regionCoupledLduInterface.
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches...
Definition: lduInterface.H:53
commsTypes
Types of communications.
Definition: UPstream.H:64
virtual const polyMesh & nbrMesh() const =0
Return AMI.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
const objectRegistry & thisDb() const
Return the object registry.
Definition: polyMesh.H:484
virtual const regionCoupledLduInterface & neighbPatch() const =0
Return neighb regionCoupledLduInterface.
An abstract base class for region coupled interfaces.
virtual bool owner() const =0
Is it owner?
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
const lduInterface & nbrLduInterface(const label fineLevelIndex, const label index) const
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
Abstract base class for GAMG agglomerated interfaces.
Definition: GAMGInterface.H:51
virtual const lduInterfacePtrsList & coarseInterfaces() const
Base class for GAMG agglomerated coupled region interface.
A class for managing temporary objects.
Definition: PtrList.H:118
virtual label neighbPatchID() const =0
Return neighbour.