Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / src / finiteVolume / interpolation / pointVolInterpolation / pointVolInterpolation.H
blobfe2f1aaf7045a8ea03221d6692f3348ca31e6c00
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation, either version 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     pointVolInterpolation
27 Description
29 SourceFiles
30     pointVolInterpolation.C
31     pointVolInterpolate.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef pointVolInterpolation_H
36 #define pointVolInterpolation_H
38 #include "primitiveFieldsFwd.H"
39 #include "primitivePatchInterpolation.H"
40 #include "volFieldsFwd.H"
41 #include "pointFieldsFwd.H"
42 #include "scalarList.H"
43 #include "tmp.H"
44 #include "className.H"
45 #include "FieldFields.H"
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 namespace Foam
52 class fvMesh;
53 class pointMesh;
55 /*---------------------------------------------------------------------------*\
56                       Class pointVolInterpolation Declaration
57 \*---------------------------------------------------------------------------*/
59 class pointVolInterpolation
61     // Private data
63         const pointMesh& pointMesh_;
64         const fvMesh& fvMesh_;
66         //- Interpolation scheme weighting factor array.
67         mutable FieldField<Field, scalar>* volWeightsPtr_;
69         //- Primitive patch interpolators
70         mutable PtrList<primitivePatchInterpolation>* patchInterpolatorsPtr_;
73     // Private member functions
75         //- Return patch interpolators
76         const PtrList<primitivePatchInterpolation>& patchInterpolators() const;
78         //- Construct point weighting factors
79         void makeWeights() const;
81         //- Clear addressing
82         void clearAddressing() const;
84         //- Clear geometry
85         void clearGeom() const;
88 protected:
90         const pointMesh& pMesh() const
91         {
92             return pointMesh_;
93         }
95         const fvMesh& vMesh() const
96         {
97             return fvMesh_;
98         }
101 public:
103     // Declare name of the class and it's debug switch
104     ClassName("pointVolInterpolation");
107     // Constructors
109         //- Constructor given pointMesh and fvMesh.
110         pointVolInterpolation(const pointMesh&, const fvMesh&);
113     // Destructor
115         ~pointVolInterpolation();
118     // Member functions
120         // Access
122             //- Return reference to weights arrays.
123             //  This also constructs the weighting factors if neccessary.
124             const FieldField<Field, scalar>& volWeights() const;
127         // Edit
129             //- Update mesh topology using the morph engine
130             void updateTopology();
132             //- Correct weighting factors for moving mesh.
133             bool movePoints();
136     // Interpolation functions
138         //- Interpolate from pointField to volField
139         //  using inverse distance weighting
140         template<class Type>
141         void interpolate
142         (
143             const GeometricField<Type, pointPatchField, pointMesh>&,
144             GeometricField<Type, fvPatchField, volMesh>&
145         ) const;
147         //- Interpolate pointField returning volField
148         //  using inverse distance weighting
149         template<class Type>
150         tmp<GeometricField<Type, fvPatchField, volMesh> > interpolate
151         (
152             const GeometricField<Type, pointPatchField, pointMesh>&
153         ) const;
155         //- Interpolate tmp<pointField> returning volField
156         //  using inverse distance weighting
157         template<class Type>
158         tmp<GeometricField<Type, fvPatchField, volMesh> > interpolate
159         (
160             const tmp<GeometricField<Type, pointPatchField, pointMesh> >&
161         ) const;
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 } // End namespace Foam
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 #ifdef NoRepository
172 #   include "pointVolInterpolate.C"
173 #endif
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 #endif
179 // ************************************************************************* //