Fix tutorials: typo in tutorials/viscoelastic/viscoelasticFluidFoam/S-MDCPP/constant...
[OpenFOAM-1.6-ext.git] / src / finiteVolume / interpolation / pointVolInterpolation / pointVolInterpolation.H
blob01cde91e6225efd9f8d94fa4afb6000986e8ea4b
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM 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 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     pointVolInterpolation
28 Description
30 SourceFiles
31     pointVolInterpolation.C
32     pointVolInterpolate.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef pointVolInterpolation_H
37 #define pointVolInterpolation_H
39 #include "primitiveFieldsFwd.H"
40 #include "primitivePatchInterpolation.H"
41 #include "volFieldsFwd.H"
42 #include "pointFieldsFwd.H"
43 #include "scalarList.H"
44 #include "tmp.H"
45 #include "className.H"
46 #include "FieldFields.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 namespace Foam
53 class fvMesh;
54 class pointMesh;
56 /*---------------------------------------------------------------------------*\
57                       Class pointVolInterpolation Declaration
58 \*---------------------------------------------------------------------------*/
60 class pointVolInterpolation
62     // Private data
64         const pointMesh& pointMesh_;
65         const fvMesh& fvMesh_;
67         //- Interpolation scheme weighting factor array.
68         mutable FieldField<Field, scalar>* volWeightsPtr_;
70         //- Primitive patch interpolators
71         mutable PtrList<primitivePatchInterpolation>* patchInterpolatorsPtr_;
74     // Private member functions
76         //- Return patch interpolators
77         const PtrList<primitivePatchInterpolation>& patchInterpolators() const;
79         //- Construct point weighting factors
80         void makeWeights() const;
82         //- Clear addressing
83         void clearAddressing() const;
85         //- Clear geometry
86         void clearGeom() const;
89 protected:
91         const pointMesh& pMesh() const
92         {
93             return pointMesh_;
94         }
96         const fvMesh& vMesh() const
97         {
98             return fvMesh_;
99         }
102 public:
104     // Declare name of the class and it's debug switch
105     ClassName("pointVolInterpolation");
108     // Constructors
110         //- Constructor given pointMesh and fvMesh.
111         pointVolInterpolation(const pointMesh&, const fvMesh&);
114     // Destructor
116         ~pointVolInterpolation();
119     // Member functions
121         // Access
123             //- Return reference to weights arrays.
124             //  This also constructs the weighting factors if neccessary.
125             const FieldField<Field, scalar>& volWeights() const;
128         // Edit
130             //- Update mesh topology using the morph engine
131             void updateTopology();
133             //- Correct weighting factors for moving mesh.
134             bool movePoints();
137     // Interpolation functions
139         //- Interpolate from pointField to volField
140         //  using inverse distance weighting
141         template<class Type>
142         void interpolate
143         (
144             const GeometricField<Type, pointPatchField, pointMesh>&,
145             GeometricField<Type, fvPatchField, volMesh>&
146         ) const;
148         //- Interpolate pointField returning volField
149         //  using inverse distance weighting
150         template<class Type>
151         tmp<GeometricField<Type, fvPatchField, volMesh> > interpolate
152         (
153             const GeometricField<Type, pointPatchField, pointMesh>&
154         ) const;
156         //- Interpolate tmp<pointField> returning volField
157         //  using inverse distance weighting
158         template<class Type>
159         tmp<GeometricField<Type, fvPatchField, volMesh> > interpolate
160         (
161             const tmp<GeometricField<Type, pointPatchField, pointMesh> >&
162         ) const;
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 } // End namespace Foam
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 #ifdef NoRepository
173 #   include "pointVolInterpolate.C"
174 #endif
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 #endif
180 // ************************************************************************* //