preCICE v3.2.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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::io {
9
13class TXTWriter {
14public:
18 explicit TXTWriter(const std::string &filename);
19
21 void write(const Eigen::MatrixXd &matrix);
22
24 void flush();
25
26private:
27 logging::Logger _log{"io::TXTWriter"};
28
29 // @brief Filestream.
31};
32
33} // namespace precice::io
File writer for matrix in Matlab V7 ASCII format.
Definition TXTWriter.hpp:13
logging::Logger _log
Definition TXTWriter.hpp:27
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:30
This class provides a lightweight logger.
Definition Logger.hpp:17
provides Import and Export of the coupling mesh and data.