xmsinterp  1.0
xms::InterpCt Class Reference

Computes the Clough Tocher interpolation to a location. More...

Public Types

enum  RegionEnum { T1, T2, T3 }
 Triangle region enumeration.
 

Public Member Functions

 InterpCt (const std::vector< Pt3d > &a_pts, BSHP< NodalFunc > a_n)
 Constructor. More...
 
bool ComputeCtCoeff (int *a_ptIdxs)
 Calculates the coefficients used by ct interpolation. More...
 
double InterpToPt (const Pt3d &a_pt)
 Performs Clough Tocher interpolation to a point. More...
 
RegionEnum DetermineRegion (double e, double n)
 Finds the region of the triangle. More...
 
void RecalcNodalFunc ()
 Recalculated the nodal function. This happens when the scalars change.
 
std::string ToString () const
 serialize the class to a string. More...
 

Public Attributes

const std::vector< Pt3d > & m_pts
 input points interpolated from
 
BSHP< NodalFuncm_nodalFunc
 nodal function used in ct calculations
 

Detailed Description

Computes the Clough Tocher interpolation to a location.

Definition at line 25 of file InterpCt.h.

Constructor & Destructor Documentation

◆ InterpCt()

xms::InterpCt::InterpCt ( const std::vector< Pt3d > &  a_pts,
BSHP< NodalFunc a_n 
)

Constructor.

Parameters
[in]a_ptsThe point locations that are interpolated from
[in]a_nNodal function used in the setup of ct interpolation

Definition at line 55 of file InterpCt.cpp.

Member Function Documentation

◆ ComputeCtCoeff()

bool xms::InterpCt::ComputeCtCoeff ( int *  a_ptIdxs)

Calculates the coefficients used by ct interpolation.

Parameters
[in]a_ptIdxsPoint indices for a triangle
Returns
true if successful, false if errors were encountered

Definition at line 217 of file InterpCt.cpp.

References m_nodalFunc, m_pts, SQRT3, xms::Pt3< T >::x, and xms::Pt3< T >::y.

◆ DetermineRegion()

InterpCt::RegionEnum xms::InterpCt::DetermineRegion ( double  e,
double  n 
)

Finds the region of the triangle.

Parameters
[in]efactor determined by the x,y location of interpolation point
[in]nfactor determined by the x,y location of interpolation point
Returns
The triangle region where the point is located

Definition at line 66 of file InterpCt.cpp.

References SQRT3.

Referenced by InterpToPt().

◆ InterpToPt()

double xms::InterpCt::InterpToPt ( const Pt3d a_pt)

Performs Clough Tocher interpolation to a point.

Parameters
[in]a_ptThe location being interpolated to.
Returns
The interpolated value.

Definition at line 118 of file InterpCt.cpp.

References DetermineRegion(), SQRT3, xms::Pt3< T >::x, and xms::Pt3< T >::y.

◆ ToString()

std::string xms::InterpCt::ToString ( ) const

serialize the class to a string.

Returns
The string.

Definition at line 91 of file InterpCt.cpp.

References m_pts, and VecToStream().


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