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

fvMeshLduAddressing.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::fvMeshLduAddressing
00026 
00027 Description
00028     Foam::fvMeshLduAddressing
00029 
00030 SourceFiles
00031     fvMeshLduAddressing.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef fvMeshLduAddressing_H
00036 #define fvMeshLduAddressing_H
00037 
00038 #include <OpenFOAM/lduAddressing.H>
00039 #include "fvMesh.H"
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 /*---------------------------------------------------------------------------*\
00047                         Class fvMeshLduAddressing Declaration
00048 \*---------------------------------------------------------------------------*/
00049 
00050 class fvMeshLduAddressing
00051 :
00052     public lduAddressing
00053 {
00054     // Private data
00055 
00056         //- Lower as a subList of allOwner
00057         labelList::subList lowerAddr_;
00058 
00059         //- Upper as a reference to neighbour
00060         const labelList& upperAddr_;
00061 
00062         //- Patch addressing as a list of sublists
00063         List<const unallocLabelList*> patchAddr_;
00064 
00065         //- Patch field evaluation schedule
00066         const lduSchedule& patchSchedule_;
00067 
00068 
00069     // Private Member Functions
00070 
00071         //- Disallow default bitwise copy construct
00072         fvMeshLduAddressing(const fvMeshLduAddressing&);
00073 
00074         //- Disallow default bitwise assignment
00075         void operator=(const fvMeshLduAddressing&);
00076 
00077 
00078 public:
00079 
00080     // Constructors
00081 
00082         //- Construct from components
00083         fvMeshLduAddressing(const fvMesh& mesh)
00084         :
00085             lduAddressing(mesh.nCells()),
00086             lowerAddr_
00087             (
00088                 labelList::subList
00089                 (
00090                     mesh.faceOwner(),
00091                     mesh.nInternalFaces()
00092                 )
00093             ),
00094             upperAddr_(mesh.faceNeighbour()),
00095             patchAddr_(mesh.boundary().size()),
00096             patchSchedule_(mesh.globalData().patchSchedule())
00097         {
00098             forAll (mesh.boundary(), patchI)
00099             {
00100                 patchAddr_[patchI] = &mesh.boundary()[patchI].faceCells();
00101             }
00102         }
00103 
00104 
00105     // Destructor
00106 
00107         ~fvMeshLduAddressing()
00108         {}
00109 
00110 
00111     // Member Functions
00112 
00113         //- Return lower addressing (i.e. lower label = upper triangle)
00114         const unallocLabelList& lowerAddr() const
00115         {
00116             return lowerAddr_;
00117         }
00118 
00119         //- Return upper addressing (i.e. upper label)
00120         const unallocLabelList& upperAddr() const
00121         {
00122             return upperAddr_;
00123         }
00124 
00125         //- Return patch addressing
00126         const unallocLabelList& patchAddr(const label i) const
00127         {
00128             return *patchAddr_[i];
00129         }
00130 
00131         // Return patch field evaluation schedule
00132         const lduSchedule& patchSchedule() const
00133         {
00134             return patchSchedule_;
00135         }
00136 };
00137 
00138 
00139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00140 
00141 } // End namespace Foam
00142 
00143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00144 
00145 #endif
00146 
00147 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines