FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::GAMGInterface
00026 
00027 Description
00028      Abstract base class for GAMG agglomerated interfaces.
00029 
00030 SourceFiles
00031     GAMGInterface.C
00032     newAmgInterface.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef GAMGInterface_H
00037 #define GAMGInterface_H
00038 
00039 #include <OpenFOAM/lduInterface.H>
00040 #include <OpenFOAM/autoPtr.H>
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 /*---------------------------------------------------------------------------*\
00048                       Class GAMGInterface Declaration
00049 \*---------------------------------------------------------------------------*/
00050 
00051 class GAMGInterface
00052 :
00053     public lduInterface
00054 {
00055 
00056 protected:
00057 
00058     // Protected data
00059 
00060         //- Face-cell addressing
00061         labelField faceCells_;
00062 
00063         //- Face restrict addressing
00064         labelField faceRestrictAddressing_;
00065 
00066 
00067 private:
00068 
00069     // Private Member Functions
00070 
00071         //- Disallow default bitwise copy construct
00072         GAMGInterface(const GAMGInterface&);
00073 
00074         //- Disallow default bitwise assignment
00075         void operator=(const GAMGInterface&);
00076 
00077 
00078 public:
00079 
00080     //- Runtime type information
00081     TypeName("GAMGInterface");
00082 
00083 
00084     // Declare run-time constructor selection tables
00085 
00086         declareRunTimeSelectionTable
00087         (
00088             autoPtr,
00089             GAMGInterface,
00090             lduInterface,
00091             (
00092                 const lduInterface& fineInterface,
00093                 const labelField& localRestrictAddressing,
00094                 const labelField& neighbourRestrictAddressing
00095             ),
00096             (
00097                 fineInterface,
00098                 localRestrictAddressing,
00099                 neighbourRestrictAddressing
00100             )
00101         );
00102 
00103 
00104     // Selectors
00105 
00106         //- Return a pointer to a new interface created on freestore given
00107         //  the fine interface
00108         static autoPtr<GAMGInterface> New
00109         (
00110             const lduInterface& fineInterface,
00111             const labelField& localRestrictAddressing,
00112             const labelField& neighbourRestrictAddressing
00113         );
00114 
00115 
00116     // Constructors
00117 
00118         //- Construct from fine-level interface,
00119         //  local and neighbour restrict addressing
00120         GAMGInterface
00121         (
00122             const lduInterface&,
00123             const labelField&,
00124             const labelField&
00125         )
00126         {}
00127 
00128 
00129     // Member Functions
00130 
00131         // Access
00132 
00133             //- Return size
00134             virtual label size() const
00135             {
00136                 return faceCells_.size();
00137             }
00138 
00139             //- Return faceCell addressing
00140             virtual const unallocLabelList& faceCells() const
00141             {
00142                 return faceCells_;
00143             }
00144 
00145             //- Return face restrict addressing
00146             virtual const labelList& faceRestrictAddressing() const
00147             {
00148                 return faceRestrictAddressing_;
00149             }
00150 
00151             //- Return non-const access to face restrict addressing
00152             virtual labelList& faceRestrictAddressing()
00153             {
00154                 return faceRestrictAddressing_;
00155             }
00156 
00157             //- Return the interface internal field of the given field
00158             template<class Type>
00159             tmp<Field<Type> > interfaceInternalField
00160             (
00161                 const UList<Type>& internalData
00162             ) const;
00163 
00164             //- Return the values of the given internal data adjacent to
00165             //  the interface as a field
00166             virtual tmp<labelField> interfaceInternalField
00167             (
00168                 const unallocLabelList& internalData
00169             ) const;
00170 
00171 
00172         // Agglomeration
00173 
00174             //- Merge the next level with this level
00175             //  combining the face-restrict addressing
00176             //  and copying the face-cell addressing
00177             void combine(const GAMGInterface&);
00178 
00179             //- Agglomerating the given fine-level coefficients and return
00180             virtual tmp<scalarField> agglomerateCoeffs
00181             (
00182                 const scalarField& fineCoeffs
00183             ) const;
00184 };
00185 
00186 
00187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00188 
00189 } // End namespace Foam
00190 
00191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00192 
00193 #ifdef NoRepository
00194 #   include <OpenFOAM/GAMGInterfaceTemplates.C>
00195 #endif
00196 
00197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00198 
00199 #endif
00200 
00201 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines