OpenFOAM logo
Open Source CFD Toolkit

PrimitivePatchInterpolation.H

Go 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-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     PrimitivePatchInterpolation
00027 
00028 Description
00029     Interpolation class within a primitive patch. Allows interpolation from
00030     points to faces and vice versa
00031 
00032 SourceFiles
00033     PrimitivePatchInterpolation.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef PrimitivePatchInterpolation_H
00038 #define PrimitivePatchInterpolation_H
00039 
00040 #include "primitiveFields.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-edge weights
00063         mutable scalarField* faceToEdgeWeightsPtr_;
00064 
00065 
00066     // Private Member Functions
00067 
00068         //- Disallow default bitwise copy construct
00069         PrimitivePatchInterpolation(const PrimitivePatchInterpolation&);
00070 
00071         //- Disallow default bitwise assignment
00072         void operator=(const PrimitivePatchInterpolation&);
00073 
00074 
00075         //- Face-to-edge weights
00076         const scalarField& faceToEdgeWeights() const;
00077 
00078         //- Make face-to-edge weights
00079         void makeFaceToEdgeWeights() const;
00080 
00081         //- Clear weights
00082         void clearWeights();
00083 
00084 
00085 public:
00086 
00087     // Constructors
00088 
00089         //- Construct from PrimitivePatch
00090         PrimitivePatchInterpolation
00091         (
00092             const Patch& p
00093         )
00094         :
00095             patch_(p),
00096             faceToEdgeWeightsPtr_(NULL)
00097         {}
00098 
00099 
00100     // Destructor
00101 
00102         ~PrimitivePatchInterpolation();
00103 
00104 
00105     // Member Functions
00106 
00107         //- Interpolate from faces to points
00108         template<class Type>
00109         tmp<Field<Type> > faceToPointInterpolate
00110         (
00111             const Field<Type>& ff
00112         ) const;
00113 
00114         template<class Type>
00115         tmp<Field<Type> > faceToPointInterpolate
00116         (
00117             const tmp<Field<Type> >& tff
00118         ) const;
00119 
00120         //- Interpolate from points to faces
00121         template<class Type>
00122         tmp<Field<Type> > pointToFaceInterpolate
00123         (
00124             const Field<Type>& pf
00125         ) const;
00126 
00127         template<class Type>
00128         tmp<Field<Type> > pointToFaceInterpolate
00129         (
00130             const tmp<Field<Type> >& tpf
00131         ) const;
00132 
00133         //- Interpolate from faces to edges
00134         template<class Type>
00135         tmp<Field<Type> > faceToEdgeInterpolate
00136         (
00137             const Field<Type>& ff
00138         ) const;
00139 
00140         template<class Type>
00141         tmp<Field<Type> > faceToEdgeInterpolate
00142         (
00143             const tmp<Field<Type> >& tff
00144         ) const;
00145 
00146         //- Do what is neccessary if the mesh has moved
00147         bool movePoints();
00148 };
00149 
00150 
00151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00152 
00153 } // End namespace Foam
00154 
00155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00156 
00157 #ifdef NoRepository
00158 #   include "PrimitivePatchInterpolation.C"
00159 #endif
00160 
00161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00162 
00163 #endif
00164 
00165 // ************************************************************************* //
For further information go to www.openfoam.org