1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::mapAddedPolyMesh
29 Class containing mesh-to-mesh mapping information after a mesh addition
30 where we add a mesh ('added mesh') to an old mesh, creating a new mesh.
32 We store mapping from the old to the new mesh and from the added mesh
35 Note: Might need some more access functions or maybe some zone maps?
40 \*---------------------------------------------------------------------------*/
42 #ifndef mapAddedPolyMesh_H
43 #define mapAddedPolyMesh_H
45 #include "labelList.H"
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 /*---------------------------------------------------------------------------*\
55 Class mapAddedPolyMesh Declaration
56 \*---------------------------------------------------------------------------*/
58 class mapAddedPolyMesh
62 //- Old mesh points/face/cells
67 //- Added mesh points/faces/cells
73 //- From old mesh points to new points
74 labelList oldPointMap_;
75 //- From old mesh faces to new faces
76 labelList oldFaceMap_;
77 //- From old mesh cells to new cells
78 labelList oldCellMap_;
80 //- From added mesh points to new points
81 labelList addedPointMap_;
82 //- From added mesh faces to new faces
83 labelList addedFaceMap_;
84 //- From added mesh cells to new cells
85 labelList addedCellMap_;
87 //- original mesh to new mesh patch map. -1 for deleted patches.
88 labelList oldPatchMap_;
90 //- added mesh to new mesh patch map. -1 for deleted patches.
91 labelList addedPatchMap_;
93 //- original patch sizes on old mesh
94 labelList oldPatchSizes_;
96 //- original patch starts
97 labelList oldPatchStarts_;
104 //- Construct from components
107 const label nOldPoints,
108 const label nOldFaces,
109 const label nOldCells,
110 const label nAddedPoints,
111 const label nAddedFaces,
112 const label nAddedCells,
113 const labelList& oldPointMap,
114 const labelList& oldFaceMap,
115 const labelList& oldCellMap,
117 const labelList& addedPointMap,
118 const labelList& addedFaceMap,
119 const labelList& addedCellMap,
121 const labelList& oldPatchMap,
122 const labelList& addedPatchMap,
123 const labelList& oldPatchSizes,
124 const labelList& oldPatchStarts
134 label nOldPoints() const
139 label nOldFaces() const
144 label nOldCells() const
150 //- From old mesh point/face/cell to new mesh point/face/cell.
151 const labelList& oldPointMap() const
155 const labelList& oldFaceMap() const
159 const labelList& oldCellMap() const
164 //- From old patch index to new patch index or -1 if patch
165 // not present (since 0 size)
166 const labelList& oldPatchMap() const
171 //- Return list of the old patch sizes
172 const labelList& oldPatchSizes() const
174 return oldPatchSizes_;
177 //- Return list of the old patch start labels
178 const labelList& oldPatchStarts() const
180 return oldPatchStarts_;
183 //- Number of old internal faces
184 label nOldInternalFaces() const
186 return oldPatchStarts_[0];
192 label nAddedPoints() const
194 return nAddedPoints_;
197 label nAddedFaces() const
202 label nAddedCells() const
207 //- From added mesh point/face/cell to new mesh point/face/cell.
208 const labelList& addedPointMap() const
210 return addedPointMap_;
212 const labelList& addedFaceMap() const
214 return addedFaceMap_;
216 const labelList& addedCellMap() const
218 return addedCellMap_;
221 //- From added mesh patch index to new patch index or -1 if
222 // patch not present (since 0 size)
223 const labelList& addedPatchMap() const
225 return addedPatchMap_;
231 void updateMesh(const mapPolyMesh&)
235 "mapAddedPolyMesh::updateMesh(const mapPolyMesh&)"
241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
243 } // End namespace Foam
245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
249 // ************************************************************************* //