Public Member Functions | Private Attributes | Friends | List of all members
ecl::TensionFunction Class Reference

Representation of a tension function. More...

#include <tension_function.hpp>

Inheritance diagram for ecl::TensionFunction:
Inheritance graph
[legend]

Public Member Functions

double dderivative (const double &tau, const double &x) const
 Generates the 2nd derivative for a certain tension at the specified point. More...
 
double derivative (const double &tau, const double &x) const
 Generates the derivative for a certain tension at the specified point. More...
 
double operator() (const double &tau, const double &x) const
 Calculates the value for a certain tension at the specified point. More...
 
 TensionFunction ()
 Default constructor. More...
 
template<typename Derived >
 TensionFunction (const BluePrint< Derived > &blueprint)
 Blueprint constructor. More...
 
virtual ~TensionFunction ()
 
- Public Member Functions inherited from ecl::BluePrintFactory< TensionFunction >
virtual ~BluePrintFactory ()
 

Private Attributes

double x_0
 
double x_f
 
double y_0
 
double y_f
 
double z_0
 
double z_f
 

Friends

class blueprints::TensionSecondDerivativeInterpolation
 
template<typename OutputStream >
OutputStream & operator<< (OutputStream &ostream, const TensionFunction &function)
 Streaming output insertion operator for tension functions. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ecl::BluePrintFactory< TensionFunction >
static blueprints::TensionSecondDerivativeInterpolation Interpolation (const double x_i, const double y_i, const double yddot_i, const double x_f, const double y_f, const double yddot_f)
 Blueprint for interpolating a tension function between two end points using second derivatives. More...
 

Detailed Description

Representation of a tension function.

This is a hyperbolic function often used in spline interpolations that parameterises the 'tension' of a curve interpolation between points. At low tension it behaves like a cubic polynomial, while at high tension, it tends towards a piecewise smooth series of linear functions.

Theoretical Notes:

Tension functions are derived from the following constraints on an interval [x_i, x_i+1]:

f'''' - tau^2 f'' = 0
f(x_i)     = y_i
f(x_i+1)   = y_i+1
f''(x_i)   = z_i
f''(x_i+1) = z_i+1

This yields a C2 continuous function with hyperbolic terms (not a polynomial) that ranges from looking like a cubic interpolation at low tensions (tau -> 0) and a linearly blended interpolation at high tensions.

Definition at line 110 of file tension_function.hpp.

Constructor & Destructor Documentation

◆ TensionFunction() [1/2]

ecl::TensionFunction::TensionFunction ( )
inline

Default constructor.

Don't really need this, but things like vectors and array containers need it so they can reserve the appropriate storage.

Definition at line 121 of file tension_function.hpp.

◆ ~TensionFunction()

virtual ecl::TensionFunction::~TensionFunction ( )
inlinevirtual

Definition at line 122 of file tension_function.hpp.

◆ TensionFunction() [2/2]

template<typename Derived >
ecl::TensionFunction::TensionFunction ( const BluePrint< Derived > &  blueprint)
inline

Blueprint constructor.

Constructor that allows automatic generation from an existing blueprint. This can be used simply in the following manner for any static element belonging to the BluePrintFactory.

Since this is not explicit, it will also allow assignment.

f = TensionFunction::Interpolation(2.0,0.0,0.0,3.0,1.0,0.0);

This will emit a compile time failure if the template argument does not conform to the blueprints concept (refer to ecl_concepts' documentation).

Parameters
blueprint: the blue print to use to generate this instance.
See also
ecl::utilities::BluePrintFactory<TensionFunction>.

Definition at line 146 of file tension_function.hpp.

Member Function Documentation

◆ dderivative()

double ecl::TensionFunction::dderivative ( const double &  tau,
const double &  x 
) const

Generates the 2nd derivative for a certain tension at the specified point.

Calculates the value of the 2nd derivative for a certain tension at the specified point.

Parameters
tau: the tension parameter.
x: the point at which you wish to calculate the value for.
Returns
double : the value of the 2nd derivative at x for tension tau.

Definition at line 37 of file lib/tension_function.cpp.

◆ derivative()

double ecl::TensionFunction::derivative ( const double &  tau,
const double &  x 
) const

Generates the derivative for a certain tension at the specified point.

Calculates the value of the derivative for a certain tension at the specified point.

Parameters
tau: the tension parameter.
x: the point at which you wish to calculate the value for.
Returns
double : the value of the derivative at x for tension tau.

Definition at line 26 of file lib/tension_function.cpp.

◆ operator()()

double ecl::TensionFunction::operator() ( const double &  tau,
const double &  x 
) const

Calculates the value for a certain tension at the specified point.

Calculates the value for a certain tension at the specified point.

Parameters
tau: the tension parameter.
x: the point at which you wish to calculate the value for.
Returns
double : the value of the function at x for tension tau.

Definition at line 45 of file lib/tension_function.cpp.

Friends And Related Function Documentation

◆ blueprints::TensionSecondDerivativeInterpolation

Definition at line 195 of file tension_function.hpp.

◆ operator<<

template<typename OutputStream >
OutputStream& operator<< ( OutputStream &  ostream,
const TensionFunction function 
)
friend

Streaming output insertion operator for tension functions.

Streaming output insertion operator for tension functions.

Template Parameters
OutputStream: the type of stream being used.
Parameters
ostream: the output stream being used.
function: the tension function.
Returns
OutputStream : the output stream.

Definition at line 223 of file tension_function.hpp.

Member Data Documentation

◆ x_0

double ecl::TensionFunction::x_0
private

Definition at line 203 of file tension_function.hpp.

◆ x_f

double ecl::TensionFunction::x_f
private

Definition at line 203 of file tension_function.hpp.

◆ y_0

double ecl::TensionFunction::y_0
private

Definition at line 204 of file tension_function.hpp.

◆ y_f

double ecl::TensionFunction::y_f
private

Definition at line 204 of file tension_function.hpp.

◆ z_0

double ecl::TensionFunction::z_0
private

Definition at line 202 of file tension_function.hpp.

◆ z_f

double ecl::TensionFunction::z_f
private

Definition at line 202 of file tension_function.hpp.


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


ecl_geometry
Author(s): Daniel Stonier
autogenerated on Mon Feb 28 2022 22:18:49