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::faceMapper 00026 00027 Description 00028 This object provides mapping and fill-in information for face data 00029 between the two meshes after the topological change. It is 00030 constructed from mapPolyMesh. 00031 00032 SourceFiles 00033 faceMapper.C 00034 00035 \*---------------------------------------------------------------------------*/ 00036 00037 #ifndef faceMapper_H 00038 #define faceMapper_H 00039 00040 #include <OpenFOAM/morphFieldMapper.H> 00041 #include <OpenFOAM/HashSet.H> 00042 00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00044 00045 namespace Foam 00046 { 00047 00048 // Forward declaration of classes 00049 class polyMesh; 00050 class mapPolyMesh; 00051 00052 /*---------------------------------------------------------------------------*\ 00053 Class faceMapper Declaration 00054 \*---------------------------------------------------------------------------*/ 00055 00056 class faceMapper 00057 : 00058 public morphFieldMapper 00059 { 00060 // Private data 00061 00062 //- Reference to polyMesh 00063 const polyMesh& mesh_; 00064 00065 //- Reference to mapPolyMesh 00066 const mapPolyMesh& mpm_; 00067 00068 //- Are there any inserted (unmapped) faces 00069 bool insertedFaces_; 00070 00071 //- Is the mapping direct 00072 bool direct_; 00073 00074 00075 // Demand-driven private data 00076 00077 //- Direct addressing (only one for of addressing is used) 00078 mutable labelList* directAddrPtr_; 00079 00080 //- Interpolated addressing (only one for of addressing is used) 00081 mutable labelListList* interpolationAddrPtr_; 00082 00083 //- Interpolation weights 00084 mutable scalarListList* weightsPtr_; 00085 00086 //- Inserted faces 00087 mutable labelList* insertedFaceLabelsPtr_; 00088 00089 00090 // Private Member Functions 00091 00092 //- Disallow default bitwise copy construct 00093 faceMapper(const faceMapper&); 00094 00095 //- Disallow default bitwise assignment 00096 void operator=(const faceMapper&); 00097 00098 00099 //- Calculate addressing for mapping with inserted faces 00100 void calcAddressing() const; 00101 00102 //- Clear out local storage 00103 void clearOut(); 00104 00105 00106 public: 00107 00108 // Static data members 00109 00110 // Constructors 00111 00112 //- Construct from mapPolyMesh 00113 faceMapper(const mapPolyMesh& mpm); 00114 00115 00116 // Destructor 00117 00118 virtual ~faceMapper(); 00119 00120 00121 // Member Functions 00122 00123 //- Return size 00124 virtual label size() const; 00125 00126 //- Return size of field before mapping 00127 virtual label sizeBeforeMapping() const; 00128 00129 //- Return number of internal faces before mapping 00130 virtual label internalSizeBeforeMapping() const; 00131 00132 //- Is the mapping direct 00133 virtual bool direct() const 00134 { 00135 return direct_; 00136 } 00137 00138 //- Return direct addressing 00139 virtual const unallocLabelList& directAddressing() const; 00140 00141 //- Return interpolated addressing 00142 virtual const labelListList& addressing() const; 00143 00144 //- Return interpolaion weights 00145 virtual const scalarListList& weights() const; 00146 00147 //- Return flux flip map 00148 virtual const labelHashSet& flipFaceFlux() const; 00149 00150 //- Return number of old internalFaces 00151 virtual label nOldInternalFaces() const; 00152 00153 //- Return old patch starts 00154 virtual const labelList& oldPatchStarts() const; 00155 00156 //- Return old patch sizes 00157 virtual const labelList& oldPatchSizes() const; 00158 00159 //- Are there any inserted faces 00160 virtual bool insertedObjects() const 00161 { 00162 return insertedFaces_; 00163 } 00164 00165 //- Return list of inserted faces 00166 virtual const labelList& insertedObjectLabels() const; 00167 }; 00168 00169 00170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00171 00172 } // End namespace Foam 00173 00174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00175 00176 #endif 00177 00178 // ************************ vim: set sw=4 sts=4 et: ************************ //