FreeFOAM The Cross-Platform CFD Toolkit
GAMGInterface.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) 1991-2010 OpenCFD Ltd.
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::GAMGInterface
26 
27 Description
28  Abstract base class for GAMG agglomerated interfaces.
29 
30 SourceFiles
31  GAMGInterface.C
32  newAmgInterface.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef GAMGInterface_H
37 #define GAMGInterface_H
38 
39 #include <OpenFOAM/lduInterface.H>
40 #include <OpenFOAM/autoPtr.H>
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class GAMGInterface Declaration
49 \*---------------------------------------------------------------------------*/
50 
52 :
53  public lduInterface
54 {
55 
56 protected:
57 
58  // Protected data
59 
60  //- Face-cell addressing
62 
63  //- Face restrict addressing
65 
66 
67 private:
68 
69  // Private Member Functions
70 
71  //- Disallow default bitwise copy construct
73 
74  //- Disallow default bitwise assignment
75  void operator=(const GAMGInterface&);
76 
77 
78 public:
79 
80  //- Runtime type information
81  TypeName("GAMGInterface");
82 
83 
84  // Declare run-time constructor selection tables
85 
87  (
88  autoPtr,
91  (
92  const lduInterface& fineInterface,
93  const labelField& localRestrictAddressing,
94  const labelField& neighbourRestrictAddressing
95  ),
96  (
97  fineInterface,
98  localRestrictAddressing,
99  neighbourRestrictAddressing
100  )
101  );
102 
103 
104  // Selectors
105 
106  //- Return a pointer to a new interface created on freestore given
107  // the fine interface
109  (
110  const lduInterface& fineInterface,
111  const labelField& localRestrictAddressing,
112  const labelField& neighbourRestrictAddressing
113  );
114 
115 
116  // Constructors
117 
118  //- Construct from fine-level interface,
119  // local and neighbour restrict addressing
121  (
122  const lduInterface&,
123  const labelField&,
124  const labelField&
125  )
126  {}
127 
128 
129  // Member Functions
130 
131  // Access
132 
133  //- Return size
134  virtual label size() const
135  {
136  return faceCells_.size();
137  }
138 
139  //- Return faceCell addressing
140  virtual const unallocLabelList& faceCells() const
141  {
142  return faceCells_;
143  }
144 
145  //- Return face restrict addressing
146  virtual const labelList& faceRestrictAddressing() const
147  {
149  }
150 
151  //- Return non-const access to face restrict addressing
153  {
155  }
156 
157  //- Return the interface internal field of the given field
158  template<class Type>
160  (
161  const UList<Type>& internalData
162  ) const;
163 
164  //- Return the values of the given internal data adjacent to
165  // the interface as a field
167  (
168  const unallocLabelList& internalData
169  ) const;
170 
171 
172  // Agglomeration
173 
174  //- Merge the next level with this level
175  // combining the face-restrict addressing
176  // and copying the face-cell addressing
177  void combine(const GAMGInterface&);
178 
179  //- Agglomerating the given fine-level coefficients and return
181  (
182  const scalarField& fineCoeffs
183  ) const;
184 };
185 
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 } // End namespace Foam
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 #ifdef NoRepository
195 #endif
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 #endif
200 
201 // ************************ vim: set sw=4 sts=4 et: ************************ //