1 /*---------------------------------------------------------------------------*\
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 -------------------------------------------------------------------------------
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/>.
28 Radial basis function interpolation class
31 Interpolation class which uses Radial Basis Functions to interpolate
32 field from given data points to arbitrary set of points.
34 The coefficient vectors, alpha and beta are determined by solving
37 | db | = | Mbb Pb | | alpha |
38 | 0 | | Pb 0 | | beta |
40 where db are the given field values at data carrier points.
41 Mbb the boundary RBF correlation matrix (NbxNb), containing RBF evaluations
42 at the boundary nodes, and Pb some linear polynomial matrix (Nbx4).
44 In cases where far field data is not of interest, a cutoff function
45 is used to eliminate unnecessary data points in the far field
48 Frank Bos, TU Delft. All rights reserved.
49 Dubravko Matijasevic, FSB Zagreb.
50 Reorganisation by Hrvoje Jasak, Wikki Ltd.
54 RBFInterpolationTemplates.C
56 \*---------------------------------------------------------------------------*/
58 #ifndef RBFInterpolation_H
59 #define RBFInterpolation_H
61 #include "dictionary.H"
62 #include "RBFFunction.H"
65 #include "simpleMatrix.H"
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72 /*---------------------------------------------------------------------------*\
73 Class RBFInterpolation Declaration
74 \*---------------------------------------------------------------------------*/
76 class RBFInterpolation
80 //- Reference to control points
81 const vectorField& controlPoints_;
83 //- Reference to all points
84 const vectorField& dataPoints_;
87 autoPtr<RBFFunction> RBF_;
89 //- Interpolation matrix
90 mutable scalarSquareMatrix* BPtr_;
92 //- Focal point for cut-off radii
95 //- Inner cut-off radius
98 //- Outer cut-off radius
101 //- Add polynomials to RBF matrix
105 // Private Member Functions
107 //- Disallow default bitwise assignment
108 void operator=(const RBFInterpolation&);
111 //- Return interpolation matrix
112 const scalarSquareMatrix& B() const;
114 //- Calculate interpolation matrix
125 //- Construct from components
128 const dictionary& dict,
129 const vectorField& controlPoints,
130 const vectorField& dataPoints
133 //- Construct as copy
134 RBFInterpolation(const RBFInterpolation&);
144 //- Return reference to control points
145 const vectorField& controlPoints() const
147 return controlPoints_;
150 //- Reference to all points
151 const vectorField& dataPoints() const
158 tmp<Field<Type> > interpolate(const Field<Type>& ctrlField) const;
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 } // End namespace Foam
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 # include "RBFInterpolationTemplates.C"
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 // ************************************************************************* //