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::extendedCentredFaceToCellStencil 00026 00027 Description 00028 00029 SourceFiles 00030 extendedCentredFaceToCellStencil.C 00031 00032 \*---------------------------------------------------------------------------*/ 00033 00034 #ifndef extendedCentredFaceToCellStencil_H 00035 #define extendedCentredFaceToCellStencil_H 00036 00037 #include "extendedFaceToCellStencil.H" 00038 00039 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00040 00041 namespace Foam 00042 { 00043 00044 class faceToCellStencil; 00045 00046 /*---------------------------------------------------------------------------*\ 00047 Class extendedCentredFaceToCellStencil Declaration 00048 \*---------------------------------------------------------------------------*/ 00049 00050 class extendedCentredFaceToCellStencil 00051 : 00052 public extendedFaceToCellStencil 00053 { 00054 // Private data 00055 00056 //- Swap map for getting neigbouring data 00057 autoPtr<mapDistribute> mapPtr_; 00058 00059 //- Per face the stencil. 00060 labelListList stencil_; 00061 00062 00063 // Private Member Functions 00064 00065 //- Disallow default bitwise copy construct 00066 extendedCentredFaceToCellStencil 00067 ( 00068 const extendedCentredFaceToCellStencil& 00069 ); 00070 00071 //- Disallow default bitwise assignment 00072 void operator=(const extendedCentredFaceToCellStencil&); 00073 00074 00075 public: 00076 00077 // Constructors 00078 00079 //- Construct from uncompacted face stencil 00080 explicit extendedCentredFaceToCellStencil(const faceToCellStencil&); 00081 00082 00083 // Member Functions 00084 00085 //- Return reference to the parallel distribution map 00086 const mapDistribute& map() const 00087 { 00088 return mapPtr_(); 00089 } 00090 00091 //- Return reference to the stencil 00092 const labelListList& stencil() const 00093 { 00094 return stencil_; 00095 } 00096 00097 //- After removing elements from the stencil adapt the schedule (map). 00098 void compact(); 00099 00100 //- Use map to get the data into stencil order 00101 template<class T> 00102 void collectData 00103 ( 00104 const GeometricField<T, fvsPatchField, surfaceMesh>& fld, 00105 List<List<T> >& stencilFld 00106 ) const 00107 { 00108 extendedFaceToCellStencil::collectData 00109 ( 00110 map(), 00111 stencil(), 00112 fld, 00113 stencilFld 00114 ); 00115 } 00116 00117 //- Sum surface field contributions to create cell values 00118 template<class Type> 00119 tmp<GeometricField<Type, fvPatchField, volMesh> > weightedSum 00120 ( 00121 const GeometricField<Type, fvsPatchField, surfaceMesh>& fld, 00122 const List<List<scalar> >& stencilWeights 00123 ) const 00124 { 00125 return extendedFaceToCellStencil::weightedSum 00126 ( 00127 map(), 00128 stencil(), 00129 fld, 00130 stencilWeights 00131 ); 00132 } 00133 00134 }; 00135 00136 00137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00138 00139 } // End namespace Foam 00140 00141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00142 00143 #endif 00144 00145 // ************************ vim: set sw=4 sts=4 et: ************************ //