OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

GAMGInterface.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::GAMGInterface
00027 
00028 Description
00029      Abstract base class for GAMG agglomerated interfaces.
00030 
00031 SourceFiles
00032     GAMGInterface.C
00033     newAmgInterface.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef GAMGInterface_H
00038 #define GAMGInterface_H
00039 
00040 #include "lduInterface.H"
00041 #include "autoPtr.H"
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 
00048 /*---------------------------------------------------------------------------*\
00049                       Class GAMGInterface Declaration
00050 \*---------------------------------------------------------------------------*/
00051 
00052 class GAMGInterface
00053 :
00054     public lduInterface
00055 {
00056 
00057 protected:
00058 
00059     // Protected data
00060 
00061         //- Face-cell addressing
00062         labelField faceCells_;
00063 
00064         //- Face restrict addressing
00065         labelField faceRestrictAddressing_;
00066 
00067 
00068 private:
00069 
00070     // Private Member Functions
00071 
00072         //- Disallow default bitwise copy construct
00073         GAMGInterface(const GAMGInterface&);
00074 
00075         //- Disallow default bitwise assignment
00076         void operator=(const GAMGInterface&);
00077 
00078 
00079 public:
00080 
00081     //- Runtime type information
00082     TypeName("GAMGInterface");
00083 
00084 
00085     // Declare run-time constructor selection tables
00086 
00087         declareRunTimeSelectionTable
00088         (
00089             autoPtr,
00090             GAMGInterface,
00091             lduInterface,
00092             (
00093                 const lduInterface& fineInterface,
00094                 const labelField& localRestrictAddressing,
00095                 const labelField& neighbourRestrictAddressing
00096             ),
00097             (
00098                 fineInterface,
00099                 localRestrictAddressing,
00100                 neighbourRestrictAddressing
00101             )
00102         );
00103 
00104 
00105     // Selectors
00106 
00107         //- Return a pointer to a new interface created on freestore given
00108         //  the fine interface
00109         static autoPtr<GAMGInterface> New
00110         (
00111             const lduInterface& fineInterface,
00112             const labelField& localRestrictAddressing,
00113             const labelField& neighbourRestrictAddressing
00114         );
00115 
00116 
00117     // Constructors
00118 
00119         //- Construct from fine-level interface,
00120         //  local and neighbour restrict addressing
00121         GAMGInterface
00122         (
00123             const lduInterface&,
00124             const labelField&,
00125             const labelField&
00126         )
00127         {}
00128 
00129 
00130     // Member Functions
00131 
00132         // Access
00133 
00134             //- Return size
00135             virtual label size() const
00136             {
00137                 return faceCells_.size();
00138             }
00139 
00140             //- Return faceCell addressing
00141             virtual const unallocLabelList& faceCells() const
00142             {
00143                 return faceCells_;
00144             }
00145 
00146             //- Return face restrict addressing
00147             virtual const labelList& faceRestrictAddressing() const
00148             {
00149                 return faceRestrictAddressing_;
00150             }
00151 
00152             //- Return non-const access to face restrict addressing
00153             virtual labelList& faceRestrictAddressing()
00154             {
00155                 return faceRestrictAddressing_;
00156             }
00157 
00158             //- Return the interface internal field of the given field
00159             template<class Type>
00160             tmp<Field<Type> > interfaceInternalField
00161             (
00162                 const UList<Type>& internalData
00163             ) const;
00164 
00165             //- Return the values of the given internal data adjacent to
00166             //  the interface as a field
00167             virtual tmp<labelField> interfaceInternalField
00168             (
00169                 const unallocLabelList& internalData
00170             ) const;
00171 
00172 
00173         // Agglomeration
00174 
00175             //- Merge the next level with this level
00176             //  combining the face-restrict addressing
00177             //  and copying the face-cell addressing
00178             void combine(const GAMGInterface&);
00179 
00180             //- Agglomerating the given fine-level coefficients and return
00181             virtual tmp<scalarField> agglomerateCoeffs
00182             (
00183                 const scalarField& fineCoeffs
00184             ) const;
00185 };
00186 
00187 
00188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00189 
00190 } // End namespace Foam
00191 
00192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00193 
00194 #ifdef NoRepository
00195 #   include "GAMGInterfaceTemplates.C"
00196 #endif
00197 
00198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00199 
00200 #endif
00201 
00202 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd