Forward compatibility: flex
[foam-extend-3.2.git] / src / finiteArea / faMesh / faMeshLduAddressing.H
blob05bece24d9a389c2bc168945f46df796c26f0b30
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend 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 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     faMeshLduAddressing
27 Description
29 SourceFiles
30     faMeshLduAddressing.C
32 \*---------------------------------------------------------------------------*/
34 #ifndef faMeshLduAddressing_H
35 #define faMeshLduAddressing_H
37 #include "lduAddressing.H"
38 #include "faMesh.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 namespace Foam
45 /*---------------------------------------------------------------------------*\
46                         Class faMeshLduAddressing Declaration
47 \*---------------------------------------------------------------------------*/
49 class faMeshLduAddressing
51     public lduAddressing
53     // Private data
55         //- Lower as a subList of allOwner
56         labelList::subList lowerAddr_;
58         //- Upper as a reference to neighbour
59         const labelList& upperAddr_;
61         //- Patch addressing as a list of sublists
62         List<const unallocLabelList*> patchAddr_;
64         //- Patch field evaluation schedule
65         const lduSchedule& patchSchedule_;
68     // Private Member Functions
70         //- Disallow default bitwise copy construct
71         faMeshLduAddressing(const faMeshLduAddressing&);
73         //- Disallow default bitwise assignment
74         void operator=(const faMeshLduAddressing&);
77 public:
79     // Constructors
81         //- Construct from components
82         faMeshLduAddressing(const faMesh& mesh)
83         :
84             lduAddressing(mesh.nFaces()),
85             lowerAddr_
86             (
87                 labelList::subList
88                 (
89                     mesh.edgeOwner(),
90                     mesh.nInternalEdges()
91                 )
92             ),
93             upperAddr_(mesh.edgeNeighbour()),
94             patchAddr_(mesh.boundary().size()),
95             patchSchedule_(mesh.globalData().patchSchedule())
96         {
97             forAll (mesh.boundary(), patchI)
98             {
99                 patchAddr_[patchI] = &mesh.boundary()[patchI].edgeFaces();
100             }
101         }
103     // Destructor
105         virtual ~faMeshLduAddressing()
106         {}
109     // Member Functions
111         //- Return number of interfaces
112         virtual label nPatches() const
113         {
114             return patchAddr_.size();
115         }
117         //- Return lower addressing (i.e. lower label = upper triangle)
118         virtual const unallocLabelList& lowerAddr() const
119         {
120             return lowerAddr_;
121         }
123         //- Return upper addressing (i.e. upper label)
124         virtual const unallocLabelList& upperAddr() const
125         {
126             return upperAddr_;
127         }
129         //- Return patch addressing
130         virtual const unallocLabelList& patchAddr(const label i) const
131         {
132             return *patchAddr_[i];
133         }
135         // Return patch field evaluation schedule
136         virtual const lduSchedule& patchSchedule() const
137         {
138             return patchSchedule_;
139         }
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 } // End namespace Foam
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 #endif
151 // ************************************************************************* //