FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::mapAddedPolyMesh
00026 
00027 Description
00028     Class containing mesh-to-mesh mapping information after a mesh addition
00029     where we add a mesh ('added mesh') to an old mesh, creating a new mesh.
00030 
00031     We store mapping from the old to the new mesh and from the added mesh
00032     to the new mesh.
00033 
00034     Note: Might need some more access functions or maybe some zone maps?
00035 
00036 SourceFiles
00037     mapAddedPolyMesh.C
00038 
00039 \*---------------------------------------------------------------------------*/
00040 
00041 #ifndef mapAddedPolyMesh_H
00042 #define mapAddedPolyMesh_H
00043 
00044 #include <OpenFOAM/labelList.H>
00045 
00046 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00047 
00048 namespace Foam
00049 {
00050 
00051 class mapPolyMesh;
00052 
00053 /*---------------------------------------------------------------------------*\
00054                            Class mapAddedPolyMesh Declaration
00055 \*---------------------------------------------------------------------------*/
00056 
00057 class mapAddedPolyMesh
00058 {
00059     // Private data
00060 
00061         //- Old mesh points/face/cells
00062         label nOldPoints_;
00063         label nOldFaces_;
00064         label nOldCells_;
00065 
00066         //- Added mesh points/faces/cells
00067         label nAddedPoints_;
00068         label nAddedFaces_;
00069         label nAddedCells_;
00070 
00071 
00072         //- From old mesh points to new points
00073         labelList oldPointMap_;
00074         //- From old mesh faces to new faces
00075         labelList oldFaceMap_;
00076         //- From old mesh cells to new cells
00077         labelList oldCellMap_;
00078 
00079         //- From added mesh points to new points
00080         labelList addedPointMap_;
00081         //- From added mesh faces to new faces
00082         labelList addedFaceMap_;
00083         //- From added mesh cells to new cells
00084         labelList addedCellMap_;
00085 
00086         //- original mesh to new mesh patch map. -1 for deleted patches.
00087         labelList oldPatchMap_;
00088 
00089         //- added mesh to new mesh patch map. -1 for deleted patches.
00090         labelList addedPatchMap_;
00091 
00092         //- original patch sizes on old mesh
00093         labelList oldPatchSizes_;
00094 
00095         //- original patch starts
00096         labelList oldPatchStarts_;
00097 
00098 
00099 public:
00100 
00101     // Constructors
00102 
00103         //- Construct from components
00104         mapAddedPolyMesh
00105         (
00106             const label nOldPoints,
00107             const label nOldFaces,
00108             const label nOldCells,
00109             const label nAddedPoints,
00110             const label nAddedFaces,
00111             const label nAddedCells,
00112             const labelList& oldPointMap,
00113             const labelList& oldFaceMap,
00114             const labelList& oldCellMap,
00115 
00116             const labelList& addedPointMap,
00117             const labelList& addedFaceMap,
00118             const labelList& addedCellMap,
00119 
00120             const labelList& oldPatchMap,
00121             const labelList& addedPatchMap,
00122             const labelList& oldPatchSizes,
00123             const labelList& oldPatchStarts
00124         );
00125 
00126 
00127     // Member Functions
00128 
00129         // Access
00130 
00131             // Old mesh data
00132 
00133                 label nOldPoints() const
00134                 {
00135                     return nOldPoints_;
00136                 }
00137 
00138                 label nOldFaces() const
00139                 {
00140                     return nOldFaces_;
00141                 }
00142 
00143                 label nOldCells() const
00144                 {
00145                     return nOldCells_;
00146                 }
00147 
00148 
00149                 //- From old mesh point/face/cell to new mesh point/face/cell.
00150                 const labelList& oldPointMap() const
00151                 {
00152                     return oldPointMap_;
00153                 }
00154                 const labelList& oldFaceMap() const
00155                 {
00156                     return oldFaceMap_;
00157                 }
00158                 const labelList& oldCellMap() const
00159                 {
00160                     return oldCellMap_;
00161                 }
00162 
00163                 //- From old patch index to new patch index or -1 if patch
00164                 //  not present (since 0 size)
00165                 const labelList& oldPatchMap() const
00166                 {
00167                     return oldPatchMap_;
00168                 }
00169 
00170                 //- Return list of the old patch sizes
00171                 const labelList& oldPatchSizes() const
00172                 {
00173                     return oldPatchSizes_;
00174                 }
00175 
00176                 //- Return list of the old patch start labels
00177                 const labelList& oldPatchStarts() const
00178                 {
00179                     return oldPatchStarts_;
00180                 }
00181 
00182                 //- Number of old internal faces
00183                 label nOldInternalFaces() const
00184                 {
00185                     return oldPatchStarts_[0];
00186                 }
00187 
00188 
00189             // Added mesh data
00190 
00191                 label nAddedPoints() const
00192                 {
00193                     return nAddedPoints_;
00194                 }
00195 
00196                 label nAddedFaces() const
00197                 {
00198                     return nAddedFaces_;
00199                 }
00200 
00201                 label nAddedCells() const
00202                 {
00203                     return nAddedCells_;
00204                 }
00205 
00206                 //- From added mesh point/face/cell to new mesh point/face/cell.
00207                 const labelList& addedPointMap() const
00208                 {
00209                     return addedPointMap_;
00210                 }
00211                 const labelList& addedFaceMap() const
00212                 {
00213                     return addedFaceMap_;
00214                 }
00215                 const labelList& addedCellMap() const
00216                 {
00217                     return addedCellMap_;
00218                 }
00219 
00220                 //- From added mesh patch index to new patch index or -1 if
00221                 //  patch not present (since 0 size)
00222                 const labelList& addedPatchMap() const
00223                 {
00224                     return addedPatchMap_;
00225                 }
00226 
00227 
00228         // Edit
00229 
00230             void updateMesh(const mapPolyMesh&)
00231             {
00232                 notImplemented
00233                 (
00234                     "mapAddedPolyMesh::updateMesh(const mapPolyMesh&)"
00235                 );
00236             }
00237 };
00238 
00239 
00240 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00241 
00242 } // End namespace Foam
00243 
00244 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00245 
00246 #endif
00247 
00248 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines