Loading...
Searching...
No Matches
ithacaInterpolator.H
1/*---------------------------------------------------------------------------*\
2 ██╗████████╗██╗ ██╗ █████╗ ██████╗ █████╗ ███████╗██╗ ██╗
3 ██║╚══██╔══╝██║ ██║██╔══██╗██╔════╝██╔══██╗ ██╔════╝██║ ██║
4 ██║ ██║ ███████║███████║██║ ███████║█████╗█████╗ ██║ ██║
5 ██║ ██║ ██╔══██║██╔══██║██║ ██╔══██║╚════╝██╔══╝ ╚██╗ ██╔╝
6 ██║ ██║ ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ╚████╔╝
7 ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═══╝
8
9 * In real Time Highly Advanced Computational Applications for Finite Volumes
10 * Copyright (C) 2017 by the ITHACA-FV authors
11-------------------------------------------------------------------------------
12
13License
14 This file is part of ITHACA-FV
15
16 ITHACA-FV is free software: you can redistribute it and/or modify
17 it under the terms of the GNU Lesser General Public License as published by
18 the Free Software Foundation, either version 3 of the License, or
19 (at your option) any later version.
20
21 ITHACA-FV is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 GNU Lesser General Public License for more details.
25
26 You should have received a copy of the GNU Lesser General Public License
27 along with ITHACA-FV. If not, see <http://www.gnu.org/licenses/>.
28
29Class
30 ithacaInterpolator Declaration
31Description
32 Radial Basis Function Interpolator interface class that wraps different RBF packages.
33Source files
34 ithacaInterpolator.C
35\*---------------------------------------------------------------------------*/
36
37#ifndef ithacaInterpolator_H
38#define ithacaInterpolator_H
39
40#include <Eigen/Core>
41#include <memory>
42#include <string>
43#include "dictionary.H"
44
45// Forward declarations
46class mtbGPR;
47class mtbRBF;
48class splinterRBF;
49
50class ithacaInterpolator
51{
52public:
53 // Constructor from OpenFOAM dictionary
54 ithacaInterpolator(const Foam::dictionary& dict);
55
56 // Destructor
57 ~ithacaInterpolator();
58
59 // Fit function
60 void fit(const Eigen::MatrixXd& X, const Eigen::VectorXd& y);
61
62 // Predict function
63 double predict(const Eigen::VectorXd& x);
64
65 // Predict for multiple points
66 Eigen::VectorXd predict(const Eigen::MatrixXd& X);
67
68 // Print model information
69 void printInfo() const;
70
71private:
72 std::unique_ptr<mtbGPR> mtbGPR_;
73 std::unique_ptr<mtbRBF> mtb_;
74 std::unique_ptr<splinterRBF> splinter_;
75 std::string algorithm_;
76 std::string package_;
77};
78
79#endif