1 #include "rbf_interpolation.h" 2 #include <eigen/Eigen/Dense> 3 #include <eigen/Eigen/LU> 5 #include "ROL_StdVector.hpp" 8 namespace ProperOrthogonalDecomposition {
11 : data_coordinates(data_coordinates)
12 , data_values(data_values)
24 for(
unsigned int i = 0 ; i < N ; i++){
25 for(
unsigned int j = i ; j < N ; j++){
37 if(
kernel ==
"thin_plate_spline"){
39 return std::pow(r, 2) * std::log(r);
45 else if(
kernel ==
"cubic"){
46 return std::pow(r, 3);
48 else if(
kernel ==
"linear"){
52 return std::pow(r, 2) * std::log(r);
61 for(
unsigned int i = 0 ; i < N ; i++){
72 ROL::Ptr<const vector> xp = getVector<ROL::StdVector<double>>(x);
73 RowVectorXd evaluate_coordinate(2);
74 evaluate_coordinate(0) = (*xp)[0];
75 evaluate_coordinate(1) = (*xp)[1];
76 double val =
evaluate(evaluate_coordinate);
79 return -std::abs(val);
double evaluate(const RowVectorXd &evaluate_coordinate) const
Evaluate RBF.
Files for the baseline physics.
const MatrixXd data_coordinates
Data coordinates.
const VectorXd data_values
Data values.
RBFInterpolation(const MatrixXd &data_coordinates, const VectorXd &data_values, std::string kernel)
Constructor.
double radialBasisFunction(double r) const
Choose radial basis function.
void computeWeights()
Compute RBF interpolation weights.
real1 norm(const dealii::Tensor< 1, dim, real1 > x)
Returns norm of dealii::Tensor<1,dim,real>
const std::string kernel
RBF kernel.
double value(const ROL::Vector< double > &x, double &)
ROL evaluate value.
VectorXd weights
RBF weights.