Public Member Functions | Private Member Functions | Private Attributes
interpolationLookUpTable< Type > Class Template Reference

A list of lists. Interpolates based on the first dimension. The values must be positive and monotonically increasing in each dimension. More...

Inheritance diagram for interpolationLookUpTable< Type >:
Inheritance graph
[legend]
Collaboration diagram for interpolationLookUpTable< Type >:
Collaboration graph
[legend]

Public Member Functions

 interpolationLookUpTable ()
 Construct null. More...
 
 interpolationLookUpTable (const fileName &, const word &instance, const objectRegistry &)
 Construct given the name of the file containing the table of data. More...
 
 interpolationLookUpTable (const dictionary &)
 Construct from dictionary. More...
 
 interpolationLookUpTable (const interpolationLookUpTable &)
 Construct copy. More...
 
bool found (const word &fieldName) const
 Return true if the field exists in the table. More...
 
const List< scalar > & lookUp (const scalar)
 Return the output list given a single input scalar. More...
 
void write (Ostream &, const fileName &, const word &instance, const objectRegistry &) const
 Write lookup table to filename. More...
 
label findFieldIndex (const word &fieldName) const
 Return the index of a field by name. More...
 
const List< dictionary > & output () const
 Return const access to the output dictionaries. More...
 
const List< dictionary > & entries () const
 Return const access tp the dictionary entries. More...
 
const List< scalar > & min () const
 Return const access to the list of min dimensions. More...
 
const List< label > & dim () const
 Return const access to the list of dimensions. More...
 
const List< scalar > & delta () const
 Return const access to the deltas in each dimension. More...
 
const List< scalar > & max () const
 Return const access to the list of max dimensions. More...
 
word tableName () const
 Return const access to the table name. More...
 
const scalarFieldoperator[] (const label) const
 Return an element of constant List<scalar, Type> More...
 
scalarFieldoperator[] (const label)
 Return an element of List<scalar, Type> More...
 
- Public Member Functions inherited from List< scalarField >
label size () const
 Return the number of elements in the UList. More...
 
 List ()
 Null constructor. More...
 
 List (const label)
 Construct with given size. More...
 
 List (const label, const T &)
 Construct with given size and value for all elements. More...
 
 List (const List< T > &)
 Copy constructor. More...
 
 List (const Xfer< List< T > > &)
 Construct by transferring the parameter contents. More...
 
 List (List< T > &, bool reUse)
 Construct as copy or re-use as specified. More...
 
 List (const UList< T > &, const labelUList &mapAddressing)
 Construct as subset. More...
 
 List (InputIterator first, InputIterator last)
 Construct given start and end iterators. More...
 
 List (const FixedList< T, Size > &)
 Construct as copy of FixedList<T, Size> More...
 
 List (const PtrList< T > &)
 Construct as copy of PtrList<T> More...
 
 List (const SLList< T > &)
 Construct as copy of SLList<T> More...
 
 List (const UIndirectList< T > &)
 Construct as copy of UIndirectList<T> More...
 
 List (const BiIndirectList< T > &)
 Construct as copy of BiIndirectList<T> More...
 
 List (Istream &)
 Construct from Istream. More...
 
 List (const label s)
 
 List (const label s, const T &a)
 
 List (const List< T > &a)
 
 List (const Xfer< List< T > > &lst)
 
 List (List< T > &a, bool reUse)
 
 List (const UList< T > &a, const labelUList &map)
 
 List (const PtrList< T > &lst)
 
 List (const SLList< T > &lst)
 
 List (const UIndirectList< T > &lst)
 
 List (const BiIndirectList< T > &lst)
 
 List ()
 
 List (Istream &is)
 
autoPtr< List< T > > clone () const
 Clone. More...
 
 ~List ()
 Destructor. More...
 
void resize (const label)
 Alias for setSize(const label) More...
 
void resize (const label, const T &)
 Alias for setSize(const label, const T&) More...
 
void setSize (const label)
 Reset size of List. More...
 
void setSize (const label, const T &)
 Reset size of List and value for new elements. More...
 
void clear ()
 Clear the list, i.e. set size to zero. More...
 
void append (const T &)
 Append an element at the end of the list. More...
 
void append (const UList< T > &)
 Append a List at the end of this list. More...
 
void append (const UIndirectList< T > &)
 Append a UIndirectList at the end of this list. More...
 
void transfer (List< T > &)
 Transfer the contents of the argument List into this list. More...
 
void transfer (DynamicList< T, SizeInc, SizeMult, SizeDiv > &)
 Transfer the contents of the argument List into this list. More...
 
void transfer (SortableList< T > &)
 Transfer the contents of the argument List into this list. More...
 
void transfer (List< T > &a)
 
void transfer (SortableList< T > &a)
 
Xfer< List< T > > xfer ()
 Transfer contents to the Xfer container. More...
 
TnewElmt (const label)
 Return subscript-checked element of UList. More...
 
void operator= (const UList< T > &)
 Assignment from UList operator. Takes linear time. More...
 
void operator= (const List< T > &)
 Assignment operator. Takes linear time. More...
 
void operator= (const SLList< T > &)
 Assignment from SLList operator. Takes linear time. More...
 
void operator= (const UIndirectList< T > &)
 Assignment from UIndirectList operator. Takes linear time. More...
 
void operator= (const BiIndirectList< T > &)
 Assignment from BiIndirectList operator. Takes linear time. More...
 
void operator= (const T &)
 Assignment of all entries to the given value. More...
 

Private Member Functions

void readTable (const word &instance, const objectRegistry &)
 Read the table of data from file. More...
 
void dimensionTable ()
 Dimension table from dictionaries input and output. More...
 
label index (const List< scalar > &, const bool lastDim=true) const
 Find table index by scalarList. More...
 
label index (const scalar) const
 Find table index by scalar. More...
 
bool checkRange (const scalar, const label) const
 Check range of lookup value. More...
 
scalar interpolate (const label lo, const label hi, const scalar lookUpValue, const label ofield, const label interfield) const
 Interpolate function returning a scalar. More...
 
void check () const
 
void findHi (const label lo, const scalar retvals)
 

Private Attributes

fileName fileName_
 File name. More...
 
List< labeldim_
 Table dimensions. More...
 
List< scalar > min_
 Min on each dimension. More...
 
List< scalar > delta_
 Deltas on each dimension. More...
 
List< scalar > max_
 Maximum on each dimension. More...
 
List< dictionaryentries_
 Dictionary entries. More...
 
List< dictionaryoutput_
 Output dictionaries. More...
 
List< labelentryIndices_
 Input indices from the lookup table. More...
 
List< labeloutputIndices_
 Output indices from the lookup Table. More...
 
HashTable< labelfieldIndices_
 Field names and indices. More...
 
List< scalar > interpOutput_
 Output list containing input and interpolation values of outputs. More...
 

Additional Inherited Members

- Public Types inherited from List< scalarField >
typedef SubList< TsubList
 Declare type of subList. More...
 
- Static Public Member Functions inherited from List< scalarField >
static const List< T > & null ()
 Return a null List. More...
 
- Protected Member Functions inherited from List< scalarField >
void size (const label)
 Override size to be inconsistent with allocated storage. More...
 

Detailed Description

template<class Type>
class Foam::interpolationLookUpTable< Type >

A list of lists. Interpolates based on the first dimension. The values must be positive and monotonically increasing in each dimension.

Note
  • Accessing an empty list results in an error.
  • Accessing a list with a single element always returns the same value.
Source files

Definition at line 61 of file interpolationLookUpTable.H.

Constructor & Destructor Documentation

◆ interpolationLookUpTable() [1/4]

Construct null.

Definition at line 229 of file interpolationLookUpTable.C.

◆ interpolationLookUpTable() [2/4]

interpolationLookUpTable ( const fileName fn,
const word instance,
const objectRegistry obr 
)

Construct given the name of the file containing the table of data.

Definition at line 238 of file interpolationLookUpTable.C.

◆ interpolationLookUpTable() [3/4]

Construct from dictionary.

Definition at line 282 of file interpolationLookUpTable.C.

◆ interpolationLookUpTable() [4/4]

interpolationLookUpTable ( const interpolationLookUpTable< Type > &  interpTable)

Construct copy.

Definition at line 262 of file interpolationLookUpTable.C.

Member Function Documentation

◆ readTable()

void readTable ( const word instance,
const objectRegistry obr 
)
private

Read the table of data from file.

Definition at line 193 of file interpolationLookUpTable.C.

◆ dimensionTable()

void dimensionTable
private

Dimension table from dictionaries input and output.

Definition at line 148 of file interpolationLookUpTable.C.

◆ index() [1/2]

Foam::label index ( const List< scalar > &  indices,
const bool  lastDim = true 
) const
private

Find table index by scalarList.

Definition at line 31 of file interpolationLookUpTable.C.

◆ index() [2/2]

Foam::label index ( const scalar  indice) const
private

Find table index by scalar.

Definition at line 75 of file interpolationLookUpTable.C.

◆ checkRange()

bool checkRange ( const scalar  lookUpValue,
const label  interfield 
) const
private

Check range of lookup value.

Definition at line 97 of file interpolationLookUpTable.C.

◆ interpolate()

Foam::scalar interpolate ( const label  lo,
const label  hi,
const scalar  lookUpValue,
const label  ofield,
const label  interfield 
) const
private

Interpolate function returning a scalar.

Definition at line 108 of file interpolationLookUpTable.C.

◆ check()

void check
private

Definition at line 306 of file interpolationLookUpTable.C.

◆ findHi()

void findHi ( const label  lo,
const scalar  retvals 
)
private

Definition at line 447 of file interpolationLookUpTable.C.

◆ found()

bool found ( const word fieldName) const

Return true if the field exists in the table.

Definition at line 429 of file interpolationLookUpTable.C.

◆ lookUp()

const Foam::scalarList & lookUp ( const scalar  retvals)

Return the output list given a single input scalar.

Definition at line 437 of file interpolationLookUpTable.C.

◆ write()

void write ( Ostream os,
const fileName fn,
const word instance,
const objectRegistry obr 
) const

Write lookup table to filename.

Definition at line 336 of file interpolationLookUpTable.C.

◆ findFieldIndex()

Foam::label findFieldIndex ( const word fieldName) const
inline

Return the index of a field by name.

Definition at line 29 of file interpolationLookUpTableI.H.

◆ output()

const Foam::List< Foam::dictionary > & output
inline

Return const access to the output dictionaries.

Definition at line 39 of file interpolationLookUpTableI.H.

◆ entries()

const Foam::List< Foam::dictionary > & entries
inline

Return const access tp the dictionary entries.

Definition at line 47 of file interpolationLookUpTableI.H.

◆ min()

const Foam::List< Foam::scalar > & min
inline

Return const access to the list of min dimensions.

Definition at line 55 of file interpolationLookUpTableI.H.

◆ dim()

const Foam::List< Foam::label > & dim
inline

Return const access to the list of dimensions.

Definition at line 63 of file interpolationLookUpTableI.H.

◆ delta()

const Foam::List< Foam::scalar > & delta
inline

Return const access to the deltas in each dimension.

Definition at line 71 of file interpolationLookUpTableI.H.

◆ max()

const Foam::List< Foam::scalar > & max
inline

Return const access to the list of max dimensions.

Definition at line 79 of file interpolationLookUpTableI.H.

◆ tableName()

Foam::word tableName
inline

Return const access to the table name.

Definition at line 86 of file interpolationLookUpTableI.H.

◆ operator[]() [1/2]

const Foam::scalarField & operator[] ( const label  i) const

Return an element of constant List<scalar, Type>

Definition at line 403 of file interpolationLookUpTable.C.

◆ operator[]() [2/2]

Foam::scalarField & operator[] ( const label  i)

Return an element of List<scalar, Type>

Definition at line 377 of file interpolationLookUpTable.C.

Field Documentation

◆ fileName_

fileName fileName_
private

File name.

Definition at line 70 of file interpolationLookUpTable.H.

◆ dim_

List<label> dim_
private

Table dimensions.

Definition at line 73 of file interpolationLookUpTable.H.

◆ min_

List<scalar> min_
private

Min on each dimension.

Definition at line 76 of file interpolationLookUpTable.H.

◆ delta_

List<scalar> delta_
private

Deltas on each dimension.

Definition at line 79 of file interpolationLookUpTable.H.

◆ max_

List<scalar> max_
private

Maximum on each dimension.

Definition at line 82 of file interpolationLookUpTable.H.

◆ entries_

List<dictionary> entries_
private

Dictionary entries.

Definition at line 85 of file interpolationLookUpTable.H.

◆ output_

List<dictionary> output_
private

Output dictionaries.

Definition at line 88 of file interpolationLookUpTable.H.

◆ entryIndices_

List<label> entryIndices_
private

Input indices from the lookup table.

Definition at line 91 of file interpolationLookUpTable.H.

◆ outputIndices_

List<label> outputIndices_
private

Output indices from the lookup Table.

Definition at line 94 of file interpolationLookUpTable.H.

◆ fieldIndices_

HashTable<label> fieldIndices_
private

Field names and indices.

Definition at line 97 of file interpolationLookUpTable.H.

◆ interpOutput_

List<scalar> interpOutput_
private

Output list containing input and interpolation values of outputs.

Definition at line 100 of file interpolationLookUpTable.H.


The documentation for this class was generated from the following files: