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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::mapAddedPolyMesh
28
29Description
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
38SourceFiles
39 mapAddedPolyMesh.C
40
41\*---------------------------------------------------------------------------*/
42
43#ifndef mapAddedPolyMesh_H
44#define mapAddedPolyMesh_H
45
46#include "labelList.H"
47
48// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50namespace Foam
51{
52
53class mapPolyMesh;
54
55/*---------------------------------------------------------------------------*\
56 Class mapAddedPolyMesh Declaration
57\*---------------------------------------------------------------------------*/
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
101public:
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
119 const labelList& addedFaceMap,
120 const labelList& addedCellMap,
121
122 const labelList& oldPatchMap,
126 );
127
128
129 // Member Functions
130
131 // Access
132
133 // Old mesh data
135 label nOldPoints() const
136 {
137 return nOldPoints_;
138 }
140 label nOldFaces() const
141 {
142 return nOldFaces_;
143 }
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_;
156 const labelList& oldFaceMap() const
157 {
158 return oldFaceMap_;
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
193 label nAddedPoints() const
194 {
195 return nAddedPoints_;
196 }
198 label nAddedFaces() const
199 {
200 return nAddedFaces_;
201 }
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_;
213 const labelList& addedFaceMap() const
214 {
215 return addedFaceMap_;
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
232 void updateMesh(const mapPolyMesh&)
233 {
235 }
236};
237
238
239// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
240
241} // End namespace Foam
242
243// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
244
245#endif
246
247// ************************************************************************* //
Class containing mesh-to-mesh mapping information after a mesh addition where we add a mesh ('added m...
const labelList & oldPointMap() const
From old mesh point/face/cell to new mesh point/face/cell.
const labelList & oldPatchStarts() const
Return list of the old patch start labels.
label nOldInternalFaces() const
Number of old internal faces.
const labelList & addedPointMap() const
From added mesh point/face/cell to new mesh point/face/cell.
const labelList & oldCellMap() const
const labelList & addedCellMap() const
const labelList & addedPatchMap() const
From added mesh patch index to new patch index or -1 if.
void updateMesh(const mapPolyMesh &)
const labelList & oldPatchMap() const
From old patch index to new patch index or -1 if patch.
const labelList & oldFaceMap() const
const labelList & oldPatchSizes() const
Return list of the old patch sizes.
const labelList & addedFaceMap() const
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:162
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
Namespace for OpenFOAM.