Transferred copyright to the OpenFOAM Foundation
[OpenFOAM-2.0.x.git] / src / OpenFOAM / meshes / polyMesh / mapPolyMesh / mapAddedPolyMesh.H
bloba4d54bcef1c6ccbf3645504ff004da7f61038955
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
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
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
19     for more details.
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/>.
24 Class
25     Foam::mapAddedPolyMesh
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.
31     We store mapping from the old to the new mesh and from the added mesh
32     to the new mesh.
34     Note: Might need some more access functions or maybe some zone maps?
36 SourceFiles
37     mapAddedPolyMesh.C
39 \*---------------------------------------------------------------------------*/
41 #ifndef mapAddedPolyMesh_H
42 #define mapAddedPolyMesh_H
44 #include "labelList.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 namespace Foam
51 class mapPolyMesh;
53 /*---------------------------------------------------------------------------*\
54                            Class mapAddedPolyMesh Declaration
55 \*---------------------------------------------------------------------------*/
57 class mapAddedPolyMesh
59     // Private data
61         //- Old mesh points/face/cells
62         label nOldPoints_;
63         label nOldFaces_;
64         label nOldCells_;
66         //- Added mesh points/faces/cells
67         label nAddedPoints_;
68         label nAddedFaces_;
69         label nAddedCells_;
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_;
99 public:
101     // Constructors
103         //- Construct from components
104         mapAddedPolyMesh
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,
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
124         );
127     // Member Functions
129         // Access
131             // Old mesh data
133                 label nOldPoints() const
134                 {
135                     return nOldPoints_;
136                 }
138                 label nOldFaces() const
139                 {
140                     return nOldFaces_;
141                 }
143                 label nOldCells() const
144                 {
145                     return nOldCells_;
146                 }
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                 }
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                 }
170                 //- Return list of the old patch sizes
171                 const labelList& oldPatchSizes() const
172                 {
173                     return oldPatchSizes_;
174                 }
176                 //- Return list of the old patch start labels
177                 const labelList& oldPatchStarts() const
178                 {
179                     return oldPatchStarts_;
180                 }
182                 //- Number of old internal faces
183                 label nOldInternalFaces() const
184                 {
185                     return oldPatchStarts_[0];
186                 }
189             // Added mesh data
191                 label nAddedPoints() const
192                 {
193                     return nAddedPoints_;
194                 }
196                 label nAddedFaces() const
197                 {
198                     return nAddedFaces_;
199                 }
201                 label nAddedCells() const
202                 {
203                     return nAddedCells_;
204                 }
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                 }
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                 }
228         // Edit
230             void updateMesh(const mapPolyMesh&)
231             {
232                 notImplemented
233                 (
234                     "mapAddedPolyMesh::updateMesh(const mapPolyMesh&)"
235                 );
236             }
240 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242 } // End namespace Foam
244 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
246 #endif
248 // ************************************************************************* //