117 indices[1] = index_ + 1;
148 const label n =
max(i2 - i1 + (i1 == iClip1) + (i2 == iClip2), 1);
151 bool changed =
false;
152 if (indices.
size() !=
n)
160 if (indices[indexi] == indexi +
max(i1, 0))
189 const scalar d =
samples_[i1 + 1] - t1;
191 weights[0] +=
sign*d;
196 if (i1 != i2)
for (
label i = i1 + 1; i <= iClip2; i ++)
199 indices[i - iClip1] = i;
200 weights[i - iClip1] +=
sign*d;
201 indices[i - iClip1 + 1] = i + 1;
207 const scalar d =
samples_[i2 + 1] - t2;
209 weights[
n - 2] -=
sign*d;
210 indices[
n - 1] = i2 + 1;
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
void resize(const label)
Alias for setSize(const label)
void size(const label)
Override size to be inconsistent with allocated storage.
T & first()
Return the first element of the list.
T & last()
Return the last element of the list.
Abstract base class for interpolating in 1D.
const scalarField & samples_
Cached samples.
Generates the weight for step-wise interpolation and integration.
stepInterpolationWeights(const scalarField &samples)
Construct from components.
virtual bool integrationWeights(scalar t1, scalar t2, labelList &indices, scalarField &weights) const
Calculate weights and indices to calculate integrand of t1..t2.
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 string.
dimensionedScalar sign(const dimensionedScalar &ds)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
label findLower(const ListType &, typename ListType::const_reference, const label stary, const BinaryOp &bop)
Find last element < given value in sorted list and return index,.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
defineTypeNameAndDebug(combustionModel, 0)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
scalarField samples(nIntervals, 0)