OpenFOAM logo
Open Source CFD Toolkit

edgeCorrectedVolPointInterpolation.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     edgeCorrectedVolPointInterpolation
00027 
00028 Description
00029     Volume-to-point interpolation class which introduces the
00030     correction for the points shared between the patches.  This is
00031     done by gradient-based extrapolation into the vertices from the
00032     boundary faces around them using inverse-distance weighting.  This
00033     kind of interpolation is useful when trying to use the volume
00034     field as a basis of the mesh motion.
00035 
00036 SourceFiles
00037     edgeCorrectedVolPointInterpolation.C
00038     edgeCorrectedVolPointInterpolate.C
00039 
00040 \*---------------------------------------------------------------------------*/
00041 
00042 #ifndef edgeCorrectedVolPointInterpolation_H
00043 #define edgeCorrectedVolPointInterpolation_H
00044 
00045 #include "volPointInterpolation.H"
00046 
00047 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00048 
00049 namespace Foam
00050 {
00051 
00052 /*---------------------------------------------------------------------------*\
00053               Class edgeCorrectedVolPointInterpolation Declaration
00054 \*---------------------------------------------------------------------------*/
00055 
00056 class edgeCorrectedVolPointInterpolation
00057 :
00058     public volPointInterpolation
00059 {
00060     // Private data
00061 
00062         //- Extrapolation vectors
00063         mutable FieldField<Field, vector>* extrapolationVectorsPtr_;
00064 
00065 
00066     // Private Member Functions
00067 
00068         //- Disallow default bitwise copy construct
00069         edgeCorrectedVolPointInterpolation
00070         (
00071             const edgeCorrectedVolPointInterpolation&
00072         );
00073 
00074         //- Disallow default bitwise assignment
00075         void operator=(const edgeCorrectedVolPointInterpolation&);
00076 
00077 
00078         //- Construct weighting factor array on demand.
00079         void makeExtrapolationWeights() const;
00080 
00081         //- Return extrapolation vectors
00082         const FieldField<Field, vector>& extrapolationVectors() const;
00083 
00084 
00085 public:
00086 
00087     // Constructors
00088 
00089         //- Constructor given fvMesh and pointMesh.
00090         edgeCorrectedVolPointInterpolation(const fvMesh&, const pointMesh&);
00091 
00092 
00093     // Destructor
00094 
00095         virtual ~edgeCorrectedVolPointInterpolation();
00096 
00097 
00098     // Member Functions
00099 
00100         //- Correct weighting factors for moving mesh.
00101         virtual bool movePoints();
00102 
00103 
00104     // Interpolation functions
00105 
00106         //- Interpolate from volField to pointField
00107         //  using inverse distance weighting with boundary correction
00108         //  given the field and its gradient
00109         template<class Type>
00110         void interpolate
00111         (
00112             const GeometricField<Type, fvPatchField, volMesh>&,
00113             const GeometricField
00114             <
00115                 typename outerProduct<vector, Type>::type,
00116                 fvPatchField,
00117                 volMesh
00118             >&,
00119             GeometricField<Type, pointPatchField, pointMesh>&
00120         ) const;
00121 
00122         //- Interpolate volField returning pointField
00123         //  using inverse distance weighting with boundary correction
00124         //  given the field and its gradient
00125         template<class Type>
00126         tmp<GeometricField<Type, pointPatchField, pointMesh> > interpolate
00127         (
00128             const GeometricField<Type, fvPatchField, volMesh>&,
00129             const GeometricField
00130             <
00131                 typename outerProduct<vector, Type>::type,
00132                 fvPatchField,
00133                 volMesh
00134             >&
00135         ) const;
00136 
00137         //- Interpolate tmp<volField> returning pointField
00138         //  using inverse distance weighting with boundary correction
00139         //  given the field and its gradient
00140         template<class Type>
00141         tmp<GeometricField<Type, pointPatchField, pointMesh> > interpolate
00142         (
00143             const tmp<GeometricField<Type, fvPatchField, volMesh> >&,
00144             const GeometricField
00145             <
00146                 typename outerProduct<vector, Type>::type,
00147                 fvPatchField,
00148                 volMesh
00149             >&
00150         ) const;
00151 
00152         template<class Type>
00153         tmp<GeometricField<Type, pointPatchField, pointMesh> > interpolate
00154         (
00155             const GeometricField<Type, fvPatchField, volMesh>&,
00156             const tmp<GeometricField
00157             <
00158                 typename outerProduct<vector, Type>::type,
00159                 fvPatchField,
00160                 volMesh
00161             > >&
00162         ) const;
00163 
00164         template<class Type>
00165         tmp<GeometricField<Type, pointPatchField, pointMesh> > interpolate
00166         (
00167             const tmp<GeometricField<Type, fvPatchField, volMesh> >&,
00168             const tmp<GeometricField
00169             <
00170                 typename outerProduct<vector, Type>::type,
00171                 fvPatchField,
00172                 volMesh
00173             > >&
00174         ) const;
00175 };
00176 
00177 
00178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00179 
00180 } // End namespace Foam
00181 
00182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00183 
00184 #include "edgeCorrectedVolPointInterpolate.C"
00185 
00186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00187 
00188 #endif
00189 
00190 // ************************************************************************* //
For further information go to www.openfoam.org