|
|
|
pointPatchMapper.HGo 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::pointPatchMapper 00027 00028 Description 00029 Mapping class for a pointPatchField. 00030 00031 SourceFiles 00032 pointPatchMapper.C 00033 00034 \*---------------------------------------------------------------------------*/ 00035 00036 #ifndef pointPatchMapper_H 00037 #define pointPatchMapper_H 00038 00039 #include "pointMapper.H" 00040 #include "pointPatchFieldMapper.H" 00041 #include "pointPatch.H" 00042 #include "primitiveFields.H" 00043 00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00045 00046 namespace Foam 00047 { 00048 00049 // Forward declaration of classes 00050 class pointPatch; 00051 class mapPolyMesh; 00052 00053 /*---------------------------------------------------------------------------*\ 00054 Class pointPatchMapper Declaration 00055 \*---------------------------------------------------------------------------*/ 00056 00057 class pointPatchMapper 00058 : 00059 public pointPatchFieldMapper 00060 { 00061 // Private data 00062 00063 //- Reference to patch 00064 const pointPatch& patch_; 00065 00066 //- Reference to point mapper for internal field 00067 const morphFieldMapper& pointMapper_; 00068 00069 //- Reference to mapping data 00070 const mapPolyMesh& mpm_; 00071 00072 //- Size before mapping 00073 const label sizeBeforeMapping_; 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 00088 // Private Member Functions 00089 00090 //- Disallow default bitwise copy construct 00091 pointPatchMapper 00092 ( 00093 const pointPatchMapper& 00094 ); 00095 00096 //- Disallow default bitwise assignment 00097 void operator=(const pointPatchMapper&); 00098 00099 00100 //- Calculate addressing for mapping with inserted cells 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 mappers 00114 pointPatchMapper 00115 ( 00116 const pointPatch& patch, 00117 const pointMapper& pointMap, 00118 const mapPolyMesh& mpm 00119 ); 00120 00121 00122 // Destructor 00123 00124 virtual ~pointPatchMapper(); 00125 00126 00127 // Member Functions 00128 00129 //- Return size 00130 virtual label size() const 00131 { 00132 return patch_.size(); 00133 } 00134 00135 //- Return size of field before mapping 00136 virtual label sizeBeforeMapping() const 00137 { 00138 return sizeBeforeMapping_; 00139 } 00140 00141 //- Is the mapping direct 00142 virtual bool direct() const 00143 { 00144 return pointMapper_.direct(); 00145 } 00146 00147 //- Return direct addressing 00148 virtual const unallocLabelList& directAddressing() const; 00149 00150 //- Return interpolated addressing 00151 virtual const labelListList& addressing() const; 00152 00153 //- Return interpolaion weights 00154 virtual const scalarListList& weights() const; 00155 00156 }; 00157 00158 00159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00160 00161 } // End namespace Foam 00162 00163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00164 00165 #endif 00166 00167 // ************************************************************************* // |