Chaste Commit::ca8ccdedf819b6e02855bc0e8e6f50bdecbc5208
SimpleDataWriter Class Reference

#include <SimpleDataWriter.hpp>

+ Collaboration diagram for SimpleDataWriter:

Public Member Functions

 SimpleDataWriter (const std::string &rDirectory, const std::string &rFileName, const std::vector< std::vector< double > > &rData, bool cleanDirectory=true)
 
 SimpleDataWriter (const std::string &rDirectory, const std::string &rFileName, const std::vector< double > &rT, const std::vector< double > &rX, bool cleanDirectory=true)
 
 SimpleDataWriter (const std::string &rDirectory, const std::string &rFileName, const std::vector< double > &rData, bool cleanDirectory=true)
 

Detailed Description

A basic data writer that is easier to use than ColumnDataWriter but has less functionality. NOTE: this is not an efficient writer.

This class does not writer header lines so is ideal for immediately reading with MATLAB or Gnuplot.

Definition at line 49 of file SimpleDataWriter.hpp.

Constructor & Destructor Documentation

◆ SimpleDataWriter() [1/3]

SimpleDataWriter::SimpleDataWriter ( const std::string &  rDirectory,
const std::string &  rFileName,
const std::vector< std::vector< double > > &  rData,
bool  cleanDirectory = true 
)

Write the provided data out to the given file in columns

Parameters
rDirectoryThe directory, relative to TEST_OUTPUT
rFileNameThe full file name (no format will be apended)
rDataThe data. data[0] will written as the first column, data[1] the second, and so on. An exception is thrown if they are not the same size
cleanDirectoryWhether to clean the directory (defaults to true)

Definition at line 40 of file SimpleDataWriter.cpp.

References EXCEPTION, and OutputFileHandler::OpenOutputFile().

◆ SimpleDataWriter() [2/3]

SimpleDataWriter::SimpleDataWriter ( const std::string &  rDirectory,
const std::string &  rFileName,
const std::vector< double > &  rT,
const std::vector< double > &  rX,
bool  cleanDirectory = true 
)

Write the provided data out to the given file in 2 columns

Parameters
rDirectoryThe directory, relative to TEST_OUTPUT
rFileNameThe full file name (no format will be apended)
rTThe first column of data
rXThe second column of data. An exception is thrown if the size of x is not the same as the size of t.
cleanDirectoryWhether to clean the directory (defaults to true)

Definition at line 72 of file SimpleDataWriter.cpp.

◆ SimpleDataWriter() [3/3]

SimpleDataWriter::SimpleDataWriter ( const std::string &  rDirectory,
const std::string &  rFileName,
const std::vector< double > &  rData,
bool  cleanDirectory = true 
)

Write the provided data out to the given file in one column

Parameters
rDirectoryThe directory, relative to TEST_OUTPUT
rFileNameThe full file name (no format will be apended)
rDataA std::vec of data
cleanDirectoryWhether to clean the directory (defaults to true)

Definition at line 84 of file SimpleDataWriter.cpp.

References SimpleDataWriter().

Referenced by SimpleDataWriter().


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