initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / OpenFOAM / meshes / polyMesh / mapPolyMesh / mapAddedPolyMesh.H
blob21523fba49967f8b7a8443713be61c43159ef14a
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::mapAddedPolyMesh
28 Description
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
33     to the new mesh.
35     Note: Might need some more access functions or maybe some zone maps?
37 SourceFiles
38     mapAddedPolyMesh.C
40 \*---------------------------------------------------------------------------*/
42 #ifndef mapAddedPolyMesh_H
43 #define mapAddedPolyMesh_H
45 #include "labelList.H"
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 namespace Foam
52 class mapPolyMesh;
54 /*---------------------------------------------------------------------------*\
55                            Class mapAddedPolyMesh Declaration
56 \*---------------------------------------------------------------------------*/
58 class mapAddedPolyMesh
60     // Private data
62         //- Old mesh points/face/cells
63         label nOldPoints_;
64         label nOldFaces_;
65         label nOldCells_;
67         //- Added mesh points/faces/cells
68         label nAddedPoints_;
69         label nAddedFaces_;
70         label nAddedCells_;
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_;
100 public:
102     // Constructors
104         //- Construct from components
105         mapAddedPolyMesh
106         (
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
125         );
128     // Member Functions
130         // Access
132             // Old mesh data
134                 label nOldPoints() const
135                 {
136                     return nOldPoints_;
137                 }
139                 label nOldFaces() const
140                 {
141                     return nOldFaces_;
142                 }
144                 label nOldCells() const
145                 {
146                     return nOldCells_;
147                 }
150                 //- From old mesh point/face/cell to new mesh point/face/cell.
151                 const labelList& oldPointMap() const
152                 {
153                     return oldPointMap_;
154                 }
155                 const labelList& oldFaceMap() const
156                 {
157                     return oldFaceMap_;
158                 }
159                 const labelList& oldCellMap() const
160                 {
161                     return oldCellMap_;
162                 }
164                 //- From old patch index to new patch index or -1 if patch
165                 //  not present (since 0 size)
166                 const labelList& oldPatchMap() const
167                 {
168                     return oldPatchMap_;
169                 }
171                 //- Return list of the old patch sizes
172                 const labelList& oldPatchSizes() const
173                 {
174                     return oldPatchSizes_;
175                 }
177                 //- Return list of the old patch start labels
178                 const labelList& oldPatchStarts() const
179                 {
180                     return oldPatchStarts_;
181                 }
183                 //- Number of old internal faces
184                 label nOldInternalFaces() const
185                 {
186                     return oldPatchStarts_[0];
187                 }
190             // Added mesh data
192                 label nAddedPoints() const
193                 {
194                     return nAddedPoints_;
195                 }
197                 label nAddedFaces() const
198                 {
199                     return nAddedFaces_;
200                 }
202                 label nAddedCells() const
203                 {
204                     return nAddedCells_;
205                 }
207                 //- From added mesh point/face/cell to new mesh point/face/cell.
208                 const labelList& addedPointMap() const
209                 {
210                     return addedPointMap_;
211                 }
212                 const labelList& addedFaceMap() const
213                 {
214                     return addedFaceMap_;
215                 }
216                 const labelList& addedCellMap() const
217                 {
218                     return addedCellMap_;
219                 }
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
224                 {
225                     return addedPatchMap_;
226                 }
229         // Edit
231             void updateMesh(const mapPolyMesh&)
232             {
233                 notImplemented
234                 (
235                     "mapAddedPolyMesh::updateMesh(const mapPolyMesh&)"
236                 );
237             }
241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
243 } // End namespace Foam
245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
247 #endif
249 // ************************************************************************* //