preCICE v3.1.2
Loading...
Searching...
No Matches
TXTWriter.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <Eigen/Core>
4#include <fstream>
5#include <string>
6#include "logging/Logger.hpp"
7
8namespace precice {
9namespace io {
10
14class TXTWriter {
15public:
19 explicit TXTWriter(const std::string &filename);
20
22 void write(const Eigen::MatrixXd &matrix);
23
25 void flush();
26
27private:
28 logging::Logger _log{"io::TXTWriter"};
29
30 // @brief Filestream.
32};
33
34} // namespace io
35} // namespace precice
File writer for matrix in Matlab V7 ASCII format.
Definition TXTWriter.hpp:14
logging::Logger _log
Definition TXTWriter.hpp:28
TXTWriter(const std::string &filename)
Constructor, opens file and sets format.
Definition TXTWriter.cpp:7
void flush()
Flush the buffer to file.
Definition TXTWriter.cpp:19
void write(const Eigen::MatrixXd &matrix)
Writes (appends) the matrix to the file.
Definition TXTWriter.cpp:24
std::ofstream _file
Definition TXTWriter.hpp:31
This class provides a lightweight logger.
Definition Logger.hpp:16
Main namespace of the precice library.