lumpedPointInterpolator Class Reference

A simple linear interpolator between two locations, which are referenced by index. More...

Public Member Functions

 lumpedPointInterpolator ()
 Default construct, with zero weighting and invalid ids. More...
 
 lumpedPointInterpolator (const label id)
 Construct with nearest id. More...
 
 ~lumpedPointInterpolator ()=default
 Destructor. More...
 
bool valid () const
 Valid if there is an associated nearest point. More...
 
label nearest () const
 The nearest control point, or -1 if invalid. More...
 
label next () const
 The first neighbour control point - identical to next1() More...
 
label next1 () const
 The first neighbour control point, or -1 if invalid. More...
 
label next2 () const
 The second neighbour control point, or -1 if invalid. More...
 
scalar weight0 () const
 The weighting for the nearest point. More...
 
scalar weight1 () const
 
scalar weight2 () const
 
void nearest (const label id)
 Assign the nearest point, clearing any neighbour. More...
 
void next (const label id, const scalar weight)
 Assign single neighbour control point and its weight. More...
 
void next (const label id, const scalar weight, const label position)
 Assign the neighbour control point and its weight. More...
 
void set (const triFace &ids, const barycentric2D &weights)
 Assign all control points and their weights. More...
 
template<class T >
T interpolate (const UList< T > &input) const
 Linear interpolated value between nearest and next locations. More...
 

Detailed Description

A simple linear interpolator between two locations, which are referenced by index.

When the interpolator is built for based on searching for nearest and next-nearest points, the interpolation will typically cover a (0-0.5) range rather than a (0-1) range. The (0.5-1) range implies a flip in the relationship of nearest vs. next-nearest.

Source files

Definition at line 59 of file lumpedPointInterpolator.H.

Constructor & Destructor Documentation

◆ lumpedPointInterpolator() [1/2]

Default construct, with zero weighting and invalid ids.

Definition at line 30 of file lumpedPointInterpolatorI.H.

◆ lumpedPointInterpolator() [2/2]

lumpedPointInterpolator ( const label  id)
inlineexplicit

Construct with nearest id.

Definition at line 36 of file lumpedPointInterpolatorI.H.

◆ ~lumpedPointInterpolator()

Destructor.

Member Function Documentation

◆ valid()

bool valid ( ) const
inline

Valid if there is an associated nearest point.

Definition at line 48 of file lumpedPointInterpolatorI.H.

◆ nearest() [1/2]

Foam::label nearest ( ) const
inline

The nearest control point, or -1 if invalid.

Definition at line 54 of file lumpedPointInterpolatorI.H.

◆ next() [1/3]

Foam::label next ( ) const
inline

The first neighbour control point - identical to next1()

Definition at line 60 of file lumpedPointInterpolatorI.H.

◆ next1()

Foam::label next1 ( ) const
inline

The first neighbour control point, or -1 if invalid.

Definition at line 66 of file lumpedPointInterpolatorI.H.

◆ next2()

Foam::label next2 ( ) const
inline

The second neighbour control point, or -1 if invalid.

Definition at line 72 of file lumpedPointInterpolatorI.H.

◆ weight0()

Foam::scalar weight0 ( ) const
inline

The weighting for the nearest point.

Definition at line 78 of file lumpedPointInterpolatorI.H.

◆ weight1()

Foam::scalar weight1 ( ) const
inline

The weighting for the first neighbour point, this also corresponds to the logical location (interval 0-1)

Definition at line 84 of file lumpedPointInterpolatorI.H.

◆ weight2()

Foam::scalar weight2 ( ) const
inline

The weighting for the second neighbour point, this also corresponds to the logical location (interval 0-1)

Definition at line 90 of file lumpedPointInterpolatorI.H.

◆ nearest() [2/2]

void nearest ( const label  id)
inline

Assign the nearest point, clearing any neighbour.

Definition at line 96 of file lumpedPointInterpolatorI.H.

References Foam::Zero.

◆ next() [2/3]

void next ( const label  id,
const scalar  weight 
)
inline

Assign single neighbour control point and its weight.

Definition at line 103 of file lumpedPointInterpolatorI.H.

References Foam::Zero.

◆ next() [3/3]

void next ( const label  id,
const scalar  weight,
const label  position 
)
inline

Assign the neighbour control point and its weight.

Parameters
positionUse 0 or 1 for first/second

Definition at line 125 of file lumpedPointInterpolatorI.H.

◆ set()

void set ( const triFace ids,
const barycentric2D weights 
)
inline

Assign all control points and their weights.

The triFace points [0,1,2] correspond to [nearest,next1,next2], respectively

Definition at line 154 of file lumpedPointInterpolatorI.H.

◆ interpolate()

T interpolate ( const UList< T > &  input) const
inline

Linear interpolated value between nearest and next locations.

Definition at line 170 of file lumpedPointInterpolatorI.H.

References Foam::input(), and Foam::Zero.

Here is the call graph for this function:

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