32 const List<scalar>& indices,
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
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;
178 List<scalarField>&
internal = *
this;
180 internal.setSize(entries_.size() + output_.size());
182 interpOutput_.setSize(entries_.size() + output_.size());
186 internal[i].setSize(tableDim);
194 const word& instance,
195 const objectRegistry& obr
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);
267 fileName_(interpTable.fileName_),
268 entryIndices_(interpTable.entryIndices_),
269 outputIndices_(interpTable.outputIndices_),
270 dim_(interpTable.dim_),
271 min_(interpTable.min_),
272 delta_(interpTable.delta_),
273 max_(interpTable.max_),
276 interpOutput_(interpTable.interpOutput_)
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]))
466 tmp +=
interpolate(lo, hi, retvals, ofield, entryIndices_[i])
469 interpOutput_[entryIndices_[i]] = retvals;
473 interpOutput_[outputIndices_[j]] = tmp;
#define forAll(list, i)
Loop across all elements in list.
string expand(const string &, const HashTable< string, word, string::hash > &mapping, const char sigil='$')
Expand occurences of variables according to the mapping.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
friend Ostream & operator(Ostream &, const UList< T > &)
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
T & operator[](const label)
Return element of UList.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
interpolationLookUpTable()
Construct null.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
void write(Ostream &, const fileName &, const word &instance, const objectRegistry &) const
Write lookup table to filename.
stressControl lookup("compactNormalStress") >> compactNormalStress
A class for handling words, derived from string.
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.
label readLabel(Istream &is)
bool found(const word &fieldName) const
Return true if the field exists in the table.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
void setSize(const label)
Reset size of List.
bool writeHeader(Ostream &) const
Write header.
A class for managing temporary objects.
Registry of regIOobjects.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.