Foam< Type > Class Template Reference

Reads an interpolation table from a file in OpenFOAM-format. This is a list of Tuples in which complex types are delimited by parentheses. By default, a Tuple2 is assumed in which the first column is the (scalar) x-axis and the second column is the y-axis. But finer control over a n-component Tuple can be achieved by specifying the column indices. More...

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

Public Member Functions

 TypeName ("foam")
 Runtime type information. More...
 
 Foam (const word &name, const Function1s::unitConversions &units, const dictionary &dict)
 Construct from name and dictionary. More...
 
virtual autoPtr< TableReader< Type > > clone () const
 Construct and return a copy. More...
 
virtual ~Foam ()
 Destructor. More...
 
virtual void write (Ostream &os, const Function1s::unitConversions &units, const List< Tuple2< scalar, Type >> &table, const word &valuesKeyword=word::null) const
 Write settings and values. More...
 
- Public Member Functions inherited from TableFileReader< Type >
 TableFileReader (const Function1s::unitConversions &defaultUnits, const dictionary &dict)
 Construct from dictionary. More...
 
 TableFileReader (const TableFileReader< Type > &)
 Copy construct. More...
 
virtual ~TableFileReader ()
 Destructor. More...
 
virtual List< Tuple2< scalar, Type > > read (const Function1s::unitConversions &units, const dictionary &dict, const word &valuesKeyword=word::null) const
 Read values. More...
 
- Public Member Functions inherited from TableReader< Type >
 TypeName ("TableReader")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, TableReader, dictionary,(const word &name, const Function1s::unitConversions &units, const dictionary &dict),(name, units, dict))
 
 TableReader ()
 Default construct. More...
 
virtual ~TableReader ()
 Destructor. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from TableReader< Type >
static autoPtr< TableReader< Type > > New (const word &name, const Function1s::unitConversions &units, const dictionary &dict)
 
- Protected Member Functions inherited from TableFileReader< Type >
void read (const Function1s::unitConversions &defaultUnits, const dictionary &dict, List< Tuple2< scalar, Type >> &) const
 Read a 1D table. More...
 
- Protected Member Functions inherited from TableReader< Type >
void convertRead (const Function1s::unitConversions &units, List< Tuple2< scalar, Type >> &table) const
 Do unit conversions on input data. More...
 
List< Tuple2< scalar, Type > > convertRead (const Function1s::unitConversions &units, const List< Tuple2< scalar, Type >> &table) const
 Do unit conversions on input data. More...
 
List< Tuple2< scalar, Type > > convertWrite (const Function1s::unitConversions &units, const List< Tuple2< scalar, Type >> &table) const
 Do unit conversions in order to output data. More...
 

Detailed Description

template<class Type>
class Foam::TableReaders::Foam< Type >

Reads an interpolation table from a file in OpenFOAM-format. This is a list of Tuples in which complex types are delimited by parentheses. By default, a Tuple2 is assumed in which the first column is the (scalar) x-axis and the second column is the y-axis. But finer control over a n-component Tuple can be achieved by specifying the column indices.

Usage
A file containing the following will be read with the first element in each tuple as the x-coordinate and the second as the y-values:
    (
        (0.0 (1 2 3))
        (1.0 (4 5 6))
    )

A more complex table file might look as follows:

    (
        (0 (1 2 3) 4 (5 6 7 8 9 10))
        (1 (2 3 4) 5 (6 7 8 9 10 11))
        (2 (3 4 5) 6 (7 8 9 10 11 12))
    )

In this case, the columns to be used can be specified using the columns entry. In this example, the second scalar column is taken as the x-axis, and the six-component symmTensor-s are used as the values:

    columns     (2 3);
Source files

Definition at line 82 of file FoamTableReader.H.

Constructor & Destructor Documentation

◆ Foam()

Foam ( const word name,
const Function1s::unitConversions units,
const dictionary dict 
)

Construct from name and dictionary.

Definition at line 53 of file FoamTableReader.C.

◆ ~Foam()

~Foam
virtual

Destructor.

Definition at line 68 of file FoamTableReader.C.

Member Function Documentation

◆ TypeName()

TypeName ( "foam"  )

Runtime type information.

◆ clone()

virtual autoPtr<TableReader<Type> > clone ( ) const
inlinevirtual

Construct and return a copy.

Implements TableReader< Type >.

Definition at line 115 of file FoamTableReader.H.

◆ write()

void write ( Ostream os,
const Function1s::unitConversions units,
const List< Tuple2< scalar, Type >> &  table,
const word valuesKeyword = word::null 
) const
virtual

Write settings and values.

Reimplemented from TableFileReader< Type >.

Definition at line 75 of file FoamTableReader.C.

References Foam::units(), TableFileReader< Type >::write(), and Foam::writeEntry().

Here is the call graph for this function:

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