OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

mapAddedPolyMesh.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::mapAddedPolyMesh
00027 
00028 Description
00029     Class containing mesh-to-mesh mapping information after a mesh addition
00030     where we add a mesh ('added mesh') to an old mesh, creating a new mesh.
00031 
00032     We store mapping from the old to the new mesh and from the added mesh
00033     to the new mesh.
00034 
00035     Note: Might need some more access functions or maybe some zone maps?
00036 
00037 SourceFiles
00038     mapAddedPolyMesh.C
00039 
00040 \*---------------------------------------------------------------------------*/
00041 
00042 #ifndef mapAddedPolyMesh_H
00043 #define mapAddedPolyMesh_H
00044 
00045 #include "labelList.H"
00046 
00047 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00048 
00049 namespace Foam
00050 {
00051 
00052 class mapPolyMesh;
00053 
00054 /*---------------------------------------------------------------------------*\
00055                            Class mapAddedPolyMesh Declaration
00056 \*---------------------------------------------------------------------------*/
00057 
00058 class mapAddedPolyMesh
00059 {
00060     // Private data
00061 
00062         //- Old mesh points/face/cells
00063         label nOldPoints_;
00064         label nOldFaces_;
00065         label nOldCells_;
00066 
00067         //- Added mesh points/faces/cells
00068         label nAddedPoints_;
00069         label nAddedFaces_;
00070         label nAddedCells_;
00071 
00072 
00073         //- From old mesh points to new points
00074         labelList oldPointMap_;
00075         //- From old mesh faces to new faces
00076         labelList oldFaceMap_;
00077         //- From old mesh cells to new cells
00078         labelList oldCellMap_;
00079 
00080         //- From added mesh points to new points
00081         labelList addedPointMap_;
00082         //- From added mesh faces to new faces
00083         labelList addedFaceMap_;
00084         //- From added mesh cells to new cells
00085         labelList addedCellMap_;
00086 
00087         //- original mesh to new mesh patch map. -1 for deleted patches.
00088         labelList oldPatchMap_;
00089 
00090         //- added mesh to new mesh patch map. -1 for deleted patches.
00091         labelList addedPatchMap_;
00092 
00093         //- original patch sizes on old mesh
00094         labelList oldPatchSizes_;
00095 
00096         //- original patch starts
00097         labelList oldPatchStarts_;
00098 
00099 
00100 public:
00101 
00102     // Constructors
00103 
00104         //- Construct from components
00105         mapAddedPolyMesh
00106         (
00107             const label nOldPoints,
00108             const label nOldFaces,
00109             const label nOldCells,
00110             const label nAddedPoints,
00111             const label nAddedFaces,
00112             const label nAddedCells,
00113             const labelList& oldPointMap,
00114             const labelList& oldFaceMap,
00115             const labelList& oldCellMap,
00116 
00117             const labelList& addedPointMap,
00118             const labelList& addedFaceMap,
00119             const labelList& addedCellMap,
00120 
00121             const labelList& oldPatchMap,
00122             const labelList& addedPatchMap,
00123             const labelList& oldPatchSizes,
00124             const labelList& oldPatchStarts
00125         );
00126 
00127 
00128     // Member Functions
00129 
00130         // Access
00131 
00132             // Old mesh data
00133 
00134                 label nOldPoints() const
00135                 {
00136                     return nOldPoints_;
00137                 }
00138 
00139                 label nOldFaces() const
00140                 {
00141                     return nOldFaces_;
00142                 }
00143 
00144                 label nOldCells() const
00145                 {
00146                     return nOldCells_;
00147                 }
00148 
00149 
00150                 //- From old mesh point/face/cell to new mesh point/face/cell.
00151                 const labelList& oldPointMap() const
00152                 {
00153                     return oldPointMap_;
00154                 }
00155                 const labelList& oldFaceMap() const
00156                 {
00157                     return oldFaceMap_;
00158                 }
00159                 const labelList& oldCellMap() const
00160                 {
00161                     return oldCellMap_;
00162                 }
00163 
00164                 //- From old patch index to new patch index or -1 if patch
00165                 //  not present (since 0 size)
00166                 const labelList& oldPatchMap() const
00167                 {
00168                     return oldPatchMap_;
00169                 }
00170 
00171                 //- Return list of the old patch sizes
00172                 const labelList& oldPatchSizes() const
00173                 {
00174                     return oldPatchSizes_;
00175                 }
00176 
00177                 //- Return list of the old patch start labels
00178                 const labelList& oldPatchStarts() const
00179                 {
00180                     return oldPatchStarts_;
00181                 }
00182 
00183                 //- Number of old internal faces
00184                 label nOldInternalFaces() const
00185                 {
00186                     return oldPatchStarts_[0];
00187                 }
00188 
00189 
00190             // Added mesh data
00191 
00192                 label nAddedPoints() const
00193                 {
00194                     return nAddedPoints_;
00195                 }
00196 
00197                 label nAddedFaces() const
00198                 {
00199                     return nAddedFaces_;
00200                 }
00201 
00202                 label nAddedCells() const
00203                 {
00204                     return nAddedCells_;
00205                 }
00206 
00207                 //- From added mesh point/face/cell to new mesh point/face/cell.
00208                 const labelList& addedPointMap() const
00209                 {
00210                     return addedPointMap_;
00211                 }
00212                 const labelList& addedFaceMap() const
00213                 {
00214                     return addedFaceMap_;
00215                 }
00216                 const labelList& addedCellMap() const
00217                 {
00218                     return addedCellMap_;
00219                 }
00220 
00221                 //- From added mesh patch index to new patch index or -1 if
00222                 //  patch not present (since 0 size)
00223                 const labelList& addedPatchMap() const
00224                 {
00225                     return addedPatchMap_;
00226                 }
00227 
00228 
00229         // Edit
00230 
00231             void updateMesh(const mapPolyMesh&)
00232             {
00233                 notImplemented
00234                 (
00235                     "mapAddedPolyMesh::updateMesh(const mapPolyMesh&)"
00236                 );
00237             }
00238 };
00239 
00240 
00241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00242 
00243 } // End namespace Foam
00244 
00245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00246 
00247 #endif
00248 
00249 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd