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

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