Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
TableBase Class Reference

Base class for table with bounds handling, interpolation and integration. More...

Collaboration diagram for TableBase:
Collaboration graph
[legend]

Public Types

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

Public Member Functions

 TableBase (const word &name, const dictionary &dict)
 Construct from dictionary - note table is not populated. More...
 
 TableBase (const TableBase< Type > &tbl)
 Copy constructor. Note: steals interpolator, tableSamples. More...
 
virtual ~TableBase ()
 Destructor. 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 check () const
 Check the table for size and consistency. More...
 
bool checkMinBounds (const scalar x, scalar &xDash) const
 Check minimum table bounds. More...
 
bool checkMaxBounds (const scalar x, scalar &xDash) const
 Check maximum table bounds. More...
 
virtual void convertTimeBase (const Time &t)
 Convert time. More...
 
virtual Type value (const scalar x) const
 Return Table value. More...
 
virtual Type integrate (const scalar x1, const scalar x2) const
 Integrate between two (scalar) values. More...
 
virtual dimensioned< Type > dimValue (const scalar x) const
 Return dimensioned constant value. More...
 
virtual dimensioned< Type > dimIntegrate (const scalar x1, const scalar x2) const
 Integrate between two values and return dimensioned type. More...
 
virtual tmp< scalarFieldx () const
 Return the reference values. More...
 
virtual tmp< Field< Type > > y () const
 Return the dependent values. More...
 
virtual void writeData (Ostream &os) const
 Write all table data in dictionary format. More...
 
virtual void writeEntries (Ostream &os) const
 Write keywords only in dictionary format. Used for non-inline. More...
 

Protected Member Functions

const interpolationWeightsinterpolator () const
 Return (demand driven) interpolator. More...
 
void operator= (const TableBase< Type > &)
 Disallow default bitwise assignment. More...
 

Protected Attributes

const word name_
 Table name. More...
 
const boundsHandling boundsHandling_
 Enumeration for handling out-of-bound values. More...
 
const word interpolationScheme_
 Interpolation type. More...
 
List< Tuple2< scalar, Type > > table_
 Table data. More...
 
dimensionSet dimensions_
 The dimension set. More...
 
autoPtr< scalarFieldtableSamplesPtr_
 Extracted values. More...
 
autoPtr< interpolationWeightsinterpolatorPtr_
 Interpolator method. More...
 
labelList currentIndices_
 Cached indices and weights. More...
 
scalarField currentWeights_
 

Friends

Ostreamoperator (Ostream &os, const TableBase< Type > &tbl)
 Ostream Operator. More...
 

Detailed Description

Base class for table with bounds handling, interpolation and integration.

Source files

Definition at line 47 of file TableBase.H.

Member Enumeration Documentation

◆ 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

REPEAT 

Treat as a repeating list

Definition at line 72 of file TableBase.H.

Constructor & Destructor Documentation

◆ TableBase() [1/2]

TableBase ( const word name,
const dictionary dict 
)

Construct from dictionary - note table is not populated.

Definition at line 58 of file TableBase.C.

◆ TableBase() [2/2]

TableBase ( const TableBase< Type > &  tbl)

Copy constructor. Note: steals interpolator, tableSamples.

Definition at line 79 of file TableBase.C.

◆ ~TableBase()

~TableBase ( )
virtual

Destructor.

Definition at line 95 of file TableBase.C.

Member Function Documentation

◆ interpolator()

const Foam::interpolationWeights & interpolator ( ) const
protected

Return (demand driven) interpolator.

Definition at line 33 of file TableBase.C.

References forAll, Foam::compressible::New(), and scalarField().

Here is the call graph for this function:

◆ operator=()

void operator= ( const TableBase< Type > &  )
protected

Disallow default bitwise assignment.

◆ boundsHandlingToWord()

Foam::word boundsHandlingToWord ( const boundsHandling bound) const

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

Definition at line 103 of file TableBase.C.

References Foam::bound().

Here is the call graph for this function:

◆ wordToBoundsHandling()

Foam::TableBase< Type >::boundsHandling wordToBoundsHandling ( const word bound) const

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

Definition at line 140 of file TableBase.C.

References Foam::bound(), Foam::endl(), and WarningInFunction.

Here is the call graph for this function:

◆ outOfBounds()

Foam::TableBase< Type >::boundsHandling outOfBounds ( const boundsHandling bound)

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

Definition at line 174 of file TableBase.C.

References Foam::bound().

Here is the call graph for this function:

◆ check()

void check ( ) const

Check the table for size and consistency.

Definition at line 186 of file TableBase.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, n, and Foam::nl.

Referenced by Table::Table(), and TableFile::TableFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkMinBounds()

bool checkMinBounds ( const scalar  x,
scalar &  xDash 
) const

Check minimum table bounds.

Definition at line 216 of file TableBase.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::nl, WarningInFunction, and x.

Here is the call graph for this function:

◆ checkMaxBounds()

bool checkMaxBounds ( const scalar  x,
scalar &  xDash 
) const

Check maximum table bounds.

Definition at line 266 of file TableBase.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::nl, WarningInFunction, and x.

Here is the call graph for this function:

◆ convertTimeBase()

void convertTimeBase ( const Time t)
virtual

Convert time.

Definition at line 315 of file TableBase.C.

References forAll, and TimeState::userTimeToTime().

Here is the call graph for this function:

◆ value()

Type value ( const scalar  x) const
virtual

Return Table value.

Definition at line 329 of file TableBase.C.

References x.

◆ integrate()

Type integrate ( const scalar  x1,
const scalar  x2 
) const
virtual

Integrate between two (scalar) values.

Definition at line 357 of file TableBase.C.

References Foam::sum().

Here is the call graph for this function:

◆ dimValue()

Foam::dimensioned< Type > dimValue ( const scalar  x) const
virtual

Return dimensioned constant value.

Definition at line 374 of file TableBase.C.

References x.

◆ dimIntegrate()

Foam::dimensioned< Type > dimIntegrate ( const scalar  x1,
const scalar  x2 
) const
virtual

Integrate between two values and return dimensioned type.

Definition at line 382 of file TableBase.C.

◆ x()

Foam::tmp< Foam::scalarField > x ( ) const
virtual

Return the reference values.

Definition at line 396 of file TableBase.C.

References fld(), and forAll.

Here is the call graph for this function:

◆ y()

Foam::tmp< Foam::Field< Type > > y ( ) const
virtual

Return the dependent values.

Definition at line 411 of file TableBase.C.

References fld(), and forAll.

Here is the call graph for this function:

◆ writeData()

void writeData ( Ostream os) const
virtual

Write all table data in dictionary format.

Definition at line 63 of file TableBaseIO.C.

References Foam::indent(), Foam::nl, and writeData().

Here is the call graph for this function:

◆ writeEntries()

void writeEntries ( Ostream os) const
virtual

Write keywords only in dictionary format. Used for non-inline.

table types

Definition at line 72 of file TableBaseIO.C.

References Foam::nl, and Ostream::writeKeyword().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator

Ostream& operator ( Ostream os,
const TableBase< Type > &  tbl 
)
friend

Ostream Operator.

Field Documentation

◆ name_

const word name_
protected

Table name.

Definition at line 86 of file TableBase.H.

◆ boundsHandling_

const boundsHandling boundsHandling_
protected

Enumeration for handling out-of-bound values.

Definition at line 89 of file TableBase.H.

◆ interpolationScheme_

const word interpolationScheme_
protected

Interpolation type.

Definition at line 92 of file TableBase.H.

◆ table_

List<Tuple2<scalar, Type> > table_
protected

Table data.

Definition at line 95 of file TableBase.H.

◆ dimensions_

dimensionSet dimensions_
protected

The dimension set.

Definition at line 98 of file TableBase.H.

◆ tableSamplesPtr_

autoPtr<scalarField> tableSamplesPtr_
mutableprotected

Extracted values.

Definition at line 101 of file TableBase.H.

◆ interpolatorPtr_

autoPtr<interpolationWeights> interpolatorPtr_
mutableprotected

Interpolator method.

Definition at line 104 of file TableBase.H.

◆ currentIndices_

labelList currentIndices_
mutableprotected

Cached indices and weights.

Definition at line 107 of file TableBase.H.

◆ currentWeights_

scalarField currentWeights_
mutableprotected

Definition at line 109 of file TableBase.H.


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