NonUniformTable< Type > Class Template Reference

Non-uniform tabulated property function that linearly interpolates between the values. More...

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

Public Member Functions

 TypeName ("nonUniformTable")
 Runtime type information. More...
 
 NonUniformTable (const word &name, const dictionary &dict)
 Construct from name and dictionary. More...
 
 NonUniformTable (const NonUniformTable< Type > &nut)
 Copy constructor. More...
 
const List< Tuple2< scalar, Type > > & values () const
 Return the non-uniform table of values. More...
 
virtual Type value (scalar x) const
 Evaluate the function and return the result. More...
 
virtual Type integral (const scalar x1, const scalar x2) const
 Integrate between two scalar values. More...
 
Type dfdT (scalar T) const
 Evaluate the derivative of the function and return the result. More...
 
void write (Ostream &os) const
 Write the function coefficients. More...
 
void operator= (const NonUniformTable< Type > &)
 Assignment. More...
 
- Public Member Functions inherited from FieldFunction1< Type, NonUniformTable< Type > >
 FieldFunction1 (const word &name)
 Construct from name. More...
 
virtual tmp< Function1< Type > > clone () const
 Construct and return a clone. More...
 
virtual ~FieldFunction1 ()
 Destructor. More...
 
virtual tmp< Field< Type > > value (const scalarField &x) const
 Return value as a function of one scalar field. More...
 
virtual tmp< Field< Type > > integral (const scalarField &x1, const scalarField &x2) const
 Integrate between two scalar fields. More...
 
- Public Member Functions inherited from Function1< Type >
 TypeName ("Function1")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, Function1, dictionary,(const word &name, const dictionary &dict),(name, dict))
 Declare runtime constructor selection table. More...
 
 Function1 (const word &name)
 Construct from name. More...
 
 Function1 (const Function1< Type > &f1)
 Copy constructor. More...
 
virtual ~Function1 ()
 Destructor. More...
 
const wordname () const
 Return the name of the entry. More...
 
void operator= (const Function1< Type > &)
 Assignment. More...
 
- Public Member Functions inherited from refCount
int count () const
 Return the current reference count. More...
 
bool unique () const
 Return true if the reference count is zero. More...
 
void operator++ ()
 Increment the reference count. More...
 
void operator++ (int)
 Increment the reference count. More...
 
void operator-- ()
 Decrement the reference count. More...
 
void operator-- (int)
 Decrement the reference count. More...
 

Protected Member Functions

label index (scalar x) const
 Return the lower index of the interval in the table. More...
 
- Protected Member Functions inherited from refCount
 refCount ()
 Construct null initialising count to 0. More...
 

Additional Inherited Members

- Public Types inherited from Function1< Type >
typedef Type returnType
 
- Static Public Member Functions inherited from Function1< Type >
static autoPtr< Function1< Type > > New (const word &name, const dictionary &dict)
 Selector. More...
 
- Protected Attributes inherited from Function1< Type >
const word name_
 Name of entry. More...
 

Detailed Description

template<class Type>
class Foam::Function1s::NonUniformTable< Type >

Non-uniform tabulated property function that linearly interpolates between the values.

To speed-up the search of the non-uniform table a uniform jump-table is created on construction which is used for fast indirect addressing into the table.

Usage
Property Description
values List of value pairs

Example for the density of water between 280 and 350K

    rho
    {
        type    nonUniformTable;

        values
        (
            (280 999.87)
            (300 995.1)
            (350 973.7)
        );
    }

Definition at line 82 of file NonUniformTable1.H.

Constructor & Destructor Documentation

◆ NonUniformTable() [1/2]

NonUniformTable ( const word name,
const dictionary dict 
)

Construct from name and dictionary.

Definition at line 31 of file NonUniformTable1.C.

References dict, Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, Foam::first(), forAll, Foam::min(), Function1< Type >::name(), Foam::nl, List< T >::setSize(), and x.

Here is the call graph for this function:

◆ NonUniformTable() [2/2]

NonUniformTable ( const NonUniformTable< Type > &  nut)

Copy constructor.

Definition at line 83 of file NonUniformTable1.C.

Member Function Documentation

◆ index()

Foam::label index ( scalar  x) const
inlineprotected

Return the lower index of the interval in the table.

corresponding to the given value

Definition at line 29 of file NonUniformTable1I.H.

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

Here is the call graph for this function:

◆ TypeName()

TypeName ( "nonUniformTable"  )

Runtime type information.

◆ values()

const List<Tuple2<scalar, Type> >& values ( ) const
inline

Return the non-uniform table of values.

Definition at line 131 of file NonUniformTable1.H.

◆ value()

Type value ( scalar  x) const
virtual

Evaluate the function and return the result.

Implements FieldFunction1< Type, NonUniformTable< Type > >.

Definition at line 101 of file NonUniformTable1.C.

References Foam::first(), lambda(), and x.

Here is the call graph for this function:

◆ integral()

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

Integrate between two scalar values.

Implements FieldFunction1< Type, NonUniformTable< Type > >.

Definition at line 117 of file NonUniformTable1.C.

◆ dfdT()

Type dfdT ( scalar  T) const

Evaluate the derivative of the function and return the result.

Definition at line 129 of file NonUniformTable1.C.

References Foam::T().

Here is the call graph for this function:

◆ write()

void write ( Ostream os) const
virtual

Write the function coefficients.

Implements Function1< Type >.

Definition at line 143 of file NonUniformTable1.C.

Referenced by integratedNonUniformTable::write().

Here is the caller graph for this function:

◆ operator=()

void operator= ( const NonUniformTable< Type > &  nut)

Assignment.

Definition at line 152 of file NonUniformTable1.C.

References nut.


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