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
65 
66  //- Added mesh points/faces/cells
70 
71 
72  //- From old mesh points to new points
74  //- From old mesh faces to new faces
76  //- From old mesh cells to new cells
78 
79  //- From added mesh points to new points
81  //- From added mesh faces to new faces
83  //- From added mesh cells to new cells
85 
86  //- Original mesh to new mesh patch map. -1 for deleted patches.
88 
89  //- Added mesh to new mesh patch map. -1 for deleted patches.
91 
92  //- Original patch sizes on old mesh
94 
95  //- Original patch starts
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
132 
133  label nOldPoints() const
134  {
135  return nOldPoints_;
136  }
137 
138  label nOldFaces() const
139  {
140  return nOldFaces_;
141  }
142 
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
190 
191  label nAddedPoints() const
192  {
193  return nAddedPoints_;
194  }
195 
196  label nAddedFaces() const
197  {
198  return nAddedFaces_;
199  }
200 
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
229 
230  void updateMesh(const mapPolyMesh&)
231  {
233  }
234 };
235 
236 
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238 
239 } // End namespace Foam
240 
241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242 
243 #endif
244 
245 // ************************************************************************* //
Foam::mapAddedPolyMesh::nOldInternalFaces
label nOldInternalFaces() const
Number of old internal faces.
Definition: mapAddedPolyMesh.H:182
Foam::mapAddedPolyMesh::oldPatchStarts
const labelList & oldPatchStarts() const
Return list of the old patch start labels.
Definition: mapAddedPolyMesh.H:176
Foam::mapAddedPolyMesh::addedCellMap
const labelList & addedCellMap() const
Definition: mapAddedPolyMesh.H:214
Foam::mapAddedPolyMesh::nOldCells
label nOldCells() const
Definition: mapAddedPolyMesh.H:142
Foam::mapAddedPolyMesh::nAddedCells_
label nAddedCells_
Definition: mapAddedPolyMesh.H:68
Foam::mapAddedPolyMesh::nAddedFaces
label nAddedFaces() const
Definition: mapAddedPolyMesh.H:195
Foam::mapAddedPolyMesh::nOldPoints_
label nOldPoints_
Old mesh points/face/cells.
Definition: mapAddedPolyMesh.H:61
Foam::mapAddedPolyMesh::nAddedCells
label nAddedCells() const
Definition: mapAddedPolyMesh.H:200
Foam::mapAddedPolyMesh::oldPatchMap_
labelList oldPatchMap_
Original mesh to new mesh patch map. -1 for deleted patches.
Definition: mapAddedPolyMesh.H:86
Foam::mapAddedPolyMesh::addedPatchMap_
labelList addedPatchMap_
Added mesh to new mesh patch map. -1 for deleted patches.
Definition: mapAddedPolyMesh.H:89
Foam::mapAddedPolyMesh::oldPatchSizes_
labelList oldPatchSizes_
Original patch sizes on old mesh.
Definition: mapAddedPolyMesh.H:92
Foam::mapAddedPolyMesh::addedPointMap
const labelList & addedPointMap() const
From added mesh point/face/cell to new mesh point/face/cell.
Definition: mapAddedPolyMesh.H:206
Foam::mapAddedPolyMesh::addedFaceMap
const labelList & addedFaceMap() const
Definition: mapAddedPolyMesh.H:210
Foam::mapAddedPolyMesh::nAddedFaces_
label nAddedFaces_
Definition: mapAddedPolyMesh.H:67
Foam::mapAddedPolyMesh::nOldCells_
label nOldCells_
Definition: mapAddedPolyMesh.H:63
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:365
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
labelList.H
Foam::mapAddedPolyMesh::oldPointMap
const labelList & oldPointMap() const
From old mesh point/face/cell to new mesh point/face/cell.
Definition: mapAddedPolyMesh.H:149
Foam::mapAddedPolyMesh::nOldFaces
label nOldFaces() const
Definition: mapAddedPolyMesh.H:137
Foam::mapAddedPolyMesh::nOldFaces_
label nOldFaces_
Definition: mapAddedPolyMesh.H:62
Foam::mapAddedPolyMesh::addedPointMap_
labelList addedPointMap_
From added mesh points to new points.
Definition: mapAddedPolyMesh.H:79
Foam::mapAddedPolyMesh::addedCellMap_
labelList addedCellMap_
From added mesh cells to new cells.
Definition: mapAddedPolyMesh.H:83
Foam::mapAddedPolyMesh::oldCellMap
const labelList & oldCellMap() const
Definition: mapAddedPolyMesh.H:157
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:35
Foam::mapAddedPolyMesh::oldPointMap_
labelList oldPointMap_
From old mesh points to new points.
Definition: mapAddedPolyMesh.H:72
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::mapAddedPolyMesh::oldFaceMap
const labelList & oldFaceMap() const
Definition: mapAddedPolyMesh.H:153
Foam::mapAddedPolyMesh::addedPatchMap
const labelList & addedPatchMap() const
From added mesh patch index to new patch index or -1 if.
Definition: mapAddedPolyMesh.H:221
Foam::mapAddedPolyMesh::updateMesh
void updateMesh(const mapPolyMesh &)
Definition: mapAddedPolyMesh.H:229
Foam::mapAddedPolyMesh::nAddedPoints
label nAddedPoints() const
Definition: mapAddedPolyMesh.H:190
Foam::mapAddedPolyMesh::nAddedPoints_
label nAddedPoints_
Added mesh points/faces/cells.
Definition: mapAddedPolyMesh.H:66
Foam::mapAddedPolyMesh::oldFaceMap_
labelList oldFaceMap_
From old mesh faces to new faces.
Definition: mapAddedPolyMesh.H:74
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
Foam::mapAddedPolyMesh::oldPatchSizes
const labelList & oldPatchSizes() const
Return list of the old patch sizes.
Definition: mapAddedPolyMesh.H:170
Foam::mapAddedPolyMesh::oldPatchStarts_
labelList oldPatchStarts_
Original patch starts.
Definition: mapAddedPolyMesh.H:95
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
Foam::mapAddedPolyMesh
Class containing mesh-to-mesh mapping information after a mesh addition where we add a mesh ('added m...
Definition: mapAddedPolyMesh.H:56
Foam::mapAddedPolyMesh::nOldPoints
label nOldPoints() const
Definition: mapAddedPolyMesh.H:132
Foam::mapAddedPolyMesh::oldPatchMap
const labelList & oldPatchMap() const
From old patch index to new patch index or -1 if patch.
Definition: mapAddedPolyMesh.H:164
Foam::mapAddedPolyMesh::oldCellMap_
labelList oldCellMap_
From old mesh cells to new cells.
Definition: mapAddedPolyMesh.H:76
Foam::mapAddedPolyMesh::addedFaceMap_
labelList addedFaceMap_
From added mesh faces to new faces.
Definition: mapAddedPolyMesh.H:81