19 "name of the file in which the time sequence is read");
21 "indicates whether the file contains a header with the column names");
22 params.
addParam<std::string>(
"delimiter",
",",
"delimiter used to parse the file");
24 "column_name",
"time",
"name of the column which contains the time sequence");
25 params.
addParam<
unsigned int>(
"column_index",
26 "index of the column which contains the time sequence");
28 "Solves the Transient problem at a sequence of given time points read in a file.");
34 _file_name(getParam<FileName>(
"file_name")),
35 _header(isParamValid(
"header")
36 ? (getParam<bool>(
"header") ?
MooseUtils::DelimitedFileReader::HeaderFlag::ON
37 :
MooseUtils::DelimitedFileReader::HeaderFlag::OFF)
39 _delimiter(getParam<
std::string>(
"delimiter")),
40 _column_name(getParam<
std::string>(
"column_name")),
41 _search_by_index(isParamValid(
"column_index")),
42 _column_index(_search_by_index ? getParam<unsigned
int>(
"column_index") : 0)
55 std::vector<Real> instants;
59 std::vector<std::vector<double>> data = file.
getData();
67 if (instants.size() == 0)
void setHeaderFlag(HeaderFlag value)
void read()
Perform the actual data reading.
Solves the PDEs at a sequence of time points given as a column in a text table file (such as a *...
const std::vector< std::vector< double > > & getData() const
Return the rows/columns of data.
Utility class for reading delimited data (e.g., CSV data).
const bool _search_by_index
indicates whether to access a column using its index or its name
void setupSequence(const std::vector< Real > ×)
const MooseUtils::DelimitedFileReader::HeaderFlag _header
whether the file contains a header with the column names
const std::string _column_name
name of the column containing the time data
CSVTimeSequenceStepper(const InputParameters ¶meters)
void setDelimiter(const std::string &value)
static InputParameters validParams()
registerMooseObject("MooseApp", CSVTimeSequenceStepper)
const std::string _file_name
name of the file where the data is read
virtual void init() override
Initialize the time stepper.
Solves the PDEs at a sequence of given time points.
static InputParameters validParams()
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
const unsigned int _column_index
index of the column containing the time data
void ErrorVector unsigned int
const std::string _delimiter
string used as a delimiter