Go to the documentation of this file.
41 for (
int j = i + 1; j < dim_.size(); j++)
50 max(
label((indices[i] - min_[i])/delta_[i]), 0),
57 label iLastdim = dim_.size() - 1;
62 label((indices[iLastdim] - min_[iLastdim])/delta_[iLastdim]),
85 label((indice - min_[i])/delta_[i]),
98 const scalar lookUpValue,
99 const label interfield
102 return lookUpValue >= min_[interfield] && lookUpValue <= max_[interfield];
111 const scalar lookUpValue,
113 const label interfield
150 min_.setSize(entries_.size());
151 dim_.setSize(entries_.size());
152 delta_.setSize(entries_.size());
153 max_.setSize(entries_.size());
154 entryIndices_.setSize(entries_.size());
155 outputIndices_.setSize(output_.size());
164 delta_[i] = (max_[i] - min_[i])/dim_[i];
165 tableDim *= dim_[i] + 1;
166 fieldIndices_.insert(entries_[i].
lookup(
"name"), index);
167 entryIndices_[i] = index;
173 fieldIndices_.insert(output_[i].
lookup(
"name"), index);
174 outputIndices_[i] = index;
180 internal.
setSize(entries_.size() + output_.size());
182 interpOutput_.setSize(entries_.size() + output_.size());
186 internal[i].setSize(tableDim);
194 const word& instance,
205 IOobject::MUST_READ_IF_MODIFIED,
210 control.
lookup(
"fields") >> entries_;
211 control.
lookup(
"output") >> output_;
212 control.
lookup(
"values") >> *
this;
218 if (this->size() == 0)
232 fileName_(
"fileNameIsUndefined")
240 const word& instance,
256 readTable(instance, obr);
270 dim_(interpTable.
dim_),
271 min_(interpTable.
min_),
272 delta_(interpTable.
delta_),
273 max_(interpTable.
max_),
292 entries_(
dict.lookup(
"fields")),
293 output_(
dict.lookup(
"output")),
311 for (
int j = 1; j < dim_.size(); j++)
316 for (
label i = 1; i < dim_[0]; i++)
319 const scalar currValue =
323 if (currValue <= prevValue)
326 <<
"out-of-order value: " << currValue
329 prevValue = currValue;
339 const word& instance,
358 << entries_ << token::END_STATEMENT <<
nl;
361 << output_ << token::END_STATEMENT <<
nl;
363 if (this->size() == 0)
369 << *
this << token::END_STATEMENT <<
nl;
379 const label n = this->size();
405 const label n = this->size();
420 <<
"index (" << i <<
") overflow" <<
nl
431 return fieldIndices_.found(fieldName);
439 const label lo = index(retvals);
441 return interpOutput_;
455 label ofield = outputIndices_[j];
460 if (checkRange(retvals, entryIndices_[i]))
469 interpOutput_[entryIndices_[i]] = retvals;
473 interpOutput_[outputIndices_[j]] =
tmp;
List< scalar > interpOutput_
Output list containing input and interpolation values of outputs.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
A class for handling words, derived from string.
A class for handling file names.
#define forAll(list, i)
Loop across all elements in list.
bool checkRange(const scalar, const label) const
Check range of lookup value.
A class for managing temporary objects.
bool found(const word &fieldName) const
Return true if the field exists in the table.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
tmp< surfaceScalarField > interpolate(const RhoType &rho)
label index(const List< scalar > &, const bool lastDim=true) const
Find table index by scalarList.
List< label > entryIndices_
Input indices from the lookup table.
List< scalar > min_
Min on each dimension.
void dimensionTable()
Dimension table from dictionaries input and output.
Registry of regIOobjects.
const scalarField & operator[](const label) const
Return an element of constant List<scalar, Type>
bool writeHeader(Ostream &) const
Write header.
List< label > outputIndices_
Output indices from the lookup Table.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
List< label > dim_
Table dimensions.
List< scalar > delta_
Deltas on each dimension.
A list of keyword definitions, which are a keyword followed by any number of values (e....
interpolationLookUpTable()
Construct null.
void findHi(const label lo, const scalar retvals)
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
List< scalar > max_
Maximum on each dimension.
void setSize(const label)
Reset size of List.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
string & expand(const bool allowEmpty=false)
Expand initial tildes and all occurences of environment variables.
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
scalar interpolate(const label lo, const label hi, const scalar lookUpValue, const label ofield, const label interfield) const
Interpolate function returning a scalar.
label readLabel(Istream &is)
const List< scalar > & lookUp(const scalar)
Return the output list given a single input scalar.
A list of lists. Interpolates based on the first dimension. The values must be positive and monotonic...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
void readTable(const word &instance, const objectRegistry &)
Read the table of data from file.
void write(Ostream &, const fileName &, const word &instance, const objectRegistry &) const
Write lookup table to filename.
fileName fileName_
File name.
stressControl lookup("compactNormalStress") >> compactNormalStress