1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
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
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
29 Radial basis function interpolation class
32 Interpolation class which uses Radial Basis Functions to interpolate the
33 fluid displacements for given boundary displacements.
35 The coefficient vectors, alpha and beta are determined by solving
38 | db | = | Mbb Pb | | alpha |
39 | 0 | | Pb 0 | | beta |
41 where db are the given boundary displacements,
42 Mbb the boundary RBF correlation matrix (NbxNb), containing RBF evaluations
43 at the boundary nodes, and Pb some linear polynomial matrix (Nbx4).
45 Those coefficients are calculated every timestep, with the current
46 boundary displacements db, with the inverse of Mbb. Using those
47 coefficients, the RBF is evaluated at all fluid points every
50 The efficiency of this method is increased by:
51 1) using control points which is a subset of the moving
52 boundary points. Those control points are selected by
53 a coarsening function.
54 2) The outer boundary points are neglected since a cutoff function
55 is used toward the outer boundaries.
58 Frank Bos, TU Delft. All rights reserved.
59 Dubravko Matijasevic, FSB Zagreb.
63 RBFInterpolationTemplates.C
65 \*---------------------------------------------------------------------------*/
67 #ifndef RBFInterpolation_H
68 #define RBFInterpolation_H
70 #include "dictionary.H"
71 #include "RBFFunction.H"
74 #include "simpleMatrix.H"
76 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
81 /*---------------------------------------------------------------------------*\
82 Class RBFInterpolation Declaration
83 \*---------------------------------------------------------------------------*/
85 class RBFInterpolation
90 const dictionary& dict_;
92 //- Reference to control points
93 const vectorField& controlPoints_;
95 //- Rerefence to all points
96 const vectorField& allPoints_;
99 autoPtr<RBFFunction> RBF_;
101 //- Interpolation matrix
102 mutable scalarSquareMatrix* BPtr_;
104 //- Focal point for cut-off radii
107 //- Inner cut-off radius
110 //- Outer cut-off radius
113 //- Add polynomials to RBF matrix
117 // Private Member Functions
119 //- Disallow default bitwise assignment
120 void operator=(const RBFInterpolation&);
123 //- Return interpolation matrix
124 const scalarSquareMatrix& B() const;
126 //- Calculate interpolation matrix
137 //- Construct from components
140 const dictionary& dict,
141 const vectorField& controlPoints,
142 const vectorField& allPoints
145 //- Construct as copy
146 RBFInterpolation(const RBFInterpolation&);
158 tmp<Field<Type> > interpolate(const Field<Type>& ctrlField) const;
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 } // End namespace Foam
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 # include "RBFInterpolationTemplates.C"
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 // ************************************************************************* //