OpenFOAM logo
Open Source CFD Toolkit

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-2005 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     fvMeshLduAddressing
00027 
00028 Description
00029 
00030 SourceFiles
00031     fvMeshLduAddressing.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef fvMeshLduAddressing_H
00036 #define fvMeshLduAddressing_H
00037 
00038 #include "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         PtrList<labelList::subList> patchAddr_;
00064 
00065 
00066     // Private Member Functions
00067 
00068         //- Disallow default bitwise copy construct
00069         fvMeshLduAddressing(const fvMeshLduAddressing&);
00070 
00071         //- Disallow default bitwise assignment
00072         void operator=(const fvMeshLduAddressing&);
00073 
00074 
00075 public:
00076 
00077     // Constructors
00078 
00079         //- Construct from components
00080         fvMeshLduAddressing(const fvMesh& m)
00081         :
00082             lduAddressing(m.nCells()),
00083             lowerAddr_
00084             (
00085                 labelList::subList
00086                 (
00087                     m.faceOwner(),
00088                     m.nInternalFaces()
00089                 )
00090             ),
00091             upperAddr_(m.faceNeighbour()),
00092             patchAddr_(m.boundary().size())
00093         {
00094             forAll (m.boundary(), patchI)
00095             {
00096                 patchAddr_.hook
00097                 (
00098                     new labelList::subList(m.boundary()[patchI].faceCells())
00099                 );
00100             }
00101         }
00102 
00103 
00104     // Destructor
00105 
00106         ~fvMeshLduAddressing()
00107         {}
00108 
00109 
00110     // Member Functions
00111 
00112         //- Return lower addressing (i.e. lower label = upper triangle)
00113         const unallocLabelList& lowerAddr() const
00114         {
00115             return lowerAddr_;
00116         }
00117 
00118         //- Return upper addressing (i.e. upper label)
00119         const unallocLabelList& upperAddr() const
00120         {
00121             return upperAddr_;
00122         }
00123 
00124         //- Return patch addressing
00125         const unallocLabelList& patchAddr(const label i) const
00126         {
00127             return patchAddr_[i];
00128         }
00129 
00130 };
00131 
00132 
00133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00134 
00135 } // End namespace Foam
00136 
00137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00138 
00139 #endif
00140 
00141 // ************************************************************************* //
For further information go to www.openfoam.org