mapSubsetMesh.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::mapSubsetMesh
28
29Description
30 Class containing mesh-to-mesh mapping information after a subset operation
31
32SourceFiles
33
34\*---------------------------------------------------------------------------*/
35
36#ifndef mapSubsetMesh_H
37#define mapSubsetMesh_H
38
39#include "labelList.H"
40
41// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42
43namespace Foam
44{
45
46/*---------------------------------------------------------------------------*\
47 Class mapSubsetMesh Declaration
48\*---------------------------------------------------------------------------*/
50class mapSubsetMesh
51{
52 // Private data
53
54 //- Number of old live points
55 label nOldPoints_;
56
57 //- Number of old live faces
58 label nOldFaces_;
59
60 //- Number of old live cells
61 label nOldCells_;
62
63 //- Point mapping array
64 const labelList pointMap_;
65
66 //- Face mapping array
67 const labelList faceMap_;
68
69 //- Cell mapping array
70 const labelList cellMap_;
71
72 //- Patch for exposed faces
73 const label exposedPatchID_;
74
75 //- List of the old patch sizes
76 labelList oldPatchSizes_;
77
78 //- List of the old patch start labels
79 const labelList oldPatchStarts_;
80
81 //- List of numbers of mesh points per old patch
82 const labelList oldPatchNMeshPoints_;
83
84public:
85
86 // Constructors
87
88 //- Construct from components
90 (
91 const label nOldPoints,
92 const label nOldFaces,
93 const label nOldCells,
94 const labelList& pointMap,
95 const labelList& faceMap,
96 const labelList& cellMap,
97 const label exposedPatchID,
100 );
101
102 //- Construct from components and optionally reuse storage
104 (
105 const label nOldPoints,
106 const label nOldFaces,
107 const label nOldCells,
111 const label exposedPatchID,
114 const bool reuse
115 );
116
117
118 // Member Functions
119
120 // Access
121
122 //- Number of old points
123 label nOldPoints() const
124 {
125 return nOldPoints_;
126 }
127
128 //- Number of old internal faces
129 label nOldInternalFaces() const
130 {
131 return oldPatchStarts_[0];
132 }
133
134 //- Number of old faces
135 label nOldFaces() const
136 {
137 return nOldFaces_;
138 }
139
140 //- Number of old cells
141 label nOldCells() const
142 {
143 return nOldCells_;
144 }
145
146 //- Patch that exposed faces were put into
147 label exposedPatchID() const
148 {
149 return exposedPatchID_;
150 }
151
152 //- Old point map.
153 // Contains the old point label for all points of the subsetted
154 // mesh
155 const labelList& pointMap() const
156 {
157 return pointMap_;
158 }
159
160 //- Old face map.
161 // Contains the old point label for all faces of the subsetted
162 // mesh
163 const labelList& faceMap() const
164 {
165 return faceMap_;
166 }
167
168 //- Old cell map.
169 // Contains the old point label for all cells of the subsetted
170 // mesh
171 const labelList& cellMap() const
172 {
173 return cellMap_;
174 }
175
176 //- Return list of the old patch sizes
177 const labelList& oldPatchSizes() const
178 {
179 return oldPatchSizes_;
180 }
181
182 //- Return list of the old patch start labels
183 const labelList& oldPatchStarts() const
184 {
185 return oldPatchStarts_;
186 }
187
188 //- Return numbers of mesh points per old patch
189 const labelList& oldPatchNMeshPoints() const
190 {
191 return oldPatchNMeshPoints_;
192 }
193};
194
195
196// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197
198} // End namespace Foam
199
200// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201
202#endif
203
204// ************************************************************************* //
Class containing mesh-to-mesh mapping information after a subset operation.
Definition: mapSubsetMesh.H:50
label nOldCells() const
Number of old cells.
const labelList & oldPatchNMeshPoints() const
Return numbers of mesh points per old patch.
const labelList & faceMap() const
Old face map.
const labelList & oldPatchStarts() const
Return list of the old patch start labels.
label nOldInternalFaces() const
Number of old internal faces.
mapSubsetMesh(const label nOldPoints, const label nOldFaces, const label nOldCells, labelList &pointMap, labelList &faceMap, labelList &cellMap, const label exposedPatchID, labelList &oldPatchStarts, labelList &oldPatchNMeshPoints, const bool reuse)
Construct from components and optionally reuse storage.
mapSubsetMesh(const label nOldPoints, const label nOldFaces, const label nOldCells, const labelList &pointMap, const labelList &faceMap, const labelList &cellMap, const label exposedPatchID, const labelList &oldPatchStarts, const labelList &oldPatchNMeshPoints)
Construct from components.
const labelList & cellMap() const
Old cell map.
label nOldFaces() const
Number of old faces.
const labelList & pointMap() const
Old point map.
label nOldPoints() const
Number of old points.
label exposedPatchID() const
Patch that exposed faces were put into.
const labelList & oldPatchSizes() const
Return list of the old patch sizes.
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition: List.H:66