STORMM Source Documentation
Loading...
Searching...
No Matches
stormm::structure::TricubicCell< T > Class Template Reference

One element of a three-dimensional, space-filling tile representing a three-dimensional function to be interpolated by a tricubic spline. More...

#include <tricubic_cell.h>

Public Member Functions

getCoefficient (int i, int j, int k) const
 Retrieve one of the 64 coefficients Aijk for the tricubic spline.
 
std::vector< T > getCoefficients () const
 Get a Standard Template Library vector containing all coefficients in the element. The order of coefficients is given in Fortran order: for the term Aijk x^i y^j z^k, the ith coefficient varies the most rapidly and the index for Aijk is given by (((k * 4) + j) * 4 + i.
 
void setCoefficient (T value, int i, int j, int k)
 Set one of the 64 coefficients Aijk for the tricubic spline. Parameter descriptions follow from above, with the addition of:
 
getData (FunctionLevel kind, int i, int j, int k) const
 Get one of the data points from the boundary. Parameter descriptions follow from above, with the addition of:
 
void setData (T value, FunctionLevel kind, int i, int j, int k)
 Set one of the data items. Parameter descriptions follow from above.
 
getCellOrigin (CartesianDimension dim) const
 Get the cell origin along one dimension.
 
getCellLength (CartesianDimension dim) const
 Get the cell length along one dimension.
 
void fractionalPosition (T x, T y, T z, T *a_frac, T *b_frac, T *c_frac, ExceptionResponse policy=ExceptionResponse::SILENT, const char *caller=nullptr) const
 Get the fractional position of a point in Cartesian coordinates within a mesh cell. This includes a check on whether the point is actually within the mesh cell.
 
evaluate (T x, T y, T z) const
 Evaluate the function at a specific point in space. This will take into account the grid cell's origin and lengths to determine where in the grid cell the point of interest lies. If the point is outside the grid cell, produce an error.
 
template<typename T3>
T3 derivative (T x, T y, T z) const
 Evaluate the first derivatives of a tricubic mesh element at a point and return the results along Cartesian axes. Descriptions of input parameters follow from the evaluate() member function above.
 
 TricubicCell ()
 The constructor can take nothing and simply initialize all values to zero, or accept the tricubic weights matrix, a dimensions array, and details of the potential function.
 
 TricubicCell (const TricubicStencil weights_matrix, const std::vector< double > &bounds, const std::vector< T > &f_in, const std::vector< T > &dx_in, const std::vector< T > &dy_in, const std::vector< T > &dz_in, const std::vector< T > &dxx_in, const std::vector< T > &dxy_in, const std::vector< T > &dxz_in, const std::vector< T > &dyy_in, const std::vector< T > &dyz_in, const std::vector< T > &dxxx_in, const std::vector< T > &dxxy_in, const std::vector< T > &dxxz_in, const std::vector< T > &dxyy_in, const std::vector< T > &dxyz_in)
 
 TricubicCell (const TricubicStencil weights_matrix, const std::vector< double > &bounds, const std::vector< T > &f_in, const std::vector< T > &dx_in, const std::vector< T > &dy_in, const std::vector< T > &dz_in, const std::vector< T > &dxy_in, const std::vector< T > &dxz_in, const std::vector< T > &dyz_in, const std::vector< T > &dxyz_in)
 
void secondDerivative (T x, T y, T z, T *result) const
 Evaluate the second derivatives of a tricubic mesh element at a point and return the results along Cartesian axes. Descriptions of input parameters follow from the evaluate() member function above, with the addition of:
 
void secondDerivative (T x, T y, T z, std::vector< T > *result) const
 
std::vector< T > secondDerivative (T x, T y, T z) const
 
void thirdDerivative (T x, T y, T z, T *result) const
 Evaluate the second derivatives of a tricubic mesh element at a point and return the results along Cartesian axes. Descriptions of input parameters follow from the evaluate() member function above, with the addition of:
 
void thirdDerivative (T x, T y, T z, std::vector< T > *result) const
 
std::vector< T > thirdDerivative (T x, T y, T z) const
 

Detailed Description

template<typename T>
class stormm::structure::TricubicCell< T >

One element of a three-dimensional, space-filling tile representing a three-dimensional function to be interpolated by a tricubic spline.

Constructor & Destructor Documentation

◆ TricubicCell()

template<typename T>
stormm::stmath::TricubicCell< T >::TricubicCell ( )

The constructor can take nothing and simply initialize all values to zero, or accept the tricubic weights matrix, a dimensions array, and details of the potential function.

Parameters
weights_matrixThe inverse matrix of polynomial weights obtained from getTricubicMatrix() in this library
boundsArray containing the Cartesian x, y, and z coordinates of the grid cell origin plus its lengths along each axis (the grid cell is NOT required to be orthorhombic). This array can have four entries (in which case the final entry is assumed to be the isotropic length parameter), six (for anisotropic cells), or twelve entries, in which case the last nine represent the column matrix of cell vectors.

Member Function Documentation

◆ evaluate()

template<typename T>
T stormm::stmath::TricubicCell< T >::evaluate ( T x,
T y,
T z ) const

Evaluate the function at a specific point in space. This will take into account the grid cell's origin and lengths to determine where in the grid cell the point of interest lies. If the point is outside the grid cell, produce an error.

Parameters
xCartesian X location of the point
yCartesian Y location of the point
zCartesian Z location of the point

◆ fractionalPosition()

template<typename T>
void stormm::stmath::TricubicCell< T >::fractionalPosition ( T x,
T y,
T z,
T * a_frac,
T * b_frac,
T * c_frac,
ExceptionResponse policy = ExceptionResponse::SILENT,
const char * caller = nullptr ) const

Get the fractional position of a point in Cartesian coordinates within a mesh cell. This includes a check on whether the point is actually within the mesh cell.

Parameters
xCartesian X coordinate
yCartesian Y coordinate
zCartesian Z coordinate
a_fracFractional coordinate along the mesh element's a axis, evaluated and returned
b_fracFractional coordinate along the mesh element's b axis, evaluated and returned
c_fracFractional coordinate along the mesh element's c axis, evaluated and returned
policyIndicate the course of action if the point lies outside the mesh element
callerName of the calling function

◆ getCellLength()

template<typename T>
T stormm::stmath::TricubicCell< T >::getCellLength ( CartesianDimension dim) const

Get the cell length along one dimension.

Parameters
dimThe Cartesian dimension along which to return the cell length

◆ getCellOrigin()

template<typename T>
T stormm::stmath::TricubicCell< T >::getCellOrigin ( CartesianDimension dim) const

Get the cell origin along one dimension.

Parameters
dimThe Cartesian dimension along which to return the origin coordinate

◆ getCoefficient()

template<typename T>
T stormm::stmath::TricubicCell< T >::getCoefficient ( int i,
int j,
int k ) const

Retrieve one of the 64 coefficients Aijk for the tricubic spline.

Parameters
iThe ith coefficient relevant to the notation Aijk
jThe jth coefficient relevant to the notation Aijk
kThe kth coefficient relevant to the notation Aijk

◆ getData()

template<typename T>
T stormm::stmath::TricubicCell< T >::getData ( FunctionLevel kind,
int i,
int j,
int k ) const

Get one of the data points from the boundary. Parameter descriptions follow from above, with the addition of:

Parameters
kindThe classification of the boundary condition as a derivative (or value)

◆ secondDerivative()

template<typename T>
void stormm::stmath::TricubicCell< T >::secondDerivative ( T x,
T y,
T z,
T * result ) const

Evaluate the second derivatives of a tricubic mesh element at a point and return the results along Cartesian axes. Descriptions of input parameters follow from the evaluate() member function above, with the addition of:

Overloaded:

  • Use a pre-allocated space to hold the results (provided as a C-style array or Standard Template Library vector)
  • Produce a Standard Template Library vector holding the results (of trusted length 9)
Parameters
resultPre-allocated space to hold the output

◆ setCoefficient()

template<typename T>
void stormm::stmath::TricubicCell< T >::setCoefficient ( T value,
int i,
int j,
int k )

Set one of the 64 coefficients Aijk for the tricubic spline. Parameter descriptions follow from above, with the addition of:

Parameters
valueThe value to apply

◆ thirdDerivative()

template<typename T>
void stormm::stmath::TricubicCell< T >::thirdDerivative ( T x,
T y,
T z,
T * result ) const

Evaluate the second derivatives of a tricubic mesh element at a point and return the results along Cartesian axes. Descriptions of input parameters follow from the evaluate() member function above, with the addition of:

Overloaded:

  • Use a pre-allocated space to hold the results (provided as a C-style array or Standard Template Library vector)
  • Produce a Standard Template Library vector holding the results (of trusted length 27)
Parameters
resultPre-allocated space to hold the output tensor

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