16 #ifndef __H2D_SPLINE_H
17 #define __H2D_SPLINE_H
25 class HERMES_API
CubicSpline :
public Hermes::Hermes1DFunction < double >
29 CubicSpline(std::vector<double> points, std::vector<double> values,
30 double bc_left,
double bc_right,
31 bool first_der_left =
true,
bool first_der_right =
true,
32 bool extend_der_left =
true,
bool extend_der_right =
true);
42 void calculate_coeffs();
45 double value(
double x)
const;
48 Hermes::Ord
value(Hermes::Ord x)
const {
return Hermes::Ord(3); };
51 double derivative(
double x)
const;
54 Hermes::Ord
derivative(Hermes::Ord x)
const {
return Hermes::Ord(2); };
62 void plot(
const char* filename,
double extension,
bool plot_derivative =
false,
int subdiv = 50)
const;
67 bool find_interval(
double x_in,
int& m)
const;
70 double extrapolate_value(
double point_end,
double value_end,
double derivative_end,
double x_in)
const;
94 double point_right, value_right, derivative_right;
100 double get_derivative_from_interval(
double x_in,
int m)
const;
103 double get_value_from_interval(
double x_in,
int m)
const;
std::vector< double > points
Grid points, ordered.
Hermes::Ord value(Hermes::Ord x) const
One-dimensional function integration order.
std::vector< SplineCoeff > coeffs
A set of four coefficients a, b, c, d for an elementary cubic spline.
Common definitions for Hermes2D.
double point_left
Values and derivatives at end points for extrapolation purposes.
bool extrapolate_der_left
double bc_left
Boundary conditions.
Hermes::Ord derivative(Hermes::Ord x) const
One-dimensional function derivative integration order.
std::vector< double > values
Values at the grid points.