Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / src / dynamicMesh / dynamicTopoFvMesh / coupledMesh / subMeshLduAddressing.H
blobb9e2d1ebcd644ece5b89562666fb58476f9e7846
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     subMeshLduAddressing
27 Description
28     Customized lduAddressing for subMeshes
30 Author
31     Sandeep Menon
32     University of Massachusetts Amherst
33     All rights reserved
35 \*---------------------------------------------------------------------------*/
37 #ifndef subMeshLduAddressing_H
38 #define subMeshLduAddressing_H
40 #include "lduAddressing.H"
41 #include "fvMesh.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 /*---------------------------------------------------------------------------*\
49                       Class subMeshLduAddressing Declaration
50 \*---------------------------------------------------------------------------*/
52 class subMeshLduAddressing
54     public lduAddressing
56     // Private data
58         //- Lower as a subList of allOwner
59         labelList::subList lowerAddr_;
61         //- Upper as a reference to neighbour
62         const labelList& upperAddr_;
64         //- Number of patches
65         label nPatches_;
67     // Private Member Functions
69         //- Disallow default bitwise copy construct
70         subMeshLduAddressing(const subMeshLduAddressing&);
72         //- Disallow default bitwise assignment
73         void operator=(const subMeshLduAddressing&);
75 public:
77     // Constructors
79         //- Construct from components
80         subMeshLduAddressing(const fvMesh& mesh)
81         :
82             lduAddressing(mesh.nCells()),
83             lowerAddr_
84             (
85                 labelList::subList
86                 (
87                     mesh.faceOwner(),
88                     mesh.nInternalFaces()
89                 )
90             ),
91             upperAddr_(mesh.faceNeighbour()),
92             nPatches_(mesh.boundary().size())
93         {}
95     // Destructor
97         virtual ~subMeshLduAddressing()
98         {}
100     // Member Functions
102         //- Return number of interfaces
103         virtual label nPatches() const
104         {
105             return nPatches_;
106         }
108         //- Return lower addressing (i.e. lower label = upper triangle)
109         virtual const unallocLabelList& lowerAddr() const
110         {
111             return lowerAddr_;
112         }
114         //- Return upper addressing (i.e. upper label)
115         virtual const unallocLabelList& upperAddr() const
116         {
117             return upperAddr_;
118         }
120         //- Return patch addressing
121         virtual const unallocLabelList& patchAddr(const label i) const
122         {
123             FatalErrorIn
124             (
125                 "void subMeshLduAddressing::patchAddr(const label i)"
126             )
127                 << " Illegal request. "
128                 << abort(FatalError);
130             return unallocLabelList::null();
131         }
133         // Return patch field evaluation schedule
134         virtual const lduSchedule& patchSchedule() const
135         {
136             FatalErrorIn
137             (
138                 "void subMeshLduAddressing::patchSchedule()"
139             )
140                 << " Illegal request. "
141                 << abort(FatalError);
143             return lduSchedule::null();
144         }
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 } // End namespace Foam
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 #endif
155 // ************************************************************************* //