Csv< Coordinate, Value > Class Template Reference

Reads an interpolation table from a file in CSV-format. Entries govern the layout of the CSV file. The indices of the columns of the table that are to be used are given by the columns entry. This is a tuple for which the first part is the index of the column used for the x-axis, and the second part is the column index used for the scalar values, or a list of column indices used for the components of vector, tensor, etc..., values. More...

Inheritance diagram for Csv< Coordinate, Value >:
Collaboration diagram for Csv< Coordinate, Value >:

Public Member Functions

 TypeName ("csv")
 Runtime type information. More...
 
 Csv (const word &name, const Function1s::unitSets &units, const dictionary &dict)
 Construct from name and dictionary. More...
 
virtual autoPtr< TableReader< Coordinate, Value > > clone () const
 Construct and return a copy. More...
 
virtual ~Csv ()
 Destructor. More...
 
virtual void write (Ostream &os, const Function1s::unitSets &units, const List< Tuple2< Coordinate, Value >> &table, const word &valuesKeyword=word::null) const
 Write settings and values. More...
 
- Public Member Functions inherited from TableFileReader< Coordinate, Value >
 TableFileReader (const Function1s::unitSets &defaultUnits, const dictionary &dict)
 Construct from dictionary. More...
 
 TableFileReader (const TableFileReader< Coordinate, Value > &)
 Copy construct. More...
 
virtual ~TableFileReader ()
 Destructor. More...
 
virtual List< Tuple2< Coordinate, Value > > read (const Function1s::unitSets &units, const dictionary &dict, const word &valuesKeyword=word::null) const
 Read values. More...
 
- Public Member Functions inherited from TableReader< Coordinate, Value >
 TypeName ("TableReader")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, TableReader, dictionary,(const word &name, const Function1s::unitSets &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< Coordinate, Value >
static autoPtr< TableReader< Coordinate, Value > > New (const word &name, const Function1s::unitSets &units, const dictionary &dict)
 
- Protected Member Functions inherited from TableFileReader< Coordinate, Value >
void read (const Function1s::unitSets &defaultUnits, const dictionary &dict, List< Tuple2< Coordinate, Value >> &) const
 Read a 1D table. More...
 
- Protected Member Functions inherited from TableReader< Coordinate, Value >
void convertRead (const Function1s::unitSets &units, List< Tuple2< Coordinate, Value >> &table) const
 Do unit conversions on input data. More...
 
List< Tuple2< Coordinate, Value > > convertRead (const Function1s::unitSets &units, const List< Tuple2< Coordinate, Value >> &table) const
 Do unit conversions on input data. More...
 
List< Tuple2< Coordinate, Value > > convertWrite (const Function1s::unitSets &units, const List< Tuple2< Coordinate, Value >> &table) const
 Do unit conversions in order to output data. More...
 

Detailed Description

template<class Coordinate, class Value>
class Foam::TableReaders::Csv< Coordinate, Value >

Reads an interpolation table from a file in CSV-format. Entries govern the layout of the CSV file. The indices of the columns of the table that are to be used are given by the columns entry. This is a tuple for which the first part is the index of the column used for the x-axis, and the second part is the column index used for the scalar values, or a list of column indices used for the components of vector, tensor, etc..., values.

Usage
    nHeaderLine         4;           // number of header lines
    columns             (0 (1 2 3)); // column indices for vector values
    separator           ",";         // optional (defaults to ",")
    mergeSeparators     no;          // merge multiple separators
Source files

Definition at line 110 of file CsvTableReader.H.

Constructor & Destructor Documentation

◆ Csv()

Csv ( const word name,
const Function1s::unitSets units,
const dictionary dict 
)

Construct from name and dictionary.

Definition at line 221 of file CsvTableReader.C.

◆ ~Csv()

~Csv
virtual

Destructor.

Definition at line 262 of file CsvTableReader.C.

Member Function Documentation

◆ TypeName()

TypeName ( "csv"  )

Runtime type information.

◆ clone()

virtual autoPtr<TableReader<Coordinate, Value> > clone ( ) const
inlinevirtual

Construct and return a copy.

Implements TableReader< Coordinate, Value >.

Definition at line 162 of file CsvTableReader.H.

◆ write()

void write ( Ostream os,
const Function1s::unitSets units,
const List< Tuple2< Coordinate, Value >> &  table,
const word valuesKeyword = word::null 
) const
virtual

Write settings and values.

Reimplemented from TableFileReader< Coordinate, Value >.

Definition at line 269 of file CsvTableReader.C.

References Foam::dimensions::table, TableFileReader< Coordinate, Value >::write(), and Foam::writeEntry().

Here is the call graph for this function:

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