initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / OpenFOAM / meshes / polyMesh / mapPolyMesh / mapSubsetMesh / mapSubsetMesh.H
blob36b795e8c89387252bddb12dd66ed5c2d8f507a1
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::mapSubsetMesh
28 Description
29     Class containing mesh-to-mesh mapping information after a subset operation
31 SourceFiles
33 \*---------------------------------------------------------------------------*/
35 #ifndef mapSubsetMesh_H
36 #define mapSubsetMesh_H
38 #include "refCount.H"
39 #include "labelList.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47                            Class mapSubsetMesh Declaration
48 \*---------------------------------------------------------------------------*/
50 class mapSubsetMesh
52     public refCount
54     // Private data
56         //- Number of old live points
57         label nOldPoints_;
59         //- Number of old live faces
60         label nOldFaces_;
62         //- Number of old live cells
63         label nOldCells_;
65         //- Point mapping array
66         const labelList pointMap_;
68         //- Face mapping array
69         const labelList faceMap_;
71         //- Cell mapping array
72         const labelList cellMap_;
74         //- Patch for exposed faces
75         const label exposedPatchID_;
77         //- List of the old patch sizes
78         labelList oldPatchSizes_;
80         //- List of the old patch start labels
81         const labelList oldPatchStarts_;
83         //- List of numbers of mesh points per old patch
84         const labelList oldPatchNMeshPoints_;
86 public:
88     // Constructors
90         //- Construct from components
91         mapSubsetMesh
92         (
93             const label nOldPoints,
94             const label nOldFaces,
95             const label nOldCells,
96             const labelList& pointMap,
97             const labelList& faceMap,
98             const labelList& cellMap,
99             const label exposedPatchID,
100             const labelList& oldPatchStarts,
101             const labelList& oldPatchNMeshPoints
102         );
104         //- Construct from components and optionally reuse storage
105         mapSubsetMesh
106         (
107             const label nOldPoints,
108             const label nOldFaces,
109             const label nOldCells,
110             labelList& pointMap,
111             labelList& faceMap,
112             labelList& cellMap,
113             const label exposedPatchID,
114             labelList& oldPatchStarts,
115             labelList& oldPatchNMeshPoints,
116             const bool reUse
117         );
120     // Member Functions
122         // Access
124             //- Number of old points
125             label nOldPoints() const
126             {
127                 return nOldPoints_;
128             }
130             //- Number of old internal faces
131             label nOldInternalFaces() const
132             {
133                 return oldPatchStarts_[0];
134             }
136             //- Number of old faces
137             label nOldFaces() const
138             {
139                 return nOldFaces_;
140             }
142             //- Number of old cells
143             label nOldCells() const
144             {
145                 return nOldCells_;
146             }
148             //- Patch that exposed faces were put into
149             label exposedPatchID() const
150             {
151                 return exposedPatchID_;
152             }
154             //- Old point map.
155             //  Contains the old point label for all points of the subsetted
156             //  mesh
157             const labelList& pointMap() const
158             {
159                 return pointMap_;
160             }
162             //- Old face map.
163             //  Contains the old point label for all faces of the subsetted
164             //  mesh
165             const labelList& faceMap() const
166             {
167                 return faceMap_;
168             }
170             //- Old cell map.
171             //  Contains the old point label for all cells of the subsetted
172             //  mesh
173             const labelList& cellMap() const
174             {
175                 return cellMap_;
176             }
178             //- Return list of the old patch sizes
179             const labelList& oldPatchSizes() const
180             {
181                 return oldPatchSizes_;
182             }
184             //- Return list of the old patch start labels
185             const labelList& oldPatchStarts() const
186             {
187                 return oldPatchStarts_;
188             }
190             //- Return numbers of mesh points per old patch
191             const labelList& oldPatchNMeshPoints() const
192             {
193                 return oldPatchNMeshPoints_;
194             }
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 } // End namespace Foam
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 #endif
206 // ************************************************************************* //