Templated CSV container data entry. Reference column is always a scalar, e.g. time. More...
Public Member Functions | |
TypeName ("csvFile") | |
Runtime type information. More... | |
CSV (const word &entryName, const dictionary &dict, const word &ext="Coeffs") | |
Construct from entry name and dictionary. More... | |
CSV (const CSV< Type > &tbl) | |
Copy constructor. More... | |
virtual tmp< DataEntry< Type > > | clone () const |
Construct and return a clone. More... | |
virtual | ~CSV () |
Destructor. More... | |
virtual const fileName & | fName () const |
Return const access to the file name. More... | |
virtual void | writeData (Ostream &os) const |
Write in dictionary format. More... | |
Private Member Functions | |
void | read () |
Read csv data table. More... | |
Type | readValue (const List< string > &) |
Read the next value from the splitted string. More... | |
void | operator= (const CSV< Type > &) |
Disallow default bitwise assignment. More... | |
label | readValue (const List< string > &splitted) |
scalar | readValue (const List< string > &splitted) |
Private Attributes | |
dictionary | coeffs_ |
Coefficients dictionary (for convenience on reading) More... | |
label | nHeaderLine_ |
Number header lines. More... | |
label | refColumn_ |
Column of the time. More... | |
labelList | componentColumns_ |
Labels of the components. More... | |
char | separator_ |
Separator character. More... | |
bool | mergeSeparators_ |
Merge separators flag, e.g. ',,,' becomes ','. More... | |
fileName | fName_ |
File name for csv table. More... | |
Friends | |
Ostream & | operator (Ostream &os, const CSV< Type > &cnst) |
Ostream Operator. More... | |
Templated CSV container data entry. Reference column is always a scalar, e.g. time.
<entryName> csvFile; <entryName>Coeffs { 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 fileName "fileXYZ"; // name of csv data file outOfBounds clamp; // optional out-of-bounds handling interpolationScheme linear; // optional interpolation scheme }
CSV | ( | const word & | entryName, |
const dictionary & | dict, | ||
const word & | ext = "Coeffs" |
||
) |
Construct from entry name and dictionary.
|
private |
Read csv data table.
Definition at line 88 of file CSV.C.
References DynamicList::append(), Foam::exit(), string::expand(), Foam::FatalIOError, FatalIOErrorInFunction, found, ISstream::getLine(), IOstream::good(), Foam::max(), n, Foam::pos(), readScalar, and x.
TypeName | ( | "csvFile" | ) |
Runtime type information.
|
virtual |
|
virtual |
Write in dictionary format.
Definition at line 60 of file CSVIO.C.
References Foam::decrIndent(), Foam::endl(), IOstream::format(), Foam::incrIndent(), Foam::indent(), Foam::name(), Foam::nl, writeData(), and Ostream::writeKeyword().
Definition at line 35 of file CSV.C.
References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::readLabel(), and List::size().
Definition at line 49 of file CSV.C.
References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::readScalar(), and List::size().
|
private |
|
private |
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.