![]() |
|
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 fvSurfaceMapper 00027 00028 Description 00029 FV surface mapper. 00030 00031 SourceFiles 00032 fvSurfaceMapper.C 00033 00034 \*---------------------------------------------------------------------------*/ 00035 00036 #ifndef fvSurfaceMapper_H 00037 #define fvSurfaceMapper_H 00038 00039 #include "morphFieldMapper.H" 00040 #include "fvMesh.H" 00041 #include "faceMapper.H" 00042 #include "labelHashSet.H" 00043 #include "mapPolyMesh.H" 00044 00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00046 00047 namespace Foam 00048 { 00049 00050 // Class forward declarations 00051 00052 /*---------------------------------------------------------------------------*\ 00053 Class fvSurfaceMapper Declaration 00054 \*---------------------------------------------------------------------------*/ 00055 00056 class fvSurfaceMapper 00057 : 00058 public morphFieldMapper 00059 { 00060 // Private data 00061 00062 //- Reference to mesh 00063 const fvMesh& mesh_; 00064 00065 //- Reference to face mapper 00066 const faceMapper& faceMap_; 00067 00068 00069 // Demand-driven private data 00070 00071 //- Direct addressing (only one for of addressing is used) 00072 mutable labelList* directAddrPtr_; 00073 00074 //- Interpolated addressing (only one for of addressing is used) 00075 mutable labelListList* interpolationAddrPtr_; 00076 00077 //- Interpolation weights 00078 mutable scalarListList* weightsPtr_; 00079 00080 //- Inserted faces 00081 mutable labelList* insertedObjectLabelsPtr_; 00082 00083 00084 00085 // Private Member Functions 00086 00087 //- Disallow default bitwise copy construct 00088 fvSurfaceMapper(const fvSurfaceMapper&); 00089 00090 //- Disallow default bitwise assignment 00091 void operator=(const fvSurfaceMapper&); 00092 00093 00094 //- Calculate addressing 00095 void calcAddressing() const; 00096 00097 //- Clear out local storage 00098 void clearOut(); 00099 00100 00101 public: 00102 00103 // Constructors 00104 00105 //- Construct from components 00106 fvSurfaceMapper 00107 ( 00108 const fvMesh& mesh, 00109 const faceMapper& fMapper 00110 ); 00111 00112 00113 // Destructor 00114 00115 virtual ~fvSurfaceMapper(); 00116 00117 00118 // Member Functions 00119 00120 //- Return size 00121 virtual label size() const 00122 { 00123 return mesh_.nInternalFaces(); 00124 } 00125 00126 //- Return size of field before mapping 00127 virtual label sizeBeforeMapping() const 00128 { 00129 return faceMap_.internalSizeBeforeMapping(); 00130 } 00131 00132 //- Is the mapping direct 00133 virtual bool direct() const 00134 { 00135 return faceMap_.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 //- Are there any inserted faces 00148 bool insertedObjects() const 00149 { 00150 return faceMap_.insertedObjects(); 00151 } 00152 00153 //- Return list of inserted faces 00154 const labelList& insertedObjectLabels() const; 00155 00156 //- Return flux flip map 00157 const labelHashSet& flipFaceFlux() const 00158 { 00159 return faceMap_.flipFaceFlux(); 00160 } 00161 }; 00162 00163 00164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00165 00166 } // End namespace Foam 00167 00168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00169 00170 #endif 00171 00172 // ************************************************************************* //