36 fileName fName(fileName_);
40 reader_()(fName, *
this);
45 <<
"table read from " << fName <<
" is empty" <<
nl
60 bounding_(bounds::normalBounding::WARN),
61 fileName_(
"fileNameIsUndefined"),
85 bounding_(bounds::normalBounding::WARN),
99 bounds::normalBoundingNames.getOrDefault
103 bounds::normalBounding::WARN,
121 bounding_(tbl.bounding_),
122 fileName_(tbl.fileName_),
123 reader_(tbl.reader_.clone())
146template<
class BinaryOp>
159 limitI = t.
size() - 1;
162 if (bop(valueX, t[limitI].first()))
169 <<
"value (" << valueX <<
") out of bounds" <<
nl
176 <<
"value (" << valueX <<
") out of bounds" <<
nl;
190 <<
"Unhandled bounding type " << int(bounding_)
199 const label nX = t.
size();
201 while ((i < nX) && (valueX > t[i].first()))
209 while ((i > 0) && (valueX < t[i].first()))
233 bounding_ = rhs.bounding_;
234 fileName_ = rhs.fileName_;
235 reader_.reset(rhs.reader_.clone());
249 const label nX = t.
size();
254 <<
"Cannot interpolate zero-sized table - returning zero" <<
nl;
261 return interpolateValue(t.
first().second(), valueY);
271 return interpolateValue(t[lo].second(), valueY);
277 const Type
y0(interpolateValue(t[lo].second(), valueY));
278 const Type
y1(interpolateValue(t[hi].second(), valueY));
280 const scalar& x0 = t[lo].
first();
281 const scalar& x1 = t[hi].
first();
283 return (
y0 + (
y1 -
y0)*(valueX - x0)/(x1 - x0));
295 for (
const auto& item : list)
297 const scalar& currValue = item.first();
300 if (i && currValue <= prevValue)
303 <<
"out-of-order value: "
304 << currValue <<
" at index " << i <<
nl
307 prevValue = currValue;
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
T & first()
Return the first element of the list.
void size(const label n)
Older name for setAddressableSize.
virtual const volScalarField & Xi() const
Return the flame-wrinkling Xi.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
friend Ostream & operator(Ostream &, const faMatrix< Type > &)
A class for handling file names.
virtual bool write()
Write the output fields.
2D table interpolation. The data must be in ascending order in both dimensions x and y.
void check() const
Check that list is monotonically increasing.
interpolation2DTable()
Default construct.
static Type interpolateValue(const List< Tuple2< scalar, Type > > &list, scalar lookupValue, bounds::repeatableBounding=bounds::repeatableBounding::CLAMP)
Return an interpolated value in List.
Reads an interpolation table from a file - OpenFOAM-format.
Base class to read table data for the interpolationTable.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
#define WarningInFunction
Report a warning using Foam::Warning.
repeatableBounding
Enumeration for handling out-of-bound values that are repeatable.
const Foam::Enum< normalBounding > normalBoundingNames
Strings corresponding to the normalBounding.
normalBounding
Enumeration for handling out-of-bound values.
@ WARN
Issue warning and clamp value (this is a good default)
@ ERROR
Exit with a FatalError.
@ CLAMP
Clamp value to the start/end value.
dimensionedScalar y0(const dimensionedScalar &ds)
void reverse(UList< T > &list, const label n)
Reverse the first n elements of the list.
dimensionedScalar y1(const dimensionedScalar &ds)
errorManip< error > abort(error &err)
static constexpr const zero Zero
Global zero (0)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)