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 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 "refCount.H"
38 #include "labelList.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class mapSubsetMesh Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 class mapSubsetMesh
50 :
51  public refCount
52 {
53  // Private data
54 
55  //- Number of old live points
56  label nOldPoints_;
57 
58  //- Number of old live faces
59  label nOldFaces_;
60 
61  //- Number of old live cells
62  label nOldCells_;
63 
64  //- Point mapping array
65  const labelList pointMap_;
66 
67  //- Face mapping array
68  const labelList faceMap_;
69 
70  //- Cell mapping array
71  const labelList cellMap_;
72 
73  //- Patch for exposed faces
74  const label exposedPatchID_;
75 
76  //- List of the old patch sizes
77  labelList oldPatchSizes_;
78 
79  //- List of the old patch start labels
80  const labelList oldPatchStarts_;
81 
82  //- List of numbers of mesh points per old patch
83  const labelList oldPatchNMeshPoints_;
84 
85 public:
86 
87  // Constructors
88 
89  //- Construct from components
91  (
92  const label nOldPoints,
93  const label nOldFaces,
94  const label nOldCells,
95  const labelList& pointMap,
96  const labelList& faceMap,
97  const labelList& cellMap,
98  const label exposedPatchID,
101  );
102 
103  //- Construct from components and optionally reuse storage
105  (
106  const label nOldPoints,
107  const label nOldFaces,
108  const label nOldCells,
109  labelList& pointMap,
110  labelList& faceMap,
111  labelList& cellMap,
112  const label exposedPatchID,
113  labelList& oldPatchStarts,
114  labelList& oldPatchNMeshPoints,
115  const bool reUse
116  );
117 
118 
119  // Member Functions
120 
121  // Access
122 
123  //- Number of old points
124  label nOldPoints() const
125  {
126  return nOldPoints_;
127  }
128 
129  //- Number of old internal faces
130  label nOldInternalFaces() const
131  {
132  return oldPatchStarts_[0];
133  }
134 
135  //- Number of old faces
136  label nOldFaces() const
137  {
138  return nOldFaces_;
139  }
140 
141  //- Number of old cells
142  label nOldCells() const
143  {
144  return nOldCells_;
145  }
146 
147  //- Patch that exposed faces were put into
148  label exposedPatchID() const
149  {
150  return exposedPatchID_;
151  }
152 
153  //- Old point map.
154  // Contains the old point label for all points of the subsetted
155  // mesh
156  const labelList& pointMap() const
157  {
158  return pointMap_;
159  }
160 
161  //- Old face map.
162  // Contains the old point label for all faces of the subsetted
163  // mesh
164  const labelList& faceMap() const
165  {
166  return faceMap_;
167  }
168 
169  //- Old cell map.
170  // Contains the old point label for all cells of the subsetted
171  // mesh
172  const labelList& cellMap() const
173  {
174  return cellMap_;
175  }
176 
177  //- Return list of the old patch sizes
178  const labelList& oldPatchSizes() const
179  {
180  return oldPatchSizes_;
181  }
182 
183  //- Return list of the old patch start labels
184  const labelList& oldPatchStarts() const
185  {
186  return oldPatchStarts_;
187  }
188 
189  //- Return numbers of mesh points per old patch
190  const labelList& oldPatchNMeshPoints() const
191  {
192  return oldPatchNMeshPoints_;
193  }
194 };
195 
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 } // End namespace Foam
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 #endif
204 
205 // ************************************************************************* //
label nOldInternalFaces() const
Number of old internal faces.
const labelList & cellMap() const
Old cell map.
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 & pointMap() const
Old point map.
Class containing mesh-to-mesh mapping information after a subset operation.
Definition: mapSubsetMesh.H:48
Namespace for OpenFOAM.
label nOldPoints() const
Number of old points.
label nOldCells() const
Number of old cells.
const labelList & oldPatchNMeshPoints() const
Return numbers of mesh points per old patch.
Reference counter for various OpenFOAM components.
Definition: refCount.H:45
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.
const labelList & faceMap() const
Old face map.
label exposedPatchID() const
Patch that exposed faces were put into.
label nOldFaces() const
Number of old faces.
const labelList & oldPatchSizes() const
Return list of the old patch sizes.