1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
28 Abstract base class for GAMG agglomerated interfaces.
34 \*---------------------------------------------------------------------------*/
36 #ifndef GAMGInterface_H
37 #define GAMGInterface_H
40 #include "lduInterfacePtrsList.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 /*---------------------------------------------------------------------------*\
48 Class GAMGInterface Declaration
49 \*---------------------------------------------------------------------------*/
60 //- My index in coarseInterfaces
64 const lduInterfacePtrsList& coarseInterfaces_;
66 //- Face-cell addressing
67 labelField faceCells_;
69 //- Face restrict addressing
70 labelField faceRestrictAddressing_;
75 // Private Member Functions
77 //- Disallow default bitwise copy construct
78 GAMGInterface(const GAMGInterface&);
80 //- Disallow default bitwise assignment
81 void operator=(const GAMGInterface&);
86 //- Runtime type information
87 TypeName("GAMGInterface");
90 // Declare run-time constructor selection tables
92 declareRunTimeSelectionTable
99 const lduInterfacePtrsList& coarseInterfaces,
100 const lduInterface& fineInterface,
101 const labelField& localRestrictAddressing,
102 const labelField& neighbourRestrictAddressing
108 localRestrictAddressing,
109 neighbourRestrictAddressing
116 //- Return a pointer to a new interface created on freestore given
117 // the fine interface
118 static autoPtr<GAMGInterface> New
121 const lduInterfacePtrsList& coarseInterfaces,
122 const lduInterface& fineInterface,
123 const labelField& localRestrictAddressing,
124 const labelField& neighbourRestrictAddressing
130 //- Construct from fine-level interface,
131 // local and neighbour restrict addressing
135 const lduInterfacePtrsList& coarseInterfaces,
142 coarseInterfaces_(coarseInterfaces)
151 virtual label size() const
153 return faceCells_.size();
156 virtual label index() const
161 virtual const lduInterfacePtrsList& coarseInterfaces() const
163 return coarseInterfaces_;
166 //- Return faceCell addressing
167 virtual const labelUList& faceCells() const
172 //- Return face restrict addressing
173 virtual const labelList& faceRestrictAddressing() const
175 return faceRestrictAddressing_;
178 //- Return non-const access to face restrict addressing
179 virtual labelList& faceRestrictAddressing()
181 return faceRestrictAddressing_;
184 //- Return the interface internal field of the given field
186 tmp<Field<Type> > interfaceInternalField
188 const UList<Type>& internalData
191 //- Return the values of the given internal data adjacent to
192 // the interface as a field
193 virtual tmp<labelField> interfaceInternalField
195 const labelUList& internalData
201 //- Merge the next level with this level
202 // combining the face-restrict addressing
203 // and copying the face-cell addressing
204 void combine(const GAMGInterface&);
206 //- Agglomerating the given fine-level coefficients and return
207 virtual tmp<scalarField> agglomerateCoeffs
209 const scalarField& fineCoeffs
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 } // End namespace Foam
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 # include "GAMGInterfaceTemplates.C"
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228 // ************************************************************************* //