OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

interpolationTable< Type > Class Template Reference

A list of times and values. The time values must be positive and monotonically increasing. More...

Inheritance diagram for interpolationTable< Type >:
Collaboration diagram for interpolationTable< Type >:

List of all members.


Public Types

enum  boundsHandling { ERROR, WARN, CLAMP, REPEAT }
 Enumeration for handling out-of-bound values. More...

Public Member Functions

 interpolationTable ()
 Construct null.
 interpolationTable (const List< Tuple2< scalar, Type > > &values, const boundsHandling bounds, const fileName &fName)
 Construct from components.
 interpolationTable (const fileName &fName)
 Construct given the name of the file containing the table of data.
 interpolationTable (const dictionary &dict)
 Construct by reading the fileName and boundsHandling from dictionary.
 interpolationTable (const interpolationTable &interpTable)
 Construct copy.
word boundsHandlingToWord (const boundsHandling &bound) const
 Return the out-of-bounds handling as a word.
boundsHandling wordToBoundsHandling (const word &bound) const
 Return the out-of-bounds handling as an enumeration.
boundsHandling outOfBounds (const boundsHandling &bound)
 Set the out-of-bounds handling from enum, return previous setting.
void check () const
 Check that list is monotonically increasing.
void write (Ostream &os) const
 Write.
const Tuple2< scalar, Type > & operator[] (const label) const
 Return an element of constant Tuple2<scalar, Type>.
Type operator() (const scalar) const
 Return an interpolated value.

Detailed Description

template<class Type>
class Foam::interpolationTable< Type >

A list of times and values. The time values must be positive and monotonically increasing.

The handling of out-of-bounds values depends on the current setting of outOfBounds.

If REPEAT is chosen for the out-of-bounds handling, the final time value is treated as being equivalent to time=0 for the following periods.

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 57 of file interpolationTable.H.


Member Enumeration Documentation

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
REPEAT  Treat as a repeating list

Definition at line 66 of file interpolationTable.H.


Constructor & Destructor Documentation

interpolationTable (  )  [inline]

Construct null.

Definition at line 52 of file interpolationTable.C.

interpolationTable ( const List< Tuple2< scalar, Type > > &  values,
const boundsHandling  bounds,
const fileName &  fName 
) [inline]

Construct from components.

Definition at line 62 of file interpolationTable.C.

interpolationTable ( const fileName &  fName  )  [inline]

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

Definition at line 75 of file interpolationTable.C.

interpolationTable ( const dictionary &  dict  )  [inline]

Construct by reading the fileName and boundsHandling from dictionary.

and read the table from that file. This is a specialised constructor used by patchFields

Definition at line 86 of file interpolationTable.C.

interpolationTable ( const interpolationTable< Type > &  interpTable  )  [inline]

Construct copy.

Definition at line 98 of file interpolationTable.C.


Member Function Documentation

Foam::word boundsHandlingToWord ( const boundsHandling &  bound  )  const [inline]

Return the out-of-bounds handling as a word.

Definition at line 113 of file interpolationTable.C.

Foam::interpolationTable< Type >::boundsHandling wordToBoundsHandling ( const word &  bound  )  const [inline]

Return the out-of-bounds handling as an enumeration.

Definition at line 150 of file interpolationTable.C.

Foam::interpolationTable< Type >::boundsHandling outOfBounds ( const boundsHandling &  bound  )  [inline]

Set the out-of-bounds handling from enum, return previous setting.

Definition at line 185 of file interpolationTable.C.

void check (  )  const [inline]

Check that list is monotonically increasing.

Exit with a FatalError if there is a problem

Definition at line 196 of file interpolationTable.C.

void write ( Ostream &  os  )  const [inline]

Write.

Definition at line 222 of file interpolationTable.C.

const Foam::Tuple2< Foam::scalar, Type > & operator[] ( const label  i  )  const [inline]

Return an element of constant Tuple2<scalar, Type>.

Reimplemented from UList< Tuple2< scalar, Type > >.

Definition at line 235 of file interpolationTable.C.

Type operator() ( const scalar  value  )  const [inline]

Return an interpolated value.

Definition at line 330 of file interpolationTable.C.


The documentation for this class was generated from the following files:
Copyright © 2000-2009 OpenCFD Ltd