version 3.8
Dumux::Spline< Scalar, numSamples > Class Template Reference

A 3rd order polynomial spline. More...

#include <dumux/common/spline.hh>

Inheritance diagram for Dumux::Spline< Scalar, numSamples >:

Description

template<class Scalar, int numSamples = 2>
class Dumux::Spline< Scalar, numSamples >

This class implements a spline \(s(x)\) for which, given \(n\) sampling points \(x_1, \dots, x_n\), the following conditions hold

\begin{align*} s(x_i) & = y_i \quad \forall i \in \{1, \dots, n \}\\ s'(x_1) & = m_1 \\ s'(x_n) & = m_n \end{align*}

for any given boundary slopes \(m_1\) and \(m_n\). Alternatively, natural splines are supported which are defined by

\begin{align*} s(x_i) & = y_i \quad \forall i \in \{1, \dots, n \} \\ s''(x_1) & = 0 \\ s''(x_n) & = 0 \end{align*}

Public Member Functions

 Spline ()
 Default constructor for a spline. More...
 
template<class ScalarArray >
 Spline (const ScalarArray &x, const ScalarArray &y)
 Convenience constructor for a full spline. More...
 
template<class PointArray >
 Spline (const PointArray &points)
 Convenience constructor for a full spline. More...
 
template<class ScalarArray >
 Spline (const ScalarArray &x, const ScalarArray &y, Scalar m0, Scalar m1)
 Convenience constructor for a full spline. More...
 
template<class PointArray >
 Spline (const PointArray &points, Scalar m0, Scalar m1)
 Convenience constructor for a full spline. More...
 

Constructor & Destructor Documentation

◆ Spline() [1/5]

template<class Scalar , int numSamples = 2>
Dumux::Spline< Scalar, numSamples >::Spline ( )
inline

To specify the actual curve, use one of the set() methods.

◆ Spline() [2/5]

template<class Scalar , int numSamples = 2>
template<class ScalarArray >
Dumux::Spline< Scalar, numSamples >::Spline ( const ScalarArray &  x,
const ScalarArray &  y 
)
inline
Parameters
xAn array containing the \(x\) values of the spline's sampling points
yAn array containing the \(y\) values of the spline's sampling points

◆ Spline() [3/5]

template<class Scalar , int numSamples = 2>
template<class PointArray >
Dumux::Spline< Scalar, numSamples >::Spline ( const PointArray &  points)
inline
Parameters
pointsAn array of \((x,y)\) tuples of the spline's sampling points

◆ Spline() [4/5]

template<class Scalar , int numSamples = 2>
template<class ScalarArray >
Dumux::Spline< Scalar, numSamples >::Spline ( const ScalarArray &  x,
const ScalarArray &  y,
Scalar  m0,
Scalar  m1 
)
inline
Parameters
xAn array containing the \(x\) values of the spline's sampling points
yAn array containing the \(y\) values of the spline's sampling points
m0The slope of the spline at \(x_0\)
m1The slope of the spline at \(x_n\)

◆ Spline() [5/5]

template<class Scalar , int numSamples = 2>
template<class PointArray >
Dumux::Spline< Scalar, numSamples >::Spline ( const PointArray &  points,
Scalar  m0,
Scalar  m1 
)
inline
Parameters
pointsAn array of \((x,y)\) tuples of the spline's sampling points
m0The slope of the spline at \(x_0\)
m1The slope of the spline at \(x_n\)

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