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

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