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