OpenFOAM logo
Open Source CFD Toolkit

linearEdgeInterpolation.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     linearEdgeInterpolation
00027 
00028 Description
00029     Central-differencing interpolation scheme class
00030 
00031 SourceFiles
00032     linearEdgeInterpolation.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef linearEdgeInterpolation_H
00037 #define linearEdgeInterpolation_H
00038 
00039 #include "edgeInterpolationScheme.H"
00040 #include "areaFields.H"
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 /*---------------------------------------------------------------------------*\
00048                            Class linear Declaration
00049 \*---------------------------------------------------------------------------*/
00050 
00051 template<class Type>
00052 class linearEdgeInterpolation
00053 :
00054     virtual public edgeInterpolationScheme<Type>
00055 {
00056     // Private Member Functions
00057 
00058         //- Disallow default bitwise assignment
00059         void operator=(const linearEdgeInterpolation&);
00060 
00061 public:
00062 
00063     //- Runtime type information
00064     TypeName("linear");
00065 
00066 
00067     // Constructors
00068 
00069         //- Construct from mesh
00070         linearEdgeInterpolation(const faMesh& mesh)
00071         :
00072             edgeInterpolationScheme<Type>(mesh)
00073         {}
00074 
00075         //- Construct from Istream
00076         linearEdgeInterpolation(const faMesh& mesh, Istream&)
00077         :
00078             edgeInterpolationScheme<Type>(mesh)
00079         {}
00080 
00081         //- Construct from faceFlux and Istream
00082         linearEdgeInterpolation
00083         (
00084             const faMesh& mesh,
00085             const edgeScalarField&,
00086             Istream&
00087         )
00088         :
00089             edgeInterpolationScheme<Type>(mesh)
00090         {}
00091 
00092 
00093     // Member Functions
00094 
00095         //- Return the interpolation weighting factors
00096         tmp<edgeScalarField> weights
00097         (
00098             const GeometricField<Type, faPatchField, areaMesh>&
00099         ) const
00100         {
00101             return this->mesh().edgeInterpolation::weights();
00102         }
00103 };
00104 
00105 
00106 template<class Type>
00107 tmp<GeometricField<Type, faPatchField, edgeMesh> >
00108 linearEdgeInterpolate(const GeometricField<Type, faPatchField, areaMesh>& vf)
00109 {
00110     return edgeInterpolationScheme<Type>::interpolate
00111     (
00112         vf,
00113         vf.mesh().edgeInterpolation::weights()
00114     );
00115 }
00116 
00117 
00118 template<class Type>
00119 tmp<GeometricField<Type, faPatchField, edgeMesh> >
00120 linearEdgeInterpolate
00121 (
00122     const tmp<GeometricField<Type, faPatchField, areaMesh> >& tvf
00123 )
00124 {
00125     tmp<GeometricField<Type, faPatchField, edgeMesh> > tinterp = 
00126         linearEdgeInterpolate(tvf());
00127     tvf.clear();
00128     return tinterp;
00129 }
00130 
00131 
00132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00133 
00134 } // End namespace Foam
00135 
00136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00137 
00138 #endif
00139 
00140 // ************************************************************************* //
For further information go to www.openfoam.org