34 const List<scalar>& indices,
43 for (
int j = i + 1; j < dim_.size(); j++)
52 max(label((indices[i] - min_[i])/delta_[i]), 0),
59 label iLastdim = dim_.size() - 1;
64 label((indices[iLastdim] - min_[iLastdim])/delta_[iLastdim]),
87 label((indice - min_[i])/delta_[i]),
100 const scalar lookUpValue,
101 const label interfield
104 return lookUpValue >= min_[interfield] && lookUpValue <= max_[interfield];
113 const scalar lookUpValue,
115 const label interfield
120 List<scalarField>::operator[](interfield).
operator[](hi)
121 != List<scalarField>::operator[](interfield).
operator[](lo)
126 List<scalarField>::operator[](ofield).
operator[](lo)
128 List<scalarField>::operator[](ofield).
operator[](hi)
129 - List<scalarField>::operator[](ofield).
operator[](lo)
133 - List<scalarField>::operator[](interfield).
operator[](lo)
136 List<scalarField>::operator[](interfield).
operator[](hi)
137 - List<scalarField>::operator[](interfield).
operator[](lo)
153 dim_.setSize(entries_.size());
154 delta_.setSize(entries_.size());
155 max_.setSize(entries_.size());
156 entryIndices_.setSize(entries_.size());
157 outputIndices_.setSize(output_.size());
163 dim_[i] = entries_[i].template get<label>(
"N");
164 max_[i] = entries_[i].template get<scalar>(
"max");
165 min_[i] = entries_[i].template get<scalar>(
"min");
166 delta_[i] = (max_[i] - min_[i])/dim_[i];
167 tableDim *= dim_[i] + 1;
168 fieldIndices_.insert(entries_[i].
template get<word>(
"name"), index);
169 entryIndices_[i] = index;
175 fieldIndices_.insert(output_[i].
template get<word>(
"name"), index);
176 outputIndices_[i] = index;
180 List<scalarField>& internal = *
this;
182 internal.
setSize(entries_.size() + output_.size());
184 interpOutput_.setSize(entries_.size() + output_.size());
196 const word& instance,
197 const objectRegistry& obr
207 IOobject::MUST_READ_IF_MODIFIED,
212 control.readEntry(
"fields", entries_);
213 control.readEntry(
"output", output_);
214 control.readEntry(
"values", *
this);
220 if (this->size() == 0)
223 <<
"table is empty" <<
nl <<
exit(FatalError);
234 fileName_(
"fileNameIsUndefined")
242 const word& instance,
258 readTable(instance, obr);
269 fileName_(interpTable.fileName_),
270 entryIndices_(interpTable.entryIndices_),
271 outputIndices_(interpTable.outputIndices_),
272 dim_(interpTable.dim_),
273 min_(interpTable.min_),
274 delta_(interpTable.delta_),
275 max_(interpTable.max_),
278 interpOutput_(interpTable.interpOutput_)
289 fileName_(
dict.template get<
fileName>(
"file").expand()),
313 for (
int j = 1; j < dim_.size(); j++)
318 for (label i = 1; i < dim_[0]; i++)
321 const scalar currValue =
325 if (currValue <= prevValue)
328 <<
"out-of-order value: " << currValue
331 prevValue = currValue;
341 const word& instance,
362 if (this->size() == 0)
377 const label
n = this->size();
403 const label
n = this->size();
418 <<
"index (" << i <<
") overflow" <<
nl
429 return fieldIndices_.found(fieldName);
437 const label lo = index(retvals);
439 return interpOutput_;
453 label ofield = outputIndices_[j];
458 if (checkRange(retvals, entryIndices_[i]))
462 label hi =
Foam::min(lo + dim, (*
this)[0].size() - 1);
467 interpOutput_[entryIndices_[i]] = retvals;
471 interpOutput_[outputIndices_[j]] = tmp;
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
bool writeHeader(Ostream &os) const
Write header with current type()
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void setSize(const label n)
Alias for resize()
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.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
label operator[](const label i) const
Processor-local element id from linear-list of addresses.
A class for handling file names.
virtual bool write()
Write the output fields.
A list of lists. Interpolates based on the first dimension. The values must be positive and monotonic...
const scalarField & operator[](const label) const
Return an element of constant List<scalar, Type>
const List< scalar > & lookUp(const scalar)
Return the output list given a single input scalar.
interpolationLookUpTable()
Construct null.
Registry of regIOobjects.
Lookup type of boundary radiation properties.
bool interpolate() const noexcept
Same as isPointData()
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.