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