BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / finiteVolume / fvMesh / fvMeshLduAddressing.H
blob6a86c095c009148b2ee552996b28bb71a640560c
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by
13     the Free Software Foundation, either version 3 of the License, or
14     (at your option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::fvMeshLduAddressing
27 Description
28     Foam::fvMeshLduAddressing
30 SourceFiles
31     fvMeshLduAddressing.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef fvMeshLduAddressing_H
36 #define fvMeshLduAddressing_H
38 #include "lduAddressing.H"
39 #include "fvMesh.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47                         Class fvMeshLduAddressing Declaration
48 \*---------------------------------------------------------------------------*/
50 class fvMeshLduAddressing
52     public lduAddressing
54     // Private data
56         //- Lower as a subList of allOwner
57         labelList::subList lowerAddr_;
59         //- Upper as a reference to neighbour
60         const labelList& upperAddr_;
62         //- Patch addressing as a list of sublists
63         List<const labelUList*> patchAddr_;
65         //- Patch field evaluation schedule
66         const lduSchedule& patchSchedule_;
69     // Private Member Functions
71         //- Disallow default bitwise copy construct
72         fvMeshLduAddressing(const fvMeshLduAddressing&);
74         //- Disallow default bitwise assignment
75         void operator=(const fvMeshLduAddressing&);
78 public:
80     // Constructors
82         //- Construct from components
83         fvMeshLduAddressing(const fvMesh& mesh)
84         :
85             lduAddressing(mesh.nCells()),
86             lowerAddr_
87             (
88                 labelList::subList
89                 (
90                     mesh.faceOwner(),
91                     mesh.nInternalFaces()
92                 )
93             ),
94             upperAddr_(mesh.faceNeighbour()),
95             patchAddr_(mesh.boundary().size()),
96             patchSchedule_(mesh.globalData().patchSchedule())
97         {
98             forAll(mesh.boundary(), patchI)
99             {
100                 patchAddr_[patchI] = &mesh.boundary()[patchI].faceCells();
101             }
102         }
105     //- Destructor
106     ~fvMeshLduAddressing()
107     {}
110     // Member Functions
112         //- Return lower addressing (i.e. lower label = upper triangle)
113         const labelUList& lowerAddr() const
114         {
115             return lowerAddr_;
116         }
118         //- Return upper addressing (i.e. upper label)
119         const labelUList& upperAddr() const
120         {
121             return upperAddr_;
122         }
124         //- Return patch addressing
125         const labelUList& patchAddr(const label i) const
126         {
127             return *patchAddr_[i];
128         }
130         // Return patch field evaluation schedule
131         const lduSchedule& patchSchedule() const
132         {
133             return patchSchedule_;
134         }
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 } // End namespace Foam
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 #endif
146 // ************************************************************************* //