ENH: patchCloud: return pTraits<Type>::max for unfound points
[OpenFOAM-1.7.x.git] / src / finiteVolume / interpolation / volPointInterpolation / volPointInterpolation.H
blobe204ca6f52867c3521f4c2b3028530b2ae15f331
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
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
13     the Free Software Foundation, either version 3 of the License, or
14     (at your 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, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::volPointInterpolation
27 Description
28     Foam::volPointInterpolation
30 SourceFiles
31     volPointInterpolation.C
32     volPointInterpolate.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef volPointInterpolation_H
37 #define volPointInterpolation_H
39 #include "MeshObject.H"
40 #include "pointPatchInterpolation.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace Foam
47 class fvMesh;
48 class pointMesh;
50 /*---------------------------------------------------------------------------*\
51                        Class volPointInterpolation Declaration
52 \*---------------------------------------------------------------------------*/
54 class volPointInterpolation
56     public MeshObject<fvMesh, volPointInterpolation>
58     // Private data
60         //- Boundary interpolation engine.
61         pointPatchInterpolation boundaryInterpolator_;
63         //- Interpolation scheme weighting factor array.
64         scalarListList pointWeights_;
67     // Private member functions
69         //- Construct point weighting factors
70         void makeWeights();
72         //- Disallow default bitwise copy construct
73         volPointInterpolation(const volPointInterpolation&);
75         //- Disallow default bitwise assignment
76         void operator=(const volPointInterpolation&);
79 public:
81     // Declare name of the class and its debug switch
82     ClassName("volPointInterpolation");
85     // Constructors
87         //- Constructor given fvMesh and pointMesh.
88         explicit volPointInterpolation(const fvMesh&);
91     // Destructor
93         ~volPointInterpolation();
96     // Member functions
98         // Access
100             const fvMesh& mesh() const
101             {
102                 return boundaryInterpolator_.mesh();
103             }
106         // Edit
108             //- Update mesh topology using the morph engine
109             void updateMesh();
111             //- Correct weighting factors for moving mesh.
112             bool movePoints();
115     // Interpolation functions
117         //- Interpolate internal field from volField to pointField
118         //  using inverse distance weighting
119         template<class Type>
120         void interpolateInternalField
121         (
122             const GeometricField<Type, fvPatchField, volMesh>&,
123             GeometricField<Type, pointPatchField, pointMesh>&
124         ) const;
126         //- Interpolate from volField to pointField
127         //  using inverse distance weighting
128         template<class Type>
129         void interpolate
130         (
131             const GeometricField<Type, fvPatchField, volMesh>&,
132             GeometricField<Type, pointPatchField, pointMesh>&
133         ) const;
135         //- Interpolate volField using inverse distance weighting
136         //  returning pointField with the same patchField types
137         template<class Type>
138         tmp<GeometricField<Type, pointPatchField, pointMesh> > interpolate
139         (
140             const GeometricField<Type, fvPatchField, volMesh>&,
141             const wordList& patchFieldTypes
142         ) const;
144         //- Interpolate tmp<volField> using inverse distance weighting
145         //  returning pointField with the same patchField types
146         template<class Type>
147         tmp<GeometricField<Type, pointPatchField, pointMesh> > interpolate
148         (
149             const tmp<GeometricField<Type, fvPatchField, volMesh> >&,
150             const wordList& patchFieldTypes
151         ) const;
153         //- Interpolate volField using inverse distance weighting 
154         //  returning pointField
155         template<class Type>
156         tmp<GeometricField<Type, pointPatchField, pointMesh> > interpolate
157         (
158             const GeometricField<Type, fvPatchField, volMesh>&
159         ) const;
161         //- Interpolate tmp<volField> using inverse distance weighting 
162         //  returning pointField
163         template<class Type>
164         tmp<GeometricField<Type, pointPatchField, pointMesh> > interpolate
165         (
166             const tmp<GeometricField<Type, fvPatchField, volMesh> >&
167         ) const;
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 } // End namespace Foam
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 #ifdef NoRepository
178 #   include "volPointInterpolate.C"
179 #endif
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 #endif
185 // ************************************************************************* //