SplineSurf Class ReferenceΒΆ

Splines: Splines::SplineSurf Class Reference
Splines
Splines::SplineSurf Class Referenceabstract

#include <Splines.hh>

Inheritance diagram for Splines::SplineSurf:
Splines::BiCubicSplineBase Splines::BiQuinticSplineBase Splines::BilinearSpline Splines::Akima2Dspline Splines::BiCubicSpline Splines::BiQuinticSpline

Public Member Functions

 SplineSurf (string const &name="Spline")
 
virtual ~SplineSurf ()
 
void clear ()
 
virtual void write_to_stream (ostream_type &s) const =0
 
virtual char const * type_name () const =0
 
virtual string info () const
 
void info (ostream_type &stream) const
 
void dump_data (ostream_type &s) const
 
Open/Close
bool is_x_closed () const
 
void make_x_closed ()
 
void make_x_opened ()
 
bool is_y_closed () const
 
void make_y_closed ()
 
void make_y_opened ()
 
bool is_x_bounded () const
 
void make_x_unbounded ()
 
void make_x_bounded ()
 
bool is_y_bounded () const
 
void make_y_unbounded ()
 
void make_y_bounded ()
 
Info
string const & name () const
 
integer num_point_x () const
 
integer num_point_y () const
 
real_type x_node (integer i) const
 
real_type y_node (integer i) const
 
real_type z_node (integer i, integer j) const
 
real_type x_min () const
 
real_type x_max () const
 
real_type y_min () const
 
real_type y_max () const
 
real_type z_min () const
 
real_type z_max () const
 
Build Spline
void build (real_type const x[], integer incx, real_type const y[], integer incy, real_type const z[], integer ldZ, integer nx, integer ny, bool fortran_storage=false, bool transposed=false)
 
void build (vector< real_type > const &x, vector< real_type > const &y, vector< real_type > const &z, bool fortran_storage=false, bool transposed=false)
 
void build (real_type const z[], integer ldZ, integer nx, integer ny, bool fortran_storage=false, bool transposed=false)
 
void build (vector< real_type > const &z, integer nx, integer ny, bool fortran_storage=false, bool transposed=false)
 
void setup (GenericContainer const &gc)
 
void build (GenericContainer const &gc)
 
Evaluate
virtual real_type eval (real_type x, real_type y) const =0
 
virtual void D (real_type x, real_type y, real_type d[3]) const =0
 
virtual real_type Dx (real_type x, real_type y) const =0
 
virtual real_type Dy (real_type x, real_type y) const =0
 
virtual void DD (real_type x, real_type y, real_type dd[6]) const =0
 
virtual real_type Dxx (real_type x, real_type y) const =0
 
virtual real_type Dxy (real_type x, real_type y) const =0
 
virtual real_type Dyy (real_type x, real_type y) const =0
 
real_type operator() (real_type x, real_type y) const
 
real_type eval_D_1 (real_type x, real_type y) const
 
real_type eval_D_2 (real_type x, real_type y) const
 
real_type eval_D_1_1 (real_type x, real_type y) const
 
real_type eval_D_1_2 (real_type x, real_type y) const
 
real_type eval_D_2_2 (real_type x, real_type y) const
 

Detailed Description

Spline Management Class

Constructor & Destructor Documentation

◆ SplineSurf()

Splines::SplineSurf::SplineSurf ( string const & name = "Spline")
inline

Spline constructor

◆ ~SplineSurf()

virtual Splines::SplineSurf::~SplineSurf ( )
virtual

Spline destructor

Member Function Documentation

◆ build() [1/5]

void Splines::SplineSurf::build ( GenericContainer const & gc)
inline

Build a spline using data in GenericContainer

◆ build() [2/5]

void Splines::SplineSurf::build ( real_type const x[],
integer incx,
real_type const y[],
integer incy,
real_type const z[],
integer ldZ,
integer nx,
integer ny,
bool fortran_storage = false,
bool transposed = false )

Build surface spline

Parameters
xvector of x-coordinates
incxaccess elements as x[0], x[incx], x[2*incx],...
yvector of y-coordinates
incyaccess elements as y[0], y[incy], y[2*incy],...
zmatrix of z-values. Elements are stored by row Z(i,j) = z[i*ny+j] as C-matrix
ldZleading dimension of z
nxnumber of points in x direction
nynumber of points in y direction
fortran_storageif true elements are stored by column i.e. Z(i,j) = z[i+j*nx] as Fortran-matrix
transposedif true matrix Z is stored transposed

Build a spline surface with data

  • x the vector of x-nodes (size nx)
  • y the vector of y-nodes (size ny)
  • z the matrix of z-values, \( z_{ij} = f(x_i,y_j) \)
+----------+
| | internally data is stored by column
index j ny zij | zij = data[ i*ny + j ]
| |
+--- nx ---+
index i
  • fortran_storage is true if matrix z is stored by column
  • transposed is true means that data are stored transposed

◆ build() [3/5]

void Splines::SplineSurf::build ( real_type const z[],
integer ldZ,
integer nx,
integer ny,
bool fortran_storage = false,
bool transposed = false )

Build a spline surface with data

  • z the matrix of z-values, \( z_{ij} = f(x_i,y_j) \)
  • ldZ leading dimension of matriz z
  • nx number of nodes in x-direction
  • ny number of nodes in y-direction

nodes are equispaced in x and y directions.

+----------+
| | internally data is stored by column
index j ny zij | zij = data[ i*ny + j ]
| |
+--- nx ---+
index i
  • fortran_storage is true if matrix z is stored by column
  • transposed is true means that data are stored transposed

◆ build() [4/5]

void Splines::SplineSurf::build ( vector< real_type > const & x,
vector< real_type > const & y,
vector< real_type > const & z,
bool fortran_storage = false,
bool transposed = false )
inline

Build surface spline

Parameters
xvector of x-coordinates, nx = x.size()
yvector of y-coordinates, ny = y.size()
zmatrix of z-values. Elements are stored by row Z(i,j) = z[i*ny+j] as C-matrix
fortran_storageif true elements are stored by column i.e. Z(i,j) = z[i+j*nx] as Fortran-matrix
transposedif true matrix Z is stored transposed

◆ build() [5/5]

void Splines::SplineSurf::build ( vector< real_type > const & z,
integer nx,
integer ny,
bool fortran_storage = false,
bool transposed = false )
inline

Build surface spline

Parameters
zmatrix of z-values. Elements are stored by row Z(i,j) = z[i*ny+j] as C-matrix. ldZ leading dimension of the matrix is ny for C-storage and nx for Fortran storage.
nxx-dimension
nyy-dimension
fortran_storageif true elements are stored by column i.e. Z(i,j) = z[i+j*nx] as Fortran-matrix
transposedif true matrix Z is stored transposed

◆ clear()

void Splines::SplineSurf::clear ( )

Cancel the support points, empty the spline.

◆ D()

virtual void Splines::SplineSurf::D ( real_type x,
real_type y,
real_type d[3] ) const
pure virtual

Value and first derivatives at point \( (x,y) \):

  • d[0] value of the spline \( S(x,y) \)
  • d[1] derivative respect to \( x \) of the spline: \( S_x(x,y) \)
  • d[2] derivative respect to \( y \) of the spline: \( S_y(x,y) \)

Implemented in Splines::BiCubicSplineBase, Splines::BilinearSpline, and Splines::BiQuinticSplineBase.

◆ DD()

virtual void Splines::SplineSurf::DD ( real_type x,
real_type y,
real_type dd[6] ) const
pure virtual

Value, first and second derivatives at point \( (x,y) \):

  • dd[0] value of the spline \( S(x,y) \)
  • dd[1] derivative respect to \( x \) of the spline: \( S_x(x,y) \)
  • dd[2] derivative respect to \( y \) of the spline: \( S_y(x,y) \)
  • dd[3] second derivative respect to \( x \) of the spline: \( S_{xx}(x,y) \)
  • dd[4] mixed second derivative: \( S_{xy}(x,y) \)
  • dd[5] second derivative respect to \( y \) of the spline: \( S_{yy}(x,y) \)

Implemented in Splines::BiCubicSplineBase, Splines::BilinearSpline, and Splines::BiQuinticSplineBase.

◆ dump_data()

void Splines::SplineSurf::dump_data ( ostream_type & s) const

Print stored data x, y, and matrix z.

◆ Dx()

virtual real_type Splines::SplineSurf::Dx ( real_type x,
real_type y ) const
pure virtual

First derivatives respect to \( x \) at point \( (x,y) \) of the spline: \( S_x(x,y) \).

Implemented in Splines::BiCubicSplineBase, Splines::BilinearSpline, and Splines::BiQuinticSplineBase.

◆ Dxx()

virtual real_type Splines::SplineSurf::Dxx ( real_type x,
real_type y ) const
pure virtual

Second derivatives respect to \( x \) at point \( (x,y) \) of the spline: \( S_{xx}(x,y) \).

Implemented in Splines::BiCubicSplineBase, Splines::BilinearSpline, and Splines::BiQuinticSplineBase.

◆ Dxy()

virtual real_type Splines::SplineSurf::Dxy ( real_type x,
real_type y ) const
pure virtual

Mixed second derivatives: \( S_{xy}(x,y) \).

Implemented in Splines::BiCubicSplineBase, Splines::BilinearSpline, and Splines::BiQuinticSplineBase.

◆ Dy()

virtual real_type Splines::SplineSurf::Dy ( real_type x,
real_type y ) const
pure virtual

First derivatives respect to \( y \) at point \( (x,y) \) of the spline: \( S_y(x,y) \).

Implemented in Splines::BiCubicSplineBase, Splines::BilinearSpline, and Splines::BiQuinticSplineBase.

◆ Dyy()

virtual real_type Splines::SplineSurf::Dyy ( real_type x,
real_type y ) const
pure virtual

Second derivatives respect to \( y \) at point \( (x,y) \) of the spline: \( S_{yy}(x,y) \).

Implemented in Splines::BiCubicSplineBase, Splines::BilinearSpline, and Splines::BiQuinticSplineBase.

◆ eval()

virtual real_type Splines::SplineSurf::eval ( real_type x,
real_type y ) const
pure virtual

Evaluate spline value at point \( (x,y) \).

Implemented in Splines::BiCubicSplineBase, Splines::BilinearSpline, and Splines::BiQuinticSplineBase.

◆ eval_D_1()

real_type Splines::SplineSurf::eval_D_1 ( real_type x,
real_type y ) const
inline

Alias for Dx(x,y)

◆ eval_D_1_1()

real_type Splines::SplineSurf::eval_D_1_1 ( real_type x,
real_type y ) const
inline

Alias for Dxx(x,y)

◆ eval_D_1_2()

real_type Splines::SplineSurf::eval_D_1_2 ( real_type x,
real_type y ) const
inline

Alias for Dxy(x,y)

◆ eval_D_2()

real_type Splines::SplineSurf::eval_D_2 ( real_type x,
real_type y ) const
inline

Alias for Dy(x,y)

◆ eval_D_2_2()

real_type Splines::SplineSurf::eval_D_2_2 ( real_type x,
real_type y ) const
inline

Alias for Dyy(x,y)

◆ info() [1/2]

virtual string Splines::SplineSurf::info ( ) const
virtual

String information of the kind and order of the spline

◆ info() [2/2]

void Splines::SplineSurf::info ( ostream_type & stream) const
inline

Print information of the kind and order of the spline

◆ is_x_bounded()

bool Splines::SplineSurf::is_x_bounded ( ) const
inline

Return true if the parameter x assumed bounded. If false the spline is estrapolated for x values outside the range.

◆ is_x_closed()

bool Splines::SplineSurf::is_x_closed ( ) const
inline

Return true if the surface is assumed closed in the x direction.

◆ is_y_bounded()

bool Splines::SplineSurf::is_y_bounded ( ) const
inline

Return true if the parameter y assumed bounded. If false the spline is extrapolated for y values outside the range.

◆ is_y_closed()

bool Splines::SplineSurf::is_y_closed ( ) const
inline

Return true if the surface is assumed closed in the y direction.

◆ make_x_bounded()

void Splines::SplineSurf::make_x_bounded ( )
inline

Make the spline surface bounded in the x direction.

◆ make_x_closed()

void Splines::SplineSurf::make_x_closed ( )
inline

Setup the surface as closed in the x direction.

◆ make_x_opened()

void Splines::SplineSurf::make_x_opened ( )
inline

Setup the surface as open in the x direction.

◆ make_x_unbounded()

void Splines::SplineSurf::make_x_unbounded ( )
inline

Make the spline surface unbounded in the x direction.

◆ make_y_bounded()

void Splines::SplineSurf::make_y_bounded ( )
inline

Make the spline surface bounded in the x direction.

◆ make_y_closed()

void Splines::SplineSurf::make_y_closed ( )
inline

Setup the surface as closed in the y direction.

◆ make_y_opened()

void Splines::SplineSurf::make_y_opened ( )
inline

Setup the surface as open in the y direction.

◆ make_y_unbounded()

void Splines::SplineSurf::make_y_unbounded ( )
inline

Make the spline surface unbounded in the y direction

◆ name()

string const & Splines::SplineSurf::name ( ) const
inline
Returns
string with the name of the spline

◆ num_point_x()

integer Splines::SplineSurf::num_point_x ( ) const
inline

Return the number of support points of the spline along x direction.

◆ num_point_y()

integer Splines::SplineSurf::num_point_y ( ) const
inline

Return the number of support points of the spline along y direction.

◆ operator()()

real_type Splines::SplineSurf::operator() ( real_type x,
real_type y ) const
inline

Evaluate spline value at point \( (x,y) \).

◆ setup()

void Splines::SplineSurf::setup ( GenericContainer const & gc)

Build spline using data in gc

Setup a spline surface using a GenericContainer

  • gc("fortran_storage") if true zdata is stored by column, otherwise by rows
  • gc("transposed") if true zdata is stored transposed
  • gc("xdata") vector of mesh point in x direction
  • gc("ydata") vector of mesh point in y direction
  • gc("zdata") may be
    • matrix of size nx x ny (ny x nx if data is transposed)
    • vector of size nx x ny stiring the data.
  • nx number of nodes in x-direction the size of vector in x direction
  • ny number of nodes in y-direction the size of vector in y direction

nodes are equispaced in x and y directions.

+----------+
| | internally data is stored by column
index j ny zij | zij = data[ i*ny + j ]
| |
+--- nx ---+
index i
  • fortran_storage is true if matrix z is stored by column
  • transposed is true means that data are stored transposed

◆ type_name()

virtual char const * Splines::SplineSurf::type_name ( ) const
pure virtual

Return spline type as a string pointer.

Implemented in Splines::Akima2Dspline, Splines::BiCubicSpline, Splines::BilinearSpline, and Splines::BiQuinticSpline.

◆ write_to_stream()

virtual void Splines::SplineSurf::write_to_stream ( ostream_type & s) const
pure virtual

◆ x_max()

real_type Splines::SplineSurf::x_max ( ) const
inline

Return x-maximum spline value.

◆ x_min()

real_type Splines::SplineSurf::x_min ( ) const
inline

Return x-minumum spline value.

◆ x_node()

real_type Splines::SplineSurf::x_node ( integer i) const
inline

Return the i-th node of the spline (x component).

◆ y_max()

real_type Splines::SplineSurf::y_max ( ) const
inline

Return y-maximum spline value.

◆ y_min()

real_type Splines::SplineSurf::y_min ( ) const
inline

Return y-minumum spline value.

◆ y_node()

real_type Splines::SplineSurf::y_node ( integer i) const
inline

Return the i-th node of the spline (y component).

◆ z_max()

real_type Splines::SplineSurf::z_max ( ) const
inline

Return z-maximum spline value.

◆ z_min()

real_type Splines::SplineSurf::z_min ( ) const
inline

Return z-minumum spline value.

◆ z_node()

real_type Splines::SplineSurf::z_node ( integer i,
integer j ) const
inline

Return the i-th node of the spline (y component).


The documentation for this class was generated from the following files:
  • /Users/enrico/Ricerca/develop/PINS/pins-mechatronix/LibSources/submodules/Splines/src/Splines.hh
  • /Users/enrico/Ricerca/develop/PINS/pins-mechatronix/LibSources/submodules/Splines/src/SplinesBivariate.cc