1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
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
29 Abstract base class for GAMG agglomerated interfaces.
35 \*---------------------------------------------------------------------------*/
37 #ifndef GAMGInterface_H
38 #define GAMGInterface_H
40 #include "lduInterface.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 /*---------------------------------------------------------------------------*\
49 Class GAMGInterface Declaration
50 \*---------------------------------------------------------------------------*/
61 //- Face-cell addressing
62 labelField faceCells_;
64 //- Face restrict addressing
65 labelField faceRestrictAddressing_;
70 // Private Member Functions
72 //- Disallow default bitwise copy construct
73 GAMGInterface(const GAMGInterface&);
75 //- Disallow default bitwise assignment
76 void operator=(const GAMGInterface&);
81 //- Runtime type information
82 TypeName("GAMGInterface");
85 // Declare run-time constructor selection tables
87 declareRunTimeSelectionTable
93 const lduInterface& fineInterface,
94 const labelField& localRestrictAddressing,
95 const labelField& neighbourRestrictAddressing
99 localRestrictAddressing,
100 neighbourRestrictAddressing
107 //- Return a pointer to a new interface created on freestore given
108 // the fine interface
109 static autoPtr<GAMGInterface> New
111 const lduInterface& fineInterface,
112 const labelField& localRestrictAddressing,
113 const labelField& neighbourRestrictAddressing
119 //- Construct from fine-level interface,
120 // local and neighbour restrict addressing
135 virtual label size() const
137 return faceCells_.size();
140 //- Return faceCell addressing
141 virtual const unallocLabelList& faceCells() const
146 //- Return face restrict addressing
147 virtual const labelList& faceRestrictAddressing() const
149 return faceRestrictAddressing_;
152 //- Return non-const access to face restrict addressing
153 virtual labelList& faceRestrictAddressing()
155 return faceRestrictAddressing_;
158 //- Return the interface internal field of the given field
160 tmp<Field<Type> > interfaceInternalField
162 const UList<Type>& internalData
165 //- Return the values of the given internal data adjacent to
166 // the interface as a field
167 virtual tmp<labelField> interfaceInternalField
169 const unallocLabelList& internalData
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
183 const scalarField& fineCoeffs
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 } // End namespace Foam
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 # include "GAMGInterfaceTemplates.C"
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 // ************************************************************************* //