16 #include <deal.II/base/point.h> 17 #include <deal.II/base/function_cspline.h> 19 #ifdef DEAL_II_WITH_GSL 23 DEAL_II_NAMESPACE_OPEN
29 const std::vector<double> &y_)
31 interpolation_points(x_),
32 interpolation_values(y_)
45 acc = gsl_interp_accel_alloc ();
47 cspline = gsl_spline_alloc (gsl_interp_cspline, n);
57 gsl_interp_accel_free (acc);
58 gsl_spline_free (cspline);
68 const unsigned int)
const 75 const double &x = p[0];
76 Assert (x >= interpolation_points.front() && x <= interpolation_points.back(),
77 ExcCSplineRange(x,interpolation_points.front(),interpolation_points.back()));
79 return gsl_spline_eval (cspline, x, acc);
87 const unsigned int)
const 94 const double &x = p[0];
95 Assert (x >= interpolation_points.front() && x <= interpolation_points.back(),
96 ExcCSplineRange(x,interpolation_points.front(),interpolation_points.back()));
98 const double deriv = gsl_spline_eval_deriv (cspline, x, acc);
109 const unsigned int)
const 116 const double &x = p[0];
117 Assert (x >= interpolation_points.front() && x <= interpolation_points.back(),
118 ExcCSplineRange(x,interpolation_points.front(),interpolation_points.back()));
120 return gsl_spline_eval_deriv2 (cspline, x, acc);
128 const unsigned int)
const 131 res[0][0] = laplacian(p);
143 return sizeof (*this) + 2*
sizeof(double)*interpolation_values.size();
148 template class CSpline<1>;
152 DEAL_II_NAMESPACE_CLOSE
virtual SymmetricTensor< 2, dim > hessian(const Point< dim > &p, const unsigned int component=0) const
virtual double laplacian(const Point< dim > &p, const unsigned int component=0) const
#define AssertThrow(cond, exc)
virtual Tensor< 1, dim > gradient(const Point< dim > &p, const unsigned int component=0) const
static ::ExceptionBase & ExcCSplineEmpty(int arg1)
#define Assert(cond, exc)
virtual double value(const Point< dim > &point, const unsigned int component=0) const
const std::vector< double > interpolation_points
static ::ExceptionBase & ExcCSplineOrder(int arg1, double arg2, double arg3)
const std::vector< double > interpolation_values
static ::ExceptionBase & ExcCSplineRange(double arg1, double arg2, double arg3)
static ::ExceptionBase & ExcCSplineSizeMismatch(int arg1, int arg2)
CSpline(const std::vector< double > &interpolation_points, const std::vector< double > &interpolation_values)