preCICE v3.1.1
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
precice::math::Bspline Class Reference

#include <Bspline.hpp>

Public Member Functions

 Bspline (Eigen::VectorXd ts, const Eigen::MatrixXd &xs, int splineDegree)
 Initialises the B-Spline interpolation with the given data (x0,t0), (x1,t1), ..., (xn,tn) and computes the knots and control points. The code for computing the knots and the control points is copied from Eigens bspline interpolation with minor modifications, https://gitlab.com/libeigen/eigen/-/blob/master/unsupported/Eigen/src/Splines/SplineFitting.h.
 
Eigen::VectorXd interpolateAt (double t) const
 Samples the B-Spline interpolation.
 

Private Attributes

Eigen::VectorXd _knots
 
Eigen::MatrixXd _ctrls
 
double _tsMin
 
double _tsMax
 
int _ndofs
 

Detailed Description

Definition at line 6 of file Bspline.hpp.

Constructor & Destructor Documentation

◆ Bspline()

precice::math::Bspline::Bspline ( Eigen::VectorXd ts,
const Eigen::MatrixXd & xs,
int splineDegree )

Initialises the B-Spline interpolation with the given data (x0,t0), (x1,t1), ..., (xn,tn) and computes the knots and control points. The code for computing the knots and the control points is copied from Eigens bspline interpolation with minor modifications, https://gitlab.com/libeigen/eigen/-/blob/master/unsupported/Eigen/src/Splines/SplineFitting.h.

Parameters
tsthe timestamps which must be sorted from lowest to highest and contain at least 2 samples.
xsthe data to be interpolated. It has to contain at least two samples.
splineDegreethe used spline degree, which has to be larger than 0

Definition at line 14 of file Bspline.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ interpolateAt()

Eigen::VectorXd precice::math::Bspline::interpolateAt ( double t) const

Samples the B-Spline interpolation.

Parameters
tmust be within [_tsMin; _tsMax].
Returns
the inteprolant x(t) if t does not equal any of the timestamps in ts. If t equals any of the timestamps in ts the corresponding value to t is returned.

Definition at line 58 of file Bspline.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ _ctrls

Eigen::MatrixXd precice::math::Bspline::_ctrls
private

Definition at line 31 of file Bspline.hpp.

◆ _knots

Eigen::VectorXd precice::math::Bspline::_knots
private

Definition at line 30 of file Bspline.hpp.

◆ _ndofs

int precice::math::Bspline::_ndofs
private

Definition at line 34 of file Bspline.hpp.

◆ _tsMax

double precice::math::Bspline::_tsMax
private

Definition at line 33 of file Bspline.hpp.

◆ _tsMin

double precice::math::Bspline::_tsMin
private

Definition at line 32 of file Bspline.hpp.


The documentation for this class was generated from the following files: