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
57 
58  //- Number of old live faces
60 
61  //- Number of old live cells
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
78 
79  //- List of the old patch start labels
81 
82  //- List of numbers of mesh points per old patch
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,
112  const label exposedPatchID,
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 // ************************************************************************* //
Foam::mapSubsetMesh::nOldInternalFaces
label nOldInternalFaces() const
Number of old internal faces.
Definition: mapSubsetMesh.H:129
Foam::labelList
List< label > labelList
A List of labels.
Definition: labelList.H:56
Foam::mapSubsetMesh::oldPatchStarts
const labelList & oldPatchStarts() const
Return list of the old patch start labels.
Definition: mapSubsetMesh.H:183
Foam::mapSubsetMesh::exposedPatchID_
const label exposedPatchID_
Patch for exposed faces.
Definition: mapSubsetMesh.H:73
Foam::refCount
Reference counter for various OpenFOAM components.
Definition: refCount.H:45
Foam::mapSubsetMesh::nOldFaces_
label nOldFaces_
Number of old live faces.
Definition: mapSubsetMesh.H:58
Foam::mapSubsetMesh::mapSubsetMesh
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.
Foam::mapSubsetMesh::oldPatchSizes
const labelList & oldPatchSizes() const
Return list of the old patch sizes.
Definition: mapSubsetMesh.H:177
Foam::mapSubsetMesh::nOldCells_
label nOldCells_
Number of old live cells.
Definition: mapSubsetMesh.H:61
Foam::mapSubsetMesh::cellMap_
const labelList cellMap_
Cell mapping array.
Definition: mapSubsetMesh.H:70
Foam::mapSubsetMesh::nOldFaces
label nOldFaces() const
Number of old faces.
Definition: mapSubsetMesh.H:135
Foam::mapSubsetMesh::faceMap
const labelList & faceMap() const
Old face map.
Definition: mapSubsetMesh.H:163
Foam::mapSubsetMesh::oldPatchNMeshPoints
const labelList & oldPatchNMeshPoints() const
Return numbers of mesh points per old patch.
Definition: mapSubsetMesh.H:189
Foam::mapSubsetMesh::pointMap
const labelList & pointMap() const
Old point map.
Definition: mapSubsetMesh.H:155
Foam::label
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
Foam::mapSubsetMesh::exposedPatchID
label exposedPatchID() const
Patch that exposed faces were put into.
Definition: mapSubsetMesh.H:147
labelList.H
Foam::mapSubsetMesh::cellMap
const labelList & cellMap() const
Old cell map.
Definition: mapSubsetMesh.H:171
Foam::mapSubsetMesh::nOldPoints
label nOldPoints() const
Number of old points.
Definition: mapSubsetMesh.H:123
Foam::mapSubsetMesh::faceMap_
const labelList faceMap_
Face mapping array.
Definition: mapSubsetMesh.H:67
Foam::mapSubsetMesh::pointMap_
const labelList pointMap_
Point mapping array.
Definition: mapSubsetMesh.H:64
Foam::mapSubsetMesh::nOldCells
label nOldCells() const
Number of old cells.
Definition: mapSubsetMesh.H:141
Foam::mapSubsetMesh::oldPatchSizes_
labelList oldPatchSizes_
List of the old patch sizes.
Definition: mapSubsetMesh.H:76
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::mapSubsetMesh::oldPatchNMeshPoints_
const labelList oldPatchNMeshPoints_
List of numbers of mesh points per old patch.
Definition: mapSubsetMesh.H:82
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
refCount.H
Foam::mapSubsetMesh::oldPatchStarts_
const labelList oldPatchStarts_
List of the old patch start labels.
Definition: mapSubsetMesh.H:79
Foam::mapSubsetMesh::nOldPoints_
label nOldPoints_
Number of old live points.
Definition: mapSubsetMesh.H:55
Foam::mapSubsetMesh
Class containing mesh-to-mesh mapping information after a subset operation.
Definition: mapSubsetMesh.H:48