1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
25 Foam::mapAddedPolyMesh
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.
31 We store mapping from the old to the new mesh and from the added mesh
34 Note: Might need some more access functions or maybe some zone maps?
39 \*---------------------------------------------------------------------------*/
41 #ifndef mapAddedPolyMesh_H
42 #define mapAddedPolyMesh_H
44 #include "labelList.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 /*---------------------------------------------------------------------------*\
54 Class mapAddedPolyMesh Declaration
55 \*---------------------------------------------------------------------------*/
57 class mapAddedPolyMesh
61 //- Old mesh points/face/cells
66 //- Added mesh points/faces/cells
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_;
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_;
86 //- original mesh to new mesh patch map. -1 for deleted patches.
87 labelList oldPatchMap_;
89 //- added mesh to new mesh patch map. -1 for deleted patches.
90 labelList addedPatchMap_;
92 //- original patch sizes on old mesh
93 labelList oldPatchSizes_;
95 //- original patch starts
96 labelList oldPatchStarts_;
103 //- Construct from components
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,
116 const labelList& addedPointMap,
117 const labelList& addedFaceMap,
118 const labelList& addedCellMap,
120 const labelList& oldPatchMap,
121 const labelList& addedPatchMap,
122 const labelList& oldPatchSizes,
123 const labelList& oldPatchStarts
133 label nOldPoints() const
138 label nOldFaces() const
143 label nOldCells() const
149 //- From old mesh point/face/cell to new mesh point/face/cell.
150 const labelList& oldPointMap() const
154 const labelList& oldFaceMap() const
158 const labelList& oldCellMap() const
163 //- From old patch index to new patch index or -1 if patch
164 // not present (since 0 size)
165 const labelList& oldPatchMap() const
170 //- Return list of the old patch sizes
171 const labelList& oldPatchSizes() const
173 return oldPatchSizes_;
176 //- Return list of the old patch start labels
177 const labelList& oldPatchStarts() const
179 return oldPatchStarts_;
182 //- Number of old internal faces
183 label nOldInternalFaces() const
185 return oldPatchStarts_[0];
191 label nAddedPoints() const
193 return nAddedPoints_;
196 label nAddedFaces() const
201 label nAddedCells() const
206 //- From added mesh point/face/cell to new mesh point/face/cell.
207 const labelList& addedPointMap() const
209 return addedPointMap_;
211 const labelList& addedFaceMap() const
213 return addedFaceMap_;
215 const labelList& addedCellMap() const
217 return addedCellMap_;
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
224 return addedPatchMap_;
230 void updateMesh(const mapPolyMesh&)
234 "mapAddedPolyMesh::updateMesh(const mapPolyMesh&)"
240 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242 } // End namespace Foam
244 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
248 // ************************************************************************* //