MULES limitation removed: sub-cycling time now supported on morphing meshes
[OpenFOAM-1.6.x.git] / src / finiteVolume / fvMesh / fvMeshLduAddressing.H
blob1cd7f8ff60ca06f601204d6719b8387e0b70280c
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::fvMeshLduAddressing
28 Description
29     Foam::fvMeshLduAddressing
31 SourceFiles
32     fvMeshLduAddressing.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef fvMeshLduAddressing_H
37 #define fvMeshLduAddressing_H
39 #include "lduAddressing.H"
40 #include "fvMesh.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace Foam
47 /*---------------------------------------------------------------------------*\
48                         Class fvMeshLduAddressing Declaration
49 \*---------------------------------------------------------------------------*/
51 class fvMeshLduAddressing
53     public lduAddressing
55     // Private data
57         //- Lower as a subList of allOwner
58         labelList::subList lowerAddr_;
60         //- Upper as a reference to neighbour
61         const labelList& upperAddr_;
63         //- Patch addressing as a list of sublists
64         List<const unallocLabelList*> patchAddr_;
66         //- Patch field evaluation schedule
67         const lduSchedule& patchSchedule_;
70     // Private Member Functions
72         //- Disallow default bitwise copy construct
73         fvMeshLduAddressing(const fvMeshLduAddressing&);
75         //- Disallow default bitwise assignment
76         void operator=(const fvMeshLduAddressing&);
79 public:
81     // Constructors
83         //- Construct from components
84         fvMeshLduAddressing(const fvMesh& mesh)
85         :
86             lduAddressing(mesh.nCells()),
87             lowerAddr_
88             (
89                 labelList::subList
90                 (
91                     mesh.faceOwner(),
92                     mesh.nInternalFaces()
93                 )
94             ),
95             upperAddr_(mesh.faceNeighbour()),
96             patchAddr_(mesh.boundary().size()),
97             patchSchedule_(mesh.globalData().patchSchedule())
98         {
99             forAll (mesh.boundary(), patchI)
100             {
101                 patchAddr_[patchI] = &mesh.boundary()[patchI].faceCells();
102             }
103         }
106     // Destructor
108         ~fvMeshLduAddressing()
109         {}
112     // Member Functions
114         //- Return lower addressing (i.e. lower label = upper triangle)
115         const unallocLabelList& lowerAddr() const
116         {
117             return lowerAddr_;
118         }
120         //- Return upper addressing (i.e. upper label)
121         const unallocLabelList& upperAddr() const
122         {
123             return upperAddr_;
124         }
126         //- Return patch addressing
127         const unallocLabelList& patchAddr(const label i) const
128         {
129             return *patchAddr_[i];
130         }
132         // Return patch field evaluation schedule
133         const lduSchedule& patchSchedule() const
134         {
135             return patchSchedule_;
136         }
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 } // End namespace Foam
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 #endif
148 // ************************************************************************* //