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