Go to the documentation of this file.
26 "Converts columns of a CSV file into vectors of a VectorPostprocessor.");
28 "The name of the CSV file to read. Currently, with "
29 "the exception of the header row, only numeric "
30 "values are supported.");
32 "When true it is assumed that the first row contains column headers, these "
33 "headers are used as the VectorPostprocessor vector names. If false the "
34 "file is assumed to contain only numbers and the vectors are named "
35 "automatically based on the column number (e.g., 'column_0000', "
36 "'column_0001'). If not supplied the reader attempts to auto detect the "
38 params.
addParam<std::string>(
"delimiter",
39 "The column delimiter. Despite the name this can read files "
40 "separated by delimiter other than a comma. If this options is "
41 "omitted it will read comma or space separated files.");
43 "ignore_empty_lines",
true,
"When true new empty lines in the file are ignored.");
48 params.
set<
bool>(
"_is_broadcast") =
true;
80 _column_data[names[i]]->assign(data[i].begin(), data[i].end());
const std::vector< std::string > & getNames() const
Return the column/row names.
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
CSVReader(const InputParameters ¶meters)
VectorPostprocessorValue & declareVector(const std::string &vector_name)
Register a new vector to fill up.
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
void read()
Perform the actual data reading.
registerMooseObject("MooseApp", CSVReader)
void setDelimiter(const std::string &value)
static InputParameters validParams()
defineLegacyParams(CSVReader)
static InputParameters validParams()
void setHeaderFlag(HeaderFlag value)
const ExecFlagType EXEC_INITIAL
const std::vector< std::vector< double > > & getData() const
Return the rows/columns of data.
std::map< std::string, VectorPostprocessorValue * > _column_data
Data vectors, which are stored in a map to allow for late declarations to occur, i....
This class is here to combine the VectorPostprocessor interface and the base class VectorPostprocesso...
A MultiMooseEnum object to hold "execute_on" flags.
MooseUtils::DelimitedFileReader _csv_reader
The MOOSE delimited file reader.
void setIgnoreEmptyLines(bool value)
Set/Get methods for file format controls.
virtual void execute() override
Execute method.
virtual const std::string & name() const
Get the name of the object.