mapAddedPolyMesh.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-2015 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::mapAddedPolyMesh
26 
27 Description
28  Class containing mesh-to-mesh mapping information after a mesh addition
29  where we add a mesh ('added mesh') to an old mesh, creating a new mesh.
30 
31  We store mapping from the old to the new mesh and from the added mesh
32  to the new mesh.
33 
34  Note: Might need some more access functions or maybe some zone maps?
35 
36 SourceFiles
37  mapAddedPolyMesh.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef mapAddedPolyMesh_H
42 #define mapAddedPolyMesh_H
43 
44 #include "labelList.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 class mapPolyMesh;
52 
53 /*---------------------------------------------------------------------------*\
54  Class mapAddedPolyMesh Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class mapAddedPolyMesh
58 {
59  // Private data
60 
61  //- Old mesh points/face/cells
62  label nOldPoints_;
63  label nOldFaces_;
64  label nOldCells_;
65 
66  //- Added mesh points/faces/cells
67  label nAddedPoints_;
68  label nAddedFaces_;
69  label nAddedCells_;
70 
71 
72  //- From old mesh points to new points
73  labelList oldPointMap_;
74  //- From old mesh faces to new faces
75  labelList oldFaceMap_;
76  //- From old mesh cells to new cells
77  labelList oldCellMap_;
78 
79  //- From added mesh points to new points
80  labelList addedPointMap_;
81  //- From added mesh faces to new faces
82  labelList addedFaceMap_;
83  //- From added mesh cells to new cells
84  labelList addedCellMap_;
85 
86  //- Original mesh to new mesh patch map. -1 for deleted patches.
87  labelList oldPatchMap_;
88 
89  //- Added mesh to new mesh patch map. -1 for deleted patches.
90  labelList addedPatchMap_;
91 
92  //- Original patch sizes on old mesh
93  labelList oldPatchSizes_;
94 
95  //- Original patch starts
96  labelList oldPatchStarts_;
97 
98 
99 public:
100 
101  // Constructors
102 
103  //- Construct from components
105  (
106  const label nOldPoints,
107  const label nOldFaces,
108  const label nOldCells,
109  const label nAddedPoints,
110  const label nAddedFaces,
111  const label nAddedCells,
112  const labelList& oldPointMap,
113  const labelList& oldFaceMap,
114  const labelList& oldCellMap,
115 
116  const labelList& addedPointMap,
117  const labelList& addedFaceMap,
118  const labelList& addedCellMap,
119 
120  const labelList& oldPatchMap,
121  const labelList& addedPatchMap,
122  const labelList& oldPatchSizes,
124  );
125 
126 
127  // Member Functions
128 
129  // Access
130 
131  // Old mesh data
133  label nOldPoints() const
134  {
135  return nOldPoints_;
136  }
138  label nOldFaces() const
139  {
140  return nOldFaces_;
141  }
143  label nOldCells() const
144  {
145  return nOldCells_;
146  }
147 
148 
149  //- From old mesh point/face/cell to new mesh point/face/cell.
150  const labelList& oldPointMap() const
151  {
152  return oldPointMap_;
153  }
154  const labelList& oldFaceMap() const
155  {
156  return oldFaceMap_;
157  }
158  const labelList& oldCellMap() const
159  {
160  return oldCellMap_;
161  }
162 
163  //- From old patch index to new patch index or -1 if patch
164  // not present (since 0 size)
165  const labelList& oldPatchMap() const
166  {
167  return oldPatchMap_;
168  }
169 
170  //- Return list of the old patch sizes
171  const labelList& oldPatchSizes() const
172  {
173  return oldPatchSizes_;
174  }
175 
176  //- Return list of the old patch start labels
177  const labelList& oldPatchStarts() const
178  {
179  return oldPatchStarts_;
180  }
181 
182  //- Number of old internal faces
183  label nOldInternalFaces() const
184  {
185  return oldPatchStarts_[0];
186  }
187 
188 
189  // Added mesh data
191  label nAddedPoints() const
192  {
193  return nAddedPoints_;
194  }
196  label nAddedFaces() const
197  {
198  return nAddedFaces_;
199  }
201  label nAddedCells() const
202  {
203  return nAddedCells_;
204  }
205 
206  //- From added mesh point/face/cell to new mesh point/face/cell.
207  const labelList& addedPointMap() const
208  {
209  return addedPointMap_;
210  }
211  const labelList& addedFaceMap() const
212  {
213  return addedFaceMap_;
214  }
215  const labelList& addedCellMap() const
216  {
217  return addedCellMap_;
218  }
219 
220  //- From added mesh patch index to new patch index or -1 if
221  // patch not present (since 0 size)
222  const labelList& addedPatchMap() const
223  {
224  return addedPatchMap_;
225  }
226 
227 
228  // Edit
230  void updateMesh(const mapPolyMesh&)
231  {
233  }
234 };
235 
236 
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238 
239 } // End namespace Foam
240 
241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242 
243 #endif
244 
245 // ************************************************************************* //
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 & addedPointMap() const
From added mesh point/face/cell to new mesh point/face/cell.
void updateMesh(const mapPolyMesh &)
Class containing mesh-to-mesh mapping information after a mesh addition where we add a mesh (&#39;added m...
const labelList & oldCellMap() const
const labelList & oldFaceMap() const
const labelList & addedCellMap() const
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
const labelList & addedFaceMap() const
label nAddedPoints() const
const labelList & oldPatchMap() const
From old patch index to new patch index or -1 if patch.
const labelList & oldPointMap() const
From old mesh point/face/cell to new mesh point/face/cell.
label nAddedCells() const
mapAddedPolyMesh(const label nOldPoints, const label nOldFaces, const label nOldCells, const label nAddedPoints, const label nAddedFaces, const label nAddedCells, const labelList &oldPointMap, const labelList &oldFaceMap, const labelList &oldCellMap, const labelList &addedPointMap, const labelList &addedFaceMap, const labelList &addedCellMap, const labelList &oldPatchMap, const labelList &addedPatchMap, const labelList &oldPatchSizes, const labelList &oldPatchStarts)
Construct from components.
const labelList & addedPatchMap() const
From added mesh patch index to new patch index or -1 if.
label nOldInternalFaces() const
Number of old internal faces.
label nAddedFaces() const
const labelList & oldPatchSizes() const
Return list of the old patch sizes.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:366
const labelList & oldPatchStarts() const
Return list of the old patch start labels.
Namespace for OpenFOAM.