OpenFOAM logo
Open Source CFD Toolkit

volPointInterpolation.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     volPointInterpolation
00027 
00028 Description
00029 
00030 SourceFiles
00031     volPointInterpolation.C
00032     volPointInterpolate.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef volPointInterpolation_H
00037 #define volPointInterpolation_H
00038 
00039 #include "primitiveFieldsFwd.H"
00040 #include "volFieldsFwd.H"
00041 #include "pointFieldsFwd.H"
00042 #include "scalarList.H"
00043 #include "tmp.H"
00044 #include "className.H"
00045 #include "FieldFields.H"
00046 #include "primitivePatchInterpolation.H"
00047 
00048 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00049 
00050 namespace Foam
00051 {
00052 
00053 class fvMesh;
00054 class pointMesh;
00055 
00056 /*---------------------------------------------------------------------------*\
00057                        Class volPointInterpolation Declaration
00058 \*---------------------------------------------------------------------------*/
00059 
00060 class volPointInterpolation
00061 {
00062     // Private data
00063 
00064         const fvMesh& fvMesh_;
00065         const pointMesh& pointMesh_;
00066 
00067         //- Interpolation scheme weighting factor array.
00068         mutable FieldField<Field, scalar>* pointWeightsPtr_;
00069 
00070         //- Primitive patch interpolators
00071         mutable PtrList<primitivePatchInterpolation>* patchInterpolatorsPtr_;
00072 
00073         //- List of points that will be corrected
00074         mutable labelList* boundaryPointsPtr_;
00075 
00076         //- Weights
00077         mutable FieldField<Field, scalar>* pointBoundaryWeightsPtr_;
00078 
00079 
00080     // Private member functions
00081 
00082         //- Return patch interpolators
00083         const PtrList<primitivePatchInterpolation>& patchInterpolators() const;
00084 
00085         //- Construct point weighting factors
00086         void makeWeights() const;
00087 
00088         //- Construct boundary point addressing
00089         void makeBoundaryAddressing() const;
00090 
00091         //- Construct boundary point weighting factors
00092         void makeBoundaryWeights() const;
00093 
00094         //- Clear addressing
00095         void clearAddressing() const;
00096 
00097         //- Clear geometry
00098         void clearGeom() const;
00099 
00100 
00101 protected:
00102 
00103         const fvMesh& vMesh() const
00104         {
00105             return fvMesh_;
00106         }
00107 
00108         const pointMesh& pMesh() const
00109         {
00110             return pointMesh_;
00111         }
00112 
00113 
00114 public:
00115 
00116     // Declare name of the class and it's debug switch
00117     ClassName("volPointInterpolation");
00118 
00119 
00120     // Constructors
00121 
00122         //- Constructor given fvMesh and pointMesh.
00123         volPointInterpolation(const fvMesh&, const pointMesh&);
00124 
00125 
00126     // Destructor
00127 
00128         ~volPointInterpolation();
00129 
00130 
00131     // Member functions
00132 
00133         // Access
00134 
00135             //- Return reference to weights arrays.
00136             //  This also constructs the weighting factors if neccessary.
00137             const FieldField<Field, scalar>& pointWeights() const;
00138 
00139             //- Return list of points to correct
00140             const labelList& boundaryPoints() const;
00141 
00142             //- Return reference to boundary weights arrays.
00143             const FieldField<Field, scalar>& pointBoundaryWeights() const;
00144 
00145 
00146         // Edit
00147 
00148             //- Update mesh topology using the morph engine
00149             void updateMesh();
00150 
00151             //- Correct weighting factors for moving mesh.
00152             bool movePoints();
00153 
00154 
00155     // Interpolation functions
00156 
00157         //- Interpolate from volField to pointField
00158         //  using inverse distance weighting
00159         template<class Type>
00160         void interpolate
00161         (
00162             const GeometricField<Type, fvPatchField, volMesh>&,
00163             GeometricField<Type, pointPatchField, pointMesh>&
00164         ) const;
00165 
00166         //- Interpolate volField returning pointField
00167         //  using inverse distance weighting
00168         template<class Type>
00169         tmp<GeometricField<Type, pointPatchField, pointMesh> > interpolate
00170         (
00171             const GeometricField<Type, fvPatchField, volMesh>&
00172         ) const;
00173 
00174         //- Interpolate tmp<volField> returning pointField
00175         //  using inverse distance weighting
00176         template<class Type>
00177         tmp<GeometricField<Type, pointPatchField, pointMesh> > interpolate
00178         (
00179             const tmp<GeometricField<Type, fvPatchField, volMesh> >&
00180         ) const;
00181 };
00182 
00183 
00184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00185 
00186 } // End namespace Foam
00187 
00188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00189 
00190 #ifdef NoRepository
00191 #   include "volPointInterpolate.C"
00192 #endif
00193 
00194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00195 
00196 #endif
00197 
00198 // ************************************************************************* //
For further information go to www.openfoam.org