Base class for table with bounds handling, interpolation and integration. More...
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< scalarField > | x () 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 interpolationWeights & | interpolator () 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< scalarField > | tableSamplesPtr_ |
Extracted values. More... | |
autoPtr< interpolationWeights > | interpolatorPtr_ |
Interpolator method. More... | |
labelList | currentIndices_ |
Cached indices and weights. More... | |
scalarField | currentWeights_ |
Friends | |
Ostream & | operator (Ostream &os, const TableBase< Type > &tbl) |
Ostream Operator. More... | |
Base class for table with bounds handling, interpolation and integration.
Definition at line 47 of file TableBase.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 |
REPEAT | Treat as a repeating list |
Definition at line 72 of file TableBase.H.
TableBase | ( | const word & | name, |
const dictionary & | dict | ||
) |
Construct from dictionary - note table is not populated.
Definition at line 58 of file TableBase.C.
Copy constructor. Note: steals interpolator, tableSamples.
Definition at line 79 of file TableBase.C.
|
virtual |
Destructor.
Definition at line 95 of file TableBase.C.
|
protected |
Return (demand driven) interpolator.
Definition at line 33 of file TableBase.C.
References forAll, Foam::compressible::New(), and scalarField().
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().
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.
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().
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().
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.
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.
|
virtual |
Convert time.
Definition at line 315 of file TableBase.C.
References forAll, and TimeState::userTimeToTime().
|
virtual |
|
virtual |
Integrate between two (scalar) values.
Definition at line 357 of file TableBase.C.
References Foam::sum().
|
virtual |
|
virtual |
Integrate between two values and return dimensioned type.
Definition at line 382 of file TableBase.C.
|
virtual |
Return the reference values.
Definition at line 396 of file TableBase.C.
|
virtual |
Return the dependent values.
Definition at line 411 of file TableBase.C.
|
virtual |
Write all table data in dictionary format.
Definition at line 63 of file TableBaseIO.C.
References Foam::indent(), Foam::nl, and writeData().
|
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().
|
protected |
Table name.
Definition at line 86 of file TableBase.H.
|
protected |
Enumeration for handling out-of-bound values.
Definition at line 89 of file TableBase.H.
|
protected |
Interpolation type.
Definition at line 92 of file TableBase.H.
Table data.
Definition at line 95 of file TableBase.H.
|
protected |
The dimension set.
Definition at line 98 of file TableBase.H.
|
mutableprotected |
Extracted values.
Definition at line 101 of file TableBase.H.
|
mutableprotected |
Interpolator method.
Definition at line 104 of file TableBase.H.
|
mutableprotected |
Cached indices and weights.
Definition at line 107 of file TableBase.H.
|
mutableprotected |
Definition at line 109 of file TableBase.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.