MOOSE - Multiscale Object Oriented Simulation Environment
|
#include <Streamer.h>
Public Member Functions | |
void | addTable (Id table) |
Add a table to streamer. More... | |
void | addTables (vector< Id > tables) |
Add multiple tables to Streamer. More... | |
void | cleanUp (void) |
This function is called from Shell when simulation is called to write the left-over data to streamer file. More... | |
string | getFormat (void) const |
size_t | getNumTables (void) const |
Get the number of tables handled by Streamer. More... | |
string | getOutFilepath (void) const |
Streamer & | operator= (const Streamer &st) |
void | process (const Eref &e, ProcPtr p) |
This function is called at its clock tick. More... | |
void | reinit (const Eref &e, ProcPtr p) |
Reinit. More... | |
void | removeTable (Id table) |
Remove a table from Streamer. More... | |
void | removeTables (vector< Id > table) |
Remove multiple tables – if found – from Streamer. More... | |
void | setFormat (string format) |
void | setOutFilepath (string path) |
Streamer () | |
void | zipWithTime () |
This function prepares data to be written to a file. More... | |
~Streamer () | |
![]() | |
string | getOutFilepath () const |
StreamerBase & | operator= (const StreamerBase &st) |
void | setOutFilepath (string stream) |
StreamerBase () | |
~StreamerBase () | |
![]() | |
void | clearVec () |
void | compareVec (vector< double > other, string op) |
void | compareXplot (string fname, string plotname, string op) |
const vector< double > & | data () |
double | getOutputValue () const |
string | getPlotDump () const |
vector< double > | getVec () const |
unsigned int | getVecSize () const |
double | getY (unsigned int index) const |
double | interpolate (double x, double xmin, double xmax) const |
void | linearTransform (double scale, double offset) |
void | loadCSV (string fname, int startLine, int colNum, char separator) |
void | loadXplot (string fname, string plotname) |
void | loadXplotRange (string fname, string plotname, unsigned int start, unsigned int end) |
double * | lookupVec (unsigned int index) |
void | plainPlot (string file) |
void | setOutputValue (double val) |
void | setPlotDump (string v) |
void | setVec (vector< double > val) |
void | setVecSize (unsigned int num) |
TableBase () | |
void | xplot (string file, string plotname) |
Static Public Member Functions | |
static const Cinfo * | initCinfo () |
![]() | |
static void | writeToCSVFile (const string &filepath, const string &openmode, const vector< double > &data, const vector< string > &columns) |
Write data to csv file. See the documentation of writeToOutfile for details. More... | |
static void | writeToNPYFile (const string &filepath, const string &openmode, const vector< double > &data, const vector< string > &columns) |
Write to NPY format. See the documentation of writeToOutfile for more details. More... | |
static void | writeToOutFile (const string &filepath, const string &format, const string &openmode, const vector< double > &data, const vector< string > &columns) |
Write to a output file in given format. More... | |
![]() | |
static const Cinfo * | initCinfo () |
Private Attributes | |
vector< string > | columns_ |
double | currTime_ |
vector< double > | data_ |
string | format_ |
bool | isOutfilePathSet_ |
string | outfilePath_ |
vector< double > | tableDt_ |
vector< Id > | tableIds_ |
vector< Table * > | tables_ |
vector< unsigned int > | tableTick_ |
Additional Inherited Members | |
![]() | |
vector< double > & | vec () |
Definition at line 33 of file Streamer.h.
Streamer::Streamer | ( | ) |
Definition at line 139 of file Streamer.cpp.
References columns_, data_, format_, tableDt_, tableIds_, tables_, and tableTick_.
Streamer::~Streamer | ( | ) |
Definition at line 158 of file Streamer.cpp.
void Streamer::addTable | ( | Id | table | ) |
Add a table to streamer.
table | Id of table. |
Definition at line 281 of file Streamer.cpp.
References columns_, Eref::data(), Id::element(), Id::eref(), Table::getColumnName(), Element::getTick(), moose::moosePathToUserPath(), Id::path(), tableIds_, tables_, and tableTick_.
Referenced by addTables(), and initCinfo().
void Streamer::addTables | ( | vector< Id > | tables | ) |
Add multiple tables to Streamer.
tables |
Definition at line 306 of file Streamer.cpp.
References addTable().
Referenced by initCinfo().
void Streamer::cleanUp | ( | void | ) |
This function is called from Shell when simulation is called to write the left-over data to streamer file.
Definition at line 249 of file Streamer.cpp.
References columns_, data_, format_, outfilePath_, StreamerBase::writeToOutFile(), and zipWithTime().
Referenced by Shell::doStart().
string Streamer::getFormat | ( | void | ) | const |
Definition at line 386 of file Streamer.cpp.
References format_.
Referenced by initCinfo().
size_t Streamer::getNumTables | ( | void | ) | const |
Get the number of tables handled by Streamer.
Definition at line 354 of file Streamer.cpp.
References tables_.
Referenced by initCinfo().
string Streamer::getOutFilepath | ( | void | ) | const |
Definition at line 360 of file Streamer.cpp.
References outfilePath_.
Referenced by initCinfo().
|
static |
Definition at line 28 of file Streamer.cpp.
References addTable(), addTables(), getFormat(), getNumTables(), getOutFilepath(), TableBase::initCinfo(), process(), reinit(), removeTable(), removeTables(), setFormat(), setOutFilepath(), and tableStreamCinfo.
Definition at line 152 of file Streamer.cpp.
This function is called at its clock tick.
Dest functions. The process function called by scheduler on every tick
e | |
p |
Definition at line 262 of file Streamer.cpp.
References columns_, data_, format_, TableBase::getVecSize(), outfilePath_, tables_, StreamerBase::writeToOutFile(), and zipWithTime().
Referenced by initCinfo().
Reinit.
The reinit function called by scheduler for the reset
e | |
p |
Definition at line 168 of file Streamer.cpp.
References columns_, currTime_, Eref::data(), data_, Eref::element(), Id::element(), Id::eref(), format_, Element::getTick(), Clock::getTickDt(), Eref::id(), isOutfilePathSet_, LOG, moose::moosePathToUserPath(), outfilePath_, Id::path(), path, setOutFilepath(), Element::setTick(), moose::showWarn(), tableDt_, tableIds_, tables_, tableTick_, moose::warning, StreamerBase::writeToOutFile(), and zipWithTime().
Referenced by initCinfo().
void Streamer::removeTable | ( | Id | table | ) |
Remove a table from Streamer.
table. | Id of table. |
Definition at line 320 of file Streamer.cpp.
References columns_, Id::path(), tableIds_, and tables_.
Referenced by initCinfo(), and removeTables().
void Streamer::removeTables | ( | vector< Id > | tables | ) |
Remove multiple tables – if found – from Streamer.
tables |
Definition at line 343 of file Streamer.cpp.
References removeTable().
Referenced by initCinfo().
void Streamer::setFormat | ( | string | format | ) |
Definition at line 380 of file Streamer.cpp.
References format_.
Referenced by initCinfo(), and setOutFilepath().
void Streamer::setOutFilepath | ( | string | path | ) |
Definition at line 365 of file Streamer.cpp.
References moose::createParentDirs(), moose::getExtension(), isOutfilePathSet_, outfilePath_, setFormat(), and moose::toFilename().
Referenced by initCinfo(), and reinit().
void Streamer::zipWithTime | ( | ) |
This function prepares data to be written to a file.
Definition at line 394 of file Streamer.cpp.
References TableBase::clearVec(), currTime_, data_, moose::debug, TableBase::getVec(), LOG, tableDt_, and tables_.
Referenced by cleanUp(), process(), and reinit().
|
private |
Definition at line 90 of file Streamer.h.
Referenced by addTable(), cleanUp(), process(), reinit(), removeTable(), and Streamer().
|
private |
Definition at line 85 of file Streamer.h.
Referenced by reinit(), and zipWithTime().
|
private |
Definition at line 93 of file Streamer.h.
Referenced by cleanUp(), process(), reinit(), Streamer(), and zipWithTime().
|
private |
Definition at line 76 of file Streamer.h.
Referenced by cleanUp(), getFormat(), process(), reinit(), setFormat(), and Streamer().
|
private |
Definition at line 77 of file Streamer.h.
Referenced by reinit(), and setOutFilepath().
|
private |
Definition at line 75 of file Streamer.h.
Referenced by cleanUp(), getOutFilepath(), process(), reinit(), and setOutFilepath().
|
private |
Definition at line 80 of file Streamer.h.
Referenced by reinit(), Streamer(), and zipWithTime().
|
private |
Definition at line 88 of file Streamer.h.
Referenced by addTable(), reinit(), removeTable(), and Streamer().
|
private |
Definition at line 89 of file Streamer.h.
Referenced by addTable(), getNumTables(), process(), reinit(), removeTable(), Streamer(), and zipWithTime().
|
private |
Definition at line 81 of file Streamer.h.
Referenced by addTable(), reinit(), and Streamer().