53 const bool checkEqualDistance
66 if (
mag(d-interval) > SMALL)
69 <<
"Spline interpolation only valid for constant intervals."
71 <<
"Interval 0-1 : " << interval <<
nl
72 <<
"Interval " << i-1 <<
'-' << i <<
" : "
89 bool indexChanged =
false;
92 if (samples_.size() <= 2)
106 && index_ < samples_.size()
108 samples_[index_] <= t
109 && (index_ == samples_.size()-1 || t <= samples_[index_+1])
133 else if (index_ == samples_.size()-1)
138 indices[0] = samples_.
size()-1;
149 scalar
mu = (t - samples_[lo])/(samples_[hi] - samples_[lo]);
151 scalar
w0 = 0.5*(
mu*(-1+
mu*(2-
mu)));
152 scalar
w1 = 0.5*(2+
mu*(
mu*(-5 +
mu*(3))));
153 scalar
w2 = 0.5*(
mu*(1 +
mu*(4 +
mu*(-3))));
158 if (hi < samples_.size()-1)
185 weights[1] =
w1 -
w3;
186 weights[2] =
w2 + 2*
w3;
192 if (hi < samples_.size()-1)
201 weights[0] =
w1 + 2*
w0;
202 weights[1] =
w2 -
w0;
213 weights[0] =
w1 + 2*
w0 -
w3;
214 weights[1] =
w2 -
w0 + 2*
w3;
Various functions to operate on Lists.
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
void setSize(const label n)
Alias for resize()
void size(const label n)
Older name for setAddressableSize.
Abstract base class for interpolating in 1D.
const scalarField & samples_
virtual bool valueWeights(const scalar t, labelList &indices, scalarField &weights) const
Calculate weights and indices to calculate t from samples.
Catmull-Rom spline interpolation.
virtual bool valueWeights(const scalar t, labelList &indices, scalarField &weights) const
Calculate weights and indices to calculate t from samples.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const volScalarField & mu
#define WarningInFunction
Report a warning using Foam::Warning.
label findLower(const ListType &input, const T &val, const label start, const ComparePredicate &comp)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
constexpr char nl
The newline '\n' character (0x0a)
scalarField samples(nIntervals, Zero)