Csv< Type > Class Template Reference

Reads an interpolation table from a file in CSV-format. Entries govern the layout of the CSV file. The index of the first (x) column of the table is given by the refColumn entry, and is always scalar. The indices of the components of the second (y) column are given by the componentColumns entry. More...

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

Public Member Functions

 TypeName ("csv")
 Runtime type information. More...
 
 Csv (const word &name, const dictionary &dict, List< Tuple2< scalar, Type >> &table)
 Construct from dictionary. More...
 
virtual autoPtr< TableReader< Type > > clone () const
 Construct and return a copy. More...
 
virtual ~Csv ()
 Destructor. More...
 
virtual void write (Ostream &os, const List< Tuple2< scalar, Type >> &table) const
 Write the CSV parameters. More...
 
- Public Member Functions inherited from TableFileReader< Type >
 TableFileReader (const dictionary &dict)
 Construct from dictionary. More...
 
virtual ~TableFileReader ()
 Destructor. More...
 
- Public Member Functions inherited from TableReader< Type >
 TypeName ("TableReader")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, TableReader, dictionary,(const word &name, const dictionary &dict, List< Tuple2< scalar, Type >> &table),(name, dict, table))
 
 TableReader (const dictionary &dict)
 Construct from dictionary. 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 dictionary &dict, List< Tuple2< scalar, Type >> &table)
 
- Protected Member Functions inherited from TableFileReader< Type >
void read (const dictionary &dict, List< Tuple2< scalar, Type >> &) const
 Read a 1D table. More...
 

Detailed Description

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

Reads an interpolation table from a file in CSV-format. Entries govern the layout of the CSV file. The index of the first (x) column of the table is given by the refColumn entry, and is always scalar. The indices of the components of the second (y) column are given by the componentColumns entry.

Usage
    nHeaderLine         4;          // number of header lines
    refColumn           0;          // reference column index
    componentColumns    (1 2 3);    // component column indices
    separator           ",";        // optional (defaults to ",")
    mergeSeparators     no;         // merge multiple separators
Source files

Definition at line 65 of file CsvTableReader.H.

Constructor & Destructor Documentation

◆ Csv()

Csv ( const word name,
const dictionary dict,
List< Tuple2< scalar, Type >> &  table 
)

Construct from dictionary.

Definition at line 205 of file CsvTableReader.C.

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

Here is the call graph for this function:

◆ ~Csv()

~Csv ( )
virtual

Destructor.

Definition at line 233 of file CsvTableReader.C.

References Csv< Type >::write().

Referenced by Csv< Type >::clone().

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

Member Function Documentation

◆ TypeName()

TypeName ( "csv"  )

Runtime type information.

◆ clone()

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

Construct and return a copy.

Implements TableReader< Type >.

Definition at line 113 of file CsvTableReader.H.

References Csv< Type >::write(), and Csv< Type >::~Csv().

Here is the call graph for this function:

◆ write()

void write ( Ostream os,
const List< Tuple2< scalar, Type >> &  table 
) const
virtual

Write the CSV parameters.

Reimplemented from TableFileReader< Type >.

Definition at line 241 of file CsvTableReader.C.

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

Referenced by Csv< Type >::clone(), and Csv< Type >::~Csv().

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

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