3.6-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Dumux::Spline< Scalar, 2 > Class Template Reference

Spline for two sampling points. More...

#include <dumux/common/spline.hh>

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

Description

template<class Scalar>
class Dumux::Spline< Scalar, 2 >

Spline for two sampling points.

For this type of spline there is no natural spline.

Public Member Functions

 Spline ()
 
template<class ScalarArrayX , class ScalarArrayY >
 Spline (const ScalarArrayX &x, const ScalarArrayY &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...
 
 Spline (Scalar x0, Scalar x1, Scalar y0, Scalar y1, Scalar m0, Scalar m1)
 Convenience constructor for a full spline. More...
 
int numSamples () const
 Returns the number of sampling points. More...
 
void set (Scalar x0, Scalar x1, Scalar y0, Scalar y1, Scalar m0, Scalar m1)
 Set the sampling points and the boundary slopes of the spline. More...
 
template<class ScalarContainer >
void setXYArrays (int nSamples, const ScalarContainer &x, const ScalarContainer &y, Scalar m0, Scalar m1)
 Set the sampling points and the boundary slopes of the spline. More...
 
template<class ScalarContainerX , class ScalarContainerY >
void setXYContainers (const ScalarContainerX &x, const ScalarContainerY &y, Scalar m0, Scalar m1)
 Set the sampling points and the boundary slopes of the spline. More...
 
template<class PointArray >
void setArrayOfPoints (int nSamples, const PointArray &points, Scalar m0, Scalar m1)
 Set the sampling points and the boundary slopes of the spline. More...
 
template<class PointContainer >
void setContainerOfPoints (const PointContainer &points, Scalar m0, Scalar m1)
 Set the sampling points and the boundary slopes from an STL-like container of points. More...
 
template<class TupleContainer >
void setContainerOfTuples (const TupleContainer &tuples, Scalar m0, Scalar m1)
 Set the sampling points and the boundary slopes from an STL-like container of tuples. More...
 

Protected Member Functions

void assignXY_ (Scalar x0, Scalar x1, Scalar y0, Scalar y1)
 
Scalar x_ (int i) const
 Returns the x coordinate of the i-th sampling point. More...
 
Scalar y_ (int i) const
 Returns the y coordinate of the i-th sampling point. More...
 
Scalar moment_ (int i) const
 Returns the moment (i.e. second derivative) of the spline at the i-th sampling point. More...
 

Protected Attributes

Vector xPos_
 
Vector yPos_
 
Vector m_
 

Constructor & Destructor Documentation

◆ Spline() [1/4]

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

◆ Spline() [2/4]

template<class Scalar >
template<class ScalarArrayX , class ScalarArrayY >
Dumux::Spline< Scalar, 2 >::Spline ( const ScalarArrayX &  x,
const ScalarArrayY &  y,
Scalar  m0,
Scalar  m1 
)
inline

Convenience constructor for a full spline.

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() [3/4]

template<class Scalar >
template<class PointArray >
Dumux::Spline< Scalar, 2 >::Spline ( const PointArray &  points,
Scalar  m0,
Scalar  m1 
)
inline

Convenience constructor for a full spline.

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\)

◆ Spline() [4/4]

template<class Scalar >
Dumux::Spline< Scalar, 2 >::Spline ( Scalar  x0,
Scalar  x1,
Scalar  y0,
Scalar  y1,
Scalar  m0,
Scalar  m1 
)
inline

Convenience constructor for a full spline.

Parameters
x0The \(x\) value of the first sampling point
x1The \(x\) value of the second sampling point
y0The \(y\) value of the first sampling point
y1The \(y\) value of the second sampling point
m0The slope of the spline at \(x_0\)
m1The slope of the spline at \(x_n\)

Member Function Documentation

◆ assignXY_()

template<class Scalar >
void Dumux::Spline< Scalar, 2 >::assignXY_ ( Scalar  x0,
Scalar  x1,
Scalar  y0,
Scalar  y1 
)
inlineprotected

◆ moment_()

template<class Scalar >
Scalar Dumux::Spline< Scalar, 2 >::moment_ ( int  i) const
inlineprotected

Returns the moment (i.e. second derivative) of the spline at the i-th sampling point.

◆ numSamples()

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

Returns the number of sampling points.

◆ set()

template<class Scalar >
void Dumux::Spline< Scalar, 2 >::set ( Scalar  x0,
Scalar  x1,
Scalar  y0,
Scalar  y1,
Scalar  m0,
Scalar  m1 
)
inline

Set the sampling points and the boundary slopes of the spline.

Parameters
x0The \(x\) value of the first sampling point
x1The \(x\) value of the second sampling point
y0The \(y\) value of the first sampling point
y1The \(y\) value of the second sampling point
m0The slope of the spline at \(x_0\)
m1The slope of the spline at \(x_1\)

◆ setArrayOfPoints()

template<class Scalar >
template<class PointArray >
void Dumux::Spline< Scalar, 2 >::setArrayOfPoints ( int  nSamples,
const PointArray &  points,
Scalar  m0,
Scalar  m1 
)
inline

Set the sampling points and the boundary slopes of the spline.

Parameters
nSamplesThe number of sampling points (must be >= 2)
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_1\)

◆ setContainerOfPoints()

template<class Scalar >
template<class PointContainer >
void Dumux::Spline< Scalar, 2 >::setContainerOfPoints ( const PointContainer &  points,
Scalar  m0,
Scalar  m1 
)
inline

Set the sampling points and the boundary slopes from an STL-like container of points.

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_1\)

◆ setContainerOfTuples()

template<class Scalar >
template<class TupleContainer >
void Dumux::Spline< Scalar, 2 >::setContainerOfTuples ( const TupleContainer &  tuples,
Scalar  m0,
Scalar  m1 
)
inline

Set the sampling points and the boundary slopes from an STL-like container of tuples.

Parameters
tuplesAn 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_1\)

◆ setXYArrays()

template<class Scalar >
template<class ScalarContainer >
void Dumux::Spline< Scalar, 2 >::setXYArrays ( int  nSamples,
const ScalarContainer &  x,
const ScalarContainer &  y,
Scalar  m0,
Scalar  m1 
)
inline

Set the sampling points and the boundary slopes of the spline.

Parameters
nSamplesThe number of sampling points (must be >= 2)
xAn array containing the \(x\) values of the sampling points
yAn array containing the \(y\) values of the sampling points
m0The slope of the spline at \(x_0\)
m1The slope of the spline at \(x_1\)

◆ setXYContainers()

template<class Scalar >
template<class ScalarContainerX , class ScalarContainerY >
void Dumux::Spline< Scalar, 2 >::setXYContainers ( const ScalarContainerX &  x,
const ScalarContainerY &  y,
Scalar  m0,
Scalar  m1 
)
inline

Set the sampling points and the boundary slopes of the spline.

Parameters
xAn array containing the \(x\) values of the sampling points
yAn array containing the \(y\) values of the sampling points
m0The slope of the spline at \(x_0\)
m1The slope of the spline at \(x_1\)

◆ x_()

template<class Scalar >
Scalar Dumux::Spline< Scalar, 2 >::x_ ( int  i) const
inlineprotected

Returns the x coordinate of the i-th sampling point.

◆ y_()

template<class Scalar >
Scalar Dumux::Spline< Scalar, 2 >::y_ ( int  i) const
inlineprotected

Returns the y coordinate of the i-th sampling point.

Member Data Documentation

◆ m_

template<class Scalar >
Vector Dumux::Spline< Scalar, 2 >::m_
protected

◆ xPos_

template<class Scalar >
Vector Dumux::Spline< Scalar, 2 >::xPos_
protected

◆ yPos_

template<class Scalar >
Vector Dumux::Spline< Scalar, 2 >::yPos_
protected

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