Fix tutorials: typo in tutorials/viscoelastic/viscoelasticFluidFoam/S-MDCPP/constant...
[OpenFOAM-1.6-ext.git] / src / finiteVolume / fvMesh / fvMeshLduAddressing.H
blob6e7efedafac6d67f9c825e3457dac8c26b30be97
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
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         virtual ~fvMeshLduAddressing()
109         {}
112     // Member Functions
114         //- Return number of interfaces
115         virtual label nPatches() const
116         {
117             return patchAddr_.size();
118         }
120         //- Return lower addressing (i.e. lower label = upper triangle)
121         virtual const unallocLabelList& lowerAddr() const
122         {
123             return lowerAddr_;
124         }
126         //- Return upper addressing (i.e. upper label)
127         virtual const unallocLabelList& upperAddr() const
128         {
129             return upperAddr_;
130         }
132         //- Return patch addressing
133         virtual const unallocLabelList& patchAddr(const label i) const
134         {
135             return *patchAddr_[i];
136         }
138         // Return patch field evaluation schedule
139         virtual const lduSchedule& patchSchedule() const
140         {
141             return patchSchedule_;
142         }
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 } // End namespace Foam
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 #endif
154 // ************************************************************************* //