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::PrimitivePatchInterpolation 00026 00027 Description 00028 Interpolation class within a primitive patch. Allows interpolation from 00029 points to faces and vice versa 00030 00031 SourceFiles 00032 PrimitivePatchInterpolation_.C 00033 00034 \*---------------------------------------------------------------------------*/ 00035 00036 #ifndef PrimitivePatchInterpolation__H 00037 #define PrimitivePatchInterpolation__H 00038 00039 #include <OpenFOAM/scalarList.H> 00040 #include <OpenFOAM/Field.H> 00041 00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00043 00044 namespace Foam 00045 { 00046 00047 /*---------------------------------------------------------------------------*\ 00048 Class PrimitivePatchInterpolation Declaration 00049 \*---------------------------------------------------------------------------*/ 00050 00051 template<class Patch> 00052 class PrimitivePatchInterpolation 00053 { 00054 // Private data 00055 00056 //- Reference to patch 00057 const Patch& patch_; 00058 00059 00060 // Demand-driven data 00061 00062 //- Face-to-point weights 00063 mutable scalarListList* faceToPointWeightsPtr_; 00064 00065 //- Face-to-edge weights 00066 mutable scalarList* faceToEdgeWeightsPtr_; 00067 00068 00069 // Private Member Functions 00070 00071 //- Disallow default bitwise copy construct 00072 PrimitivePatchInterpolation(const PrimitivePatchInterpolation&); 00073 00074 //- Disallow default bitwise assignment 00075 void operator=(const PrimitivePatchInterpolation&); 00076 00077 00078 //- Face-to-point weights 00079 const scalarListList& faceToPointWeights() const; 00080 00081 //- Make face-to-point weights 00082 void makeFaceToPointWeights() const; 00083 00084 //- Face-to-edge weights 00085 const scalarList& faceToEdgeWeights() const; 00086 00087 //- Make face-to-edge weights 00088 void makeFaceToEdgeWeights() const; 00089 00090 //- Clear weights 00091 void clearWeights(); 00092 00093 00094 public: 00095 00096 // Constructors 00097 00098 //- Construct from PrimitivePatch 00099 PrimitivePatchInterpolation(const Patch& p); 00100 00101 00102 // Destructor 00103 00104 ~PrimitivePatchInterpolation(); 00105 00106 00107 // Member Functions 00108 00109 //- Interpolate from faces to points 00110 template<class Type> 00111 tmp<Field<Type> > faceToPointInterpolate 00112 ( 00113 const Field<Type>& ff 00114 ) const; 00115 00116 template<class Type> 00117 tmp<Field<Type> > faceToPointInterpolate 00118 ( 00119 const tmp<Field<Type> >& tff 00120 ) const; 00121 00122 //- Interpolate from points to faces 00123 template<class Type> 00124 tmp<Field<Type> > pointToFaceInterpolate 00125 ( 00126 const Field<Type>& pf 00127 ) const; 00128 00129 template<class Type> 00130 tmp<Field<Type> > pointToFaceInterpolate 00131 ( 00132 const tmp<Field<Type> >& tpf 00133 ) const; 00134 00135 //- Interpolate from faces to edges 00136 template<class Type> 00137 tmp<Field<Type> > faceToEdgeInterpolate 00138 ( 00139 const Field<Type>& ff 00140 ) const; 00141 00142 template<class Type> 00143 tmp<Field<Type> > faceToEdgeInterpolate 00144 ( 00145 const tmp<Field<Type> >& tff 00146 ) const; 00147 00148 //- Do what is neccessary if the mesh has moved 00149 bool movePoints(); 00150 }; 00151 00152 00153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00154 00155 } // End namespace Foam 00156 00157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00158 00159 #ifdef NoRepository 00160 # include <OpenFOAM/PrimitivePatchInterpolation_.C> 00161 #endif 00162 00163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00164 00165 #endif 00166 00167 // ************************ vim: set sw=4 sts=4 et: ************************ //