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

mapSubsetMesh.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::mapSubsetMesh
00027 
00028 Description
00029     Class containing mesh-to-mesh mapping information after a subset operation
00030 
00031 SourceFiles
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef mapSubsetMesh_H
00036 #define mapSubsetMesh_H
00037 
00038 #include "refCount.H"
00039 #include "labelList.H"
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 /*---------------------------------------------------------------------------*\
00047                            Class mapSubsetMesh Declaration
00048 \*---------------------------------------------------------------------------*/
00049 
00050 class mapSubsetMesh
00051 :
00052     public refCount
00053 {
00054     // Private data
00055 
00056         //- Number of old live points
00057         label nOldPoints_;
00058 
00059         //- Number of old live faces
00060         label nOldFaces_;
00061 
00062         //- Number of old live cells
00063         label nOldCells_;
00064 
00065         //- Point mapping array
00066         const labelList pointMap_;
00067 
00068         //- Face mapping array
00069         const labelList faceMap_;
00070 
00071         //- Cell mapping array
00072         const labelList cellMap_;
00073 
00074         //- Patch for exposed faces
00075         const label exposedPatchID_;
00076 
00077         //- List of the old patch sizes
00078         labelList oldPatchSizes_;
00079 
00080         //- List of the old patch start labels
00081         const labelList oldPatchStarts_;
00082 
00083         //- List of numbers of mesh points per old patch
00084         const labelList oldPatchNMeshPoints_;
00085 
00086 public:
00087 
00088     // Constructors
00089 
00090         //- Construct from components
00091         mapSubsetMesh
00092         (
00093             const label nOldPoints,
00094             const label nOldFaces,
00095             const label nOldCells,
00096             const labelList& pointMap,
00097             const labelList& faceMap,
00098             const labelList& cellMap,
00099             const label exposedPatchID,
00100             const labelList& oldPatchStarts,
00101             const labelList& oldPatchNMeshPoints
00102         );
00103 
00104         //- Construct from components and optionally reuse storage
00105         mapSubsetMesh
00106         (
00107             const label nOldPoints,
00108             const label nOldFaces,
00109             const label nOldCells,
00110             labelList& pointMap,
00111             labelList& faceMap,
00112             labelList& cellMap,
00113             const label exposedPatchID,
00114             labelList& oldPatchStarts,
00115             labelList& oldPatchNMeshPoints,
00116             const bool reUse
00117         );
00118 
00119 
00120     // Member Functions
00121 
00122         // Access
00123 
00124             //- Number of old points
00125             label nOldPoints() const
00126             {
00127                 return nOldPoints_;
00128             }
00129 
00130             //- Number of old internal faces
00131             label nOldInternalFaces() const
00132             {
00133                 return oldPatchStarts_[0];
00134             }
00135 
00136             //- Number of old faces
00137             label nOldFaces() const
00138             {
00139                 return nOldFaces_;
00140             }
00141 
00142             //- Number of old cells
00143             label nOldCells() const
00144             {
00145                 return nOldCells_;
00146             }
00147 
00148             //- Patch that exposed faces were put into
00149             label exposedPatchID() const
00150             {
00151                 return exposedPatchID_;
00152             }
00153 
00154             //- Old point map.
00155             //  Contains the old point label for all points of the subsetted
00156             //  mesh
00157             const labelList& pointMap() const
00158             {
00159                 return pointMap_;
00160             }
00161 
00162             //- Old face map.
00163             //  Contains the old point label for all faces of the subsetted
00164             //  mesh
00165             const labelList& faceMap() const
00166             {
00167                 return faceMap_;
00168             }
00169 
00170             //- Old cell map.
00171             //  Contains the old point label for all cells of the subsetted
00172             //  mesh
00173             const labelList& cellMap() const
00174             {
00175                 return cellMap_;
00176             }
00177 
00178             //- Return list of the old patch sizes
00179             const labelList& oldPatchSizes() const
00180             {
00181                 return oldPatchSizes_;
00182             }
00183 
00184             //- Return list of the old patch start labels
00185             const labelList& oldPatchStarts() const
00186             {
00187                 return oldPatchStarts_;
00188             }
00189 
00190             //- Return numbers of mesh points per old patch
00191             const labelList& oldPatchNMeshPoints() const
00192             {
00193                 return oldPatchNMeshPoints_;
00194             }
00195 };
00196 
00197 
00198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00199 
00200 } // End namespace Foam
00201 
00202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00203 
00204 #endif
00205 
00206 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd