36 if (interpolatorPtr_.empty())
39 tableSamplesPtr_.reset(
new scalarField(table_.size()));
43 tableSamples[i] = table_[i].
first();
52 return interpolatorPtr_();
87 boundsHandling_(tbl.boundsHandling_),
88 interpolationScheme_(tbl.interpolationScheme_),
90 tableSamplesPtr_(tbl.tableSamplesPtr_),
91 interpolatorPtr_(tbl.interpolatorPtr_)
110 word enumName(
"warn");
147 if (bound ==
"error")
151 else if (bound ==
"warn")
155 else if (bound ==
"clamp")
159 else if (bound ==
"repeat")
166 <<
"bad outOfBounds specifier " << bound <<
" using 'warn'" 194 <<
"Table for entry " << this->
name_ <<
" is invalid (empty)" 201 for (
label i = 1; i <
n; ++i)
206 if (currValue <= prevValue)
209 <<
"out-of-order value: " << currValue <<
" at index " << i
212 prevValue = currValue;
224 if (x <
table_[0].first())
231 <<
"value (" << x <<
") underflow" 238 <<
"value (" << x <<
") underflow" <<
nl 282 <<
"value (" << x <<
") overflow" 289 <<
"value (" << x <<
") overflow" <<
nl 340 return table_[0].second();
404 fld[i] =
table_[i].second();
Issue warning and clamp value (default)
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
boundsHandling outOfBounds(const boundsHandling &bound)
Set the out-of-bounds handling from enum, return previous setting.
Ostream & indent(Ostream &os)
Indent stream.
TableBase(const word &name, const dictionary &dict)
Construct from dictionary - note table is not populated.
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< Tuple2< scalar, Type > > table_
Table data.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const interpolationWeights & interpolator() const
Return (demand driven) interpolator.
T & ref() const
Return non-const reference or generate a fatal error.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
autoPtr< interpolationWeights > interpolatorPtr_
Interpolator method.
T & first()
Return the first element of the list.
Abstract base class for interpolating in 1D.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
virtual ~TableBase()
Destructor.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
virtual void writeData(Ostream &os) const
Write in dictionary format.
boundsHandling wordToBoundsHandling(const word &bound) const
Return the out-of-bounds handling as an enumeration.
Treat as a repeating list.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Base class for table with bounds handling, interpolation and integration.
virtual scalar userTimeToTime(const scalar theta) const
Convert the user-time (e.g. CA deg) to real-time (s).
const word name_
Table name.
A class for handling words, derived from string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual Type value(const scalar x) const
Return Table value.
bool checkMinBounds(const scalar x, scalar &xDash) const
Check minimum table bounds.
void check() const
Check the table for size and consistency.
virtual tmp< scalarField > x() const
Return the reference values.
word boundsHandlingToWord(const boundsHandling &bound) const
Return the out-of-bounds handling as a word.
scalarField currentWeights_
virtual Type integrate(const scalar x1, const scalar x2) const
Integrate between two (scalar) values.
virtual bool integrationWeights(const scalar t1, const scalar t2, labelList &indices, scalarField &weights) const =0
Calculate weights and indices to calculate integrand of t1..t2.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
volScalarField scalarField(fieldObject, mesh)
virtual tmp< Field< Type > > y() const
Return the dependent values.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
word name(const complex &)
Return a string representation of a complex.
const word interpolationScheme_
Interpolation type.
virtual void convertTimeBase(const Time &t)
Convert time.
autoPtr< scalarField > tableSamplesPtr_
Extracted values.
const boundsHandling boundsHandling_
Enumeration for handling out-of-bound values.
labelList currentIndices_
Cached indices and weights.
volScalarField & bound(volScalarField &, const dimensionedScalar &lowerBound)
Bound the given scalar field if it has gone unbounded.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
#define WarningInFunction
Report a warning using Foam::Warning.
bool checkMaxBounds(const scalar x, scalar &xDash) const
Check maximum table bounds.
A class for managing temporary objects.
T & last()
Return the last element of the list.
virtual bool valueWeights(const scalar t, labelList &indices, scalarField &weights) const =0
Calculate weights and indices to calculate t from samples.
virtual void writeData(Ostream &os) const
Write all table data in dictionary format.
Clamp value to the start/end value.
boundsHandling
Enumeration for handling out-of-bound values.
virtual void writeEntries(Ostream &os) const
Write keywords only in dictionary format. Used for non-inline.