2D table interpolation. The data must be in ascending order in both dimensions x and y. More...
Public Types | |
enum | boundsHandling { ERROR, WARN, CLAMP } |
Enumeration for handling out-of-bound values. More... | |
typedef List< Tuple2< scalar, List< Tuple2< scalar, Type > > > > | table |
Cconvenience typedef. More... | |
![]() | |
typedef SubList< T > | subList |
Declare type of subList. More... | |
Public Member Functions | |
interpolation2DTable () | |
Construct null. More... | |
interpolation2DTable (const List< Tuple2< scalar, List< Tuple2< scalar, Type > > > > &values, const boundsHandling bounds, const fileName &fName) | |
Construct from components. More... | |
interpolation2DTable (const fileName &fName) | |
Construct given the name of the file containing the table of data. More... | |
interpolation2DTable (const dictionary &dict) | |
Construct by reading the fileName and boundsHandling from dictionary. More... | |
interpolation2DTable (const interpolation2DTable &interpTable) | |
Construct copy. More... | |
word | boundsHandlingToWord (const boundsHandling &bound) const |
Return the out-of-bounds handling as a word. More... | |
boundsHandling | wordToBoundsHandling (const word &bound) const |
Return the out-of-bounds handling as an enumeration. More... | |
boundsHandling | outOfBounds (const boundsHandling &bound) |
Set the out-of-bounds handling from enum, return previous setting. More... | |
void | checkOrder () const |
Check that list is monotonically increasing. More... | |
void | write (Ostream &os) const |
Write. More... | |
const List< Tuple2< scalar, Type > > & | operator[] (const label) const |
Return an element of constant Tuple2<scalar, Type> More... | |
Type | operator() (const scalar, const scalar) const |
Return an interpolated value. More... | |
template<class BinaryOp > | |
Foam::label | Xi (const BinaryOp &bop, const scalar valueX, const bool reverse) const |
![]() | |
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... | |
T & | newElmt (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 () |
Read the table of data from file. More... | |
Type | interpolateValue (const List< Tuple2< scalar, Type > > &data, const scalar) const |
Return interpolated value in List. More... | |
template<class BinaryOp > | |
label | Xi (const BinaryOp &bop, const scalar valueX, const bool reverse) const |
Return an X index from the matrix. More... | |
Private Attributes | |
boundsHandling | boundsHandling_ |
Enumeration for handling out-of-bound values. More... | |
fileName | fileName_ |
File name. More... | |
autoPtr< tableReader< Type > > | reader_ |
The actual reader. More... | |
Additional Inherited Members | |
![]() | |
static const List< T > & | null () |
Return a null List. More... | |
![]() | |
void | size (const label) |
Override size to be inconsistent with allocated storage. More... | |
2D table interpolation. The data must be in ascending order in both dimensions x and y.
Definition at line 52 of file interpolation2DTable.H.
Cconvenience typedef.
Definition at line 69 of file interpolation2DTable.H.
enum boundsHandling |
Enumeration for handling out-of-bound values.
Enumerator | |
---|---|
ERROR | Exit with a FatalError |
WARN | Issue warning and clamp value (default) |
CLAMP | Clamp value to the start/end value |
Definition at line 61 of file interpolation2DTable.H.
Construct null.
Definition at line 55 of file interpolation2DTable.C.
interpolation2DTable | ( | const List< Tuple2< scalar, List< Tuple2< scalar, Type > > > > & | values, |
const boundsHandling | bounds, | ||
const fileName & | fName | ||
) |
Construct from components.
Definition at line 66 of file interpolation2DTable.C.
interpolation2DTable | ( | const fileName & | fName | ) |
Construct given the name of the file containing the table of data.
Definition at line 80 of file interpolation2DTable.C.
References interpolation2DTable< Type >::readTable().
interpolation2DTable | ( | const dictionary & | dict | ) |
Construct by reading the fileName and boundsHandling from dictionary.
Definition at line 92 of file interpolation2DTable.C.
References interpolation2DTable< Type >::readTable().
interpolation2DTable | ( | const interpolation2DTable< Type > & | interpTable | ) |
Construct copy.
Definition at line 105 of file interpolation2DTable.C.
|
private |
Read the table of data from file.
Definition at line 32 of file interpolation2DTable.C.
References Foam::exit(), string::expand(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.
Referenced by interpolation2DTable< Type >::interpolation2DTable().
|
private |
Return interpolated value in List.
Definition at line 121 of file interpolation2DTable.C.
References interpolation2DTable< Type >::CLAMP, Foam::endl(), interpolation2DTable< Type >::ERROR, Foam::exit(), Foam::FatalError, FatalErrorInFunction, n, Foam::nl, interpolation2DTable< Type >::WARN, and WarningInFunction.
|
private |
Return an X index from the matrix.
Foam::word boundsHandlingToWord | ( | const boundsHandling & | bound | ) | const |
Return the out-of-bounds handling as a word.
Definition at line 349 of file interpolation2DTable.C.
References Foam::bound(), interpolation2DTable< Type >::CLAMP, interpolation2DTable< Type >::ERROR, and interpolation2DTable< Type >::WARN.
Foam::interpolation2DTable< Type >::boundsHandling wordToBoundsHandling | ( | const word & | bound | ) | const |
Return the out-of-bounds handling as an enumeration.
Definition at line 381 of file interpolation2DTable.C.
References Foam::bound(), interpolation2DTable< Type >::CLAMP, Foam::endl(), interpolation2DTable< Type >::ERROR, interpolation2DTable< Type >::WARN, and WarningInFunction.
Foam::interpolation2DTable< Type >::boundsHandling outOfBounds | ( | const boundsHandling & | bound | ) |
Set the out-of-bounds handling from enum, return previous setting.
Definition at line 410 of file interpolation2DTable.C.
References Foam::bound().
void checkOrder |
Check that list is monotonically increasing.
Exit with a FatalError if there is a problem
Definition at line 421 of file interpolation2DTable.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, n, and Foam::nl.
void write | ( | Ostream & | os | ) | const |
Write.
Definition at line 446 of file interpolation2DTable.C.
References token::END_STATEMENT, Foam::nl, and Ostream::writeKeyword().
Return an element of constant Tuple2<scalar, Type>
Type operator() | ( | const scalar | valueX, |
const scalar | valueY | ||
) | const |
Return an interpolated value.
Definition at line 296 of file interpolation2DTable.C.
References Foam::endl(), WarningInFunction, Foam::y0(), and Foam::y1().
Foam::label Xi | ( | const BinaryOp & | bop, |
const scalar | valueX, | ||
const bool | reverse | ||
) | const |
Definition at line 224 of file interpolation2DTable.C.
References Foam::abort(), interpolation2DTable< Type >::CLAMP, Foam::endl(), interpolation2DTable< Type >::ERROR, Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::reverse(), List::size(), interpolation2DTable< Type >::WARN, and WarningInFunction.
|
private |
Enumeration for handling out-of-bound values.
Definition at line 77 of file interpolation2DTable.H.
|
private |
File name.
Definition at line 80 of file interpolation2DTable.H.
|
private |
The actual reader.
Definition at line 83 of file interpolation2DTable.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.