initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / OpenFOAM / matrices / lduMatrix / solvers / GAMG / interfaces / GAMGInterface / GAMGInterface.H
blob0e701d157d7e6f0d56280d10b7aec2756ded1e13
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
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.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::GAMGInterface
28 Description
29      Abstract base class for GAMG agglomerated interfaces.
31 SourceFiles
32     GAMGInterface.C
33     newAmgInterface.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef GAMGInterface_H
38 #define GAMGInterface_H
40 #include "lduInterface.H"
41 #include "autoPtr.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 /*---------------------------------------------------------------------------*\
49                       Class GAMGInterface Declaration
50 \*---------------------------------------------------------------------------*/
52 class GAMGInterface
54     public lduInterface
57 protected:
59     // Protected data
61         //- Face-cell addressing
62         labelField faceCells_;
64         //- Face restrict addressing
65         labelField faceRestrictAddressing_;
68 private:
70     // Private Member Functions
72         //- Disallow default bitwise copy construct
73         GAMGInterface(const GAMGInterface&);
75         //- Disallow default bitwise assignment
76         void operator=(const GAMGInterface&);
79 public:
81     //- Runtime type information
82     TypeName("GAMGInterface");
85     // Declare run-time constructor selection tables
87         declareRunTimeSelectionTable
88         (
89             autoPtr,
90             GAMGInterface,
91             lduInterface,
92             (
93                 const lduInterface& fineInterface,
94                 const labelField& localRestrictAddressing,
95                 const labelField& neighbourRestrictAddressing
96             ),
97             (
98                 fineInterface,
99                 localRestrictAddressing,
100                 neighbourRestrictAddressing
101             )
102         );
105     // Selectors
107         //- Return a pointer to a new interface created on freestore given
108         //  the fine interface
109         static autoPtr<GAMGInterface> New
110         (
111             const lduInterface& fineInterface,
112             const labelField& localRestrictAddressing,
113             const labelField& neighbourRestrictAddressing
114         );
117     // Constructors
119         //- Construct from fine-level interface,
120         //  local and neighbour restrict addressing
121         GAMGInterface
122         (
123             const lduInterface&,
124             const labelField&,
125             const labelField&
126         )
127         {}
130     // Member Functions
132         // Access
134             //- Return size
135             virtual label size() const
136             {
137                 return faceCells_.size();
138             }
140             //- Return faceCell addressing
141             virtual const unallocLabelList& faceCells() const
142             {
143                 return faceCells_;
144             }
146             //- Return face restrict addressing
147             virtual const labelList& faceRestrictAddressing() const
148             {
149                 return faceRestrictAddressing_;
150             }
152             //- Return non-const access to face restrict addressing
153             virtual labelList& faceRestrictAddressing()
154             {
155                 return faceRestrictAddressing_;
156             }
158             //- Return the interface internal field of the given field
159             template<class Type>
160             tmp<Field<Type> > interfaceInternalField
161             (
162                 const UList<Type>& internalData
163             ) const;
165             //- Return the values of the given internal data adjacent to
166             //  the interface as a field
167             virtual tmp<labelField> interfaceInternalField
168             (
169                 const unallocLabelList& internalData
170             ) const;
173         // Agglomeration
175             //- Merge the next level with this level
176             //  combining the face-restrict addressing
177             //  and copying the face-cell addressing
178             void combine(const GAMGInterface&);
180             //- Agglomerating the given fine-level coefficients and return
181             virtual tmp<scalarField> agglomerateCoeffs
182             (
183                 const scalarField& fineCoeffs
184             ) const;
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 } // End namespace Foam
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 #ifdef NoRepository
195 #   include "GAMGInterfaceTemplates.C"
196 #endif
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 #endif
202 // ************************************************************************* //